firmware_class: Fix problem with async requests (was: Re: [RFC] firmware loader: retry ...)
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | firmware_class: Rework usermodehelper checkdrivers/ include/ kernel/ | +18 | 0 replies | |
| 2/3 | firmware_class: Split _request_firmware() into three functionsdrivers/ | +40 | 0 replies | |
| 3/3 | firmware_class: Do not warn that system is not ready for async loadsdrivers/ include/ kernel/ | +77 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] firmware_class: Fix problem with async requests (was: Re: [RFC] firmware loader: retry ...)
Quoted 17 lines · Christian Lamparter
Quoted 16 lines · On Sunday 18 March 2012 01:29:38 Rafael J. Wysocki wrote:
The patch below (untested) goes slightly into that direction, although not as far as to modify
fw_create_instance(). It does, however, split_request_firmware()into "prepare", "load" and "cleanup" parts and moves the usermodehelper check along with the read-locking ofumhelper_semdown to the callers, ie.request_firmware()andrequest_firmware_work_func().The difference between them is that
request_firmware()fails immediately with aWARN_ON()if it seesusermodehelper_disabledset after acquiringumhelper_sem, whilerequest_firmware_work_func()waits forusermodehelper_disabledto be unset, with a timeout (the wait time is subtracted from the_request_firmware()timeout). The reason whyrequest_firmware_work_func()does it this way is that it can't wait forusermodehelper_disabledto be unset withumhelper_semheld and it has to call_request_firmware()underumhelper_sem(otherwise user space might be frozen out from under it).
Quoted 4 lines
Quoted 2 lines
I'm falling asleep now, but hopefully the patch isn't totally busted. :-) It should be split into a series of patches, though.
I'm happy to report that my test system [with the patch applied] suspended and resumed without any incidents.
Thanks for testing!
The following three patches should result in analogous code, although slightly cleaned up.
Thanks,
Rafael