* [PATCH AUTOSEL 4.19 03/13] i2c: bcm2835: Avoid clock stretching timeouts
[not found] <20220223023152.242065-1-sashal@kernel.org>
@ 2022-02-23 2:31 ` Sasha Levin
2022-02-23 2:31 ` [PATCH AUTOSEL 4.19 11/13] i2c: cadence: allow COMPILE_TEST Sasha Levin
2022-02-23 2:31 ` [PATCH AUTOSEL 4.19 12/13] i2c: qup: " Sasha Levin
2 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2022-02-23 2:31 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Eric Anholt, Stefan Wahren, Wolfram Sang, Sasha Levin, nsaenz,
f.fainelli, rjui, sbranden, bcm-kernel-feedback-list,
prabhakar.mahadev-lad.rj, linux-i2c, linux-rpi-kernel,
linux-arm-kernel
From: Eric Anholt <eric@anholt.net>
[ Upstream commit 9495b9b31abe525ebd93da58de2c88b9f66d3a0e ]
The CLKT register contains at poweron 0x40, which at our typical 100kHz
bus rate means .64ms. But there is no specified limit to how long devices
should be able to stretch the clocks, so just disable the timeout. We
still have a timeout wrapping the entire transfer.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
BugLink: https://github.com/raspberrypi/linux/issues/3064
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-bcm2835.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
index 4d19254f78c8a..db1ab9ccc30e7 100644
--- a/drivers/i2c/busses/i2c-bcm2835.c
+++ b/drivers/i2c/busses/i2c-bcm2835.c
@@ -28,6 +28,11 @@
#define BCM2835_I2C_FIFO 0x10
#define BCM2835_I2C_DIV 0x14
#define BCM2835_I2C_DEL 0x18
+/*
+ * 16-bit field for the number of SCL cycles to wait after rising SCL
+ * before deciding the slave is not responding. 0 disables the
+ * timeout detection.
+ */
#define BCM2835_I2C_CLKT 0x1c
#define BCM2835_I2C_C_READ BIT(0)
@@ -398,6 +403,12 @@ static int bcm2835_i2c_probe(struct platform_device *pdev)
adap->dev.of_node = pdev->dev.of_node;
adap->quirks = &bcm2835_i2c_quirks;
+ /*
+ * Disable the hardware clock stretching timeout. SMBUS
+ * specifies a limit for how long the device can stretch the
+ * clock, but core I2C doesn't.
+ */
+ bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_CLKT, 0);
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, 0);
ret = i2c_add_adapter(adap);
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 4.19 11/13] i2c: cadence: allow COMPILE_TEST
[not found] <20220223023152.242065-1-sashal@kernel.org>
2022-02-23 2:31 ` [PATCH AUTOSEL 4.19 03/13] i2c: bcm2835: Avoid clock stretching timeouts Sasha Levin
@ 2022-02-23 2:31 ` Sasha Levin
2022-02-23 2:31 ` [PATCH AUTOSEL 4.19 12/13] i2c: qup: " Sasha Levin
2 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2022-02-23 2:31 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Wolfram Sang, Michal Simek, Sasha Levin, krzysztof.kozlowski,
robh, semen.protsenko, yangyicong, geert+renesas, jie.deng, sven,
bence98, lukas.bulwahn, linux-i2c
From: Wolfram Sang <wsa@kernel.org>
[ Upstream commit 0b0dcb3882c8f08bdeafa03adb4487e104d26050 ]
Driver builds fine with COMPILE_TEST. Enable it for wider test coverage
and easier maintenance.
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 017aec34a238d..3a2f85d811f75 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -445,7 +445,7 @@ config I2C_BRCMSTB
config I2C_CADENCE
tristate "Cadence I2C Controller"
- depends on ARCH_ZYNQ || ARM64 || XTENSA
+ depends on ARCH_ZYNQ || ARM64 || XTENSA || COMPILE_TEST
help
Say yes here to select Cadence I2C Host Controller. This controller is
e.g. used by Xilinx Zynq.
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 4.19 12/13] i2c: qup: allow COMPILE_TEST
[not found] <20220223023152.242065-1-sashal@kernel.org>
2022-02-23 2:31 ` [PATCH AUTOSEL 4.19 03/13] i2c: bcm2835: Avoid clock stretching timeouts Sasha Levin
2022-02-23 2:31 ` [PATCH AUTOSEL 4.19 11/13] i2c: cadence: allow COMPILE_TEST Sasha Levin
@ 2022-02-23 2:31 ` Sasha Levin
2022-02-24 22:41 ` Pavel Machek
2 siblings, 1 reply; 5+ messages in thread
From: Sasha Levin @ 2022-02-23 2:31 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Wolfram Sang, Sasha Levin, krzysztof.kozlowski, semen.protsenko,
robh, yangyicong, geert+renesas, sven, jie.deng, bence98,
lukas.bulwahn, linux-i2c
From: Wolfram Sang <wsa@kernel.org>
[ Upstream commit 5de717974005fcad2502281e9f82e139ca91f4bb ]
Driver builds fine with COMPILE_TEST. Enable it for wider test coverage
and easier maintenance.
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 3a2f85d811f75..165c112bc5b9a 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -849,7 +849,7 @@ config I2C_QCOM_GENI
config I2C_QUP
tristate "Qualcomm QUP based I2C controller"
- depends on ARCH_QCOM
+ depends on ARCH_QCOM || COMPILE_TEST
help
If you say yes to this option, support will be included for the
built-in I2C interface on the Qualcomm SoCs.
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH AUTOSEL 4.19 12/13] i2c: qup: allow COMPILE_TEST
2022-02-23 2:31 ` [PATCH AUTOSEL 4.19 12/13] i2c: qup: " Sasha Levin
@ 2022-02-24 22:41 ` Pavel Machek
2022-03-02 21:01 ` Sasha Levin
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2022-02-24 22:41 UTC (permalink / raw)
To: Sasha Levin
Cc: linux-kernel, stable, Wolfram Sang, krzysztof.kozlowski,
semen.protsenko, robh, yangyicong, geert+renesas, sven, jie.deng,
bence98, lukas.bulwahn, linux-i2c
[-- Attachment #1: Type: text/plain, Size: 428 bytes --]
Hi!
> [ Upstream commit 5de717974005fcad2502281e9f82e139ca91f4bb ]
>
> Driver builds fine with COMPILE_TEST. Enable it for wider test coverage
> and easier maintenance.
I believe this does not fix a bug and so is not suitable for stable.
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH AUTOSEL 4.19 12/13] i2c: qup: allow COMPILE_TEST
2022-02-24 22:41 ` Pavel Machek
@ 2022-03-02 21:01 ` Sasha Levin
0 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2022-03-02 21:01 UTC (permalink / raw)
To: Pavel Machek
Cc: linux-kernel, stable, Wolfram Sang, krzysztof.kozlowski,
semen.protsenko, robh, yangyicong, geert+renesas, sven, jie.deng,
bence98, lukas.bulwahn, linux-i2c
On Thu, Feb 24, 2022 at 11:41:26PM +0100, Pavel Machek wrote:
>Hi!
>
>> [ Upstream commit 5de717974005fcad2502281e9f82e139ca91f4bb ]
>>
>> Driver builds fine with COMPILE_TEST. Enable it for wider test coverage
>> and easier maintenance.
>
>I believe this does not fix a bug and so is not suitable for stable.
It does not, but it helps us catch bugs we otherwise wouldn't have.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-02 21:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220223023152.242065-1-sashal@kernel.org>
2022-02-23 2:31 ` [PATCH AUTOSEL 4.19 03/13] i2c: bcm2835: Avoid clock stretching timeouts Sasha Levin
2022-02-23 2:31 ` [PATCH AUTOSEL 4.19 11/13] i2c: cadence: allow COMPILE_TEST Sasha Levin
2022-02-23 2:31 ` [PATCH AUTOSEL 4.19 12/13] i2c: qup: " Sasha Levin
2022-02-24 22:41 ` Pavel Machek
2022-03-02 21:01 ` Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox