usb: host: xhci-mem: allocate zeroed Scratchpad Buffer
Subsystems (3)
PATCH 1/1 usb: host: xhci-mem: allocate zeroed Scratchpad Buffer
According to xHCI ch4.20 Scratchpad Buffers, the Scratchpad Buffer needs to be zeroed.
...
The following operations take place to allocate Scratchpad Buffers to the xHC:
...
b. Software clears the Scratchpad Buffer to '0'
Cc stable <[email protected]>
Signed-off-by Peter Chen <[email protected]>
--- drivers/usb/host/xhci-mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-mem.c +1 -1
@@ -1718,7 +1718,7 @@ static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags) xhci->dcbaa->dev_context_ptrs[0 ] =cpu_to_le64 (xhci->scratchpad->sp_dma);for (i =0 ; i < num_sp; i++) {dma_addr_t dma; -void *buf =dma_alloc_coherent (dev, xhci->page_size, &dma, +void *buf =dma_zalloc_coherent (dev, xhci->page_size, &dma, flags);if (!buf) goto fail_sp5;
Signature · 1 line
2.7.4
Mathias Nyman
maintainerQuoted 11 lines · Peter Chen
According to xHCI ch4.20 Scratchpad Buffers, the Scratchpad Buffer needs to be zeroed.
...
The following operations take place to allocate
Scratchpad Buffers to the xHC:
...
b. Software clears the Scratchpad Buffer to '0'Cc stable <[email protected]>Signed-off-by Peter Chen <[email protected]>
Thanks, adding to queue for usb-linus (4.12-rc2)
-Mathias