Re: [PATCH] firmware: Don't attempt to allocate zero bytes with vmalloc()

From: Ming Lei
Date: Tue Oct 09 2012 - 10:55:11 EST


On Tue, Oct 9, 2012 at 8:36 PM, Mark Brown
<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Tue, Oct 09, 2012 at 08:02:18PM +0800, Ming Lei wrote:
>
>> If loading via user space, timeout or not depends on userspace,
>> at least udev won't timeout on non-existent firmware image.
>
> This may be a mdev or old udev thing... it's definitely prevelant.

I just checked history of udev, and looks it can't timeout on
non-existent firmware file, even with the oldest shell script of
firmware.sh.

Also looks mdev of busybox checks firmware file too before loading.

IMO, firmware loader can't help the problem if userspace
chooses to timeout on non-existent file. Maybe you have to
depend on direct loading.

>
>> Also looks request_firmware_nowait() is better for the case, _nowait()
>> can avoid unnecessary delay and speedup firmware loading if there
>> are more than one firmware to load.
>
> It doesn't really help as the ABI is such that you can only have one

Could you let me know where the ABI is?

> request_firmware() in play at once (unless this changed since I last
> looked at it).

I guess you mean that only one firmware device can be added
as child of the device which is requesting firmware.

The commit below(already merged into linus tree) should fix
the problem:

99c2aa72306079976369aad7fc62cc71931d692a(firmware loader:
fix creation failure of fw loader device)

Could you test it to see if more than one request_firmware_nowait()
can be called concurrently for the same device?

Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/