linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH 1/2] PCI: qcom: Switch to bus notifier for enabling ASPM of PCI devices
Date: Mon, 21 Jul 2025 11:32:44 +0200	[thread overview]
Message-ID: <aH4JPBIk_GEoAezy@hovoldconsulting.com> (raw)
In-Reply-To: <20250714-aspm_fix-v1-1-7d04b8c140c8@oss.qualcomm.com>

On Mon, Jul 14, 2025 at 11:31:04PM +0530, Manivannan Sadhasivam wrote:
> Commit 9f4f3dfad8cf ("PCI: qcom: Enable ASPM for platforms supporting 1.9.0
> ops") allowed the Qcom controller driver to enable ASPM for all PCI devices
> enumerated at the time of the controller driver probe. It proved to be
> useful for devices already powered on by the bootloader as it allowed
> devices to enter ASPM without user intervention.
> 
> However, it could not enable ASPM for the hotplug capable devices i.e.,
> devices enumerated *after* the controller driver probe. This limitation
> mostly went unnoticed as the Qcom PCI controllers are not hotplug capable
> and also the bootloader has been enabling the PCI devices before Linux
> Kernel boots (mostly on the Qcom compute platforms which users use on a
> daily basis).
> 
> But with the advent of the commit b458ff7e8176 ("PCI/pwrctl: Ensure that
> pwrctl drivers are probed before PCI client drivers"), the pwrctrl driver
> started to block the PCI device enumeration until it had been probed.
> Though, the intention of the commit was to avoid race between the pwrctrl
> driver and PCI client driver, it also meant that the pwrctrl controlled PCI
> devices may get probed after the controller driver and will no longer have
> ASPM enabled. So users started noticing high runtime power consumption with
> WLAN chipsets on Qcom compute platforms like Thinkpad X13s, and Thinkpad
> T14s, etc...

Note the ASPM regression for ath11k/ath12k only happened in 6.15, so
commit b458ff7e8176 ("PCI/pwrctl: Ensure that pwrctl drivers are probed
before PCI client drivers") in 6.13 does not seem to be the immediate
culprit here.

Candidates from 6.15 include commits like

	957f40d039a9 ("PCI/pwrctrl: Move creation of pwrctrl devices to pci_scan_device()")
	2489eeb777af ("PCI/pwrctrl: Skip scanning for the device further if pwrctrl device is created")

This is probably related to the reports of these drivers sometimes
failing to probe with

	ath12k_pci 0004:01:00.0: of_irq_parse_pci: failed with rc=134

after pwrctrl was merged, and which since 6.15 should instead result in
the drivers not probing at all (as we've discussed off list).

> Obviously, it is the pwrctrl change that caused regression, but it
> ultimately uncovered a flaw in the ASPM enablement logic of the controller
> driver. So to address the actual issue, switch to the bus notifier for
> enabling ASPM of the PCI devices. The notifier will notify the controller
> driver when a PCI device is attached to the bus, thereby allowing it to
> enable ASPM more reliably. It should be noted that the
> 'pci_dev::link_state', which is required for enabling ASPM by the
> pci_enable_link_state_locked() API, is only set by the time of
> BUS_NOTIFY_BIND_DRIVER stage of the notification. So we cannot enable ASPM
> during BUS_NOTIFY_ADD_DEVICE stage.
> 
> So with this, we can also get rid of the controller driver specific
> 'qcom_pcie_ops::host_post_init' callback.
> 
> Cc: stable@vger.kernel.org # v6.7
> Fixes: 9f4f3dfad8cf ("PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops")

So whatever form this fix ends up taking it only needs to be backported
to 6.15.

As you mention above these platforms do not support hotplug, but even if
they were, enabling ASPM for hotplugged devices is arguably more of a
new features than a bug fix.

Johan

  parent reply	other threads:[~2025-07-21  9:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14 18:01 [PATCH 0/2] PCI: qcom: Switch to bus notifier for enabling ASPM of PCI devices Manivannan Sadhasivam
2025-07-14 18:01 ` [PATCH 1/2] " Manivannan Sadhasivam
2025-07-15  7:48   ` Johan Hovold
2025-07-15  9:11     ` Manivannan Sadhasivam
2025-07-15  9:33       ` Johan Hovold
2025-07-15  9:46         ` Konrad Dybcio
2025-07-15 10:27         ` Manivannan Sadhasivam
2025-07-15 12:31           ` Johan Hovold
2025-07-21  9:32   ` Johan Hovold [this message]
2025-07-21 10:56     ` Manivannan Sadhasivam
2025-07-21 12:49       ` Johan Hovold
2025-07-21 15:45         ` Manivannan Sadhasivam
2025-07-14 18:01 ` [PATCH 2/2] PCI: qcom: Move qcom_pcie_icc_opp_update() to notifier callback Manivannan Sadhasivam
2025-07-15  7:51   ` Johan Hovold
2025-07-15  9:13     ` Manivannan Sadhasivam
2025-07-15  9:54   ` Konrad Dybcio
2025-07-15 10:36     ` Manivannan Sadhasivam
2025-07-15 10:45       ` Konrad Dybcio
2025-07-16  5:28         ` Manivannan Sadhasivam
2025-07-16 10:33           ` Konrad Dybcio
2025-07-21  9:15             ` Johan Hovold
2025-07-16  4:54       ` Krishna Chaitanya Chundru
2025-07-16  6:46         ` Manivannan Sadhasivam
2025-07-16  6:53           ` Krishna Chaitanya Chundru
2025-07-16  7:18             ` Manivannan Sadhasivam
2025-07-21  9:02           ` Johan Hovold
2025-07-21 10:59             ` 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=aH4JPBIk_GEoAezy@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=krishna.chundru@oss.qualcomm.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=stable@vger.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 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).