From: Stefan Eichenberger <eichest@gmail.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>,
kernel@pengutronix.de, andi.shyti@kernel.org,
shawnguo@kernel.org, s.hauer@pengutronix.de, Frank.Li@nxp.com,
francesco.dolcini@toradex.com, linux-i2c@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Stefan Eichenberger <stefan.eichenberger@toradex.com>
Subject: Re: [PATCH v2 1/4] i2c: imx: only poll for bus busy in multi master mode
Date: Wed, 21 Aug 2024 17:23:24 +0200 [thread overview]
Message-ID: <ZsYGbN36jwxyMAvE@eichest-laptop> (raw)
In-Reply-To: <ZsX8KzkQw0wJUCbc@pengutronix.de>
Hi Fabio, Oleksij,
On Wed, Aug 21, 2024 at 04:39:39PM +0200, Oleksij Rempel wrote:
> Hi Fabio, Stefan,
>
> On Wed, Aug 21, 2024 at 08:01:20AM -0300, Fabio Estevam wrote:
> > Hi Stefan,
> >
> > On Mon, Aug 19, 2024 at 4:20 AM Stefan Eichenberger <eichest@gmail.com> wrote:
> > >
> > > From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > >
> > > According to the i.MX8M Mini reference manual chapter "16.1.4.2
> > > Generation of Start" it is only necessary to poll for bus busy and
> > > arbitration lost in multi master mode. This helps to avoid rescheduling
> > > while the i2c bus is busy and avoids SMBus devices to timeout.
> > >
> > > Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > > Reviewed-by: Frank Li <Frank.Li@nxp.com>
> >
> > This fixes a pca953x probe error on an imx8mp board running linux-stable 6.6:
> >
> > [ 1.893260] pca953x 2-0020: failed writing register
> > [ 1.898258] pca953x 2-0020: probe with driver pca953x failed with error -11
> >
> > Could you please add a Fixes tag and Cc stable so that this can reach
> > the stable kernels?
> >
> > Tested-by: Fabio Estevam <festevam@denx.de>
Thanks a lot for testing. Are the other patches required as well or did
only introducing the master mode flag solve the issue?
> >
> > Thanks a lot,
>
> It looks like with this patch, the I2SR_IAL interrupt is not cleared.
> I would expect some kind of interrupt storm. Can you confirm it?
This is a good question. i2c_imx_trx_complete was never called in the
interrupt handler. So that would mean the storm would already be there
before just for a shorter time. We only clear the IFF flag in the isr.
> This causes a processor interrupt request (if the interrupt enable is
> asserted [IIEN = 1]). The interrupt is set when one of the following
> occurs:
> - One byte transfer is completed (the interrupt is set at the falling
> edge of the ninth clock).
> - An address is received that matches its own specific address in
> Slave Receive mode.
> - Arbitration is lost.
Unfortunately, I don't have a device that uses multi master mode and we
would only see it on such a device. However, also from the reference
manual:
> IAL must be cleared by software by writing a "0" to it at the start of
> the interrupt service routine
So most likely it was wrong the whole the time we just didn't see it
before, could that be? I think a fix would be relatively easy we have to
clear it at the beginning of the isr but after we read the status. I
could add this to the series if you agree.
Regards,
Stefan
next prev parent reply other threads:[~2024-08-21 15:23 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 7:19 [PATCH v2 0/4] i2c: imx: prevent rescheduling in non-dma mode Stefan Eichenberger
2024-08-19 7:19 ` [PATCH v2 1/4] i2c: imx: only poll for bus busy in multi master mode Stefan Eichenberger
2024-08-21 11:01 ` Fabio Estevam
2024-08-21 14:39 ` Oleksij Rempel
2024-08-21 15:23 ` Stefan Eichenberger [this message]
2024-08-21 16:43 ` Fabio Estevam
2024-08-21 22:31 ` Andi Shyti
2024-08-22 6:51 ` Oleksij Rempel
2024-08-22 11:07 ` Fabio Estevam
2024-08-22 11:50 ` Stefan Eichenberger
2024-08-22 12:59 ` Fabio Estevam
2024-08-23 13:43 ` Stefan Eichenberger
2024-08-21 22:21 ` Andi Shyti
2024-08-22 7:03 ` Stefan Eichenberger
2024-08-22 10:04 ` Oleksij Rempel
2024-08-22 12:03 ` Stefan Eichenberger
2024-08-23 0:35 ` Andi Shyti
2024-08-23 13:48 ` Stefan Eichenberger
2024-08-23 14:04 ` Oleksij Rempel
2024-08-23 14:42 ` Stefan Eichenberger
2024-08-19 7:19 ` [PATCH v2 2/4] i2c: imx: separate atomic, dma and non-dma use case Stefan Eichenberger
2024-08-30 7:31 ` Oleksij Rempel
2024-08-19 7:19 ` [PATCH v2 3/4] i2c: imx: use readb_relaxed and writeb_relaxed Stefan Eichenberger
2024-08-30 7:37 ` Oleksij Rempel
2024-08-19 7:19 ` [PATCH v2 4/4] i2c: imx: prevent rescheduling in non dma mode Stefan Eichenberger
2024-08-30 8:13 ` Oleksij Rempel
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=ZsYGbN36jwxyMAvE@eichest-laptop \
--to=eichest@gmail.com \
--cc=Frank.Li@nxp.com \
--cc=andi.shyti@kernel.org \
--cc=festevam@gmail.com \
--cc=francesco.dolcini@toradex.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=stefan.eichenberger@toradex.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