drm: fix race between driver loading and userspace open.
authorDave Airlie <airlied@redhat.com>
Tue, 14 Sep 2010 10:14:38 +0000 (20:14 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 14 Sep 2010 10:39:04 +0000 (20:39 +1000)
commitb64c115eb22516ecd187c74ad6de3f1693f1dc7b
tree9f80fe97b68f33d6c40f82e29bd271a0613aa9dd
parent930a9e283516a3a3595c0c515113f1b78d07f695
drm: fix race between driver loading and userspace open.

Not 100% sure this is due to BKL removal, its most likely a combination
of that + userspace timing changes in udev/plymouth. The drm adds the sysfs
device before the driver has completed internal loading, this causes udev
to make the node and plymouth to open it before we've completed loading.

The proper solution is to delay the sysfs manipulation until later in loading
however this causes knock on issues with sysfs connector nodes, so we can use
the global mutex to serialise loading and userspace opens.

Reported-by: Toni Spets (hifi on #radeon)
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_pci.c
drivers/gpu/drm/drm_platform.c