Skip to contentSkip to conversation

drm/i915: EBUSY status handling added to i915_gem_fault().

PATCH Superseded [email protected] 3 participants 8 messages Oct 3, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drm/i915: EBUSY status handling added to i915_gem_fault().

From: Dmitry Rogozhkin <[email protected]>

Subsequent threads returning EBUSY from vm_insert_pfn() was not handled correctly. As a result concurrent access from new threads to mmapped data caused SIGBUS.

---
 drivers/gpu/drm/i915/i915_gem.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_gem.c +4 -0
index 274d25d..18d9abb 100644
@@ -1158,6 +1158,10 @@ out:
 	case 0:
 	case -ERESTARTSYS:
 	case -EINTR:
+	case -EBUSY:
+		/* EBUSY is ok: this just means that another thread
+		   already did the job.
+		*/
 		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
 		return VM_FAULT_OOM;
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 2/3 drm/i915: print kernel warning if vmi915_gem_fault returns with error

From: Mika Kuoppala <[email protected]>

Be more verbose when vmi915_gem_fault returns with VM_FAULT_SIGBUS

---
 drivers/gpu/drm/i915/i915_gem.c |    1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/i915_gem.c +1 -0
index 18d9abb..7949e4f 100644
@@ -1166,6 +1166,7 @@ out:
 	case -ENOMEM:
 		return VM_FAULT_OOM;
 	default:
+		WARN_ON(ret);
 		return VM_FAULT_SIGBUS;
 	}
 }
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 3/3 Documentation: kernel-parameters.txt Add drm_kms_helper.poll

In reply to [email protected]

From: Mika Kuoppala <[email protected]>

Add description for drm_kms_helper.poll module parameter introduced by commit: e58f637bb96d5a0ae0919b9998b891d1ba7e47c9

---
 Documentation/kernel-parameters.txt |   11 +++++++++++
 1 file changed, 11 insertions(+)
Documentation/kernel-parameters.txt +11 -0
index f777fa9..ad97749 100644
@@ -741,6 +741,17 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			if its name and a colon are prepended to the EDID
 			name.
 
+	drm_kms_helper.poll=
+			Polling for connected VGA devices on older systems
+			can be quite expensive, causing latencies of
+			several hundred milliseconds. This will cause visible
+			stalls, for example in video playback. If you
+			experience stalls in display output occurring every
+			10 seconds (DRM_OUTPUT_POLL_PERIOD=(10*HZ)), disabling
+			polling might help.
+			Format: <bool>  (1/Y/y=enable, 0/N/n=disable)
+			default: enabled
+
 	dscc4.setup=	[NET]
 
 	dyndbg[="val"]		[KNL,DYNAMIC_DEBUG]
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v2 1/2 drm/i915: EBUSY status handling added to i915_gem_fault().

In reply to [email protected]

From: Dmitry Rogozhkin <[email protected]>

Subsequent threads returning EBUSY from vm_insert_pfn() was not handled correctly. As a result concurrent access from new threads to mmapped data caused SIGBUS.

---
 drivers/gpu/drm/i915/i915_gem.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/i915_gem.c +5 -0
index 274d25d..2b14716 100644
@@ -1158,6 +1158,11 @@ out:
 	case 0:
 	case -ERESTARTSYS:
 	case -EINTR:
+	case -EBUSY:
+		/*
+		 * EBUSY is ok: this just means that another thread
+		 * already did the job.
+		 */
 		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
 		return VM_FAULT_OOM;
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH v2 2/2 drm/i915: print warning if vmi915_gem_fault error is not handled

From: Mika Kuoppala <[email protected]>

Falling into default case in vmi915_gem_fault is a bug. Be more verbose about it.

---
 drivers/gpu/drm/i915/i915_gem.c |    1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/i915_gem.c +1 -0
index 2b14716..1826ac2 100644
@@ -1167,6 +1167,7 @@ out:
 	case -ENOMEM:
 		return VM_FAULT_OOM;
 	default:
+		WARN_ON_ONCE(ret);
 		return VM_FAULT_SIGBUS;
 	}
 }
Signature · 1 line
1.7.9.5
Reviewed-by on v2 2/2
#5 lore raw

Re: [PATCH v2 2/2] drm/i915: print warning if vmi915_gem_fault error is not handled

Quoted 6 lines · On Wed, 3 Oct 2012 17:15:27 +0300, [email protected] wrote:

From: Mika Kuoppala <[email protected]>

Falling into default case in vmi915_gem_fault is a bug. Be more verbose about it.

Once? Fair enough.

-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Reviewed-by on v2 1/2
#6 lore raw
In reply to [email protected]
Quoted 8 lines · On Wed, 3 Oct 2012 17:15:26 +0300, [email protected] wrote:

From: Dmitry Rogozhkin <[email protected]>

Subsequent threads returning EBUSY from vm_insert_pfn() was not handled correctly. As a result concurrent access from new threads to mmapped data caused SIGBUS.

Fixes? Reported-by?

I would order the case slightly different so that the comment block comes after EIO.

-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#7 lore raw
Quoted 10 lines · Chris Wilson
Quoted 8 lines · On Wed, 3 Oct 2012 17:15:26 +0300, [email protected] wrote:

From: Dmitry Rogozhkin <[email protected]>

Subsequent threads returning EBUSY from vm_insert_pfn() was not handled correctly. As a result concurrent access from new threads to mmapped data caused SIGBUS.

Quoted 6 lines

Fixes? Reported-by?

I would order the case slightly different so that the comment block comes after EIO.

I've added the fixes note and applied both patches to -fixes. Thanks for the patch & review.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch