All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>, Peter Chen <peter.chen@nxp.com>,
	stable <stable@vger.kernel.org>,
	Mathias Nyman <mathias.nyman@linux.intel.com>
Subject: [PATCH 3/8] usb: host: xhci-mem: allocate zeroed Scratchpad Buffer
Date: Wed, 17 May 2017 18:32:01 +0300	[thread overview]
Message-ID: <1495035126-29091-4-git-send-email-mathias.nyman@linux.intel.com> (raw)
In-Reply-To: <1495035126-29091-1-git-send-email-mathias.nyman@linux.intel.com>

From: Peter Chen <peter.chen@nxp.com>

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>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.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 69428e9..12b573c 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -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);
 	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_sp4;
-- 
1.9.1

  parent reply	other threads:[~2017-05-17 15:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1495035126-29091-1-git-send-email-mathias.nyman@linux.intel.com>
2017-05-17 15:32 ` [PATCH 2/8] xhci: apply PME_STUCK_QUIRK and MISSING_CAS quirk for Denverton Mathias Nyman
2017-05-17 15:32 ` Mathias Nyman [this message]
2017-05-17 15:32 ` [PATCH 5/8] USB: xhci: fix lock-inversion problem Mathias Nyman
2017-05-17 15:32 ` [PATCH 6/8] xhci: remove GFP_DMA flag from allocation Mathias Nyman
2017-05-19  9:10   ` David Laight
2017-05-19  9:49     ` Mathias Nyman
2017-05-19 13:54       ` David Laight
2017-05-17 15:32 ` [PATCH 7/8] xhci: Fix command ring stop regression in 4.11 Mathias Nyman
2017-05-17 15:32 ` [PATCH 8/8] usb: host: xhci-plat: propagate return value of platform_get_irq() Mathias Nyman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495035126-29091-4-git-send-email-mathias.nyman@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@nxp.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.