Commit 7480d912 authored by Peter Chen's avatar Peter Chen Committed by Greg Kroah-Hartman

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 <stable@vger.kernel.org>
Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a0c16630
...@@ -1724,7 +1724,7 @@ static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags) ...@@ -1724,7 +1724,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); xhci->dcbaa->dev_context_ptrs[0] = cpu_to_le64(xhci->scratchpad->sp_dma);
for (i = 0; i < num_sp; i++) { for (i = 0; i < num_sp; i++) {
dma_addr_t dma; 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); flags);
if (!buf) if (!buf)
goto fail_sp4; goto fail_sp4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment