All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	Badal Nilawar <badal.nilawar@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2 5/6] drm/i915/pm: Allow drivers/pci to manage our pci state normally
Date: Fri, 14 Mar 2025 20:56:33 -0400	[thread overview]
Message-ID: <Z9TQQbryg2B3U6m6@intel.com> (raw)
In-Reply-To: <20250311195624.22420-6-ville.syrjala@linux.intel.com>

On Tue, Mar 11, 2025 at 09:56:23PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Stop doing the pci_save_state(), except when we need to prevent
> D3 due to BIOS bugs, so that the code in drivers/pci is allowed
> to manage the state of the PCI device. Less chance something
> getting left by the wayside by i915 if/when the things change in
> drivers/pci.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_driver.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index a199e21c7bb4..503f1b6b694f 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -1154,9 +1154,8 @@ static int i915_drm_suspend_noirq(struct drm_device *dev, bool hibernation)
>  	 * pci_save_state() prevents drivers/pci from
>  	 * automagically putting the device into D3.
>  	 */
> -	pci_save_state(pdev);
> -	if (!(hibernation && GRAPHICS_VER(dev_priv) < 6))
> -		pci_set_power_state(pdev, PCI_D3hot);
> +	if (hibernation && GRAPHICS_VER(dev_priv) < 6)
> +		pci_save_state(pdev);
>  
>  	return 0;
>  }
> @@ -1164,6 +1163,7 @@ static int i915_drm_suspend_noirq(struct drm_device *dev, bool hibernation)
>  int i915_driver_suspend_switcheroo(struct drm_i915_private *i915,
>  				   pm_message_t state)
>  {
> +	struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
>  	int error;
>  
>  	if (drm_WARN_ON_ONCE(&i915->drm, state.event != PM_EVENT_SUSPEND &&
> @@ -1181,9 +1181,8 @@ int i915_driver_suspend_switcheroo(struct drm_i915_private *i915,
>  	if (error)
>  		return error;
>  
> -	error = i915_drm_suspend_noirq(&i915->drm, false);
> -	if (error)
> -		return error;
> +	pci_save_state(pdev);
> +	pci_set_power_state(pdev, PCI_D3hot);

Cc: Badal Nilawar <badal.nilawar@intel.com>

he hit an issue in Xe recently related to the lack of this iirc.
Hopefully this is right here and we can get this right here and port to Xe.

>  
>  	return 0;
>  }
> -- 
> 2.45.3
> 

  reply	other threads:[~2025-03-15  0:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 19:56 [PATCH v2 0/6] drm/i915/pm: Clean up the hibernate vs. PCI D3 quirk Ville Syrjala
2025-03-11 19:56 ` [PATCH v2 1/6] drm/i915/pm: Simplify pm hook documentation Ville Syrjala
2025-09-12 13:51   ` Hogander, Jouni
2025-03-11 19:56 ` [PATCH v2 2/6] drm/i915/pm: Hoist pci_save_state()+pci_set_power_state() to the end of pm _late() hook Ville Syrjala
2025-03-15  0:51   ` Rodrigo Vivi
2025-03-17  7:17   ` Raag Jadav
2025-09-12 13:52   ` Hogander, Jouni
2025-03-11 19:56 ` [PATCH v2 3/6] drm/i915/pm: Move the hibernate+D3 quirk stuff into noirq() pm hooks Ville Syrjala
2025-09-12 13:52   ` Hogander, Jouni
2025-03-11 19:56 ` [PATCH v2 4/6] drm/i915/pm: Do pci_restore_state() in switcheroo resume hook Ville Syrjala
2025-03-15  0:55   ` Rodrigo Vivi
2025-09-12 13:53   ` Hogander, Jouni
2025-03-11 19:56 ` [PATCH v2 5/6] drm/i915/pm: Allow drivers/pci to manage our pci state normally Ville Syrjala
2025-03-15  0:56   ` Rodrigo Vivi [this message]
2025-09-12 13:53   ` Hogander, Jouni
2025-03-11 19:56 ` [PATCH v2 6/6] drm/i915/pm: Drop redundant pci stuff from suspend/resume paths Ville Syrjala
2025-03-15  1:00   ` Rodrigo Vivi
2025-09-12  9:44   ` Hogander, Jouni
2025-09-12 12:56     ` Ville Syrjälä
2025-09-12 13:54   ` Hogander, Jouni
2025-03-11 23:15 ` ✗ i915.CI.BAT: failure for drm/i915/pm: Clean up the hibernate vs. PCI D3 quirk (rev2) Patchwork
2025-03-12  9:52   ` Ville Syrjälä
2025-03-12 10:05     ` Saarinen, Jani
2025-03-12 10:07       ` Saarinen, Jani
2025-03-12 11:53         ` Saarinen, Jani
2025-03-12 12:06       ` Knop, Ryszard
2025-04-25 18:08 ` ✗ Fi.CI.BUILD: warning for drm/i915/pm: Clean up the hibernate vs. PCI D3 quirk (rev3) Patchwork
2025-04-25 19:40 ` ✓ i915.CI.BAT: success " Patchwork
2025-04-26  3:56 ` ✓ i915.CI.Full: " 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=Z9TQQbryg2B3U6m6@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.