[Intel-xe] [PATCH] drm/xe/pm: WARN_ON() on unbounded pcie parent bridge device

Rodrigo Vivi rodrigo.vivi at intel.com
Mon May 8 17:14:35 UTC 2023


On Mon, May 08, 2023 at 02:47:34PM +0530, Anshuman Gupta wrote:
> Intel Discrete GFX cards gfx may have multiple PCIe endpoints,
> they connects to root port via pcie upstream switch port(USP)
> and virtual pcie switch port(VSP), sometimes VSP pcie devices
> doesn't bind to pcieport driver. Without pcieport driver pcie PM
> comes without any warranty and with unbounded VSP gfx card won't
> transition to low power pcie device and link state therefore
> assert drm_WARN_ON() on unbounded VSP.
> 
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_pci.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 19ead642442e..dc0d5cb4950b 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -667,12 +667,24 @@ static void xe_pci_shutdown(struct pci_dev *pdev)
>  	xe_device_shutdown(pdev_to_xe_device(pdev));
>  }
>  
> +static void xe_assert_on_unbounded_bridge(struct pci_dev *pdev)
> +{
> +	struct pci_dev *bridge = pci_upstream_bridge(pdev);
> +	struct xe_device *xe = pdev_to_xe_device(pdev);
> +
> +	if (!bridge)
> +		return;
> +
> +	drm_WARN_ON(&xe->drm, !bridge->driver);
> +}
> +
>  #ifdef CONFIG_PM_SLEEP
>  static int xe_pci_suspend(struct device *dev)
>  {
>  	struct pci_dev *pdev = to_pci_dev(dev);
>  	int err;
>  
> +	xe_assert_on_unbounded_bridge(pdev);

besides warning, shouldn't we block the suspend at all?
returning from this point...

>  	err = xe_pm_suspend(pdev_to_xe_device(pdev));
>  	if (err)
>  		return err;
> @@ -718,6 +730,7 @@ static int xe_pci_runtime_suspend(struct device *dev)
>  	struct xe_device *xe = pdev_to_xe_device(pdev);
>  	int err;
>  
> +	xe_assert_on_unbounded_bridge(pdev);
>  	err = xe_pm_runtime_suspend(xe);
>  	if (err)
>  		return err;
> -- 
> 2.38.0
> 


More information about the Intel-xe mailing list