From: Jeff Layton <jlayton@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
Russ Weight <russ.weight@linux.dev>,
Danilo Krummrich <dakr@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Michal Grzedzicki <mge@meta.com>,
driver-core@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firmware_loader: allow firmware_class.path to take multiple paths
Date: Wed, 18 Mar 2026 08:56:52 -0400 [thread overview]
Message-ID: <8298861bdc60451c114479718fefe9ac856f228a.camel@kernel.org> (raw)
In-Reply-To: <2026031838-wieldable-enlisted-5398@gregkh>
On Wed, 2026-03-18 at 13:40 +0100, Greg Kroah-Hartman wrote:
> On Wed, Mar 18, 2026 at 08:25:54AM -0400, Jeff Layton wrote:
> > Refactor fw_get_filesystem_firmware() by extracting the per-path
> > firmware loading logic into a new fw_try_firmware_path() helper.
> >
> > Use this helper to parse fw_path_para for ';'-separated paths,
> > trying each one before falling through to the default firmware
> > search paths. This allows users to specify multiple custom firmware
> > directories via firmware_class.path, e.g.:
> >
> > firmware_class.path=/custom/path1;/custom/path2
> >
> > Suggested-by: Michal Grzedzicki <mge@meta.com>
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> > This is something Michal had asked for last year, and I just got around
> > to implementing. Tested with a dummy module that calls
> > request_firmware().
> > ---
> > drivers/base/firmware_loader/main.c | 197 +++++++++++++++++++++---------------
> > 1 file changed, 118 insertions(+), 79 deletions(-)
> >
> > diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c
> > index a11b30dda23be563bd55f25474ceff2153ddd667..5328d28a2141e85265e1bcc20e995ce4c5517c36 100644
> > --- a/drivers/base/firmware_loader/main.c
> > +++ b/drivers/base/firmware_loader/main.c
> > @@ -470,7 +470,6 @@ static int fw_decompress_xz(struct device *dev, struct fw_priv *fw_priv,
> > /* direct firmware loading support */
> > static char fw_path_para[256];
> > static const char * const fw_path[] = {
> > - fw_path_para,
> > "/lib/firmware/updates/" UTS_RELEASE,
> > "/lib/firmware/updates",
> > "/lib/firmware/" UTS_RELEASE,
> > @@ -480,10 +479,83 @@ static const char * const fw_path[] = {
> > /*
> > * Typical usage is that passing 'firmware_class.path=$CUSTOMIZED_PATH'
> > * from kernel command line because firmware_class is generally built in
> > - * kernel instead of module.
> > + * kernel instead of module. Multiple paths can be separated by ';'.
> > */
> > module_param_string(path, fw_path_para, sizeof(fw_path_para), 0644);
> > -MODULE_PARM_DESC(path, "customized firmware image search path with a higher priority than default path");
> > +MODULE_PARM_DESC(path, "customized firmware image search path with a higher priority than default path, multiple paths can be separated by ';'");
>
> Ah, you documented it here, sorry, I missed that.
>
If there's another spot we should document this, then happy to do so as
well. I didn't see much about this subsystem under Documentation/.
> But still, why ';'?
>
Honestly, I don't know why, but I was thinking that ';' was the
traditional $PATH separator at the time. I'll change it to ':'. Expect
a v2 soon!
Thanks,
--
Jeff Layton <jlayton@kernel.org>
prev parent reply other threads:[~2026-03-18 12:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 12:25 Jeff Layton
2026-03-18 12:39 ` Greg Kroah-Hartman
2026-03-18 12:40 ` Greg Kroah-Hartman
2026-03-18 12:56 ` Jeff Layton [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=8298861bdc60451c114479718fefe9ac856f228a.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=dakr@kernel.org \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=mge@meta.com \
--cc=rafael@kernel.org \
--cc=russ.weight@linux.dev \
/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
all inboxes | Powered by JetHome®