lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250701203526.GA1849466@bhelgaas>
Date: Tue, 1 Jul 2025 15:35:26 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Cc: bhelgaas@...gle.com, lukas@...ner.de, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	Jim Quinlan <james.quinlan@...adcom.com>,
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v2] PCI/pwrctrl: Skip creating pwrctrl device unless
 CONFIG_PCI_PWRCTRL is enabled

[+cc Bart]

On Tue, Jul 01, 2025 at 12:17:31PM +0530, Manivannan Sadhasivam wrote:
> If devicetree describes power supplies related to a PCI device, we
> previously created a pwrctrl device even if CONFIG_PCI_PWRCTL was
> not enabled.
> 
> When pci_pwrctrl_create_device() creates and returns a pwrctrl device,
> pci_scan_device() doesn't enumerate the PCI device. It assumes the pwrctrl
> core will rescan the bus after turning on the power. However, if
> CONFIG_PCI_PWRCTL is not enabled, the rescan never happens.

Separate from this patch, can we refine the comment in
pci_scan_device() to explain *why* we should skip scanning if a
pwrctrl device was created?  The current comment leaves me with two
questions:

  1) How do we know the pwrctrl device is currently off?  If it is
     already on, why should we defer enumerating the device?

  2) If the pwrctrl device is currently off, won't the Vendor ID read
     just fail like it does for every other non-existent device?  If
     so, why can't we just let that happen?

This behavior is from 2489eeb777af ("PCI/pwrctrl: Skip scanning for
the device further if pwrctrl device is created"), which just says
"there's no need to continue scanning."  Prior to 2489eeb777af, it
looks like we *did* what try to enumerate the device even if a pwrctrl
device was created, and 2489eeb777af doesn't mention a bug fix, so I
assume it's just an optimization.

Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