linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raviteja Narayanam <rna@xilinx.com>
To: Marek Vasut <marex@denx.de>, Michal Simek <michals@xilinx.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Cc: "linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	git <git@xilinx.com>, "joe@perches.com" <joe@perches.com>
Subject: RE: [PATCH v2 00/10] i2c: xiic: Add features, bug fixes.
Date: Tue, 20 Jul 2021 14:19:36 +0000	[thread overview]
Message-ID: <SN6PR02MB4093C7F2EB59D854D8753A01CAE29@SN6PR02MB4093.namprd02.prod.outlook.com> (raw)
In-Reply-To: <45aa8d2b-a077-32a2-0608-8f20a5b807a8@denx.de>



> -----Original Message-----
> From: Marek Vasut <marex@denx.de>
> Sent: Monday, July 19, 2021 11:30 PM
> To: Raviteja Narayanam <rna@xilinx.com>; Michal Simek
> <michals@xilinx.com>; linux-i2c@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; git
> <git@xilinx.com>; joe@perches.com
> Subject: Re: [PATCH v2 00/10] i2c: xiic: Add features, bug fixes.
> 
> On 7/19/21 12:09 PM, Raviteja Narayanam wrote:
> 
> Hi,
> 
> [...]
> 
> >>>> -Add 'standard mode' feature for reads > 255 bytes.
> >>>> -Add 'smbus block read' functionality.
> >>>> -Add 'xlnx,axi-iic-2.1' new IP version support.
> >>>> -Switch to 'AXI I2C standard mode' for i2c reads in affected IP versions.
> >>>> -Remove 'local_irq_save/restore' calls as discussed here:
> >> https://www.spinics.net/lists/linux-i2c/msg46483.html.
> >>>> -Some trivial fixes.
> >>>>
> >>>> Changes in v2:
> >>>> -Grouped the commits as fixes first and then features.
> >>>> -The first 4 commits fix the dynamic mode broken feature.
> >>>> -Corrected the indentation in coding style issues.
> >>>>
> >>>> Michal Simek (1):
> >>>>     i2c: xiic: Fix coding style issues
> >>>>
> >>>> Raviteja Narayanam (7):
> >>>>     i2c: xiic: Fix Tx Interrupt path for grouped messages
> >>>>     i2c: xiic: Add standard mode support for > 255 byte read transfers
> >>>>     i2c: xiic: Switch to Xiic standard mode for i2c-read
> >>>>     i2c: xiic: Remove interrupt enable/disable in Rx path
> >>>>     dt-bindings: i2c: xiic: Add 'xlnx,axi-iic-2.1' to compatible
> >>>>     i2c: xiic: Update compatible with new IP version
> >>>>     i2c: xiic: Add smbus_block_read functionality
> >>>>
> >>>> Shubhrajyoti Datta (2):
> >>>>     i2c: xiic: Return value of xiic_reinit
> >>>>     i2c: xiic: Fix the type check for xiic_wakeup
> >>>>
> >>>>    .../bindings/i2c/xlnx,xps-iic-2.00.a.yaml     |   4 +-
> >>>>    drivers/i2c/busses/i2c-xiic.c                 | 593 ++++++++++++++----
> >>>>    2 files changed, 487 insertions(+), 110 deletions(-)
> >>>>
> >>>
> >>> Acked-by: Michal Simek <michal.simek@xilinx.com>
> >>
> >> I just tested this patchset on next-20210716 and the XIIC failures
> >> are still present, see:
> >
> > The probe of ' atmel_mxt_ts' failed as per the error. May I know the
> > details of your test case if you tweaked any i2ctransfers/added delays.
> 
> It is still the same test case from a year ago -- Atmel MXT touchscreen
> controller connected to XIIC I2C IP in ZynqMP FPGA, both drivers are
> compiled into the kernel. Also, it is not the "new" XIIC IP revision, but older
> one from Vivado 2019 or so.
> 
> > If it failed without adding anything, then please check whether the
> > vivado design constraints are correctly applied or not.
> 
> They are, we already checked multiple times and the FPGA part is OK.
> 
> > Also check if the other devices on the bus are detected and i2ctransfer
> command is successful on them.
> 
> Note that this problem is very likely a race condition in the XIIC driver, so a
> trivial test like i2ctransfer on idle system from userspace is unlikely to trigger
> it. When the system is under heavy load e.g.
> during the kernel boot, that is when these corner cases start showing up.

Thanks for all the details, Marek. 

