From: Avi Weiss <thnkslprpt@gmail.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: linux-kernel@vger.kernel.org, Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH] parport: ip32: restore state on fast EPP timeout
Date: Wed, 28 Oct 2026 11:11:50 +0200 [thread overview]
Message-ID: <20261028091150.721538-2-thnkslprpt@gmail.com> (raw)
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
reply other threads:[~2026-10-28 9:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261028091150.721538-2-thnkslprpt@gmail.com \
--to=thnkslprpt@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®