public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/i915: EBUSY status handling added to i915_gem_fault().
@ 2012-10-03 13:27 mika.kuoppala
  2012-10-03 13:27 ` [PATCH 2/3] drm/i915: print kernel warning if vmi915_gem_fault returns with error mika.kuoppala
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: mika.kuoppala @ 2012-10-03 13:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: Dmitry Rogozhkin

From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>

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.

Tested-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 274d25d..18d9abb 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -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;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] drm/i915: print kernel warning if vmi915_gem_fault returns with error
  2012-10-03 13:27 [PATCH 1/3] drm/i915: EBUSY status handling added to i915_gem_fault() mika.kuoppala
@ 2012-10-03 13:27 ` mika.kuoppala
  2012-10-03 13:27 ` [PATCH 3/3] Documentation: kernel-parameters.txt Add drm_kms_helper.poll mika.kuoppala
  2012-10-03 14:15 ` [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault() mika.kuoppala
  2 siblings, 0 replies; 8+ messages in thread
From: mika.kuoppala @ 2012-10-03 13:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From: Mika Kuoppala <mika.kuoppala@intel.com>

Be more verbose when vmi915_gem_fault returns with VM_FAULT_SIGBUS

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 18d9abb..7949e4f 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1166,6 +1166,7 @@ out:
 	case -ENOMEM:
 		return VM_FAULT_OOM;
 	default:
+		WARN_ON(ret);
 		return VM_FAULT_SIGBUS;
 	}
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] Documentation: kernel-parameters.txt Add drm_kms_helper.poll
  2012-10-03 13:27 [PATCH 1/3] drm/i915: EBUSY status handling added to i915_gem_fault() mika.kuoppala
  2012-10-03 13:27 ` [PATCH 2/3] drm/i915: print kernel warning if vmi915_gem_fault returns with error mika.kuoppala
@ 2012-10-03 13:27 ` mika.kuoppala
  2012-10-03 14:15 ` [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault() mika.kuoppala
  2 siblings, 0 replies; 8+ messages in thread
From: mika.kuoppala @ 2012-10-03 13:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

From: Mika Kuoppala <mika.kuoppala@intel.com>

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

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 Documentation/kernel-parameters.txt |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index f777fa9..ad97749 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -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]
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault().
  2012-10-03 13:27 [PATCH 1/3] drm/i915: EBUSY status handling added to i915_gem_fault() mika.kuoppala
  2012-10-03 13:27 ` [PATCH 2/3] drm/i915: print kernel warning if vmi915_gem_fault returns with error mika.kuoppala
  2012-10-03 13:27 ` [PATCH 3/3] Documentation: kernel-parameters.txt Add drm_kms_helper.poll mika.kuoppala
@ 2012-10-03 14:15 ` mika.kuoppala
  2012-10-03 14:15   ` [PATCH v2 2/2] drm/i915: print warning if vmi915_gem_fault error is not handled mika.kuoppala
  2012-10-03 14:27   ` [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault() Chris Wilson
  2 siblings, 2 replies; 8+ messages in thread
From: mika.kuoppala @ 2012-10-03 14:15 UTC (permalink / raw)
  To: intel-gfx

From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>

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.

Tested-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 274d25d..2b14716 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -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;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] drm/i915: print warning if vmi915_gem_fault error is not handled
  2012-10-03 14:15 ` [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault() mika.kuoppala
@ 2012-10-03 14:15   ` mika.kuoppala
  2012-10-03 14:25     ` Chris Wilson
  2012-10-03 14:27   ` [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault() Chris Wilson
  1 sibling, 1 reply; 8+ messages in thread
From: mika.kuoppala @ 2012-10-03 14:15 UTC (permalink / raw)
  To: intel-gfx

From: Mika Kuoppala <mika.kuoppala@intel.com>

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

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 2b14716..1826ac2 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1167,6 +1167,7 @@ out:
 	case -ENOMEM:
 		return VM_FAULT_OOM;
 	default:
+		WARN_ON_ONCE(ret);
 		return VM_FAULT_SIGBUS;
 	}
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] drm/i915: print warning if vmi915_gem_fault error is not handled
  2012-10-03 14:15   ` [PATCH v2 2/2] drm/i915: print warning if vmi915_gem_fault error is not handled mika.kuoppala
@ 2012-10-03 14:25     ` Chris Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2012-10-03 14:25 UTC (permalink / raw)
  To: mika.kuoppala, intel-gfx

On Wed,  3 Oct 2012 17:15:27 +0300, mika.kuoppala@intel.com wrote:
> From: Mika Kuoppala <mika.kuoppala@intel.com>
> 
> Falling into default case in vmi915_gem_fault is a bug. Be more
> verbose about it.
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>

Once? Fair enough.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault().
  2012-10-03 14:15 ` [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault() mika.kuoppala
  2012-10-03 14:15   ` [PATCH v2 2/2] drm/i915: print warning if vmi915_gem_fault error is not handled mika.kuoppala
@ 2012-10-03 14:27   ` Chris Wilson
  2012-10-03 14:30     ` Daniel Vetter
  1 sibling, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2012-10-03 14:27 UTC (permalink / raw)
  To: mika.kuoppala, intel-gfx

On Wed,  3 Oct 2012 17:15:26 +0300, mika.kuoppala@intel.com wrote:
> From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
> 
> 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.
> 
> Tested-by: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>

Fixes? Reported-by?

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

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault().
  2012-10-03 14:27   ` [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault() Chris Wilson
@ 2012-10-03 14:30     ` Daniel Vetter
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2012-10-03 14:30 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx, mika.kuoppala

On Wed, Oct 03, 2012 at 03:27:36PM +0100, Chris Wilson wrote:
> On Wed,  3 Oct 2012 17:15:26 +0300, mika.kuoppala@intel.com wrote:
> > From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
> > 
> > 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.
> > 
> > Tested-by: Mika Kuoppala <mika.kuoppala@intel.com>
> > Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
> 
> Fixes? Reported-by?
> 
> I would order the case slightly different so that the comment block
> comes after EIO.
> 
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

I've added the fixes note and applied both patches to -fixes. Thanks for
the patch & review.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-10-03 14:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-03 13:27 [PATCH 1/3] drm/i915: EBUSY status handling added to i915_gem_fault() mika.kuoppala
2012-10-03 13:27 ` [PATCH 2/3] drm/i915: print kernel warning if vmi915_gem_fault returns with error mika.kuoppala
2012-10-03 13:27 ` [PATCH 3/3] Documentation: kernel-parameters.txt Add drm_kms_helper.poll mika.kuoppala
2012-10-03 14:15 ` [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault() mika.kuoppala
2012-10-03 14:15   ` [PATCH v2 2/2] drm/i915: print warning if vmi915_gem_fault error is not handled mika.kuoppala
2012-10-03 14:25     ` Chris Wilson
2012-10-03 14:27   ` [PATCH v2 1/2] drm/i915: EBUSY status handling added to i915_gem_fault() Chris Wilson
2012-10-03 14:30     ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox