[Intel-xe] [PATCH v3] drm/xe/pm: Disable PM on unbounded pcie parent bridge

Rodrigo Vivi rodrigo.vivi at kernel.org
Thu May 18 17:11:23 UTC 2023


On Thu, May 18, 2023 at 02:22:59PM +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 dev_warn on unbounded VSP and disable xe driver
> PM support.
> 
> v2:
> - Disable Xe PCI PM support. [Rodrigo]
> v3:
> - Changed subject and Rebase.
> 
> 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 | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index e789a50a1310..e09d76b7755a 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -603,6 +603,19 @@ static void xe_pci_remove(struct pci_dev *pdev)
>  	pci_set_drvdata(pdev, NULL);
>  }
>  
> +static void xe_pci_unbounded_bridge_disable_pm(struct pci_dev *pdev)
> +{
> +	struct pci_dev *bridge = pci_upstream_bridge(pdev);
> +
> +	if (!bridge)
> +		return;
> +
> +	if (!bridge->driver) {
> +		dev_warn(&pdev->dev, "unbounded parent pci bridge, device won't support any PM support.\n");
> +		pdev->driver->driver.pm = NULL;
> +	}
> +}

what about having this function as part of xe_pm.c and then
call it xe_pm_assert_bounded_bridge() ?!

> +
>  static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  {
>  	const struct xe_device_desc *desc = (const void *)ent->driver_data;
> @@ -628,10 +641,13 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  		return -ENODEV;
>  	}
>  
> +
>  	err = xe_display_driver_probe_defer(pdev);
>  	if (err)
>  		return err;
>  
> +	xe_pci_unbounded_bridge_disable_pm(pdev);

Probably the safest place to call this is at xe_register_pci_driver right before registering it, no?!
possible?

> +
>  	xe = xe_device_create(pdev, ent);
>  	if (IS_ERR(xe))
>  		return PTR_ERR(xe);
> -- 
> 2.38.0
> 


More information about the Intel-xe mailing list