Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <johannes.goede@oss.qualcomm.com>
To: Sudeep Holla <sudeep.holla@kernel.org>,
	Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>,
	Cristian Marussi <cristian.marussi@arm.com>,
	Bjorn Andersson <andersson@kernel.org>
Cc: arm-scmi@vger.kernel.org, guomin_chen@sina.com,
	linux-arm-kernel@lists.infradead.org, peng.fan@nxp.com,
	quic_xinqzhan@quicinc.com
Subject: Re: [RFC PATCH 2/2] firmware: arm_scmi: Add bus support for autoloading
Date: Thu, 20 Aug 2026 16:50:22 +0200	[thread overview]
Message-ID: <09a17e4f-99cf-406c-9cf0-a237c9f0bb19@oss.qualcomm.com> (raw)
In-Reply-To: <20260729-optimistic-lemon-myna-a14bbf@sudeepholla>

Hi All,

On 29-Jul-26 16:17, Sudeep Holla wrote:
> On Wed, Jul 29, 2026 at 04:11:18PM +0200, Daniel Lezcano wrote:
>>
>> Hi Cristian,
>>
>> On 6/9/26 11:01, Sudeep Holla wrote:
>>> On Mon, Jun 08, 2026 at 05:51:57PM +0100, Cristian Marussi wrote:
>>
>> [ ... ]
>>
>>>> Thoughts ? Plans ?

Given the internal discussion about this on Slack I decided to
look into fixing this and while reading the thread from [1]
found a pointer to this thread.

>>> Just repost as non-rfc after next merge window and we will see if there is
>>> much interest to get it merged for the following one and take it from there.
>>
>> Are you planning to resend the series ? I can test them on my laptop
>>
> 
> I thought [1] from Bjorn was addressing the same issue ?

Yes, but it does not solve the chicken and the egg problem we've wrt
module auto-loading. It tries to do so in patch 2/2 of the [1] series
but that relies on request_module() rather then a proper/normal
modalias uevent and that request_module() typically will happen
inside the initramfs and then fails if the needed module is not in
the initramfs.

Normal bus devices with a proper modalias uevent do not suffer from
this because there udev does the modprobe based on the uevent file
under the device's sysfs dir and it retries this after the switch
to the real rootfs.

The problem the current scmi code has is that it creates
devices under the SCMI bus based on protocol+name pairs in
the scmi_requested_devices list.

And that list is populated based on driver->id_table entries
from any loaded drivers. So for a device to get created
the module registering the driver with the matching
scmi_device_id-s needs to be loaded first.

And the way the device model + udev contract works is that
the module will be auto-loaded based on the modalias of
the created device.

So no module, no device on the scmi bus and no device no
module autoloading. Hence chicken and egg.

I believe that the first patch from Bjorn's series which
is similar but more complete then the first patch from
this (Cristian's) series + pre-populating
the scmi_requested_devices for Standard protocol devices
as Christian's second patch does should do the trick.

This break the chicken and egg problem for standard proto
devices. This means no auto-loading for modules for
custom protocols, there is no way to avoid this.

As an exception we could add any custom protocols for
which support is added to the mainline kernel to
the table used to pre-populate the scmi_requested_devices
list.

I'll go and prepare a new series consisting of Bjorn's 1/2
(unmodified) + Christian's 2/2 reduced to just pre-populating
the table and after testing that that does the trick I'll
post that as a v2 series obsoleting both existing series.

Regards,

Hans


[1] https://lore.kernel.org/all/20260618-scmi-modalias-v2-0-8c7547c1be21@oss.qualcomm.com


  parent reply	other threads:[~2026-08-20 14:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-31 14:18 [PATCH 1/3] firmware: arm_scmi: Relax duplicate name constraint across protocol ids Sudeep Holla
2025-01-31 14:18 ` [PATCH 2/3] firmware: arm_scmi: Add name and protocol id attributes Sudeep Holla
2025-02-03  6:25   ` Dhruva Gole
2025-01-31 14:18 ` [PATCH 3/3] firmware: arm_scmi: Emit modalias for SCMI devices Sudeep Holla
2025-02-03  9:33   ` Cristian Marussi
2025-02-03 10:01     ` [RFC PATCH 1/2] firmware: arm_scmi: Generate aliases for SCMI modules Cristian Marussi
2025-02-03 10:01       ` [RFC PATCH 2/2] firmware: arm_scmi: Add bus support for autoloading Cristian Marussi
2026-06-08 14:51         ` Daniel Lezcano
2026-06-08 16:51           ` Cristian Marussi
2026-06-08 17:06             ` Daniel Lezcano
2026-06-08 20:53               ` Cristian Marussi
2026-06-09  9:01             ` Sudeep Holla
2026-07-29 14:11               ` Daniel Lezcano
2026-07-29 14:17                 ` Sudeep Holla
2026-07-29 14:53                   ` Daniel Lezcano
2026-08-20 14:50                   ` Hans de Goede [this message]
2025-02-02 11:08 ` [PATCH 1/3] firmware: arm_scmi: Relax duplicate name constraint across protocol ids Peng Fan
2025-02-03  6:21 ` Dhruva Gole
2025-02-21 11:36 ` Sudeep Holla

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=09a17e4f-99cf-406c-9cf0-a237c9f0bb19@oss.qualcomm.com \
    --to=johannes.goede@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=arm-scmi@vger.kernel.org \
    --cc=cristian.marussi@arm.com \
    --cc=daniel.lezcano@oss.qualcomm.com \
    --cc=guomin_chen@sina.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=peng.fan@nxp.com \
    --cc=quic_xinqzhan@quicinc.com \
    --cc=sudeep.holla@kernel.org \
    /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