From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: barebox@lists.infradead.org
Cc: Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: [PATCH] usb: host: ohci: restrict the driver to 32-bit builds
Date: Tue, 1 Dec 2026 14:41:54 +0300 [thread overview]
Message-ID: <20261201114154.983992-1-eagle.alexander923@gmail.com> (raw)
The OHCI driver stores physical addresses in the host controller's 32-bit
ED/TD link fields and converts them back with casts like
((struct ed *)m32_swap((unsigned long)ed_p))->hwNextED
Adding a 64BIT (i.e. x86_64) randconfig makes USB_OHCI selectable and the
build then fails with 18 int-to-pointer-cast / pointer-to-int-cast errors:
drivers/usb/host/ohci-hcd.c:608:46: error: cast to pointer from integer
of different size [-Werror=int-to-pointer-cast]
The driver has always been 32-bit only in practice: it depends on !MMU and
every board using it (dss11, at91) is a 32-bit ARM target. Fixing the casts
properly means teaching the ED/TD handling about 64-bit physical addresses,
which the hardware spec cannot express without the HCCA/ED layout changes
Linux does through hc32_to_cpup()/cpu_to_hc32().
Until such a port exists, make the 32-bit requirement explicit in Kconfig
so that randconfig cannot enable an unbuildable configuration.
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
drivers/usb/host/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 186c17fecc..b879ed0f2c 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -34,7 +34,7 @@ config USB_EFI_IO_PROTOCOL
config USB_OHCI
bool "OHCI driver"
- depends on !MMU && HAS_DMA
+ depends on !MMU && HAS_DMA && !64BIT
config USB_OHCI_AT91
depends on ARCH_AT91
--
2.54.0
reply other threads:[~2026-12-01 11:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261201114154.983992-1-eagle.alexander923@gmail.com \
--to=eagle.alexander923@gmail.com \
--cc=barebox@lists.infradead.org \
/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