From: Michal Pecio <michal.pecio@gmail.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: gregkh@linuxfoundation.org, mathias.nyman@intel.com,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
parth.pancholi@toradex.com, francesco.dolcini@toradex.com
Subject: Re: [PATCH 3/3] usb: xhci-pci: Put PWRON_POLARITY on a defined state
Date: Wed, 9 Sep 2026 16:43:39 +0200 [thread overview]
Message-ID: <20260909164339.7252469b.michal.pecio@gmail.com> (raw)
In-Reply-To: <20260909125842.528340-3-festevam@gmail.com>
On Wed, 9 Sep 2026 09:58:42 -0300, Fabio Estevam wrote:
> 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.
or by EEPROM.
Do they bother to put the chip in a wrong, non-default state at boot?
> To make the state of PWRON_POLARITY deterministic, always write it
> when the "ti,pwron-active-high" is present.
That wouldn't be too dangereous, but...
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
> 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);
> + }
... isn't device_property_present() missing here?
Also, I don't know those DT rules, but doesn't "ti,something" imply
that this must be a TI chip, no need to check IDs?
Regards,
Michal
next prev parent reply other threads:[~2026-09-09 14:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 12:58 [PATCH 1/3] usb: xhci-pci: Add TUSB73x0 definitions Fabio Estevam
2026-09-09 12:58 ` [PATCH 2/3] usb: xhci-pci: Add run-time check for TUSB73X0 Fabio Estevam
2026-09-09 12:58 ` [PATCH 3/3] usb: xhci-pci: Put PWRON_POLARITY on a defined state Fabio Estevam
2026-09-09 14:43 ` Michal Pecio [this message]
2026-09-11 13:58 ` Fabio Estevam
2026-09-11 18:11 ` Michal Pecio
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=20260909164339.7252469b.michal.pecio@gmail.com \
--to=michal.pecio@gmail.com \
--cc=festevam@gmail.com \
--cc=francesco.dolcini@toradex.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=parth.pancholi@toradex.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
all inboxes | Powered by JetHome®