public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Jeremy Kerr <jk@codeconstruct.com.au>
Cc: "Datta, Shubhrajyoti" <shubhrajyoti.datta@amd.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"git (AMD-Xilinx)" <git@amd.com>, Frank Li <Frank.Li@nxp.com>,
	Joel Stanley <joel@jms.id.au>,
	"linux-i3c@lists.infradead.org" <linux-i3c@lists.infradead.org>
Subject: Re: [PATCH v2] i3c: dw-i3c-master: Fix IBI count register selection for versalnet
Date: Fri, 3 Apr 2026 18:24:42 +0200	[thread overview]
Message-ID: <20260403162442668f12b7@mail.local> (raw)
In-Reply-To: <5cb83afcd5340a108fd5a7346494ccf73752cc27.camel@codeconstruct.com.au>

Hello,

On 02/04/2026 16:32:30+0800, Jeremy Kerr wrote:
> Hi Shubhrajyoti,
> 
> > > How are you binding the driver to this device? Are you using a unique OF
> > > compatible string, or something ACPI-based?
> > > 
> > > ... and if that can be specific to this hardware instance, would that be an
> > > effective mechanism to select the IBI read method instead?
> > Hi Jeremy,
> > 
> > VersalNet currently uses the generic "snps,dw-i3c-master-1.00a"
> > compatible string — there is no unique compatible string for this
> > hardware instance. The DTS    entry looks like:
> > 
> >   compatible = "snps,dw-i3c-master-1.00a";
> 
> You should *always* have a unique compatible string for each device
> instance, if there can be any variation in behaviours from that generic
> one (which you certainly do have here).
> 
> You can still fall-back on a generic one, but using that as your only
> compatible value means you can't do device-specific behaviours in your
> driver, as you have just found.
> 
> >   We could introduce a VersalNet-specific compatible with a generic fallback:
> > 
> >   compatible = "xlnx,versalnet-dw-i3c-master", "snps,dw-i3c-master-1.00a";
> 
> Yes, you want that anyway.
> 

I agree you need a VersalNet-specific compatible string.

> >   and pass a quirk flag via of_device_id.data to select the IBI read method.
> 
> Exactly, and there is already the struct dw_i3c_drvdata to help with
> this.
> 
> > However, the probe-time detection avoids having to enumerate all affected
> > variants — the IC_HAS_IBI_DATA=0 configuration is a synthesizable
> > option in the IP and may appear in other SoCs using the same core.
> > 
> > Do you have a preference? If the DTS change is acceptable, I can go
> > with the compatible + match-data approach
> 
> That would certainly be my recommendation.
> 
> If it's a synthesisable option, it may even be worth adding as a flag to
> the binding definition (along with the same for other options that might
> be present). This would mean you don't need a-priori knowledge of the
> mapping of compatible strings to their synthesis options.
> 
> I don't have any access to documentation on those options though, so
> can't be of much help with doing that.
> 
> > However I thought that detecting it will be helpful for backward compatible.
> 
> Given it doesn't work at the moment, there shouldn't be any backwards
> compat concerns, I think?

I guess the proposed solution works as we can probe the HW to know how
it was synthesised. It's good to be able to avoid having device tree
properties for things we can discover.


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      reply	other threads:[~2026-04-03 16:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-01  8:44 [PATCH v2] i3c: dw-i3c-master: Fix IBI count register selection for versalnet Shubhrajyoti Datta
2026-04-01  9:14 ` Jeremy Kerr
2026-04-02  7:39   ` Datta, Shubhrajyoti
2026-04-02  8:32     ` Jeremy Kerr
2026-04-03 16:24       ` Alexandre Belloni [this message]

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=20260403162442668f12b7@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=Frank.Li@nxp.com \
    --cc=git@amd.com \
    --cc=jk@codeconstruct.com.au \
    --cc=joel@jms.id.au \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shubhrajyoti.datta@amd.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