* [PATCH v2] i2c: cadence: try reset when master receive arbitration lost
@ 2019-02-19 1:24 Shikai Wang
2019-02-23 9:48 ` Wolfram Sang
2019-11-05 7:42 ` Shubhrajyoti Datta
0 siblings, 2 replies; 8+ messages in thread
From: Shikai Wang @ 2019-02-19 1:24 UTC (permalink / raw)
To: Michal Simek
Cc: Wolfram Sang, Shubhrajyoti Datta, linux-kernel, linux-i2c,
Shikai Wang, linux-arm-kernel
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.
Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Shikai Wang <sxauwsk@163.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] 8+ messages in thread
* Re: [PATCH v2] i2c: cadence: try reset when master receive arbitration lost
2019-02-19 1:24 [PATCH v2] i2c: cadence: try reset when master receive arbitration lost Shikai Wang
@ 2019-02-23 9:48 ` Wolfram Sang
2019-03-09 9:44 ` Wolfram Sang
2019-11-05 7:42 ` Shubhrajyoti Datta
1 sibling, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2019-02-23 9:48 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: 509 bytes --]
On Tue, Feb 19, 2019 at 09:24:47AM +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.
Just checking because resetting looks like a big hammer to me: there is
no way to gracefully recover form 'arbitration lost' interrupt?
[-- 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] 8+ messages in thread
* Re: [PATCH v2] i2c: cadence: try reset when master receive arbitration lost
2019-02-23 9:48 ` Wolfram Sang
@ 2019-03-09 9:44 ` Wolfram Sang
2019-03-09 9:49 ` Wolfram Sang
0 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2019-03-09 9:44 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: 703 bytes --]
On Sat, Feb 23, 2019 at 10:48:43AM +0100, Wolfram Sang wrote:
> On Tue, Feb 19, 2019 at 09:24:47AM +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.
>
> Just checking because resetting looks like a big hammer to me: there is
> no way to gracefully recover form 'arbitration lost' interrupt?
I am still wondering about this but since it is acked by the maintainer:
Applied to for-current, thanks!
[-- 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] 8+ messages in thread
* Re: [PATCH v2] i2c: cadence: try reset when master receive arbitration lost
2019-03-09 9:44 ` Wolfram Sang
@ 2019-03-09 9:49 ` Wolfram Sang
0 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2019-03-09 9:49 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: 962 bytes --]
On Sat, Mar 09, 2019 at 10:44:52AM +0100, Wolfram Sang wrote:
> On Sat, Feb 23, 2019 at 10:48:43AM +0100, Wolfram Sang wrote:
> > On Tue, Feb 19, 2019 at 09:24:47AM +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.
> >
> > Just checking because resetting looks like a big hammer to me: there is
> > no way to gracefully recover form 'arbitration lost' interrupt?
>
> I am still wondering about this but since it is acked by the maintainer:
>
> Applied to for-current, thanks!
Oops, I was mixing this up with
[PATCHv4] i2c: cadence: Fix the driver in interrupt flurry case
This one doesn't have an ack from Michal. Dropping it again.
[-- 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] 8+ messages in thread
* Re: [PATCH v2] i2c: cadence: try reset when master receive arbitration lost
2019-02-19 1:24 [PATCH v2] i2c: cadence: try reset when master receive arbitration lost Shikai Wang
2019-02-23 9:48 ` Wolfram Sang
@ 2019-11-05 7:42 ` Shubhrajyoti Datta
2019-11-05 8:47 ` sxauwsk
1 sibling, 1 reply; 8+ messages in thread
From: Shubhrajyoti Datta @ 2019-11-05 7:42 UTC (permalink / raw)
To: Shikai Wang
Cc: Wolfram Sang, Shubhrajyoti Datta, linux-kernel, Michal Simek,
linux-i2c, linux-arm-kernel
Hi Shikai,
On Tue, Feb 19, 2019 at 8:19 AM Shikai Wang <sxauwsk@163.com> 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.
>
I am missing the issue that you are facing.
You are having a multimaster scenario and getting arbitration lost.
the current code would attempt a retry did that lead to any issues?
Can you explain the issue that you are facing?
_______________________________________________
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] 8+ messages in thread
* Re: Re: [PATCH v2] i2c: cadence: try reset when master receive arbitration lost
2019-11-05 7:42 ` Shubhrajyoti Datta
@ 2019-11-05 8:47 ` sxauwsk
2019-11-07 6:13 ` Shubhrajyoti Datta
0 siblings, 1 reply; 8+ messages in thread
From: sxauwsk @ 2019-11-05 8:47 UTC (permalink / raw)
To: Shubhrajyoti Datta
Cc: Wolfram Sang, Shubhrajyoti Datta, linux-kernel, Michal Simek,
linux-i2c, linux-arm-kernel
>Hi Shikai,
>
>On Tue, Feb 19, 2019 at 8:19 AM Shikai Wang <sxauwsk@163.com> 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.
>>
>I am missing the issue that you are facing.
>You are having a multimaster scenario and getting arbitration lost.
>
>the current code would attempt a retry did that lead to any issues?
>
>Can you explain the issue that you are facing?
Of cource, The following describe my situation.
In my product, Touchscreen connect to zynq-7000 XC7Z010 by i2c bus( Just connect only one i2c-device of touchscreen),
when user tap Touchscreen, Touchscreen interrupt send to CPU and notifyed i2c-driver to obtain location data by i2c-bus,
when Tap the screen frequently, sometimes CPU get interrupt from touchscreen and try to obtain data, then detect arbitration lost,
Although i2c-driver try three times, it's useless.
Actually i2c clock-line and data-line keep high, that mean i2c bus free.
Once this situation occur, i2c-control did't work anynay but cpu receive interrputs still.
I am sorry that I have't found a good solution for this issuse;
_______________________________________________
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] 8+ messages in thread
* Re: Re: [PATCH v2] i2c: cadence: try reset when master receive arbitration lost
2019-11-05 8:47 ` sxauwsk
@ 2019-11-07 6:13 ` Shubhrajyoti Datta
2019-11-08 12:25 ` sxauwsk
0 siblings, 1 reply; 8+ messages in thread
From: Shubhrajyoti Datta @ 2019-11-07 6:13 UTC (permalink / raw)
To: sxauwsk
Cc: Wolfram Sang, Shubhrajyoti Datta, linux-kernel, Michal Simek,
linux-i2c, linux-arm-kernel
Hi Shikai,
On Tue, Nov 5, 2019 at 2:18 PM sxauwsk@163.com <sxauwsk@163.com> wrote:
>
> >Hi Shikai,
> >
> >On Tue, Feb 19, 2019 at 8:19 AM Shikai Wang <sxauwsk@163.com> 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.
> >>
> >I am missing the issue that you are facing.
> >You are having a multimaster scenario and getting arbitration lost.
> >
> >the current code would attempt a retry did that lead to any issues?
> >
> >Can you explain the issue that you are facing?
>
> Of cource, The following describe my situation.
>
> In my product, Touchscreen connect to zynq-7000 XC7Z010 by i2c bus( Just connect only one i2c-device of touchscreen),
> when user tap Touchscreen, Touchscreen interrupt send to CPU and notifyed i2c-driver to obtain location data by i2c-bus,
So it is single master single slave.
>
> when Tap the screen frequently, sometimes CPU get interrupt from touchscreen and try to obtain data, then detect arbitration lost,
the arbitration lost is surprising in non-multimaster scenario.
Is there any other master in the configuration that we may not be triggering.
Or can you probe the lines?
> Although i2c-driver try three times, it's useless.
You get bus busy? what is the issue.
>
> Actually i2c clock-line and data-line keep high, that mean i2c bus free.
> Once this situation occur, i2c-control did't work anynay but cpu receive interrputs still.
>
> I am sorry that I have't found a good solution for this issuse;
_______________________________________________
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] 8+ messages in thread
* Re: Re: [PATCH v2] i2c: cadence: try reset when master receive arbitration lost
2019-11-07 6:13 ` Shubhrajyoti Datta
@ 2019-11-08 12:25 ` sxauwsk
0 siblings, 0 replies; 8+ messages in thread
From: sxauwsk @ 2019-11-08 12:25 UTC (permalink / raw)
To: Shubhrajyoti Datta
Cc: Wolfram Sang, Shubhrajyoti Datta, linux-kernel, Michal Simek,
linux-i2c, linux-arm-kernel
>Hi Shikai,
>
>On Tue, Nov 5, 2019 at 2:18 PM sxauwsk@163.com <sxauwsk@163.com> wrote:
>>
>> >Hi Shikai,
>> >
>> >On Tue, Feb 19, 2019 at 8:19 AM Shikai Wang <sxauwsk@163.com> 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.
>> >>
>> >I am missing the issue that you are facing.
>> >You are having a multimaster scenario and getting arbitration lost.
>> >
>> >the current code would attempt a retry did that lead to any issues?
>> >
>> >Can you explain the issue that you are facing?
>>
>> Of cource, The following describe my situation.
>>
>> In my product, Touchscreen connect to zynq-7000 XC7Z010 by i2c bus( Just connect only one i2c-device of touchscreen),
>> when user tap Touchscreen, Touchscreen interrupt send to CPU and notifyed i2c-driver to obtain location data by i2c-bus,
>
>So it is single master single slave.
>>
>> when Tap the screen frequently, sometimes CPU get interrupt from touchscreen and try to obtain data, then detect arbitration lost,
>the arbitration lost is surprising in non-multimaster scenario.
>Is there any other master in the configuration that we may not be triggering.
>Or can you probe the lines?
>
>> Although i2c-driver try three times, it's useless.
>
>You get bus busy? what is the issue.
>>
>> Actually i2c clock-line and data-line keep high, that mean i2c bus free.
>> Once this situation occur, i2c-control did't work anynay but cpu receive interrputs still.
>>
>> I am sorry that I have't found a good solution for this issuse;
Yes, I can't believe that, Maybe caused by the hardware environment or any other well.
Additionally I have't probe this issue recently.
_______________________________________________
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] 8+ messages in thread
end of thread, other threads:[~2019-11-08 12:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19 1:24 [PATCH v2] i2c: cadence: try reset when master receive arbitration lost Shikai Wang
2019-02-23 9:48 ` Wolfram Sang
2019-03-09 9:44 ` Wolfram Sang
2019-03-09 9:49 ` Wolfram Sang
2019-11-05 7:42 ` Shubhrajyoti Datta
2019-11-05 8:47 ` sxauwsk
2019-11-07 6:13 ` Shubhrajyoti Datta
2019-11-08 12:25 ` sxauwsk
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).