Re: [PATCH 0/3] firmware_loader: Fix shutdown ordering and reference counting
From: Pratik R. Sampat
Date: Thu Sep 03 2026 - 18:16:07 EST
On 4/7/26 10:34 PM, Dan Williams wrote:
> Chao Gao wrote:
>> On Tue, Apr 07, 2026 at 01:24:03PM -0600, Russ Weight wrote:
>>> On Tue, Mar 31, 2026 at 02:47:23PM -0700, Dan Williams wrote:
>>>> Chao Gao raised a module reference circular dependency report resulting
>>>> from *correct* usage of the firmware_upload_register() API [1]. The
>>>> module reference count is not necessary nor sufficient for protecting
>>>> against racing unregister against in-flight requests. After that is
>>>> fixed, a couple more cleanups fall out.
>>>>
>>>> [1]: https://sashiko.dev/#/patchset/20260326084448.29947-1-chao.gao%40intel.com?patch=10705
>>>>
>>>>
>>>> Dan Williams (3):
>>>> firmware_loader: Stop pinning modules on registration
>>>> firmware_loader: Stop pinning parent device per workqueue invocation
>>>> treewide: firmware_loader: Drop the unused @module argument
>>>>
Hi all,
I am preparing a download_firmware_ex live update series and, since these
patches were close to complete, I would like to introduce them as a
precursor to my patches.
I will rebase and fold in Chao's build fixups from this thread, and
preserve the rest of the attributions.
Please let me know if you'd rather they go in through another tree first
instead of being bundled with the SEV live firmware update patches.
Thanks,
Pratik
>>>> .../driver-api/firmware/fw_upload.rst | 2 +-
>>>> include/linux/firmware.h | 15 +++---
>>>> drivers/base/firmware_loader/sysfs_upload.c | 48 ++++++++-----------
>>>> drivers/cxl/core/memdev.c | 4 +-
>>>> drivers/firmware/microchip/mpfs-auto-update.c | 2 +-
>>>> drivers/fpga/intel-m10-bmc-sec-update.c | 4 +-
>>>> drivers/greybus/gb-beagleplay.c | 2 +-
>>>> drivers/media/i2c/thp7312.c | 2 +-
>>>> drivers/net/pse-pd/pd692x0.c | 4 +-
>>>> lib/test_firmware.c | 3 +-
>>>> 10 files changed, 38 insertions(+), 48 deletions(-)
>>>>
>>>>
>>>> base-commit: f338e77383789c0cae23ca3d48adcc5e9e137e3c
>>>
>>> Hi Dan,
>>>
>>> Thanks for making these changes! Overall, the changes look good to
>>> me. However, when I apply these changes to the specified base-commit
>>> and attempt to build, I'm getting these errors:
>>
>> (+Dan's new email)
>
> Thanks! I will note that thanks to the korgalore tool I am subscribed to my old
> email, at least if someone also copies a public-inbox list.
>
>> Yes, I noticed that Sashiko reported them.
>
> Let's just say last week was "hectic". Sorry the noise.
>
>>> drivers/base/firmware_loader/sysfs_upload.c:229:24: warning: unused variable ‘fw_dev’ [-Wunused-variable]
>>> 229 | struct device *fw_dev = &fw_sysfs->dev;
>>> | ^~~~~~
>>
>> This can be fixed by applying the following diff to patch 2:
> [..]
>> the @module field should be removed in patch 3:
>
> Fixups look good.