From: Manivannan Sadhasivam <mani@kernel.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
lpieralisi@kernel.org, kw@linux.com, bhelgaas@google.com,
robh@kernel.org, gustavo.pimentel@synopsys.com,
jingoohan1@gmail.com, andersson@kernel.org,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v2 2/2] PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops
Date: Wed, 11 Oct 2023 10:33:39 +0530 [thread overview]
Message-ID: <20231011050339.GD3508@thinkpad> (raw)
In-Reply-To: <e6d22992-e3aa-480c-8def-00a447951a02@linaro.org>
On Tue, Oct 10, 2023 at 06:33:52PM +0200, Konrad Dybcio wrote:
>
>
> On 10/10/23 17:59, Manivannan Sadhasivam wrote:
> > ASPM is supported by Qcom host controllers/bridges on most of the recent
> > platforms and so the devices tested so far. But for enabling ASPM by
> > default (without Kconfig/cmdline/sysfs), BIOS has to enable ASPM on both
> > host bridge and downstream devices during boot. Unfortunately, none of the
> > BIOS available on Qcom platforms enables ASPM. Due to this, the platforms
> > making use of Qcom SoCs draw high power during runtime.
> >
> > To fix this power issue, users/distros have to enable ASPM using configs
> > such as (Kconfig/cmdline/sysfs) or the BIOS has to start enabling ASPM.
> > The latter may happen in the future, but that won't address the issue on
> > current platforms. Also, asking users/distros to enable a feature to get
> > the power management right would provide an unpleasant out-of-the-box
> > experience.
> >
> > So the apt solution is to enable ASPM in the controller driver itself. And
> > this is being accomplished by calling pci_enable_link_state() in the newly
> > introduced host_post_init() callback for all the devices connected to the
> > bus. This function enables all supported link low power states for both
> > host bridge and the downstream devices.
> >
> > Due to limited testing, ASPM is only enabled for platforms making use of
> > ops_1_9_0 callbacks.
> >
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> [...]
>
> > +static int qcom_pcie_enable_aspm(struct pci_dev *pdev, void *userdata)
> > +{
> > + /* Downstream devices need to be in D0 state before enabling PCI PM substates */
> > + pci_set_power_state(pdev, PCI_D0);
> > + pci_enable_link_state(pdev, PCIE_LINK_STATE_ALL);
> Do we not care about retval here?
>
No. Even if it fails, we shouldn't care about it.
> > +
> > + return 0;
> > +}
> > +
> > +static void qcom_pcie_host_post_init_2_7_0(struct qcom_pcie *pcie)
> post_init_enable_aspm?
>
The scope of this callback may get extended in the future. So I'd keep it as it
is.
- Mani
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2023-10-11 5:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 15:59 [PATCH v2 0/2] PCI: qcom: Enable ASPM on host bridge and devices Manivannan Sadhasivam
2023-10-10 15:59 ` [PATCH v2 1/2] PCI: dwc: Add host_post_init() callback Manivannan Sadhasivam
2023-10-16 20:58 ` Bjorn Helgaas
2023-10-17 7:59 ` Manivannan Sadhasivam
2023-10-18 16:47 ` Bjorn Helgaas
2023-10-10 15:59 ` [PATCH v2 2/2] PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops Manivannan Sadhasivam
2023-10-10 16:29 ` Bjorn Helgaas
2023-10-11 5:00 ` Manivannan Sadhasivam
2023-10-10 16:33 ` Konrad Dybcio
2023-10-11 5:03 ` Manivannan Sadhasivam [this message]
2023-10-10 16:25 ` [PATCH v2 0/2] PCI: qcom: Enable ASPM on host bridge and devices Konrad Dybcio
2023-10-14 20:32 ` Krzysztof Wilczyński
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=20231011050339.GD3508@thinkpad \
--to=mani@kernel.org \
--cc=andersson@kernel.org \
--cc=bhelgaas@google.com \
--cc=gustavo.pimentel@synopsys.com \
--cc=jingoohan1@gmail.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=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.