Re: [PATCH 1/3] drm: kill BKL from common code

From: Andreas Schwab
Date: Tue Aug 24 2010 - 14:46:48 EST


Arnd Bergmann <arnd@xxxxxxxx> writes:

> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 4a66201..76d98f4 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -506,9 +506,9 @@ long drm_ioctl(struct file *filp,
> if (ioctl->flags & DRM_UNLOCKED)
> retcode = func(dev, kdata, file_priv);
> else {
> - lock_kernel();
> + mutex_lock(&drm_global_mutex);
> retcode = func(dev, kdata, file_priv);
> - unlock_kernel();
> + mutex_unlock(&drm_global_mutex);

How is this supposed to work in the context of sleeping ioctls, like
drm_lock?

[drm:drm_ioctl], pid=2461, cmd=0x8008642a, nr=0x2a, dev 0xe200, auth=1
[drm:drm_lock], 1 (pid 2461) requests lock (0x80000003), flags = 0x00000000
[drm:drm_ioctl], pid=2520, cmd=0x8008642b, nr=0x2b, dev 0xe200, auth=1

# ps 2461 2520
PID TTY STAT TIME COMMAND
2461 tty7 Ss+ 0:01 /usr/bin/Xorg -br :0 vt7 -nolisten tcp -auth /var/lib
2520 pts/2 D+ 0:00 glxgears

Andreas.

--
Andreas Schwab, schwab@xxxxxxxxxxxxxx
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
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/