[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1032377: firmware loading tests with bookworm-DI-alpha2



Hello,

On 05/03/2023 at 15:59, Cyril Brulebois wrote:
Pascal Hambourg <pascal@plouf.fr.eu.org> (2023-03-05):
I am afraid that when the firmware is missing the driver is not
attached to the device so there is no direct way to retrieve it
through /sys.

Alright, nice to know which part of the lookup was failing anyway
(single 2-4:1.0 below 2-4, but missing driver symlink).

What is wrong if there are multiple /sys/bus/devices/$address/$address:* subdirectories ?

An indirect way may be to list loaded USB driver modules in
/sys/bus/usb/drivers or /proc/modules and search in their firmware
fields with modinfo ? Heavy and not 100% reliable though...

Since the existing code seems to work in at least some cases, it
wouldn't seem crazy to me to implement a fallback plan in case it
doesn't (as opposed to replacing the existing lookup entirely). After
all, we're quite certain that reloading usb* isn't going to work anyway,
so anything else we can try can't really be worse.

OK, I am working on fallback module detection based on matching modalias and firmware fields when they exist. Also check module holders when needed.

And I suppose iterating over a (uniquified) list of basename for
/sys/bus/<bus>/drivers/*/module might work on more buses than just usb
(see mhi for the qrtr-mhi thing in #1032140), so it should even be
possible to reuse this outside this specific usb usecase.

Yes, although #1032140 seems to be a very special case because ath11k_pci fields do not advertise the requested firmware file ath11k/WCN6855/hw2.1/amss.bin, and only advertise pci aliases, not mhi.


Reply to: