linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Stefan Eichenberger <eichest@gmail.com>
Cc: o.rempel@pengutronix.de, kernel@pengutronix.de,
	andi.shyti@kernel.org,  shawnguo@kernel.org,
	s.hauer@pengutronix.de, festevam@gmail.com, Frank.Li@nxp.com,
	 imx@lists.linux.dev, linux-kernel@vger.kernel.org,
	Stefan Eichenberger <stefan.eichenberger@toradex.com>,
	linux-i2c@vger.kernel.org,  francesco.dolcini@toradex.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 1/4] i2c: imx: only poll for bus busy in multi master mode
Date: Wed, 02 Oct 2024 17:16:35 +0200	[thread overview]
Message-ID: <bcdd6cae28edd9dd05a71118f9979e7460688775.camel@pengutronix.de> (raw)
In-Reply-To: <Zv1fEAFKlzNpmHnD@eichest-laptop>

Am Mittwoch, dem 02.10.2024 um 16:56 +0200 schrieb Stefan Eichenberger:
> On Wed, Oct 02, 2024 at 04:40:32PM +0200, Lucas Stach wrote:
> > Am Mittwoch, dem 02.10.2024 um 13:19 +0200 schrieb Stefan Eichenberger:
> > > 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.
> > > 
> > This is a backward incompatible change, as far as I can see. Until now
> > the driver would properly handle a multi-mastered bus, without any
> > specific configuration. Now it requires the new multi-master DT
> > property to be set, which isn't even documented in the binding to be
> > understood by this driver.
> > 
> > Are you sure that every single instance of a i.MX i2c bus is only
> > single mastered?
> > 
> > If this is a worthwhile performance improvement I guess you need to
> > flip the logic around by adding a new single-master DT property (or
> > something along those lines), which should go through proper DT binding
> > review. You can then use this property for boards/busses to opt into
> > skipping the arbitration lost check.
> 
> According to the discussion here the property documentation should not
> be added:
> https://lore.kernel.org/linux-i2c/2bbddaxyjkxfmlgmq3yqcbzo7dsb2pq5bvdatk2y4ig4iintkt@35btqkdv7sy3/
> 
Ah, I wasn't aware of that.

> However, the point regarding single-master and multi-master is correct.
> We also discussed this internally and assumed the single-master use case
> is more likely to be the default and that this patch series would fix
> issues for other devices out there.
> 
I agree that the vast majority of busses is single master only and I
can see why you did it this way.

However, I still think it's a risky change, as some boards/DTs may rely
on the fact that the driver implicitly handled multi-master until now
and we can't retroactively change DTs in the wild.

I just looked up the dtschema for i2c-controller and there is a
"single-master" property defined already. I think it would be good if
you used this instead to have boards opt in to this optimization.

Regards,
Lucas

>  However, your point is valid and if
> preferred I can change it to single-master with the next version.
> 
> Francesco Dolcini <francesco.dolcini@toradex.com> I think you once had a
> discussion regarding multi master mode for i2c on i.MX devices? Maybe
> you can remember the details?
> 
> Regards,
> Stefan


  reply	other threads:[~2024-10-02 15:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02 11:19 [PATCH v4 0/4] i2c: imx: prevent rescheduling in non-dma mode Stefan Eichenberger
2024-10-02 11:19 ` [PATCH v4 1/4] i2c: imx: only poll for bus busy in multi master mode Stefan Eichenberger
2024-10-02 14:40   ` Lucas Stach
2024-10-02 14:56     ` Stefan Eichenberger
2024-10-02 15:16       ` Lucas Stach [this message]
2024-10-02 11:19 ` [PATCH v4 2/4] i2c: imx: separate atomic, dma and non-dma use case Stefan Eichenberger
2024-10-02 11:19 ` [PATCH v4 3/4] i2c: imx: use readb_relaxed and writeb_relaxed Stefan Eichenberger
2024-10-02 11:51   ` Arnd Bergmann
2024-10-02 13:08     ` Stefan Eichenberger
2024-10-02 13:36       ` Arnd Bergmann
2024-10-02 14:36         ` Stefan Eichenberger
2024-10-02 11:19 ` [PATCH v4 4/4] i2c: imx: prevent rescheduling in non dma mode Stefan Eichenberger

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=bcdd6cae28edd9dd05a71118f9979e7460688775.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=Frank.Li@nxp.com \
    --cc=andi.shyti@kernel.org \
    --cc=eichest@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).