* [PATCH] usb: uhci: fix CONFIG_HAS_IOPORT guard in uhci-hcd.h
@ 2026-12-04 2:02 Pengpeng Hou
2026-12-04 2:09 ` sashiko-bot
2026-12-04 14:57 ` Alan Stern
0 siblings, 2 replies; 3+ messages in thread
From: Pengpeng Hou @ 2026-12-04 2:02 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman
Cc: Niklas Schnelle, linux-usb, linux-kernel, Pengpeng Hou
In a UHCI build supporting both PCI and non-PCI host controllers, the
register-access helper tests HAS_IOPORT instead of CONFIG_HAS_IOPORT.
This prevents selection of the port-I/O path even for a PCI controller
with an I/O base.
Use the actual configuration symbol, as the companion code already does.
Keep MMIO for the non-PCI case.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: dc54ce3e603b ("usb: uhci: handle HAS_IOPORT dependencies")
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
The original patch was prepared with Gemini. Codex assisted with this
review and revision (Assisted-by: gpt 5).
Built uhci-hcd.o for ARM with Clang 18 and W=1 using the same mixed PCI
and non-PCI configuration before and after the change. The preprocessed
UHCI code gained the runtime PCI I/O-address check. No controller was
exercised.
drivers/usb/host/uhci-hcd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
index 4326d1f3ca768d02cf241f5c1275a840f504b711..f66bd22638dac06cacc684f5d2f7bcbf0fa5deb3 100644
--- a/drivers/usb/host/uhci-hcd.h
+++ b/drivers/usb/host/uhci-hcd.h
@@ -548,7 +548,7 @@ static inline void uhci_writeb(const struct uhci_hcd *uhci, u8 val, int reg)
#else
/* Support non-PCI host controllers */
-#if defined(CONFIG_USB_PCI) && defined(HAS_IOPORT)
+#if defined(CONFIG_USB_PCI) && defined(CONFIG_HAS_IOPORT)
/* Support PCI and non-PCI host controllers */
#define uhci_has_pci_registers(u) ((u)->io_addr != 0)
#else
base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] usb: uhci: fix CONFIG_HAS_IOPORT guard in uhci-hcd.h
2026-12-04 2:02 [PATCH] usb: uhci: fix CONFIG_HAS_IOPORT guard in uhci-hcd.h Pengpeng Hou
@ 2026-12-04 2:09 ` sashiko-bot
2026-12-04 14:57 ` Alan Stern
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-12-04 2:09 UTC (permalink / raw)
To: Pengpeng Hou; +Cc: linux-usb
> In a UHCI build supporting both PCI and non-PCI host controllers, the
> register-access helper tests HAS_IOPORT instead of CONFIG_HAS_IOPORT.
> This prevents selection of the port-I/O path even for a PCI controller
> with an I/O base.
>
> Use the actual configuration symbol, as the companion code already does.
> Keep MMIO for the non-PCI case.
>
> The issue was found by our static-analysis tool and manually reviewed.
>
> Fixes: dc54ce3e603b ("usb: uhci: handle HAS_IOPORT dependencies")
> Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/179634977291.74470.11965497793381468974@163.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] usb: uhci: fix CONFIG_HAS_IOPORT guard in uhci-hcd.h
2026-12-04 2:02 [PATCH] usb: uhci: fix CONFIG_HAS_IOPORT guard in uhci-hcd.h Pengpeng Hou
2026-12-04 2:09 ` sashiko-bot
@ 2026-12-04 14:57 ` Alan Stern
1 sibling, 0 replies; 3+ messages in thread
From: Alan Stern @ 2026-12-04 14:57 UTC (permalink / raw)
To: Pengpeng Hou; +Cc: Greg Kroah-Hartman, Niklas Schnelle, linux-usb, linux-kernel
On Fri, Dec 04, 2026 at 10:02:53AM +0800, Pengpeng Hou wrote:
> In a UHCI build supporting both PCI and non-PCI host controllers, the
> register-access helper tests HAS_IOPORT instead of CONFIG_HAS_IOPORT.
> This prevents selection of the port-I/O path even for a PCI controller
> with an I/O base.
>
> Use the actual configuration symbol, as the companion code already does.
> Keep MMIO for the non-PCI case.
>
> The issue was found by our static-analysis tool and manually reviewed.
>
> Fixes: dc54ce3e603b ("usb: uhci: handle HAS_IOPORT dependencies")
> Signed-off-by: Pengpeng Hou <hppiscas@163.com>
> ---
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
We rely so heavily on the compiler to warn about misspelled names, we
forget that the preprocessor doesn't always do it. Thanks for fixing
this.
Alan Stern
> The original patch was prepared with Gemini. Codex assisted with this
> review and revision (Assisted-by: gpt 5).
> Built uhci-hcd.o for ARM with Clang 18 and W=1 using the same mixed PCI
> and non-PCI configuration before and after the change. The preprocessed
> UHCI code gained the runtime PCI I/O-address check. No controller was
> exercised.
>
> drivers/usb/host/uhci-hcd.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
> index 4326d1f3ca768d02cf241f5c1275a840f504b711..f66bd22638dac06cacc684f5d2f7bcbf0fa5deb3 100644
> --- a/drivers/usb/host/uhci-hcd.h
> +++ b/drivers/usb/host/uhci-hcd.h
> @@ -548,7 +548,7 @@ static inline void uhci_writeb(const struct uhci_hcd *uhci, u8 val, int reg)
>
> #else
> /* Support non-PCI host controllers */
> -#if defined(CONFIG_USB_PCI) && defined(HAS_IOPORT)
> +#if defined(CONFIG_USB_PCI) && defined(CONFIG_HAS_IOPORT)
> /* Support PCI and non-PCI host controllers */
> #define uhci_has_pci_registers(u) ((u)->io_addr != 0)
> #else
>
> base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-04 14:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 2:02 [PATCH] usb: uhci: fix CONFIG_HAS_IOPORT guard in uhci-hcd.h Pengpeng Hou
2026-12-04 2:09 ` sashiko-bot
2026-12-04 14:57 ` Alan Stern
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.