[Intel-xe] [PATCH 1/5] drm/xe: Only set PCI d3cold_allowed when we are really allowing.

Gupta, Anshuman anshuman.gupta at intel.com
Thu Jul 27 11:42:51 UTC 2023



> -----Original Message-----
> From: Vivi, Rodrigo <rodrigo.vivi at intel.com>
> Sent: Wednesday, July 26, 2023 3:42 AM
> To: intel-xe at lists.freedesktop.org
> Cc: Vivi, Rodrigo <rodrigo.vivi at intel.com>; Gupta, Anshuman
> <anshuman.gupta at intel.com>
> Subject: [PATCH 1/5] drm/xe: Only set PCI d3cold_allowed when we are
> really allowing.
> 
> First of all it was strange to see:
> if (allowed) {
> ...
> } else {
>    D3COLD_ENABLE
> }
> 
> But besides this misalignment, let's also use the pci d3cold_allowed useful to
> us and know that we are not really allowing d3cold.
> 
> Cc: Anshuman Gupta <anshuman.gupta at intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_pci.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 78df43c20cd2..0c4051f4f746 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -794,6 +794,7 @@ static int xe_pci_runtime_suspend(struct device
> *dev)
>  	pci_save_state(pdev);
> 
>  	if (xe->d3cold.allowed) {
> +		d3cold_toggle(pdev, D3COLD_ENABLE);
>  		pci_disable_device(pdev);
>  		pci_ignore_hotplug(pdev);
>  		pci_set_power_state(pdev, PCI_D3cold); @@ -823,8 +824,6
> @@ static int xe_pci_runtime_resume(struct device *dev)
>  			return err;
> 
>  		pci_set_master(pdev);
> -	} else {
> -		d3cold_toggle(pdev, D3COLD_ENABLE);
>  	}
Looks good to me.
Reviewed-by: Anshuman Gupta <anshuman.gupta at intel.com>
> 
>  	return xe_pm_runtime_resume(xe);
> --
> 2.41.0



More information about the Intel-xe mailing list