From fe82bfbae38aab5a888c46a5c31dceaa5a298f6b Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Tue, 28 Nov 2017 13:38:12 +0000 Subject: Use mutex_trylock() rather than mixing Linux APIs with OpenBSD ones. ok kettenis@ --- sys/dev/pci/drm/i915/i915_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/dev/pci/drm') diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c index 676a2e6ea04..306db1bc0e0 100644 --- a/sys/dev/pci/drm/i915/i915_gem.c +++ b/sys/dev/pci/drm/i915/i915_gem.c @@ -2216,7 +2216,7 @@ i915_gem_fault(struct drm_gem_object *gem_obj, struct uvm_faultinfo *ufi, offset -= drm_vma_node_offset_addr(&obj->base.vma_node); - if (rw_enter(&dev->struct_mutex, RW_NOSLEEP | RW_WRITE) != 0) { + if (!mutex_trylock(&dev->struct_mutex)) { uvmfault_unlockall(ufi, NULL, &obj->base.uobj, NULL); mutex_lock(&dev->struct_mutex); locked = uvmfault_relock(ufi); -- cgit v1.2.3