From: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>,
hkallweit1@gmail.com, nic_swsd@realtek.com, bhelgaas@google.com
Cc: koba.ko@canonical.com, acelan.kao@canonical.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, vidyas@nvidia.com, rafael.j.wysocki@intel.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org
Subject: Re: [PATCH net-next v9 2/5] PCI/ASPM: Add pcie_aspm_capable() helper
Date: Fri, 24 Feb 2023 22:10:53 -0800 [thread overview]
Message-ID: <33930e67-d2fb-1aa9-ba72-9ae61892e0fc@linux.intel.com> (raw)
In-Reply-To: <20230225034635.2220386-3-kai.heng.feng@canonical.com>
On 2/24/23 7:46 PM, Kai-Heng Feng wrote:
> Introduce a new helper, pcie_aspm_capable(), to report ASPM capability.
>
> The user will be introduced by next patch.
Instead of just saying next patch, just say which driver or use case is
going to use it.
>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> v9:
> v8:
> - No change.
>
> v7:
> - Change subject.
>
> v6:
> - No change.
>
> v5:
> - No change.
>
> v4:
> - Report aspm_capable instead.
>
> v3:
> - This is a new patch
>
> drivers/pci/pcie/aspm.c | 11 +++++++++++
> include/linux/pci.h | 2 ++
> 2 files changed, 13 insertions(+)
>
> diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
> index 692d6953f0970..d96bf0a362aa2 100644
> --- a/drivers/pci/pcie/aspm.c
> +++ b/drivers/pci/pcie/aspm.c
> @@ -1199,6 +1199,17 @@ bool pcie_aspm_enabled(struct pci_dev *pdev)
> }
> EXPORT_SYMBOL_GPL(pcie_aspm_enabled);
>
> +bool pcie_aspm_capable(struct pci_dev *pdev)
> +{
> + struct pcie_link_state *link = pcie_aspm_get_link(pdev);
> +
> + if (!link)
> + return false;
> +
> + return link->aspm_capable;
> +}
> +EXPORT_SYMBOL_GPL(pcie_aspm_capable);
> +
> static ssize_t aspm_attr_show_common(struct device *dev,
> struct device_attribute *attr,
> char *buf, u8 state)
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index adffd65e84b4e..fd56872883e14 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1692,6 +1692,7 @@ int pci_disable_link_state_locked(struct pci_dev *pdev, int state);
> void pcie_no_aspm(void);
> bool pcie_aspm_support_enabled(void);
> bool pcie_aspm_enabled(struct pci_dev *pdev);
> +bool pcie_aspm_capable(struct pci_dev *pdev);
> #else
> static inline int pci_disable_link_state(struct pci_dev *pdev, int state)
> { return 0; }
> @@ -1700,6 +1701,7 @@ static inline int pci_disable_link_state_locked(struct pci_dev *pdev, int state)
> static inline void pcie_no_aspm(void) { }
> static inline bool pcie_aspm_support_enabled(void) { return false; }
> static inline bool pcie_aspm_enabled(struct pci_dev *pdev) { return false; }
> +static inline bool pcie_aspm_capable(struct pci_dev *pdev) { return false; }
> #endif
>
> #ifdef CONFIG_PCIEAER
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
next prev parent reply other threads:[~2023-02-25 6:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-25 3:46 [PATCH net-next v9 0/5] r8169: Temporarily disable ASPM on NAPI poll Kai-Heng Feng
2023-02-25 3:46 ` [PATCH net-next v9 1/5] Revert "PCI/ASPM: Unexport pcie_aspm_support_enabled()" Kai-Heng Feng
2023-02-25 6:09 ` Sathyanarayanan Kuppuswamy
2023-02-25 3:46 ` [PATCH net-next v9 2/5] PCI/ASPM: Add pcie_aspm_capable() helper Kai-Heng Feng
2023-02-25 6:10 ` Sathyanarayanan Kuppuswamy [this message]
2023-02-25 3:46 ` [PATCH net-next v9 3/5] r8169: Consider chip-specific ASPM can be enabled on more cases Kai-Heng Feng
2023-02-25 6:13 ` Sathyanarayanan Kuppuswamy
2023-03-09 20:17 ` Bjorn Helgaas
2023-03-10 20:42 ` Heiner Kallweit
2023-03-10 20:48 ` Bjorn Helgaas
2023-02-25 3:46 ` [PATCH net-next v9 4/5] r8169: Use spinlock to guard config register locking Kai-Heng Feng
2023-02-25 6:16 ` Sathyanarayanan Kuppuswamy
2023-02-25 3:46 ` [PATCH net-next v9 5/5] r8169: Disable ASPM while doing NAPI poll Kai-Heng Feng
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=33930e67-d2fb-1aa9-ba72-9ae61892e0fc@linux.intel.com \
--to=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=acelan.kao@canonical.com \
--cc=bhelgaas@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kai.heng.feng@canonical.com \
--cc=koba.ko@canonical.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
--cc=pabeni@redhat.com \
--cc=rafael.j.wysocki@intel.com \
--cc=vidyas@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).