parport: ip32: restore state on fast EPP timeout
PATCH 1/1 parport: ip32: restore state on fast EPP timeout
parport_ip32_epp_read() and parport_ip32_epp_write() return -EIO on a fast EPP timeout without restoring PS/2 mode. The read path also leaves the data lines in reverse direction.
Restore the mode and data direction before returning the error, as in the non-fast timeout paths.
Fixes 8e75f744289f ("[PATCH] parport: add parallel port support for SGI O2")
Signed-off-by Avi Weiss <[email protected]>
--- drivers/parport/parport_ip32.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/parport/parport_ip32.c +3 -0
@@ -1109,6 +1109,8 @@ static size_t parport_ip32_epp_read(void __iomem *eppreg,readsb (eppreg, buf, len);if (readb (priv->regs.dsr) &DSR_TIMEOUT ) {parport_ip32_clear_epp_timeout (p); +parport_ip32_data_forward (p); +parport_ip32_set_mode (p,ECR_MODE_PS2 );return -EIO ; } got = len;
@@ -1148,6 +1150,7 @@ static size_t parport_ip32_epp_write(void __iomem *eppreg,writesb (eppreg, buf, len);if (readb (priv->regs.dsr) &DSR_TIMEOUT ) {parport_ip32_clear_epp_timeout (p); +parport_ip32_set_mode (p,ECR_MODE_PS2 );return -EIO ; } written = len;
base-commit: 65ba8f34ec886ec72b2c07ddc8cf3d815c32869d
Signature · 1 line
2.43.0