* [PATCH] USB: serial: mos7720: fix parallel-port state restore
@ 2020-11-04 16:47 Johan Hovold
2020-11-04 16:59 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Johan Hovold @ 2020-11-04 16:47 UTC (permalink / raw)
To: linux-usb; +Cc: Davidlohr Bueso, linux-kernel, Johan Hovold, stable
The parallel-port restore operations is called when a driver claims the
port and is supposed to restore the provided state (e.g. saved when
releasing the port).
Fixes: b69578df7e98 ("USB: usbserial: mos7720: add support for parallel port on moschip 7715")
Cc: stable <stable@vger.kernel.org> # 2.6.35
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/usb/serial/mos7720.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 5eed1078fac8..5a5d2a95070e 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -639,6 +639,8 @@ static void parport_mos7715_restore_state(struct parport *pp,
spin_unlock(&release_lock);
return;
}
+ mos_parport->shadowDCR = s->u.pc.ctr;
+ mos_parport->shadowECR = s->u.pc.ecr;
write_parport_reg_nonblock(mos_parport, MOS7720_DCR,
mos_parport->shadowDCR);
write_parport_reg_nonblock(mos_parport, MOS7720_ECR,
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] USB: serial: mos7720: fix parallel-port state restore
2020-11-04 16:47 [PATCH] USB: serial: mos7720: fix parallel-port state restore Johan Hovold
@ 2020-11-04 16:59 ` Greg KH
2020-11-05 8:05 ` Johan Hovold
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2020-11-04 16:59 UTC (permalink / raw)
To: Johan Hovold; +Cc: linux-usb, Davidlohr Bueso, linux-kernel, stable
On Wed, Nov 04, 2020 at 05:47:27PM +0100, Johan Hovold wrote:
> The parallel-port restore operations is called when a driver claims the
> port and is supposed to restore the provided state (e.g. saved when
> releasing the port).
>
> Fixes: b69578df7e98 ("USB: usbserial: mos7720: add support for parallel port on moschip 7715")
> Cc: stable <stable@vger.kernel.org> # 2.6.35
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
> drivers/usb/serial/mos7720.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
> index 5eed1078fac8..5a5d2a95070e 100644
> --- a/drivers/usb/serial/mos7720.c
> +++ b/drivers/usb/serial/mos7720.c
> @@ -639,6 +639,8 @@ static void parport_mos7715_restore_state(struct parport *pp,
> spin_unlock(&release_lock);
> return;
> }
> + mos_parport->shadowDCR = s->u.pc.ctr;
> + mos_parport->shadowECR = s->u.pc.ecr;
Wow that's old code. I'm guessing no one uses these devices really :(
Anyway, nice work:
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> write_parport_reg_nonblock(mos_parport, MOS7720_DCR,
> mos_parport->shadowDCR);
> write_parport_reg_nonblock(mos_parport, MOS7720_ECR,
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] USB: serial: mos7720: fix parallel-port state restore
2020-11-04 16:59 ` Greg KH
@ 2020-11-05 8:05 ` Johan Hovold
0 siblings, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2020-11-05 8:05 UTC (permalink / raw)
To: Greg KH; +Cc: Johan Hovold, linux-usb, Davidlohr Bueso, linux-kernel, stable
On Wed, Nov 04, 2020 at 05:59:10PM +0100, Greg Kroah-Hartman wrote:
> On Wed, Nov 04, 2020 at 05:47:27PM +0100, Johan Hovold wrote:
> > The parallel-port restore operations is called when a driver claims the
> > port and is supposed to restore the provided state (e.g. saved when
> > releasing the port).
> >
> > Fixes: b69578df7e98 ("USB: usbserial: mos7720: add support for parallel port on moschip 7715")
> > Cc: stable <stable@vger.kernel.org> # 2.6.35
> > Signed-off-by: Johan Hovold <johan@kernel.org>
> > ---
> > drivers/usb/serial/mos7720.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
> > index 5eed1078fac8..5a5d2a95070e 100644
> > --- a/drivers/usb/serial/mos7720.c
> > +++ b/drivers/usb/serial/mos7720.c
> > @@ -639,6 +639,8 @@ static void parport_mos7715_restore_state(struct parport *pp,
> > spin_unlock(&release_lock);
> > return;
> > }
> > + mos_parport->shadowDCR = s->u.pc.ctr;
> > + mos_parport->shadowECR = s->u.pc.ecr;
>
> Wow that's old code. I'm guessing no one uses these devices really :(
Possibly, but this would still work as long as you don't switch parallel
port driver without disconnecting the mos7715 device in between.
> Anyway, nice work:
>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thanks, now applied for -next.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-05 8:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04 16:47 [PATCH] USB: serial: mos7720: fix parallel-port state restore Johan Hovold
2020-11-04 16:59 ` Greg KH
2020-11-05 8:05 ` Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).