Comment 2 for bug 331415

Revision history for this message
TJ (tj) wrote : Re: [Bug 331415] [NEW] request_firmware() fails on resume from suspend

The cause of this issue is that request_firmware() blocks until the
firmware image is available. It makes a request via userspace, but at
the time of resume all userspace tasks are frozen and therefore it waits
and times out.

The solution is for drivers to use the request_firmware_nowait()
function instead and provide a call-back function that is notified when
the firmware request has completed that performs the firmware upload to
the device.

I'm working on a patch for r5u870 to confirm the solution.

This could prove to be an issue for many other drivers. A quick check
shows over a hundred instances of the use of request_firmware() and only
nine uses of request_firmware_nowait():

grep --exclude-dir=debian -rn 'request_firmware(&' * | wc -l
126

grep --exclude-dir=debian -rn 'request_firmware_nowait(' * | wc -l
9