Skip to contentSkip to conversation

USB: serial: mos7720: fix parallel-port state restore

PATCH In review Johan Hovold 2 participants 3 messages Nov 4, 2020 – Nov 5, 2020

Subsystems (3)
lore
Share & tools
lore

Johan Hovold

author maintainer
#0 lore raw

PATCH 1/1 USB: serial: mos7720: fix parallel-port state restore

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 <[email protected]> # 2.6.35
---
 drivers/usb/serial/mos7720.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/serial/mos7720.c +2 -0
index 5eed1078fac8..5a5d2a95070e 100644
@@ -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,
Signature · 1 line
2.26.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Johan Hovold

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 <[email protected]> # 2.6.35
---
 drivers/usb/serial/mos7720.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/serial/mos7720.c +0 -0
index 5eed1078fac8..5a5d2a95070e 100644

drivers/usb/serial/mos7720.c static void parport_mos7715_restore_state(struct parport *pp, · line 643

Quoted 5 lines
drivers/usb/serial/mos7720.c +2 -0
@@ -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:

Quoted 6 lines
drivers/usb/serial/mos7720.c +0 -0
 	write_parport_reg_nonblock(mos_parport, MOS7720_DCR,
 				   mos_parport->shadowDCR);
 	write_parport_reg_nonblock(mos_parport, MOS7720_ECR,
Signature · 1 line
2.26.2
author maintainer
#2 lore raw
Quoted 12 lines · Greg Kroah-Hartman
Quoted 11 lines · Johan Hovold

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 <[email protected]> # 2.6.35
---
 drivers/usb/serial/mos7720.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 12 lines

drivers/usb/serial/mos7720.c static void parport_mos7715_restore_state(struct parport *pp, · line 643

Quoted 10 lines
drivers/usb/serial/mos7720.c +2 -0
index 5eed1078fac8..5a5d2a95070e 100644
@@ -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.

Quoted 3 lines

Anyway, nice work:

Thanks, now applied for -next.

Johan