From: Russ Weight <russell.h.weight@intel.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: <sudeep.holla@arm.com>, <cristian.marussi@arm.com>,
<ardb@kernel.org>, <bjorn.andersson@linaro.org>,
<linux-kernel@vger.kernel.org>, <trix@redhat.com>,
<lgoncalv@redhat.com>, <yilun.xu@intel.com>, <hao.wu@intel.com>,
<matthew.gerlach@intel.com>
Subject: Re: [RFC PATCH 1/5] firmware: Create firmware upload framework
Date: Wed, 17 Nov 2021 12:02:05 -0800 [thread overview]
Message-ID: <29541f4f-c1d5-9ce1-9160-e5698b215c96@intel.com> (raw)
In-Reply-To: <YZVP1jetd/a+dYyf@kroah.com>
On 11/17/21 10:54 AM, Greg KH wrote:
> On Wed, Nov 17, 2021 at 10:47:38AM -0800, Russ Weight wrote:
>>
>> On 11/17/21 10:18 AM, Greg KH wrote:
>>> On Wed, Nov 17, 2021 at 10:00:54AM -0800, Russ Weight wrote:
>>>> On 11/17/21 7:15 AM, Greg KH wrote:
>>>>> On Wed, Nov 10, 2021 at 05:13:41PM -0800, Russ Weight wrote:
>>>>>> The Firmware Upload class driver provides a common API for uploading
>>>>>> firmware files to devices.
>>>>> That is exactly what the existing firmware api in the kernel is supposed
>>>>> to be accomplishing.
>>>>>
>>>>> If it is not doing what you need it to do, then you need to document the
>>>>> heck out of why it is not, and why you need a different api for this. I
>>>>> do not see that here in this changelog at all :(
>>>> This is part of the documentation included later in this patch. I can add
>>>> this to the changelog.
>>>>
>>>> +Some devices load firmware from on-board FLASH when the card initializes.
>>>> +These cards do not require the request_firmware framework to load the
>>>> +firmware when the card boots, but they to require a utility to allow
>>>> +users to update the FLASH contents.
>>> There's no requirement that request_firmware only be done at boot time,
>>> why not use it at any point in time?
>> Calling request_firmware() is not restricted to boot time. But it requires
>> a firmware filename under /lib/firmware
> Not really, there are many locations it can be in. See the different
> configuration options we have.
>
> But why would you want firmware in another location?
My current use case is for a user to upload a new, signed FPGA image to an FPGA
card. The card BMC authenticates and stores the data in FLASH. From the
perspective of the card, the image in FLASH is analogous to a firmware file
for another device being stored in /lib/firmware. For the FPGA images, there
is no real value to also storing the files in /lib/firmware (or anywhere else on
the system).
>
>> , and the convention is to specify the
>> filename in the kernel config.
> That is not a requirement at all.
>
>> I don't see any support for a user to provide a filename at run time
>> to be uploaded to a device, and that is the use case that I want to
>> support.
> If that's the only difference here, please work with the existing
> framework to add that tiny thing (i.e. pass in a name) to the current
> framework. Do not create a whole new one please.
I think another fundamental difference is that the request_firmware() API is
a driver API for the device driver to do a data "pull". The firmware-upload API
is a user API for doing a data "push" (prepare(), write(), poll_complete()) to
the lower-level driver.
I did look at the backup option of the request_firmware() framework for writing
image data via sysfs. That's a possibility, but I thought that we would be abusing
the intent. I can look more at that option...
>
>>>> When you say "existing firmware api", I'm thinking request_firmware, which
>>>> requires that driver names be specified in the kernel config and wants to
>>>> load firmware automatically during device initialization.
>>> It can be used at any time, why do you think it's restricted to init
>>> time?
>>>
>>> And I do not understand your issue with driver names.
>> Sorry - I meant so say "firmware file names"
>>
>> In an earlier iteration of this patchset, you pointed out that allowing a user
>> to provide a filename for request_firmware() to use was a security issue.
> It is crazy, don't you think?
>
>> The use case that I am targeting is to allow a user to provide an image file
>> to a device at run time.
> That's not a limitation of the existing firmware layer.
>
> thanks,
>
> greg k-h
next prev parent reply other threads:[~2021-11-17 20:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 1:13 [RFC PATCH 0/5] Firmware Upload Framework Russ Weight
2021-11-11 1:13 ` [RFC PATCH 1/5] firmware: Create firmware upload framework Russ Weight
2021-11-17 15:15 ` Greg KH
2021-11-17 18:00 ` Russ Weight
2021-11-17 18:18 ` Greg KH
2021-11-17 18:47 ` Russ Weight
2021-11-17 18:54 ` Greg KH
2021-11-17 20:02 ` Russ Weight [this message]
2021-11-11 1:13 ` [RFC PATCH 2/5] firmware: upload: Enable firmware uploads Russ Weight
2021-11-17 19:29 ` Bjorn Andersson
2021-11-11 1:13 ` [RFC PATCH 3/5] firmware: upload: Signal eventfd when complete Russ Weight
2021-11-11 1:13 ` [RFC PATCH 4/5] firmware: upload: Add status ioctl Russ Weight
2021-11-11 1:13 ` [RFC PATCH 5/5] firmware: upload: Enable cancel of firmware upload Russ Weight
2021-11-15 13:57 ` [RFC PATCH 0/5] Firmware Upload Framework Tom Rix
2021-11-17 19:20 ` Bjorn Andersson
2021-12-09 15:15 ` Tom Rix
2021-12-09 15:34 ` Greg KH
2021-12-09 18:55 ` Tom Rix
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=29541f4f-c1d5-9ce1-9160-e5698b215c96@intel.com \
--to=russell.h.weight@intel.com \
--cc=ardb@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=cristian.marussi@arm.com \
--cc=gregkh@linuxfoundation.org \
--cc=hao.wu@intel.com \
--cc=lgoncalv@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.gerlach@intel.com \
--cc=sudeep.holla@arm.com \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.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
all inboxes | Powered by JetHome®