> 
> > It would be helpful to know if the device ' atmel_mxt_ts' is
> > successfully probed with next-20210716 without applying this patchset.
> 
> Sometimes, the XIIC driver in current mainline Linux suffers from race
> conditions on SMP, so it depends.
> 
> The MXT driver also has to be patched to avoid longer than 255 byte
> transfers, because that is currently broken with XIIC.
> 
> > I have tested this again on our boards with eeprom and other sensors, this
> is working fine for us.
> 
> Can you share details of how those tests were performed ?

Stress test - 1:
Heavy ethernet traffic running in the background. 
I2c commands script (like below) running. We can see visible stutter in the output as expected, but nothing failed.

i=0
while [ 1 ]
do
		i2ctransfer -y -f 2 w1@0X54 0X00 r31@0X54
		i2ctransfer -y -f 2 w1@0X54 0X00 r32@0X54
		i2ctransfer -y -f 2 w1@0X54 0X00 r255@0X54
		i2ctransfer -y -f 2 w1@0X54 0X00 r273@0X54
                             i2ctransfer -y -f 2 w1@0X54 0X00 r1@0X54
        i=$(expr $i + 1)
        echo "$i"
done

Stress test - 2:
Two i2c scripts running in parallel with commands as shown above with different bus numbers (as a result of mux), but going into same XIIC adapter.
This is also working fine.

Stress test - 3:
Two i2c scripts running in parallel with same commands in separate terminals. This is also working fine.

From your log, the race condition is occurring at boot time during i2c clients registration. I am starting a similar test at my setup
to reproduce this issue at boot time.

Regards,
Raviteja N


  reply	other threads:[~2021-07-20 14:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-26 10:27 [PATCH v2 00/10] i2c: xiic: Add features, bug fixes Raviteja Narayanam
2021-06-26 10:27 ` [PATCH v2 01/10] i2c: xiic: Fix Tx Interrupt path for grouped messages Raviteja Narayanam
2021-06-26 10:27 ` [PATCH v2 02/10] i2c: xiic: Add standard mode support for > 255 byte read transfers Raviteja Narayanam
2022-06-29 11:02   ` Krzysztof Adamski
2022-06-29 11:39     ` Michal Simek
2022-06-29 12:07       ` Krzysztof Adamski
2021-06-26 10:27 ` [PATCH v2 03/10] i2c: xiic: Switch to Xiic standard mode for i2c-read Raviteja Narayanam
2022-06-29 12:47   ` Krzysztof Adamski
2022-06-29 14:05     ` Marek Vasut
2022-06-29 14:09       ` Krzysztof Adamski
2022-06-29 14:34         ` Marek Vasut
2022-06-30  8:23         ` Datta, Shubhrajyoti
2022-07-01  7:01           ` Krzysztof Adamski
2022-07-04  5:45             ` Datta, Shubhrajyoti
2021-06-26 10:28 ` [PATCH v2 04/10] i2c: xiic: Remove interrupt enable/disable in Rx path Raviteja Narayanam
2021-06-26 10:28 ` [PATCH v2 05/10] dt-bindings: i2c: xiic: Add 'xlnx,axi-iic-2.1' to compatible Raviteja Narayanam
2021-06-26 10:28 ` [PATCH v2 06/10] i2c: xiic: Update compatible with new IP version Raviteja Narayanam
2021-06-26 10:28 ` [PATCH v2 07/10] i2c: xiic: Return value of xiic_reinit Raviteja Narayanam
2021-06-26 10:28 ` [PATCH v2 08/10] i2c: xiic: Fix the type check for xiic_wakeup Raviteja Narayanam
2021-06-26 10:28 ` [PATCH v2 09/10] i2c: xiic: Fix coding style issues Raviteja Narayanam
2021-06-26 10:28 ` [PATCH v2 10/10] i2c: xiic: Add smbus_block_read functionality Raviteja Narayanam
2021-06-28  7:23 ` [PATCH v2 00/10] i2c: xiic: Add features, bug fixes Michal Simek
2021-07-16 16:01   ` Marek Vasut
2021-07-19 10:09     ` Raviteja Narayanam
2021-07-19 18:00       ` Marek Vasut
2021-07-20 14:19         ` Raviteja Narayanam [this message]
2021-07-20 21:43           ` Marek Vasut
2021-07-26  5:26             ` Raviteja Narayanam
2021-07-26 13:12               ` Marek Vasut
2021-07-28 10:11                 ` Raviteja Narayanam
2021-07-28 18:47                   ` Marek Vasut
2022-06-28  7:50                     ` Guntupalli, Manikanta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SN6PR02MB4093C7F2EB59D854D8753A01CAE29@SN6PR02MB4093.namprd02.prod.outlook.com \
    --to=rna@xilinx.com \
    --cc=git@xilinx.com \
    --cc=joe@perches.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=michals@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).