[PATCH 3/3] usb: xhci-pci: Put PWRON_POLARITY on a defined state

From: Fabio Estevam

Date: Wed Sep 09 2026 - 10:41:08 EST


Currently, TUSB73X0_PWRON_POLARITY is set when the "ti,pwron-active-high"
is present.

However, when "ti,pwron-active-high" is absent, its status could have been
set previously by a bootloader or by a previous running kernel.

To make the state of PWRON_POLARITY deterministic, always write it
when the "ti,pwron-active-high" is present.

Signed-off-by: Fabio Estevam <festevam@xxxxxxxxx>
---
drivers/usb/host/xhci-pci.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 75aa679f7d79..833c55c3213a 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -684,10 +684,16 @@ int xhci_pci_common_probe(struct pci_dev *dev, const struct pci_device_id *id)
dma_set_max_seg_size(&dev->dev, UINT_MAX);

if (dev->vendor == PCI_VENDOR_ID_TI &&
- dev->device == PCI_DEVICE_ID_TI_TUSB73X0)
+ dev->device == PCI_DEVICE_ID_TI_TUSB73X0) {
+ u32 pwron_polarity = 0;
+
if (device_property_read_bool(&dev->dev, "ti,pwron-active-high"))
- pci_clear_and_set_config_dword(dev, TUSB73X0_USB_CTRL, 0,
- TUSB73X0_PWRON_POLARITY);
+ pwron_polarity = TUSB73X0_PWRON_POLARITY;
+
+ pci_clear_and_set_config_dword(dev, TUSB73X0_USB_CTRL,
+ TUSB73X0_PWRON_POLARITY,
+ pwron_polarity);
+ }

return 0;

--
2.43.0