From 6f81ba0e97db71b50918fdbb7b9714106efe88b2 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Sat, 30 Aug 2008 01:00:18 +0000 Subject: [PATCH] Don't return EINVAL when trying to unlock. anholt thinks that he added this check as part of some regression testing, but it is failing at least some of the time. I don't want to remove it just yet. I added a bit of debugging to help identify the issue. Approved by: kib --- sys/dev/drm/drm_lock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/drm/drm_lock.c b/sys/dev/drm/drm_lock.c index c82ab9b189e3..938954c15f1e 100644 --- a/sys/dev/drm/drm_lock.c +++ b/sys/dev/drm/drm_lock.c @@ -171,18 +171,23 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_lock_t *lock = data; + DRM_DEBUG("%d (pid %d) requests unlock (0x%08x), flags = 0x%08x\n", + lock->context, DRM_CURRENTPID, dev->lock.hw_lock->lock, + lock->flags); + if (lock->context == DRM_KERNEL_CONTEXT) { DRM_ERROR("Process %d using kernel context %d\n", DRM_CURRENTPID, lock->context); return EINVAL; } +#if 0 /* Check that the context unlock being requested actually matches * who currently holds the lock. */ if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) || _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock) != lock->context) return EINVAL; - +#endif DRM_SPINLOCK(&dev->tsk_lock); if (dev->locked_task_call != NULL) { dev->locked_task_call(dev);