PCI/pwrctl: Abandon QCom WCN probe on pre-pwrseq device-trees
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 7 Oct 2024 09:24:46 +0000 (11:24 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 23 Oct 2024 18:34:41 +0000 (13:34 -0500)
commitad783b9f8e78572fff3b04b6caee7bea3821eea8
tree55e9e279ede6dcaf0dabb359d8db6e72a7951af7
parent1d59d474e1cb7d4fdf87dfaf96f44647f13ea590
PCI/pwrctl: Abandon QCom WCN probe on pre-pwrseq device-trees

Old device trees for some platforms already define wifi nodes for the WCN
family of chips since before power sequencing was added upstream.

These nodes don't consume the regulator outputs from the PMU, and if we
allow this driver to bind to one of such "incomplete" nodes, we'll see a
kernel log error about the infinite probe deferral.

Extend the driver by adding a platform data struct matched against the
compatible. This struct contains the pwrseq target string as well as a
validation function called right after entering probe().

For Qualcomm WCN models, check the existence of the regulator supply
property that indicates the DT is already using power sequencing and return
-ENODEV if it's not there, indicating to the driver model that the device
should not be bound to the pwrctl driver.

Link: https://lore.kernel.org/r/20241007092447.18616-1-brgl@bgdev.pl
Fixes: 6140d185a43d ("PCI/pwrctl: Add a PCI power control driver for power sequenced devices")
Reported-by: Johan Hovold <johan@kernel.org>
Closes: https://lore.kernel.org/all/Zv565olMDDGHyYVt@hovoldconsulting.com/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pwrctl/pci-pwrctl-pwrseq.c