linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: cadence: try reset when master receive arbitration lost
@ 2019-02-18  9:41 Shikai Wang
  2019-02-18 10:11 ` Michal Simek
  2019-02-18 17:06 ` Wolfram Sang
  0 siblings, 2 replies; 5+ messages in thread
From: Shikai Wang @ 2019-02-18  9:41 UTC (permalink / raw)
  To: Shubhrajyoti Datta
  Cc: linux-kernel, sxauwsk, Michal Simek, linux-arm-kernel, linux-i2c

When the adapter receive arbitration lost error interrupts,
cdns_i2c_master_xfer return to the caller directly instead of resetting
the adapter which resulted in the adapter being out of control.

So when driver detect err_status such as arbitration lost,
then try to repair and fix it.

Signed-off-by: Shikai Wang <sxauwsk@163.com>
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
 drivers/i2c/busses/i2c-cadence.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index b13605718291..595b0d56ff1a 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -548,10 +548,6 @@ static int cdns_i2c_process_msg(struct cdns_i2c *id, struct i2c_msg *msg,
 	cdns_i2c_writereg(CDNS_I2C_IXR_ALL_INTR_MASK,
 			  CDNS_I2C_IDR_OFFSET);
 
-	/* If it is bus arbitration error, try again */
-	if (id->err_status & CDNS_I2C_IXR_ARB_LOST)
-		return -EAGAIN;
-
 	return 0;
 }
 
@@ -624,6 +620,12 @@ static int cdns_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 		if (id->err_status) {
 			cdns_i2c_master_reset(adap);
 
+			/* If it is bus arbitration error, try again */
+			if (id->err_status & CDNS_I2C_IXR_ARB_LOST) {
+				ret = -EAGAIN;
+				goto out;
+			}
+
 			if (id->err_status & CDNS_I2C_IXR_NACK) {
 				ret = -ENXIO;
 				goto out;
-- 
2.19.2



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] i2c: cadence: try reset when master receive arbitration lost
  2019-02-18  9:41 [PATCH] i2c: cadence: try reset when master receive arbitration lost Shikai Wang
@ 2019-02-18 10:11 ` Michal Simek
  2019-02-18 17:06 ` Wolfram Sang
  1 sibling, 0 replies; 5+ messages in thread
From: Michal Simek @ 2019-02-18 10:11 UTC (permalink / raw)
  To: Shikai Wang, Shubhrajyoti Datta
  Cc: linux-kernel, Michal Simek, linux-arm-kernel, linux-i2c

On 18. 02. 19 10:41, Shikai Wang wrote:
> When the adapter receive arbitration lost error interrupts,
> cdns_i2c_master_xfer return to the caller directly instead of resetting
> the adapter which resulted in the adapter being out of control.
> 
> So when driver detect err_status such as arbitration lost,
> then try to repair and fix it.
> 
> Signed-off-by: Shikai Wang <sxauwsk@163.com>

ok. This is much better.

> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>

I haven't see that Shubhrajyoti gave you this line that he is coauthor
of this.
It means you shouldn't add this SoB line if he didn't work on this.
He reviewed it that's why you should wait what he is going to sent.

Anyway based on email I see that this is 3rd version but I can't see any
version in subject and also description of changes.

That's why please take a look at this
Documentation/process/submitting-patches.rst

And send proper version. I would suggest to use v2 or v3.

Thanks,
Michal

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] i2c: cadence: try reset when master receive arbitration lost
  2019-02-18  9:41 [PATCH] i2c: cadence: try reset when master receive arbitration lost Shikai Wang
  2019-02-18 10:11 ` Michal Simek
@ 2019-02-18 17:06 ` Wolfram Sang
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2019-02-18 17:06 UTC (permalink / raw)
  To: Shikai Wang
  Cc: linux-kernel, Shubhrajyoti Datta, Michal Simek, linux-arm-kernel,
	linux-i2c


[-- Attachment #1.1: Type: text/plain, Size: 663 bytes --]

On Mon, Feb 18, 2019 at 05:41:32PM +0800, Shikai Wang wrote:
> When the adapter receive arbitration lost error interrupts,
> cdns_i2c_master_xfer return to the caller directly instead of resetting
> the adapter which resulted in the adapter being out of control.
> 
> So when driver detect err_status such as arbitration lost,
> then try to repair and fix it.

Thanks for working on this issue.

> Signed-off-by: Shikai Wang <sxauwsk@163.com>
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>

Reading the previous thread, isn't this more of an acked-by or
reviewed-by than a Signed-off?

Also, is there a suitable Fixes tag?


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] i2c: cadence: try reset when master receive arbitration lost
  2019-02-18  8:35 sxauwsk
@ 2019-02-18  9:30 ` Michal Simek
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2019-02-18  9:30 UTC (permalink / raw)
  To: sxauwsk, Shubhrajyoti Datta
  Cc: linux-i2c, linux-kernel, linux-arm-kernel, Michal Simek


[-- Attachment #1.1.1: Type: text/plain, Size: 756 bytes --]

Hi,

On 18. 02. 19 9:35, sxauwsk wrote:
> When the adapter receive arbitration lost error interrupts,
> cdns_i2c_master_xfer return to the caller directly instead of resetting
> the adapter which resulted in the adapter being out of control.
> 
> So when driver detect err_status such as arbitration lost,
> then try to repair and fix it.
> 
> Signed-off-by: sxauwsk <sxauwsk@163.com>

Can you please fix your name here? And also in subject.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs



[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] i2c: cadence: try reset when master receive arbitration lost
@ 2019-02-18  8:35 sxauwsk
  2019-02-18  9:30 ` Michal Simek
  0 siblings, 1 reply; 5+ messages in thread
From: sxauwsk @ 2019-02-18  8:35 UTC (permalink / raw)
  To: Shubhrajyoti Datta
  Cc: linux-kernel, sxauwsk, Michal Simek, linux-arm-kernel, linux-i2c

When the adapter receive arbitration lost error interrupts,
cdns_i2c_master_xfer return to the caller directly instead of resetting
the adapter which resulted in the adapter being out of control.

So when driver detect err_status such as arbitration lost,
then try to repair and fix it.

Signed-off-by: sxauwsk <sxauwsk@163.com>
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
 drivers/i2c/busses/i2c-cadence.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index b13605718291..595b0d56ff1a 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -548,10 +548,6 @@ static int cdns_i2c_process_msg(struct cdns_i2c *id, struct i2c_msg *msg,
 	cdns_i2c_writereg(CDNS_I2C_IXR_ALL_INTR_MASK,
 			  CDNS_I2C_IDR_OFFSET);
 
-	/* If it is bus arbitration error, try again */
-	if (id->err_status & CDNS_I2C_IXR_ARB_LOST)
-		return -EAGAIN;
-
 	return 0;
 }
 
@@ -624,6 +620,12 @@ static int cdns_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 		if (id->err_status) {
 			cdns_i2c_master_reset(adap);
 
+			/* If it is bus arbitration error, try again */
+			if (id->err_status & CDNS_I2C_IXR_ARB_LOST) {
+				ret = -EAGAIN;
+				goto out;
+			}
+
 			if (id->err_status & CDNS_I2C_IXR_NACK) {
 				ret = -ENXIO;
 				goto out;
-- 
2.19.2



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-18 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18  9:41 [PATCH] i2c: cadence: try reset when master receive arbitration lost Shikai Wang
2019-02-18 10:11 ` Michal Simek
2019-02-18 17:06 ` Wolfram Sang
  -- strict thread matches above, loose matches on Subject: below --
2019-02-18  8:35 sxauwsk
2019-02-18  9:30 ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).