* Re: [PATCH] PCI: Disable PTM on Upstream Ports during suspend
[not found] <Yw8vgYeqY6a79HDR@black.fi.intel.com>
@ 2022-08-31 13:23 ` Bjorn Helgaas
0 siblings, 0 replies; only message in thread
From: Bjorn Helgaas @ 2022-08-31 13:23 UTC (permalink / raw)
To: Mika Westerberg
Cc: Kai-Heng Feng, Koba Ko, David E . Box, Sathyanarayanan Kuppuswamy,
linux-pci, linux-kernel, Bjorn Helgaas, Rafael J. Wysocki,
Rajvi Jingar, linux-pm
[+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@linux.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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-08-31 13:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <Yw8vgYeqY6a79HDR@black.fi.intel.com>
2022-08-31 13:23 ` [PATCH] PCI: Disable PTM on Upstream Ports during suspend Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox