[PATCH] drm: fix another race due to BKL removal.
Arnd Bergmann
arnd at arndb.de
Tue Sep 14 04:00:25 PDT 2010
On Tuesday 14 September 2010, Dave Airlie wrote:
> Since module loading was happening under the BKL, and the drm open path took
> the BKL you couldn't race between them. The drm adds the sysfs node before it
> really probably should, i.e. before driver load has completed. Then udev
> creates the device node, and plymouth opens the device before we've completed
> loading the driver. This results in fail.
Not sure what exactly happened, the module loading code never held the BKL,
at least not for a long time.
My guess is that this has something to do with dcdb16740 "drm: Add support
for platform devices to register as DRM devices", which also touches the
code that needs the lock. Maybe that patch or mine just changed the timing
to make an existing race more likely.
Your fix seems fine though. Ideally the drm_global_lock should go away
eventually, since that is also just a hack that is not much better than
the BKL (just more localized), but for now this seems the best solution.
Acked-by: Arnd Bergmann <arnd at arndb.de>
Arnd
More information about the dri-devel
mailing list