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(-)

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 032a702..580c890 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -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;
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to