diff mbox series

[2/2] drm/i915: Reduce warning for i915_vma_pin_iomap() without runtime-pm

Message ID 20200108153550.3803446-2-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915: Early return for no-op i915_vma_pin_fence() | expand

Commit Message

Chris Wilson Jan. 8, 2020, 3:35 p.m. UTC
Access through the GGTT (iomap) into the vma does require the device to
be awake. However, we often take the i915_vma_pin_iomap() as an early
preparatory step that is long before we use the iomap. Asserting that
the device is awake at pin time does not protect us, and is merely a
nuisance.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Mika Kuoppala Jan. 10, 2020, 11:39 a.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Access through the GGTT (iomap) into the vma does require the device to
> be awake. However, we often take the i915_vma_pin_iomap() as an early
> preparatory step that is long before we use the iomap. Asserting that
> the device is awake at pin time does not protect us, and is merely a
> nuisance.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

I do remember stamping this. No matter, i have plenty of ink.

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_vma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index cbd783c31adb..43d5c270bdb0 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -423,8 +423,6 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
>  	void __iomem *ptr;
>  	int err;
>  
> -	/* Access through the GTT requires the device to be awake. */
> -	assert_rpm_wakelock_held(vma->vm->gt->uncore->rpm);
>  	if (GEM_WARN_ON(!i915_vma_is_map_and_fenceable(vma))) {
>  		err = -ENODEV;
>  		goto err;
> @@ -456,6 +454,8 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
>  		goto err_unpin;
>  
>  	i915_vma_set_ggtt_write(vma);
> +
> +	/* NB Access through the GTT requires the device to be awake. */
>  	return ptr;
>  
>  err_unpin:
> -- 
> 2.25.0.rc1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index cbd783c31adb..43d5c270bdb0 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -423,8 +423,6 @@  void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
 	void __iomem *ptr;
 	int err;
 
-	/* Access through the GTT requires the device to be awake. */
-	assert_rpm_wakelock_held(vma->vm->gt->uncore->rpm);
 	if (GEM_WARN_ON(!i915_vma_is_map_and_fenceable(vma))) {
 		err = -ENODEV;
 		goto err;
@@ -456,6 +454,8 @@  void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
 		goto err_unpin;
 
 	i915_vma_set_ggtt_write(vma);
+
+	/* NB Access through the GTT requires the device to be awake. */
 	return ptr;
 
 err_unpin: