From: Andi Shyti <andi.shyti@linux.intel.com>
To: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: intel-gfx@lists.freedesktop.org, rodrigo.vivi@intel.com,
Matthew Auld <matthew.auld@intel.com>,
chris@chris-wilson.co.uk
Subject: Re: [Intel-gfx] [PATCH v4 2/2] drm/i915/dgfx: Release mmap on rpm suspend
Date: Tue, 13 Sep 2022 15:29:47 +0200 [thread overview]
Message-ID: <YyCFywmnx2kpgews@alfio.lan> (raw)
In-Reply-To: <20220912121306.24926-3-anshuman.gupta@intel.com>
Hi Anshuman,
[...]
> struct ttm_buffer_object *bo = area->vm_private_data;
> struct drm_device *dev = bo->base.dev;
> struct drm_i915_gem_object *obj;
> + intel_wakeref_t wakeref = 0;
> vm_fault_t ret;
> int idx;
>
> @@ -990,18 +1000,24 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf)
>
> /* Sanity check that we allow writing into this object */
> if (unlikely(i915_gem_object_is_readonly(obj) &&
> - area->vm_flags & VM_WRITE))
> - return VM_FAULT_SIGBUS;
> + area->vm_flags & VM_WRITE)) {
> + ret = VM_FAULT_SIGBUS;
> + goto out_rpm;
we don't need for this change, wakeref is 0 here.
> + }
>
> ret = ttm_bo_vm_reserve(bo, vmf);
> if (ret)
> - return ret;
> + goto out_rpm;
Same here.
> if (obj->mm.madv != I915_MADV_WILLNEED) {
> dma_resv_unlock(bo->base.resv);
> - return VM_FAULT_SIGBUS;
> + ret = VM_FAULT_SIGBUS;
> + goto out_rpm;
Same here.
> }
>
> + if (i915_ttm_cpu_maps_iomem(bo->resource))
> + wakeref = intel_runtime_pm_get(&to_i915(obj->base.dev)->runtime_pm);
> +
> if (!i915_ttm_resource_mappable(bo->resource)) {
> int err = -ENODEV;
> int i;
[...]
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index 8262bfb2a2d9..897148880acc 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -1634,7 +1634,6 @@ static int intel_runtime_suspend(struct device *kdev)
> return -ENODEV;
>
> drm_dbg(&dev_priv->drm, "Suspending device\n");
> -
Please remove this change.
> disable_rpm_wakeref_asserts(rpm);
>
> /*
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 3463dd795950..c3a83b234b6e 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -842,6 +842,11 @@ void i915_gem_runtime_suspend(struct drm_i915_private *i915)
> &to_gt(i915)->ggtt->userfault_list, userfault_link)
> __i915_gem_object_release_mmap_gtt(obj);
>
> + list_for_each_entry_safe(obj, on,
> + &to_gt(i915)->lmem_userfault_list, userfault_link) {
> + i915_gem_runtime_pm_object_release_mmap_offset(obj);
> + }
Don't need for brackets here.
I see that all Matt's suggestions have been addressed. From v3
this latest release was the biggest concern. From my side looks
all correct.
would be nice if you add the cleanups above, besides that:
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Thanks and thanks Matt for the reviews.
Andi
> +
> /*
> * The fence will be lost when the device powers down. If any were
> * in use by hardware (i.e. they are pinned), we should not be powering
> --
> 2.26.2
next prev parent reply other threads:[~2022-09-13 13:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 12:13 [Intel-gfx] [PATCH v4 0/2] DGFX mmap with rpm Anshuman Gupta
2022-09-12 12:13 ` [Intel-gfx] [PATCH v4 1/2] drm/i915: Refactor userfault_wakeref to re-use Anshuman Gupta
2022-09-13 13:08 ` Andi Shyti
2022-09-12 12:13 ` [Intel-gfx] [PATCH v4 2/2] drm/i915/dgfx: Release mmap on rpm suspend Anshuman Gupta
2022-09-13 13:29 ` Andi Shyti [this message]
2022-09-13 14:00 ` Gupta, Anshuman
2022-09-12 19:30 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for DGFX mmap with rpm (rev4) Patchwork
2022-09-12 19:55 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-13 1:01 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
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=YyCFywmnx2kpgews@alfio.lan \
--to=andi.shyti@linux.intel.com \
--cc=anshuman.gupta@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=rodrigo.vivi@intel.com \
/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