From: Lukas Wunner <lukas@wunner.de>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Krzysztof Wilczy??ski <kw@linux.com>,
Rob Herring <robh@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
quic_krichai@quicinc.com, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v2] PCI: Add D3 support for PCI bridges in DT based platforms
Date: Wed, 14 Feb 2024 11:28:37 +0100 [thread overview]
Message-ID: <20240214102837.GA30420@wunner.de> (raw)
In-Reply-To: <20240214-pcie-qcom-bridge-v2-1-9dd6dbb1b817@linaro.org>
On Wed, Feb 14, 2024 at 02:18:31PM +0530, Manivannan Sadhasivam wrote:
> +/**
> + * of_pci_bridge_d3 - Check if the bridge is supporting D3 states or not
> + *
> + * @node: device tree node of the bridge
> + *
> + * Return: True if the bridge is supporting D3 states, False otherwise.
A lot of kernel-doc uses %true and %false.
> +bool of_pci_bridge_d3(struct device_node *node)
> +{
> + return of_property_read_bool(node, "supports-d3");
> +}
What's the difference between of_property_read_bool() and
of_property_present()? When should one use which?
The former has 691 occurrences in the tree, the latter 120.
The latter would seem more "literary" / readable here,
but maybe that's just me.
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1142,6 +1142,9 @@ static inline bool platform_pci_bridge_d3(struct pci_dev *dev)
> if (pci_use_mid_pm())
> return false;
>
> + if (dev->dev.of_node)
> + return of_pci_bridge_d3(dev->dev.of_node);
> +
> return acpi_pci_bridge_d3(dev);
> }
This will result in an unnecessary test on non-DT platforms (e.g. ACPI)
whether dev->dev.of_node is set.
Please use dev_of_node() instead of "dev->dev.of_node" so that the
code added here can be optimized away by the compiler on non-DT
platforms (due to the IS_ENABLED(CONFIG_OF)).
Thanks,
Lukas
next prev parent reply other threads:[~2024-02-14 10:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 8:48 [PATCH v2] PCI: Add D3 support for PCI bridges in DT based platforms Manivannan Sadhasivam
2024-02-14 10:28 ` Lukas Wunner [this message]
2024-02-14 11:34 ` Manivannan Sadhasivam
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=20240214102837.GA30420@wunner.de \
--to=lukas@wunner.de \
--cc=andersson@kernel.org \
--cc=bhelgaas@google.com \
--cc=konrad.dybcio@linaro.org \
--cc=kw@linux.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mika.westerberg@linux.intel.com \
--cc=quic_krichai@quicinc.com \
--cc=robh@kernel.org \
/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.