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

Gupta, Anshuman anshuman.gupta at intel.com
Fri May 19 04:58:22 UTC 2023



> -----Original Message-----
> From: Rodrigo Vivi <rodrigo.vivi at kernel.org>
> Sent: Thursday, May 18, 2023 10:41 PM
> To: Gupta, Anshuman <anshuman.gupta at intel.com>
> Cc: intel-xe at lists.freedesktop.org; Nikula, Jani <jani.nikula at intel.com>; Vivi,
> Rodrigo <rodrigo.vivi at intel.com>
> Subject: Re: [Intel-xe] [PATCH v3] drm/xe/pm: Disable PM on unbounded
> pcie parent bridge
> 
> 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() ?!
Thanks for review comment.
AFAIU  this is pci related stuff so I have kept in to this file.
If it is ok to call  pci_upstream_bridge() in xe_pm.c ,  I will move this to xe_pm.c
> 
> > +
> >  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?
We need instance of pci_dev pdev to get the bridge device, xe_register_pci_driver does not have pdev.
xe_register_pci_driver will not be called per pcie device.
Br,
Anshuman
> 
> > +
> >  	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