From: Michal Pecio <michal.pecio@gmail.com>
To: Jihong Min <hurryman2212@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mathias Nyman <mathias.nyman@intel.com>,
Guenter Roeck <linux@roeck-us.net>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Mario Limonciello <mario.limonciello@amd.com>,
Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
linux-usb@vger.kernel.org, linux-hwmon@vger.kernel.org,
linux-doc@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Mario Limonciello (AMD)" <superm1@kernel.org>,
Yaroslav Isakov <yaroslav.isakov@gmail.com>
Subject: Re: [PATCH v6 1/2] usb: xhci-pci: add AMD Promontory 21 PCI glue
Date: Mon, 18 May 2026 23:37:11 +0200 [thread overview]
Message-ID: <20260518233711.4c99cc72.michal.pecio@gmail.com> (raw)
In-Reply-To: <144ec61c-4cc1-4986-a16c-7c1b99f3a72e@gmail.com>
On Tue, 19 May 2026 05:30:47 +0900, Jihong Min wrote:
> On 5/18/26 06:21, Michal Pecio wrote:
> > Instead of the X86 heuristic, would it be possible to build glue
> > code if and only if SENSORS_PROM21_XHCI is enabled?
> >
> > This seems to work:
> >
> > config SENSORS_PROM21_XHCI
> > tristate "AMD Promontory 21 xHCI temperature sensor"
> > - depends on USB_XHCI_PCI_PROM21
> > + depends on USB_XHCI_PCI
> >
> > config USB_XHCI_PCI_PROM21
> > tristate
> > - depends on X86
> > depends on USB_XHCI_PCI
> > - default USB_XHCI_PCI
> > + default USB_XHCI_PCI if SENSORS_PROM21_XHCI != 'n'
> > select AUXILIARY_BUS
> >
> > I don't know if it's the best way, perhaps it would be preferable
> > for the hwmon driver to select the glue, but then I'm not sure how
> > to force glue to become 'y' when xhci-pci is 'y'.
>
> I think I should keep the current hidden glue option for now.
>
> The PROM21 PCI glue is part of the PCI binding path for the xHCI
> controller when enabled, while SENSORS_PROM21_XHCI is only the
> optional user-visible hwmon driver. Tying the glue to the hwmon
> option would make the sensor option affect which driver binds the USB
> controller.
That's true.
Making this possible is the whole purpose of "if IS_ENABLED" here:
> static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
> {
> if (IS_ENABLED(CONFIG_USB_XHCI_PCI_RENESAS) &&
> pci_match_id(pci_ids_renesas, dev))
> return -ENODEV;
>
> + if (IS_ENABLED(CONFIG_USB_XHCI_PCI_PROM21) &&
> + pci_match_id(pci_ids_prom21, dev))
> + return -ENODEV;
> +
> return xhci_pci_common_probe(dev, id);
> }
Currently, you have a weird situation where xhci-pci-prom21 always
binds on x86 and xhci-pci on other platforms (with the unofficial PCIe
card you mentioned), plus the sensor cannot work on other platforms.
> As Guenter pointed out, that would be too strong; the USB controller
> should not depend on whether the optional hwmon driver is enabled.
One could further argue that neither should it care whether some hwmon
driver exists at all, or which kernel releases it exists in :)
Regards,
Michal
next prev parent reply other threads:[~2026-05-18 21:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-17 13:04 [PATCH v6 0/2] AMD Promontory 21 xHCI temperature sensor support Jihong Min
2026-05-17 13:04 ` [PATCH v6 1/2] usb: xhci-pci: add AMD Promontory 21 PCI glue Jihong Min
2026-05-17 21:21 ` Michal Pecio
2026-05-18 10:55 ` Guenter Roeck
2026-05-18 20:34 ` Michal Pecio
2026-05-18 20:30 ` Jihong Min
2026-05-18 21:37 ` Michal Pecio [this message]
2026-05-18 23:06 ` Jihong Min
2026-05-18 23:25 ` Guenter Roeck
2026-05-18 23:07 ` Jihong Min
2026-05-17 13:04 ` [PATCH v6 2/2] hwmon: add AMD Promontory 21 xHCI temperature sensor support Jihong Min
2026-05-18 10:58 ` Guenter Roeck
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=20260518233711.4c99cc72.michal.pecio@gmail.com \
--to=michal.pecio@gmail.com \
--cc=Basavaraj.Natikar@amd.com \
--cc=corbet@lwn.net \
--cc=gregkh@linuxfoundation.org \
--cc=hurryman2212@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mario.limonciello@amd.com \
--cc=mathias.nyman@intel.com \
--cc=skhan@linuxfoundation.org \
--cc=superm1@kernel.org \
--cc=yaroslav.isakov@gmail.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