Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dg1: Disable D3 for gfx's VSP
Date: Wed, 20 Jul 2022 10:03:24 -0400	[thread overview]
Message-ID: <YtgLLKqHishubmla@intel.com> (raw)
In-Reply-To: <20220720132137.18312-1-anshuman.gupta@intel.com>

On Wed, Jul 20, 2022 at 06:51:37PM +0530, Anshuman Gupta wrote:
> When DG1 gfx pci endpoint's parent upstream bridge (VSP) enters
> to D3, any direct memory read from lmem returns with 0xff.
> DG1 requires i915 driven runtime resume in order to read properly
> from lmem, DG1 is unable to wakeup from local memory reads.
> This may breaks using mmap() with lmem object on DG1 as it
> relies on mercy of i915 driven runtime resume.

why our disable at root_port not working to block this case?
If the root power is not at D3Cold our power shouldn't be cut
and our memory should be there.

> 
> Let's not break using mmap() for lmem object on DG1.
> Using pci_d3cold_disable(i915) accordingly to disable D3 for
> upstream bridge.
> 
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6331
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 6ed5786bcd29..671009fd351a 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -559,6 +559,7 @@ void intel_runtime_pm_enable(struct intel_runtime_pm *rpm)
>  	struct drm_i915_private *i915 = container_of(rpm,
>  						     struct drm_i915_private,
>  						     runtime_pm);
> +	struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
>  	struct device *kdev = rpm->kdev;
>  
>  	/*
> @@ -574,6 +575,9 @@ void intel_runtime_pm_enable(struct intel_runtime_pm *rpm)
>  	pm_runtime_set_autosuspend_delay(kdev, 10000); /* 10s */
>  	pm_runtime_mark_last_busy(kdev);
>  
> +	if (IS_DG1(i915))
> +		pci_d3cold_disable(pdev);
> +
>  	/*
>  	 * Take a permanent reference to disable the RPM functionality and drop
>  	 * it only when unloading the driver. Use the low level get/put helpers,
> @@ -607,12 +611,16 @@ void intel_runtime_pm_disable(struct intel_runtime_pm *rpm)
>  	struct drm_i915_private *i915 = container_of(rpm,
>  						     struct drm_i915_private,
>  						     runtime_pm);
> +	struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
>  	struct device *kdev = rpm->kdev;
>  
>  	/* Transfer rpm ownership back to core */
>  	drm_WARN(&i915->drm, pm_runtime_get_sync(kdev) < 0,
>  		 "Failed to pass rpm ownership back to core\n");
>  
> +	if (IS_DG1(i915))
> +		pci_d3cold_enable(pdev);
> +
>  	pm_runtime_dont_use_autosuspend(kdev);
>  
>  	if (!rpm->available)
> -- 
> 2.26.2
> 

  reply	other threads:[~2022-07-20 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20 13:21 [Intel-gfx] [PATCH] drm/i915/dg1: Disable D3 for gfx's VSP Anshuman Gupta
2022-07-20 14:03 ` Rodrigo Vivi [this message]
2022-07-21  4:15   ` Gupta, Anshuman
2022-07-20 14:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-07-20 21:43 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=YtgLLKqHishubmla@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=anshuman.gupta@intel.com \
    --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