Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xhci: Add a quirk for writing ERST in high-low order

This quirk is for the controller that has a limitation in supporting
separate ERSTBA_HI and ERSTBA_LO programming. It's supported when
the ERSTBA is programmed ERSTBA_HI before ERSTBA_LO. That's because
the internal initialization of event ring fetches the
"Event Ring Segment Table Entry" based on the indication of ERSTBA_LO
written.

Signed-off-by: Daehwan Jung <dh10.jung@samsung.com>
Link: https://lore.kernel.org/r/1718019553-111939-3-git-send-email-dh10.jung@samsung.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Daehwan Jung and committed by
Greg Kroah-Hartman
bc162403 b7ec7fd6

+6 -1
+4 -1
drivers/usb/host/xhci-mem.c
··· 2325 2325 erst_base = xhci_read_64(xhci, &ir->ir_set->erst_base); 2326 2326 erst_base &= ERST_BASE_RSVDP; 2327 2327 erst_base |= ir->erst.erst_dma_addr & ~ERST_BASE_RSVDP; 2328 - xhci_write_64(xhci, erst_base, &ir->ir_set->erst_base); 2328 + if (xhci->quirks & XHCI_WRITE_64_HI_LO) 2329 + hi_lo_writeq(erst_base, &ir->ir_set->erst_base); 2330 + else 2331 + xhci_write_64(xhci, erst_base, &ir->ir_set->erst_base); 2329 2332 2330 2333 /* Set the event ring dequeue address of this interrupter */ 2331 2334 xhci_set_hc_event_deq(xhci, ir);
+2
drivers/usb/host/xhci.h
··· 17 17 #include <linux/kernel.h> 18 18 #include <linux/usb/hcd.h> 19 19 #include <linux/io-64-nonatomic-lo-hi.h> 20 + #include <linux/io-64-nonatomic-hi-lo.h> 20 21 21 22 /* Code sharing between pci-quirks and xhci hcd */ 22 23 #include "xhci-ext-caps.h" ··· 1629 1628 #define XHCI_RESET_TO_DEFAULT BIT_ULL(44) 1630 1629 #define XHCI_ZHAOXIN_TRB_FETCH BIT_ULL(45) 1631 1630 #define XHCI_ZHAOXIN_HOST BIT_ULL(46) 1631 + #define XHCI_WRITE_64_HI_LO BIT_ULL(47) 1632 1632 1633 1633 unsigned int num_active_eps; 1634 1634 unsigned int limit_active_eps;