mt76: Fix file loading - #170
Conversation
frank-w
commented
Feb 6, 2026
afaik mt76_get_eeprom_file should not be called from mt76_get_of_eeprom and leave the check. the node must be checked when loading from devicetree, but file does not need the mt76 node...so the logic has to be changed. the changes above are because changing kernel_read to request_firmware? patch works for you without crashes, also when file does not exist? |
System64fumo
commented
Feb 6, 2026
I've not tested it when the file does not exist, I could test that but it should not crash, It would just default back to the missing firmware behavior (The behavior i was experiencing before this) |
System64fumo
commented
Feb 9, 2026
Alright, Just tested it without firmware and it behaves as expected: The interface works but is using safe fallback defaults, In other words the same behavior as without this patch. @frank-w Anything else you need me to test/change about this? |
frank-w
commented
Feb 9, 2026
Have not yet found time to look deeper into it. Imho the return for non-existent dt node must stay and the firmware load via file must be not called from there. |
System64fumo
commented
Feb 9, 2026
Can you elaborate on your points? |
frank-w
commented
Feb 9, 2026
Imho the call to mt76_get_of_eeprom in mt76_eeprom_init should be changed to call file loading not in mt76_get_of_eeprom |
System64fumo
commented
Feb 10, 2026
So move it to mt76_eeprom_init? mt76_eeprom_init would call the file loader first then fall back to the other loaders if that fails? |
frank-w
commented
Feb 10, 2026
Yes makes more sense. And does not break dt function. |
System64fumo
commented
Feb 10, 2026
Looks good? |
frank-w
commented
Feb 10, 2026
looks good so far, it is tested with latest change? could you squash the 2 commits into 1? |
Yup tested this for basic functionality (Baked in firmware) As for merging, Isn't there a squash button when pulling on your end? |
frank-w
commented
Feb 10, 2026
there is only "rebase and merge" with no squash option and it is easier to review when having this as 1 commit :) |
The previous method used hardcoded firmware paths to load the firmware from disk. That works if the driver is built as a module but does not work if baked in. The proper way to load firmware is with request_firmware which handles both file loading and blobs.
System64fumo
commented
Feb 10, 2026
Should be good now, Sorry for the hold up. |
frank-w
commented
Feb 10, 2026
You can squash with my commit, rebase on openwrt/mt76 and send a pull-request there too. Currently i have no way to test it against all circumstances |
The previous method used hard coded firmware paths to load the firmware from disk. That works if the driver is built as a module but does not work if baked in.
The proper way to load firmware is with request_firmware which handles both file loading and blobs.
I also noticed that the mt76_get_eeprom_file function wasn't getting called at all due to a seemingly unused variable?
Likely a leftover from previous code.
Either way commenting it out seems to work.
I've tested firmware blob loading (baked into the kernel) and that seems to work, Regular file loading should also still work but i've not tested it.