From db04aad0d3b3d103ec3b5b7c850c90755ecce42d Mon Sep 17 00:00:00 2001 From: Jack Pham Date: Mon, 10 Dec 2012 14:28:13 -0800 Subject: [PATCH] UPSTREAM: usb: dwc3: debugfs: fix regdump offset As with dwc_readl/writel, the global registers are specified as offsets starting from the beginning of the xHCI address space, but the memory region pointed to by dwc->regs already maps to the start of the global addresses. Fix by offsetting each of the regs relative to DWC3_GLOBALS_REGS_START. Signed-off-by: Jack Pham Signed-off-by: Felipe Balbi (cherry picked from commit 1604c1e760119ab3fe9f71679ebaeb058d3d8ae1) Cherry pick from Linus' tree, applied cleanly BUG=chromium:229725 TEST='cat /sys/kernel/debug/dwc3.0/regdump' should not crash on Snow. Change-Id: Ic58153b9c3f4135355094a5dc49ad0fabb2fcd25 Signed-off-by: Julius Werner Reviewed-on: https://gerrit.chromium.org/gerrit/48554 Reviewed-by: Vincent Palatin --- drivers/usb/dwc3/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c index 553bbaa227ac..34dc342ea93a 100644 --- a/drivers/usb/dwc3/debugfs.c +++ b/drivers/usb/dwc3/debugfs.c @@ -56,7 +56,7 @@ #define dump_register(nm) \ { \ .name = __stringify(nm), \ - .offset = DWC3_ ##nm, \ + .offset = DWC3_ ##nm - DWC3_GLOBALS_REGS_START, \ } static const struct debugfs_reg32 dwc3_regs[] = { -- 2.20.1