LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ming Lei <ming.lei@canonical.com>
To: Dmitry Torokhov <dtor@chromium.org>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Charlie Mooney <charliemooney@chromium.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] firmware_class: Add firmware filename overrides
Date: Thu, 5 Mar 2015 16:14:05 +0800	[thread overview]
Message-ID: <CACVXFVPBOvrU2OOSsFs9WGjwJix=00bZswjUWLitRic_sJ2TtA@mail.gmail.com> (raw)
In-Reply-To: <20150305004827.GC3325@dtor-glaptop>

On Thu, Mar 5, 2015 at 8:48 AM, Dmitry Torokhov <dtor@chromium.org> wrote:
> On Wed, Mar 04, 2015 at 03:57:09PM -0800, Greg KH wrote:
>> On Wed, Mar 04, 2015 at 03:25:10PM -0800, Charlie Mooney wrote:
>> > This patch adds an additional feature to the firmware_class.c module.
>> > To allow a unified method of specifying new firmware locations when
>> > drivers request a firmware binary to update their devices with, we
>> > have added the concept of a "fw override"
>> >
>> > A fw override is a rule that matches firmware requests based on the
>> > name of the device requesting the fw and what the filename for the
>> > fw they are requesting is, and overrides their requests with a new
>> > value.
>> >
>> > Overrides are set up by piping a description of the override into
>> > an attribute set up at /sys/class/firmware/fw_override.  The string
>> > should be a null-deliminited list of the firmware name you want to
>> > over ride, the new name to replace it with, and the device name that
>> > you want the override to apply to.   For example you could set up
>> > an override for a device called "my_device" so that any time it
>> > requests a firmware called "my_fw.bin" it instead gets "new_fw.bin"
>> > with the following command:
>> >
>> > echo -e 'my_fw.bin\0new_fw.bin\0my_device\0' >
>> >                             /sys/class/firmware/fw_override
>>
>> I hate to ask, but I have to, why do you need this?
>
> We may have single driver serve several devices (a touchscreen and a
> touchpad) that require different firmware/config file to function. We have

I remember some wifi drivers have similar usage too: one driver serves
several functions, and each function need its own firmware. So looks
it is fine to use different firmware name for each different function, or
my understanding about the use case is wrong?

Thanks,
Ming Lei

> several options:
>
> - modify the driver to allow changing firmware name from userspace - gets
>   old when there are several drivers that need that;
> - encode part numbers in the driver and request different firmware - not
>   easily maintainable, still has an issue that same part might be used for
>   different devices;
> - replace the firmware file on disk before initiating firmware load - does
>   not work well with read-only file systems;
> - have udev supply different data - udev went out of fashion;
> - have one central place (firmware loader) that users can control to
>   override the names - this solution.
>
> Thanks.
>
> --
> Dmitry
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2015-03-05  8:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 23:25 Charlie Mooney
2015-03-04 23:57 ` Greg KH
2015-03-05  0:48   ` Dmitry Torokhov
2015-03-05  8:14     ` Ming Lei [this message]
2015-03-05 17:29       ` Charles Mooney
2015-03-05 17:39         ` Marcel Holtmann
2015-03-05 17:52           ` Charles Mooney
2015-03-05 18:13             ` Marcel Holtmann
2015-03-05 18:20               ` Dmitry Torokhov
2015-03-05 19:11                 ` Marcel Holtmann
2015-03-05 19:14                   ` Dmitry Torokhov
2015-03-05 22:12                     ` Marcel Holtmann
2015-03-05 22:36                       ` Dmitry Torokhov
2015-03-06  1:27                         ` Ming Lei
2015-03-06 22:50                           ` Charles Mooney
2015-03-06 23:33                             ` Marcel Holtmann
2015-03-10 15:51                               ` Charles Mooney

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='CACVXFVPBOvrU2OOSsFs9WGjwJix=00bZswjUWLitRic_sJ2TtA@mail.gmail.com' \
    --to=ming.lei@canonical.com \
    --cc=charliemooney@chromium.org \
    --cc=dtor@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] firmware_class: Add firmware filename overrides' \
    /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

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).