* [PATCH 1/1] usb: host: xhci-mem: allocate zeroed Scratchpad Buffer
@ 2017-04-10 11:15 Peter Chen
2017-04-10 13:40 ` Mathias Nyman
0 siblings, 1 reply; 2+ messages in thread
From: Peter Chen @ 2017-04-10 11:15 UTC (permalink / raw)
To: mathias.nyman; +Cc: linux-usb, Peter Chen, stable
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: Peter Chen <peter.chen@nxp.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] usb: host: xhci-mem: allocate zeroed Scratchpad Buffer
2017-04-10 11:15 [PATCH 1/1] usb: host: xhci-mem: allocate zeroed Scratchpad Buffer Peter Chen
@ 2017-04-10 13:40 ` Mathias Nyman
0 siblings, 0 replies; 2+ messages in thread
From: Mathias Nyman @ 2017-04-10 13:40 UTC (permalink / raw)
To: Peter Chen; +Cc: linux-usb, stable
On 10.04.2017 14:15, Peter Chen wrote:
> 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: Peter Chen <peter.chen@nxp.com>
Thanks, adding to queue for usb-linus (4.12-rc2)
-Mathias
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-10 13:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-10 11:15 [PATCH 1/1] usb: host: xhci-mem: allocate zeroed Scratchpad Buffer Peter Chen
2017-04-10 13:40 ` Mathias Nyman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).