Patch "i2c: s3c24xx: fix read transfers in polling mode" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    i2c: s3c24xx: fix read transfers in polling mode

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     i2c-s3c24xx-fix-read-transfers-in-polling-mode.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 800ab8201ac06f6c51cd501e16469921f40b72b3
Author: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
Date:   Wed Nov 8 17:43:52 2023 +0100

    i2c: s3c24xx: fix read transfers in polling mode
    
    [ Upstream commit 0d9cf23ed55d7ba3ab26d617a3ae507863674c8f ]
    
    To properly handle read transfers in polling mode, no waiting for the ACK
    state is needed as it will never come. Just wait a bit to ensure start
    state is on the bus and continue processing next bytes.
    
    Fixes: 117053f77a5a ("i2c: s3c2410: Add polling mode support")
    Signed-off-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
    Reviewed-by: Chanho Park <chanho61.park@xxxxxxxxxxx>
    Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxx>
    Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 4c6036920388..8186af573a02 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -233,8 +233,17 @@ static bool is_ack(struct s3c24xx_i2c *i2c)
 	int tries;
 
 	for (tries = 50; tries; --tries) {
-		if (readl(i2c->regs + S3C2410_IICCON)
-			& S3C2410_IICCON_IRQPEND) {
+		unsigned long tmp = readl(i2c->regs + S3C2410_IICCON);
+
+		if (!(tmp & S3C2410_IICCON_ACKEN)) {
+			/*
+			 * Wait a bit for the bus to stabilize,
+			 * delay estimated experimentally.
+			 */
+			usleep_range(100, 200);
+			return true;
+		}
+		if (tmp & S3C2410_IICCON_IRQPEND) {
 			if (!(readl(i2c->regs + S3C2410_IICSTAT)
 				& S3C2410_IICSTAT_LASTBIT))
 				return true;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux