Re: [PATCH] typhoon: use request_firmware

David Woodhouse
2008-07-31T07:42:57Z

On Wed, 2008-07-30 at 23:37 -0400, David Dillow wrote:
> request_firmware()'s mutex is protecting against things inside of that
> subsystem, but offers no protection between the test on typhoon_fw !=
> NULL and the setting of it inside of the firmware loader. That
> requires locking at a higher level.
>
> Anyways, probing is single threaded and I seem to recall it being
> unlikely to be made parallel due to the number issues exposed last
> time, so a minimal comment is fine.

An alternative approach is to make request_firmware() do the duplicate
avoidance for itself. Since we made fw->data const (as 'fw' itself
always was), no users should be changing anything in the requested
firmware. It can be safely reused by generic code.

That simplifies the logic in drivers -- they just request what they
want, as many times as they want it, and don't have to care about the
potential duplication.

--
dwmw2