* [PATCH] parport: ip32: restore state on fast EPP timeout
@ 2026-10-28 9:11 Avi Weiss
0 siblings, 0 replies; only message in thread
From: Avi Weiss @ 2026-10-28 9:11 UTC (permalink / raw)
To: Sudip Mukherjee; +Cc: linux-kernel, Avi Weiss
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@gmail.com>
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-28 9:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-28 9:11 [PATCH] parport: ip32: restore state on fast EPP timeout Avi Weiss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®