From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: Scrub HW state on remove
Date: Tue, 06 Oct 2020 13:35:04 +0300 [thread overview]
Message-ID: <87lfgjfxrb.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20200929112639.24223-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Currently we do a final scrub of the HW state upon release. However,
> when rebinding the device, this is too late as the device may either
> have been partially rebound or the device is no longer accessible. If
> the device has been removed before release, the reset goes astray
> leaving the device in an inconsistent state, unlikely to work without a
> full PCI reset. Furthermore, if the device is partially rebound before
> the HW scrubbing, there may be leftover HW state that should have been
> scrubbed. Either way, we need to push the scrubbing earlier before the
> removal, so into unregister. The danger is that on older machines,
> reseting the GPU also impact the display engine and so the reset should
> be after modesetting is disabled (and before reuse we need to recover
> modesetting).
>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2508
> Testcase: igt/core_hotunplug
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/gt/intel_gt.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
> index 39b428c5049c..44f1d51e5ae5 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> @@ -614,6 +614,8 @@ void intel_gt_driver_remove(struct intel_gt *gt)
>
> void intel_gt_driver_unregister(struct intel_gt *gt)
> {
> + intel_wakeref_t wakeref;
> +
> intel_rps_driver_unregister(>->rps);
>
> /*
> @@ -622,16 +624,15 @@ void intel_gt_driver_unregister(struct intel_gt *gt)
> * resources.
> */
> intel_gt_set_wedged(gt);
> +
> + /* Scrub all HW state upon release */
> + with_intel_runtime_pm(gt->uncore->rpm, wakeref)
> + __intel_gt_reset(gt, ALL_ENGINES);
> }
>
> void intel_gt_driver_release(struct intel_gt *gt)
> {
> struct i915_address_space *vm;
> - intel_wakeref_t wakeref;
> -
> - /* Scrub all HW state upon release */
> - with_intel_runtime_pm(gt->uncore->rpm, wakeref)
> - __intel_gt_reset(gt, ALL_ENGINES);
>
> vm = fetch_and_zero(>->vm);
> if (vm) /* FIXME being called twice on error paths :( */
> --
> 2.20.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2020-10-06 10:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 11:26 [Intel-gfx] [PATCH] drm/i915/gt: Scrub HW state on remove Chris Wilson
2020-09-29 16:54 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2020-09-29 17:17 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-09-30 10:11 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-10-06 10:35 ` Mika Kuoppala [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lfgjfxrb.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox