From: sashiko-bot@kernel.org
To: "Jihong Min" <hurryman2212@gmail.com>
Cc: linux-hwmon@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v5 1/2] usb: xhci-pci: add AMD Promontory 21 PCI glue
Date: Thu, 14 May 2026 00:40:54 +0000 [thread overview]
Message-ID: <20260514004055.1BBCAC19425@smtp.kernel.org> (raw)
In-Reply-To: <20260512213910.871859-2-hurryman2212@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The Kconfig dependency `depends on USB_XHCI_PCI=y` completely disables PROM21 support for systems where the core driver is built as a module.
- [Low] Signed integer overflow when calculating the auxiliary device ID.
--
commit 20f4e35b2f88ebe2b8988b4f07fe7cc28199096b
Author: Jihong Min <hurryman2212@gmail.com>
Subject: usb: xhci-pci: add AMD Promontory 21 PCI glue
This commit adds a small PCI glue driver for AMD Promontory 21 xHCI
controllers. It binds the controllers, delegates USB host operation to
the common xHCI PCI core, and creates an auxiliary device for optional
temperature sensor support.
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
[ ... ]
> @@ -42,6 +42,26 @@ config USB_XHCI_PCI
> depends on USB_PCI
> default y
>
> +config USB_XHCI_PCI_PROM21
> + bool "AMD Promontory 21 xHCI PCI support"
> + depends on X86
> + depends on USB_XHCI_PCI=y
Does depending strictly on USB_XHCI_PCI=y cause a configuration regression
for most distributions where the core driver is configured as a module?
The driver source appears fully capable of being built as a module, using
module-related macros and module_pci_driver().
If the intent is to prevent an early boot mismatch where xhci-pci is
built-in but the PROM21 glue is a module, could this instead be a tristate
option using depends on USB_XHCI_PCI and depends on !(USB_XHCI_PCI=y && m)?
This would enforce the boot constraint while preserving support for modular
kernel builds.
[ ... ]
> diff --git a/drivers/usb/host/xhci-pci-prom21.c b/drivers/usb/host/xhci-pci-prom21.c
> --- /dev/null
> +++ b/drivers/usb/host/xhci-pci-prom21.c
[ ... ]
> +static int prom21_xhci_create_auxdev(struct pci_dev *pdev)
> +{
> + struct prom21_xhci_auxdev *prom21_auxdev;
> + struct usb_hcd *hcd = pci_get_drvdata(pdev);
[ ... ]
> + prom21_auxdev->auxdev =
> + auxiliary_device_create(&pdev->dev, KBUILD_MODNAME, "hwmon",
> + &prom21_auxdev->pdata,
> + (pci_domain_nr(pdev->bus) << 16) |
> + pci_dev_id(pdev));
Does left-shifting pci_domain_nr() introduce a signed integer overflow
regression?
The function pci_domain_nr() returns a signed int, which can be up to 0xFFFF
on ACPI systems. Left-shifting a value of 0x8000 or greater by 16 bits
alters the sign bit of a 32-bit int, resulting in undefined behavior in C.
Would casting the return value to an unsigned integer, such as
(u32)pci_domain_nr(pdev->bus) << 16, avoid this overflow?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260512213910.871859-1-hurryman2212@gmail.com?part=1
next prev parent reply other threads:[~2026-05-14 0:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 21:39 [PATCH v5 0/2] AMD Promontory 21 xHCI temperature sensor support Jihong Min
2026-05-12 21:39 ` [PATCH v5 1/2] usb: xhci-pci: add AMD Promontory 21 PCI glue Jihong Min
2026-05-14 0:40 ` sashiko-bot [this message]
2026-05-14 1:20 ` Guenter Roeck
2026-05-12 21:39 ` [PATCH v5 2/2] hwmon: add AMD Promontory 21 xHCI temperature sensor support Jihong Min
2026-05-14 1:00 ` sashiko-bot
2026-05-14 1:13 ` Guenter Roeck
2026-05-12 21:49 ` [PATCH v5 0/2] " Jihong Min
2026-05-13 14:48 ` Mario Limonciello
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=20260514004055.1BBCAC19425@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=hurryman2212@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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