From: Bjorn Helgaas <helgaas@kernel.org>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
Koba Ko <koba.ko@canonical.com>,
"David E . Box" <david.e.box@linux.intel.com>,
Sathyanarayanan Kuppuswamy
<sathyanarayanan.kuppuswamy@linux.intel.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Bjorn Helgaas <bhelgaas@google.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Rajvi Jingar <rajvi.jingar@linux.intel.com>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH] PCI: Disable PTM on Upstream Ports during suspend
Date: Wed, 31 Aug 2022 08:23:01 -0500 [thread overview]
Message-ID: <20220831132301.GA177609@bhelgaas> (raw)
In-Reply-To: <Yw8vgYeqY6a79HDR@black.fi.intel.com>
[+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
prev parent reply other threads:[~2022-08-31 13:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 15:52 [PATCH] PCI: Disable PTM on Upstream Ports during suspend Bjorn Helgaas
2022-08-30 16:30 ` Sathyanarayanan Kuppuswamy
2022-08-31 9:53 ` Mika Westerberg
2022-08-31 13:23 ` Bjorn Helgaas [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=20220831132301.GA177609@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=david.e.box@linux.intel.com \
--cc=kai.heng.feng@canonical.com \
--cc=koba.ko@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael@kernel.org \
--cc=rajvi.jingar@linux.intel.com \
--cc=sathyanarayanan.kuppuswamy@linux.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.