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

Configure Feed

Select the types of activity you want to include in your feed.

usb: xhci: move reserving command ring trb

Move the command ring TRB reservation from xhci_mem_init() to xhci_init().

Function xhci_mem_init() is intended for memory allocation,
while xhci_init() is for initialization.

This split allows xhci_init() to be reused when resuming from S4
suspend-to-disk.

Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://patch.msgid.link/20260402131342.2628648-8-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Niklas Neronin and committed by
Greg Kroah-Hartman
b1ebf192 0837c87f

+6 -7
-7
drivers/usb/host/xhci-mem.c
··· 2485 2485 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "First segment DMA is 0x%pad", 2486 2486 &xhci->cmd_ring->first_seg->dma); 2487 2487 2488 - /* 2489 - * Reserve one command ring TRB for disabling LPM. 2490 - * Since the USB core grabs the shared usb_bus bandwidth mutex before 2491 - * disabling LPM, we only need to reserve one TRB for all devices. 2492 - */ 2493 - xhci->cmd_ring_reserved_trbs++; 2494 - 2495 2488 /* Allocate and set up primary interrupter 0 with an event ring. */ 2496 2489 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Allocating primary event ring"); 2497 2490 xhci->interrupters = kcalloc_node(xhci->max_interrupters, sizeof(*xhci->interrupters),
+6
drivers/usb/host/xhci.c
··· 564 564 /* Set the Number of Device Slots Enabled to the maximum supported value */ 565 565 xhci_enable_max_dev_slots(xhci); 566 566 567 + /* 568 + * Reserve one command ring TRB for disabling LPM. 569 + * Since the USB core grabs the shared usb_bus bandwidth mutex before 570 + * disabling LPM, we only need to reserve one TRB for all devices. 571 + */ 572 + xhci->cmd_ring_reserved_trbs = 1; 567 573 /* Set the address in the Command Ring Control register */ 568 574 xhci_set_cmd_ring_deq(xhci); 569 575