All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@kernel.org>
To: "Gupta, Anshuman" <anshuman.gupta@intel.com>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Subject: Re: [Intel-xe] [PATCH] drm/xe/pm: WARN_ON() on unbounded pcie parent bridge device
Date: Tue, 9 May 2023 13:26:17 -0400	[thread overview]
Message-ID: <ZFqCOT4dPFUmTPSZ@rdvivi-mobl4> (raw)
In-Reply-To: <CY5PR11MB621101BF5C5C5B3F769B530595769@CY5PR11MB6211.namprd11.prod.outlook.com>

On Tue, May 09, 2023 at 03:20:25AM +0000, Gupta, Anshuman wrote:
> 
> 
> > -----Original Message-----
> > From: Vivi, Rodrigo <rodrigo.vivi@intel.com>
> > Sent: Monday, May 8, 2023 10:45 PM
> > To: Gupta, Anshuman <anshuman.gupta@intel.com>
> > Cc: intel-xe@lists.freedesktop.org
> > Subject: Re: [Intel-xe] [PATCH] drm/xe/pm: WARN_ON() on unbounded pcie
> > parent bridge device
> > 
> > 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@intel.com>
> > > Signed-off-by: Anshuman Gupta <anshuman.gupta@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...
> If that is desired then, we shall check this in xe probe and initializes the PM OPS with NULL rather then failing suspend ?

great idea!

> Br,
> Anshuman Gupta. 
> > 
> > >  	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
> > >

      reply	other threads:[~2023-05-09 17:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08  9:17 [Intel-xe] [PATCH] drm/xe/pm: WARN_ON() on unbounded pcie parent bridge device Anshuman Gupta
2023-05-08  9:22 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-05-08  9:23 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-05-08  9:27 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-05-08  9:52 ` [Intel-xe] ○ CI.BAT: info " Patchwork
2023-05-08 17:14 ` [Intel-xe] [PATCH] " Rodrigo Vivi
2023-05-09  3:20   ` Gupta, Anshuman
2023-05-09 17:26     ` Rodrigo Vivi [this message]

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=ZFqCOT4dPFUmTPSZ@rdvivi-mobl4 \
    --to=rodrigo.vivi@kernel.org \
    --cc=anshuman.gupta@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=rodrigo.vivi@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.