Skip to content

Commit 12a121b

Browse files
committed
i2c: i801: Improve too small kill wait time in i801_check_post
JIRA: https://issues.redhat.com/browse/RHEL-113184 commit 3a3c6b7 Author: Heiner Kallweit <hkallweit1@gmail.com> Date: Fri Feb 21 21:30:46 2025 +0100 i2c: i801: Improve too small kill wait time in i801_check_post In my tests terminating a transaction took about 25ms, what is in line with the chip-internal timeout as described in 5.21.3.2 "Bus Time Out" in [0]. Therefore the 2ms delay is too low. Instead of a fixed delay let's use i801_wait_intr() here, this also facilitates the status handling. This potential issue seems to have been existing forever, but as no related problem is known, treat it as an improvement. [0] Intel document #326776-003, 7 Series PCH datasheet Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/ad4ef645-5d03-4833-a0b6-f31f8fd06483@gmail.com Signed-off-by: Steve Best <sbest@redhat.com>
1 parent d37fc40 commit 12a121b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/i2c/busses/i2c-i801.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,12 +441,11 @@ static int i801_check_post(struct i801_priv *priv, int status)
441441
if (unlikely(status < 0)) {
442442
/* try to stop the current command */
443443
outb_p(SMBHSTCNT_KILL, SMBHSTCNT(priv));
444-
usleep_range(1000, 2000);
444+
status = i801_wait_intr(priv);
445445
outb_p(0, SMBHSTCNT(priv));
446446

447447
/* Check if it worked */
448-
status = inb_p(SMBHSTSTS(priv));
449-
if ((status & SMBHSTSTS_HOST_BUSY) || !(status & SMBHSTSTS_FAILED))
448+
if (status < 0 || !(status & SMBHSTSTS_FAILED))
450449
pci_dbg(priv->pci_dev, "Failed terminating the transaction\n");
451450
return -ETIMEDOUT;
452451
}

0 commit comments

Comments
 (0)