Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Wei Fang <wei.fang@nxp.com>,
	devnull+manivannan.sadhasivam.linaro.org@kernel.org
Cc: bartosz.golaszewski@linaro.org, bhelgaas@google.com,
	brgl@bgdev.pl, conor+dt@kernel.org, devicetree@vger.kernel.org,
	krzk+dt@kernel.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, robh@kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH v3 3/5] PCI/pwrctrl: Skip scanning for the device further if pwrctrl device is created
Date: Fri, 21 Mar 2025 10:12:55 +0530	[thread overview]
Message-ID: <2BFDC577-949F-49EE-A639-A21010FEEE0E@linaro.org> (raw)
In-Reply-To: <20250321025940.2103854-1-wei.fang@nxp.com>

Hi,

On March 21, 2025 8:29:40 AM GMT+05:30, Wei Fang <wei.fang@nxp.com> wrote:
>@@ -2487,7 +2487,14 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
> 	struct pci_dev *dev;
> 	u32 l;
> 
>-	pci_pwrctrl_create_device(bus, devfn);
>+	/*
>+	 * Create pwrctrl device (if required) for the PCI device to handle the
>+	 * power state. If the pwrctrl device is created, then skip scanning
>+	 * further as the pwrctrl core will rescan the bus after powering on
>+	 * the device.
>+	 */
>+	if (pci_pwrctrl_create_device(bus, devfn))
>+		return NULL;
>
>Hi Manivannan,
>
>The current patch logic is that if the pcie device node is found to have
>the "xxx-supply" property, the scan will be skipped, and then the pwrctrl
>driver will rescan and enable the regulators. However, after merging this
>patch, there is a problem on our platform. The .probe() of our device
>driver will not be called. The reason is that CONFIG_PCI_PWRCTL_SLOT is
>not enabled at all in our configuration file, and the compatible string
>of the device is also not added to the pwrctrl driver.

Hmm. So I guess the controller driver itself is enabling the supplies I believe (which I failed to spot). May I know what platforms are affected?

> I think other
>platforms should also have similar problems, which undoubtedly make these
>platforms be unstable. This patch has been applied, and I am not familiar
>with this. Can you fix this problem? I mean that those platforms that do
>not use pwrctrl can avoid skipping the scan.

Sure. It makes sense to add a check to see if the pwrctrl driver is enabled or not. If it is not enabled, then the pwrctrl device creation could be skipped. I'll send a patch once I'm infront of my computer.

But in the long run, we would like to move all platforms to use pwrctrl instead of fiddling the power supplies in the controller driver (well that was the motivation to introduce it in the first place).

Once you share the platform details, I'll try to migrate it to use pwrctrl. Also, please note that we are going to enable pwrctrl in ARM64 defconfig very soon. So I'll try to fix the affected platforms before that happens.

- Mani

மணிவண்ணன் சதாசிவம்

  reply	other threads:[~2025-03-21  4:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16 14:09 [PATCH v3 0/5] PCI/pwrctrl: Rework pwrctrl driver integration and add driver for PCI slot Manivannan Sadhasivam via B4 Relay
2025-01-16 14:09 ` [PATCH v3 1/5] PCI/pwrctrl: Move creation of pwrctrl devices to pci_scan_device() Manivannan Sadhasivam via B4 Relay
2025-01-16 14:09 ` [PATCH v3 2/5] PCI/pwrctrl: Move pci_pwrctrl_unregister() to pci_destroy_dev() Manivannan Sadhasivam via B4 Relay
2025-04-13 21:08   ` Lukas Wunner
2025-01-16 14:09 ` [PATCH v3 3/5] PCI/pwrctrl: Skip scanning for the device further if pwrctrl device is created Manivannan Sadhasivam via B4 Relay
2025-02-20 23:24   ` Bjorn Helgaas
2025-02-21 17:38     ` Manivannan Sadhasivam
2025-02-20 23:35   ` Bjorn Helgaas
2025-02-21 17:40     ` Manivannan Sadhasivam
2025-03-21  2:59   ` Wei Fang
2025-03-21  4:42     ` Manivannan Sadhasivam [this message]
2025-03-21  7:04       ` Wei Fang
2025-03-22  3:23         ` Manivannan Sadhasivam
2025-03-22 11:39           ` Wei Fang
2025-03-24  8:15             ` Manivannan Sadhasivam
2025-03-27  6:02               ` Wei Fang
2025-04-02  8:14                 ` Manivannan Sadhasivam
2025-01-16 14:09 ` [PATCH v3 4/5] dt-bindings: vendor-prefixes: Document the 'pciclass' prefix Manivannan Sadhasivam via B4 Relay
2025-01-16 14:09 ` [PATCH v3 5/5] PCI/pwrctrl: Add pwrctrl driver for PCI Slots Manivannan Sadhasivam via B4 Relay
2025-02-20 14:24 ` [PATCH v3 0/5] PCI/pwrctrl: Rework pwrctrl driver integration and add driver for PCI slot 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=2BFDC577-949F-49EE-A639-A21010FEEE0E@linaro.org \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=bhelgaas@google.com \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=devnull+manivannan.sadhasivam.linaro.org@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=wei.fang@nxp.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