From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>,
lpieralisi@kernel.org, kwilczynski@kernel.org, mani@kernel.org,
bhelgaas@google.com
Cc: will@kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, robh@kernel.org,
linux-arm-msm@vger.kernel.org, zhangsenchuan@eswincomputing.com
Subject: Re: [PATCH 1/3] PCI: host-common: Add an API to check for any device under the Root Ports
Date: Thu, 6 Nov 2025 10:47:48 +0100 [thread overview]
Message-ID: <4aface5d-66eb-41bb-b6f3-ee8ce5d5da6b@oss.qualcomm.com> (raw)
In-Reply-To: <20251106061326.8241-2-manivannan.sadhasivam@oss.qualcomm.com>
On 11/6/25 7:13 AM, Manivannan Sadhasivam wrote:
> Some controller drivers need to check if there is any device available
> under the Root Ports. So add an API that returns 'true' if a device is
> found under any of the Root Ports, 'false' otherwise.
>
> Controller drivers can use this API for usecases like turning off the
> controller resources only if there are no devices under the Root Ports,
> skipping PME_Turn_Off broadcast etc...
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
> ---
> drivers/pci/controller/pci-host-common.c | 21 +++++++++++++++++++++
> drivers/pci/controller/pci-host-common.h | 2 ++
> 2 files changed, 23 insertions(+)
>
> diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c
> index 810d1c8de24e..6b4f90903dc6 100644
> --- a/drivers/pci/controller/pci-host-common.c
> +++ b/drivers/pci/controller/pci-host-common.c
> @@ -17,6 +17,27 @@
>
> #include "pci-host-common.h"
>
> +/**
> + * pci_root_ports_have_device - Check if the Root Ports under the Root bus have
> + * any device underneath
> + * @dev: Root bus
> + *
> + * Return: true if a device is found, false otherwise
> + */
> +bool pci_root_ports_have_device(struct pci_bus *root_bus)
> +{
> + struct pci_bus *child;
> +
> + /* Iterate over the Root Port busses and look for any device */
> + list_for_each_entry(child, &root_bus->children, node) {
> + if (list_count_nodes(&child->devices))
Is this list ever shrunk? I grepped around and couldn't find where
that happens
Konrad
next prev parent reply other threads:[~2025-11-06 9:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 6:13 [PATCH 0/3] PCI: dwc: Replace Link up check with device presence in suspend path Manivannan Sadhasivam
2025-11-06 6:13 ` [PATCH 1/3] PCI: host-common: Add an API to check for any device under the Root Ports Manivannan Sadhasivam
2025-11-06 9:47 ` Konrad Dybcio [this message]
2025-11-06 11:52 ` Manivannan Sadhasivam
2025-11-07 0:12 ` kernel test robot
2025-11-06 6:13 ` [PATCH 2/3] PCI: qcom: Check for the presence of a device instead of Link up during suspend Manivannan Sadhasivam
2025-11-06 10:13 ` zhangsenchuan
2025-11-06 11:57 ` Manivannan Sadhasivam
2025-11-07 6:27 ` zhangsenchuan
2025-11-08 10:25 ` Manivannan Sadhasivam
2025-11-10 9:12 ` zhangsenchuan
2025-11-06 6:13 ` [PATCH 3/3] PCI: dwc: Skip PME_Turn_Off and L2/L3 transition if no device is available Manivannan Sadhasivam
2025-11-06 10:02 ` zhangsenchuan
2025-11-06 12:09 ` Manivannan Sadhasivam
2025-11-07 3:28 ` kernel test robot
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=4aface5d-66eb-41bb-b6f3-ee8ce5d5da6b@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=bhelgaas@google.com \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=manivannan.sadhasivam@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=will@kernel.org \
--cc=zhangsenchuan@eswincomputing.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