[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220831132301.GA177609@bhelgaas>
Date: Wed, 31 Aug 2022 08:23:01 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc: Kai-Heng Feng <kai.heng.feng@...onical.com>,
Koba Ko <koba.ko@...onical.com>,
"David E . Box" <david.e.box@...ux.intel.com>,
Sathyanarayanan Kuppuswamy
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
Bjorn Helgaas <bhelgaas@...gle.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Rajvi Jingar <rajvi.jingar@...ux.intel.com>,
linux-pm@...r.kernel.org
Subject: Re: [PATCH] PCI: Disable PTM on Upstream Ports during suspend
[+cc Rafael, Rajvi, linux-pm]
On Wed, Aug 31, 2022 at 12:53:05PM +0300, Mika Westerberg wrote:
> On Tue, Aug 30, 2022 at 10:52:24AM -0500, Bjorn Helgaas wrote:
> > + type = pci_pcie_type(dev);
> > + if (!(type == PCI_EXP_TYPE_ROOT_PORT ||
> > + type == PCI_EXP_TYPE_UPSTREAM ||
> > + type == PCI_EXP_TYPE_ENDPOINT))
> > + return;
>
> Perhaps switch () instead?
>
> switch (pci_pcie_type(dev)) {
> case PCI_EXP_TYPE_ROOT_PORT:
> case PCI_EXP_TYPE_UPSTREAM:
> case PCI_EXP_TYPE_ENDPOINT:
> break;
> default:
> return;
> }
>
> Either way,
>
> Reviewed-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
Thanks! I dropped this patch for now. I think Rajvi's similar
patch [1] is much better because we only need this kind of check in
one place -- where we enable PTM.
Also, we need to tighten this up so we *always* disable PTM [2]. The
patch I posted still calls pci_disable_ptm() from
pci_prepare_to_sleep(), which means we only do it when
!pdev->state_saved, so we leave PTM enabled if the driver saves its
own state.
Bjorn
[1] https://lore.kernel.org/r/20220830104913.1620539-2-rajvi.jingar@linux.intel.com
[2] https://lore.kernel.org/r/CAJZ5v0iHckqia4OywKzSNWFCaq7eOkJcm5yXJdT2_sNdd36gDw@mail.gmail.com
Powered by blists - more mailing lists