[PATCH] parport: ip32: restore state on fast EPP timeout
From: Avi Weiss
Date: Wed Oct 28 2026 - 05:12:04 EST
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 <thnkslprpt@xxxxxxxxx>
---
drivers/parport/parport_ip32.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/parport/parport_ip32.c b/drivers/parport/parport_ip32.c
index 14a4f4251d5cf..103a75a17eda0 100644
--- a/drivers/parport/parport_ip32.c
+++ b/drivers/parport/parport_ip32.c
@@ -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
--
2.43.0