From: Alexander Sverdlin <alexander.sverdlin@gmail.com>
To: Mark Brown <broonie@kernel.org>,
Javier Martinez Canillas <javierm@redhat.com>,
Wolfram Sang <wsa@the-dreams.de>
Cc: Herve Codina <herve.codina@bootlin.com>,
David Rhodes <david.rhodes@cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Nikita Shubin <nikita.shubin@maquefel.me>,
Axel Lin <axel.lin@ingics.com>,
Brian Austin <brian.austin@cirrus.com>,
linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH 1/3] ASoC: cs4271: Fix cs4271 I2C and SPI drivers automatic module loading
Date: Fri, 17 Oct 2025 20:14:43 +0200 [thread overview]
Message-ID: <d51a3e4e0ea960df60d5ba91817ae50eba0a4026.camel@gmail.com> (raw)
In-Reply-To: <5f2aeb66-97d6-41b7-8c80-87674c1b14d8@sirena.org.uk>
Hi Mark, Wolfram and all,
On Fri, 2025-10-17 at 16:01 +0100, Mark Brown wrote:
> On Fri, Oct 17, 2025 at 04:41:53PM +0200, Alexander Sverdlin wrote:
>
> > indeed, that's what I've got for a fake I2C device:
>
> > # cat /sys/bus/i2c/devices/0-0010/uevent
> > OF_NAME=cs4271
> > OF_FULLNAME=/soc/i2c@4000000/cs4271@10
> > OF_COMPATIBLE_0=cirrus,cs4271
> > OF_COMPATIBLE_N=1
> > MODALIAS=of:Ncs4271T(null)Ccirrus,cs4271
>
> > to me it looks like a bug somewhere in I2C core...
>
> IIRC this has been round the loop a few times and whatever you do
> something breaks.
it turns out it has been changed back in v4.18, with commit af503716ac14
("i2c: core: report OF style module alias for devices registered via OF"),
but the change is not symmetric with SPI, and SPI core doesn't call
of_device_uevent_modalias().
Not only is this inconsistent with SPI, but I anticipate yet another problem
if SPI would also adopt the same mechanism:
for instance there are many CODEC drivers in sound/soc, which have
SPI and I2C backends modelled as distinct modules.
In the current situation most of them have MODULE_DEVICE_TABLE(i2c,
and are therefore broken regarding module autoloading.
"Reparing" them as Herve proposed would result in I2C modules being
loaded only via "of:" style modalias and SPI still via "spi:". Which
sounds all but consistent.
If SPI ever adopts the same of_device_uevent_modalias(), both backends
would require "of:" prefixed modalias, and it will not be possible to
load the proper one for the corresponding bus type.
What are your thoughs on this?
--
Alexander Sverdlin.
next prev parent reply other threads:[~2025-10-17 18:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 13:03 [PATCH 0/3] Add support for an external Master Clock in the Cirrus CS4271 codec Herve Codina
2025-10-16 13:03 ` [PATCH 1/3] ASoC: cs4271: Fix cs4271 I2C and SPI drivers automatic module loading Herve Codina
2025-10-16 18:40 ` Alexander Sverdlin
2025-10-17 6:32 ` Herve Codina
2025-10-17 13:25 ` Alexander Sverdlin
2025-10-17 14:41 ` Alexander Sverdlin
2025-10-17 15:01 ` Mark Brown
2025-10-17 18:14 ` Alexander Sverdlin [this message]
2025-10-21 19:00 ` Mark Brown
2025-10-21 19:12 ` Alexander Sverdlin
2025-10-22 14:56 ` Mark Brown
2025-10-22 17:46 ` Alexander Sverdlin
2025-10-22 18:01 ` Mark Brown
2025-10-23 11:40 ` Javier Martinez Canillas
2025-10-23 12:32 ` Alexander Sverdlin
2025-10-17 15:10 ` Herve Codina
2025-10-17 15:35 ` Alexander Sverdlin
2025-10-17 16:03 ` Herve Codina
2025-10-21 17:25 ` Herve Codina
2025-10-16 13:03 ` [PATCH 2/3] ASoC: dt-bindings: cirrus,cs4271: Document mclk clock Herve Codina
2025-10-22 7:57 ` Krzysztof Kozlowski
2025-10-16 13:03 ` [PATCH 3/3] ASoC: cs4271: Add support for the external mclk Herve Codina
2025-10-16 19:14 ` Alexander Sverdlin
2025-10-16 19:17 ` Mark Brown
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=d51a3e4e0ea960df60d5ba91817ae50eba0a4026.camel@gmail.com \
--to=alexander.sverdlin@gmail.com \
--cc=axel.lin@ingics.com \
--cc=brian.austin@cirrus.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=david.rhodes@cirrus.com \
--cc=devicetree@vger.kernel.org \
--cc=herve.codina@bootlin.com \
--cc=javierm@redhat.com \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=nikita.shubin@maquefel.me \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=rf@opensource.cirrus.com \
--cc=robh@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=tiwai@suse.com \
--cc=wsa@the-dreams.de \
/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).