public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Add missing rpm wakelock to GGTT pread
@ 2016-08-04  8:09 Chris Wilson
  2016-08-04  8:41 ` Joonas Lahtinen
  2016-08-04 10:13 ` ✗ Ro.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2016-08-04  8:09 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ankitprasad Sharma, drm-intel-fixes

Joonas spotted a discrepancy between the pwrite and pread ioctls, in
that pwrite takes the rpm wakelock around its GGTT access, The wakelock
is required in order for the GTT to function. In disregard for the
current convention, we take the rpm wakelock around the access itself
rather than around the struct_mutex as the nesting is not strictly
required and such ordering will one day be fixed by explicitly noting
the barrier dependencies between the GGTT and rpm.

Fixes: b50a53715f09 ("drm/i915: Support for pread/pwrite ...")
Reported-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: drm-intel-fixes@lists.freedesktop.org
---
 drivers/gpu/drm/i915/i915_gem.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 9bef2c0803a5..9cb838ef8d02 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -887,9 +887,12 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
 	ret = i915_gem_shmem_pread(dev, obj, args, file);
 
 	/* pread for non shmem backed objects */
-	if (ret == -EFAULT || ret == -ENODEV)
+	if (ret == -EFAULT || ret == -ENODEV) {
+		intel_runtime_pm_get(to_i915(dev));
 		ret = i915_gem_gtt_pread(dev, obj, args->size,
 					args->offset, args->data_ptr);
+		intel_runtime_pm_put(to_i915(dev));
+	}
 
 out:
 	i915_gem_object_put(obj);
-- 
2.8.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Add missing rpm wakelock to GGTT pread
  2016-08-04  8:09 [PATCH] drm/i915: Add missing rpm wakelock to GGTT pread Chris Wilson
@ 2016-08-04  8:41 ` Joonas Lahtinen
  2016-08-04 10:13 ` ✗ Ro.CI.BAT: failure for " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Joonas Lahtinen @ 2016-08-04  8:41 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: Ankitprasad Sharma, drm-intel-fixes

On to, 2016-08-04 at 09:09 +0100, Chris Wilson wrote:
> Joonas spotted a discrepancy between the pwrite and pread ioctls, in
> that pwrite takes the rpm wakelock around its GGTT access, The wakelock
> is required in order for the GTT to function. In disregard for the
> current convention, we take the rpm wakelock around the access itself
> rather than around the struct_mutex as the nesting is not strictly
> required and such ordering will one day be fixed by explicitly noting
> the barrier dependencies between the GGTT and rpm.
> 
> Fixes: b50a53715f09 ("drm/i915: Support for pread/pwrite ...")
> Reported-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: drm-intel-fixes@lists.freedesktop.org
> ---
>  drivers/gpu/drm/i915/i915_gem.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 9bef2c0803a5..9cb838ef8d02 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -887,9 +887,12 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
>  	ret = i915_gem_shmem_pread(dev, obj, args, file);
>  
>  	/* pread for non shmem backed objects */
> -	if (ret == -EFAULT || ret == -ENODEV)
> +	if (ret == -EFAULT || ret == -ENODEV) {
> +		intel_runtime_pm_get(to_i915(dev));
>  		ret = i915_gem_gtt_pread(dev, obj, args->size,
>  					args->offset, args->data_ptr);
> +		intel_runtime_pm_put(to_i915(dev));
> +	}
>  
>  out:
>  	i915_gem_object_put(obj);
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Ro.CI.BAT: failure for drm/i915: Add missing rpm wakelock to GGTT pread
  2016-08-04  8:09 [PATCH] drm/i915: Add missing rpm wakelock to GGTT pread Chris Wilson
  2016-08-04  8:41 ` Joonas Lahtinen
@ 2016-08-04 10:13 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2016-08-04 10:13 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Add missing rpm wakelock to GGTT pread
URL   : https://patchwork.freedesktop.org/series/10648/
State : failure

== Summary ==

Series 10648v1 drm/i915: Add missing rpm wakelock to GGTT pread
http://patchwork.freedesktop.org/api/1.0/series/10648/revisions/1/mbox

Test kms_cursor_legacy:
        Subgroup basic-flip-vs-cursor-legacy:
                pass       -> FAIL       (ro-bdw-i7-5600u)
                pass       -> FAIL       (ro-bdw-i5-5250u)
                pass       -> FAIL       (ro-skl3-i5-6260u)
Test kms_flip:
        Subgroup basic-flip-vs-wf_vblank:
                fail       -> PASS       (ro-byt-n2820)

fi-kbl-qkkr      total:240  pass:182  dwarn:28  dfail:1   fail:2   skip:27 
fi-skl-i5-6260u  total:240  pass:224  dwarn:0   dfail:0   fail:2   skip:14 
fi-skl-i7-6700k  total:240  pass:208  dwarn:0   dfail:0   fail:4   skip:28 
fi-snb-i7-2600   total:240  pass:198  dwarn:0   dfail:0   fail:0   skip:42 
ro-bdw-i5-5250u  total:240  pass:218  dwarn:4   dfail:0   fail:2   skip:16 
ro-bdw-i7-5557U  total:240  pass:224  dwarn:0   dfail:0   fail:0   skip:16 
ro-bdw-i7-5600u  total:240  pass:206  dwarn:0   dfail:0   fail:2   skip:32 
ro-bsw-n3050     total:240  pass:194  dwarn:0   dfail:0   fail:4   skip:42 
ro-byt-n2820     total:240  pass:197  dwarn:0   dfail:0   fail:3   skip:40 
ro-hsw-i3-4010u  total:240  pass:214  dwarn:0   dfail:0   fail:0   skip:26 
ro-hsw-i7-4770r  total:240  pass:214  dwarn:0   dfail:0   fail:0   skip:26 
ro-ilk-i7-620lm  total:240  pass:173  dwarn:1   dfail:0   fail:1   skip:65 
ro-ilk1-i5-650   total:235  pass:173  dwarn:0   dfail:0   fail:2   skip:60 
ro-ivb-i7-3770   total:240  pass:205  dwarn:0   dfail:0   fail:0   skip:35 
ro-ivb2-i7-3770  total:240  pass:209  dwarn:0   dfail:0   fail:0   skip:31 
ro-skl3-i5-6260u total:240  pass:222  dwarn:0   dfail:0   fail:4   skip:14 
ro-snb-i7-2620M  total:240  pass:198  dwarn:0   dfail:0   fail:1   skip:41 

Results at /archive/results/CI_IGT_test/RO_Patchwork_1702/

d1f669d drm-intel-nightly: 2016y-08m-04d-09h-29m-29s UTC integration manifest
cec335a drm/i915: Add missing rpm wakelock to GGTT pread

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-08-04 10:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-04  8:09 [PATCH] drm/i915: Add missing rpm wakelock to GGTT pread Chris Wilson
2016-08-04  8:41 ` Joonas Lahtinen
2016-08-04 10:13 ` ✗ Ro.CI.BAT: failure for " Patchwork

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