From: Umang Jain <uajain@igalia.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Lucas De Marchi <demarchi@kernel.org>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-dev@igalia.com, Umang Jain <uajain@igalia.com>
Subject: [RFC PATCH v1 3/3] WIP: early: xhci-xdbc: Map lower and with 0 offset to partially work
Date: Thu, 4 Jun 2026 20:11:22 +0530 [thread overview]
Message-ID: <20260604144122.962236-4-uajain@igalia.com> (raw)
In-Reply-To: <20260604144122.962236-1-uajain@igalia.com>
Map the area slightly lower than max fixmap. Detect the offset of xhci
xdbc cap and remap it again, so that the offset becomes 0.
----
>> This is investigation patch to get early xdbc attached to host
>> successfully. Without this, the xdbc doesn't attach to host.
on host:
[180056.895751] usb usb4-port2: attempt power cycle
[180059.049494] usb 4-2: Device not responding to setup address.
[180059.262513] usb 4-2: Device not responding to setup address.
[180059.463201] usb 4-2: device not accepting address 81, error -71
[180059.651391] usb 4-2: Device not responding to setup address.
[180059.862171] usb 4-2: Device not responding to setup address.
[180060.065072] usb 4-2: device not accepting address 82, error -71
on target:
[ 5.779884] xhci_dbc:xdbc_start: waiting for device configuration timed out
[ 5.779891] xhci_dbc:early_xdbc_setup_hardware: failed to setup the connection to host
----
This patches atleast makes the target attach to xhci host at
/dev/ttyUSB0. It's meant to debug and discuss the core issue as a
"clue".
Signed-off-by: Umang Jain <uajain@igalia.com>
---
drivers/usb/early/xhci-dbc.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c
index 1f6a129d4b5d..b2bde2e8f85f 100644
--- a/drivers/usb/early/xhci-dbc.c
+++ b/drivers/usb/early/xhci-dbc.c
@@ -95,6 +95,9 @@ static void __iomem * __init xdbc_map_pci_mmio(u32 bus, u32 dev, u32 func)
return early_ioremap(val64, sz64);
}
+ /* Do not fill all fixed page slots in one go. */
+ fixmap_size = fixmap_size / 2;
+
/*
* Base address size is greater than fixed size boot mappings,
* hence iterate over the region one fixmap_size at a time.
@@ -110,6 +113,14 @@ static void __iomem * __init xdbc_map_pci_mmio(u32 bus, u32 dev, u32 func)
early_iounmap(base, fixmap_size);
base = early_ioremap(val64 + offset, XDBC_MAPPING_SIZE);
}
+
+ pr_notice("Found CAPS_DEBUG: mapped size: %llu, \
+ fixmap_size: %llu, offset: %d, page_size:%d\n",
+ mapped_size, fixmap_size, offset, 1 << PAGE_SHIFT);
+
+ early_iounmap(base, fixmap_size);
+ base = early_ioremap(val64+offset, fixmap_size);
+
break;
}
@@ -681,17 +692,7 @@ int __init early_xdbc_parse_parameter(char *s, int keep_early)
if (!xdbc.xhci_base)
return -EINVAL;
- /* Locate DbC registers: */
- offset = xhci_find_next_ext_cap(xdbc.xhci_base, 0, XHCI_EXT_CAPS_DEBUG);
- if (!offset) {
- pr_notice("xhci host doesn't support debug capability\n");
- early_iounmap(xdbc.xhci_base, xdbc.xhci_base_length);
- xdbc.xhci_base = NULL;
- xdbc.xhci_base_length = 0;
-
- return -ENODEV;
- }
- xdbc.xdbc_reg = (struct xdbc_regs __iomem *)(xdbc.xhci_base + offset);
+ xdbc.xdbc_reg = (struct xdbc_regs __iomem *)(xdbc.xhci_base);
return 0;
}
--
2.53.0
prev parent reply other threads:[~2026-06-04 14:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 14:41 [RFC PATCH v1 0/3] usb: early: xhci-dbc: Handle out-of-bound Umang Jain
2026-06-04 14:41 ` [RFC PATCH v1 1/3] usb: early: xhci-dbc: Track early_ioremap size separately Umang Jain
2026-06-04 14:41 ` [RFC PATCH v1 2/3] early: usb: xhci-dbc: Handle out of bounds xhci-xdbc capability Umang Jain
2026-06-05 18:16 ` Mathias Nyman
2026-06-04 14:41 ` Umang Jain [this message]
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=20260604144122.962236-4-uajain@igalia.com \
--to=uajain@igalia.com \
--cc=demarchi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@linux.intel.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®