diff mbox series

[15/19] drm/i915/gt: Flush the requests after wedging on suspend

Message ID 20191118230254.2615942-16-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [01/19] drm/i915/selftests: Force bonded submission to overlap | expand

Commit Message

Chris Wilson Nov. 18, 2019, 11:02 p.m. UTC
Retire all requests if we resort to wedged the driver on suspend. They
will now be idle, so we might as we free them before shutting down.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Tvrtko Ursulin Nov. 19, 2019, 4:12 p.m. UTC | #1
On 18/11/2019 23:02, Chris Wilson wrote:
> Retire all requests if we resort to wedged the driver on suspend. They
> will now be idle, so we might as we free them before shutting down.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/gt/intel_gt_pm.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> index 7a9044ac4b75..f6b5169d623f 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> @@ -256,6 +256,7 @@ static void wait_for_suspend(struct intel_gt *gt)
>   		 * the gpu quiet.
>   		 */
>   		intel_gt_set_wedged(gt);
> +		intel_gt_retire_requests(gt);
>   	}
>   
>   	intel_gt_pm_wait_for_idle(gt);
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Or given that parking is now sync it could work to make 
intel_gt_park_requests flush and then intel_gt_pm_wait_for_idle would 
handle it. But that would keep the GPU alive for too long, given that 
request retire can run independently. So perhaps this is better.

Regards,

Tvrtko
Chris Wilson Nov. 19, 2019, 5:22 p.m. UTC | #2
Quoting Tvrtko Ursulin (2019-11-19 16:12:18)
> 
> On 18/11/2019 23:02, Chris Wilson wrote:
> > Retire all requests if we resort to wedged the driver on suspend. They
> > will now be idle, so we might as we free them before shutting down.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >   drivers/gpu/drm/i915/gt/intel_gt_pm.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> > index 7a9044ac4b75..f6b5169d623f 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> > @@ -256,6 +256,7 @@ static void wait_for_suspend(struct intel_gt *gt)
> >                * the gpu quiet.
> >                */
> >               intel_gt_set_wedged(gt);
> > +             intel_gt_retire_requests(gt);
> >       }
> >   
> >       intel_gt_pm_wait_for_idle(gt);
> > 
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Or given that parking is now sync it could work to make 
> intel_gt_park_requests flush and then intel_gt_pm_wait_for_idle would 
> handle it. But that would keep the GPU alive for too long, given that 
> request retire can run independently. So perhaps this is better.

It's the unlikely path, so favours the simpler hammer.

It's what we used to do, dropped and then forgotten as the mutexes were
moved around. Hopefully, it still makes sense tomorrow.
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
index 7a9044ac4b75..f6b5169d623f 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
@@ -256,6 +256,7 @@  static void wait_for_suspend(struct intel_gt *gt)
 		 * the gpu quiet.
 		 */
 		intel_gt_set_wedged(gt);
+		intel_gt_retire_requests(gt);
 	}
 
 	intel_gt_pm_wait_for_idle(gt);