From: Russ Weight <russell.h.weight@intel.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: <gregkh@linuxfoundation.org>, <rafael@kernel.org>,
<linux-kernel@vger.kernel.org>, <trix@redhat.com>,
<lgoncalv@redhat.com>, <yilun.xu@intel.com>, <hao.wu@intel.com>,
<matthew.gerlach@intel.com>, <basheer.ahmed.muddebihal@intel.com>,
<tianfei.zhang@intel.com>
Subject: Re: [RFC PATCH 0/5] Extend FW framework for user FW uploads
Date: Thu, 10 Feb 2022 18:30:31 -0800 [thread overview]
Message-ID: <d0c18f9b-383f-ce36-94e8-e273cd26a2c9@intel.com> (raw)
In-Reply-To: <Yfxem+AF9lroota0@bombadil.infradead.org>
On 2/3/22 3:00 PM, Luis Chamberlain wrote:
> On Thu, Feb 03, 2022 at 02:30:47PM -0700, Russ Weight wrote:
>> Extend the firmware loader subsystem to support a persistent sysfs
>> interface that userspace may use to initiate a firmware update. For
>> example, FPGA based PCIe cards automatically load firmware and FPGA images
>> from local FLASH when the card boots. The images in FLASH may be updated
>> with new images that are uploaded by the user.
>>
>> A device driver may call fw_upload_register() to expose persistent
>> "loading" and "data" sysfs files at /sys/class/firmare/<NAME>/*. These
>> files are used in the same way as the fallback sysfs "loading" and "data"
>> files. However, when 0 is written to "loading" to complete the write of
>> firmware data, the data is also transferred to the lower-level driver
>> using pre-registered call-back functions. The data transfer is done in
>> the context of a kernel worker thread.
>>
>> Additional sysfs nodes are added in the same location as "loading" and
>> "data" to monitor the transfer of the image data to the device using
>> callback functions provided by the lower-level device driver and to allow
>> the data transfer to be cancelled.
>>
>> Example usage:
>>
>> $ pwd
>> /sys/class/firmware/n3000bmc-sec-update.8
>> $ ls
>> cancel device loading remaining_size subsystem
>> data error power status uevent
>> $ echo 1 > loading
>> $ cat /tmp/firmware.bin > data
>> $ echo 0 > loading
>> $ while :; do cat status; cat remaining_size ; sleep 3; done
>> preparing
>> 44590080
>> <--snip-->
>> transferring
>> 44459008
>> transferring
>> 44311552
>> <--snip-->
>> <snip>
>> transferring
>> 173056
>> <--snip-->
>> programming
>> 0
>> <--snip-->
>> idle
>> 0
>> ^C
> Nice. Please extend lib/test_firmware.c while at it and try to break
> and ensure your stuff is not regressed with future changes.
Yes. I'm looking at the test_firmware module and I'll add to it
for the next patch submission.
Thanks,
- Russ
>
> Luis
prev parent reply other threads:[~2022-02-11 2:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 21:30 Russ Weight
2022-02-03 21:30 ` [RFC PATCH 1/5] firmware_loader: Clear data and size in fw_free_paged_buf Russ Weight
2022-02-03 21:30 ` [RFC PATCH 2/5] firmware_loader: Check fw_state_is_done in loading_store Russ Weight
2022-02-03 21:30 ` [RFC PATCH 3/5] firmware_loader: Split fw_sysfs support from fallback Russ Weight
2022-02-03 22:51 ` Luis Chamberlain
2022-02-11 1:50 ` Russ Weight
2022-02-06 15:43 ` Tom Rix
2022-02-11 2:24 ` Russ Weight
2022-02-03 21:30 ` [RFC PATCH 4/5] firmware_loader: Add firmware-upload support Russ Weight
2022-02-03 22:59 ` Luis Chamberlain
2022-02-11 2:29 ` Russ Weight
2022-02-03 21:30 ` [RFC PATCH 5/5] firmware_loader: Add sysfs nodes to monitor fw_upload Russ Weight
2022-02-03 23:00 ` [RFC PATCH 0/5] Extend FW framework for user FW uploads Luis Chamberlain
2022-02-11 2:30 ` Russ Weight [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=d0c18f9b-383f-ce36-94e8-e273cd26a2c9@intel.com \
--to=russell.h.weight@intel.com \
--cc=basheer.ahmed.muddebihal@intel.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=mcgrof@kernel.org \
--cc=rafael@kernel.org \
--cc=tianfei.zhang@intel.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®