From: "Thang Q. Nguyen" <tqnguyen@apm.com>
To: Felipe Balbi <balbi@ti.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arm@lists.infradead.org
Cc: Phong Vo <pvo@apm.com>, Loc Ho <lho@apm.com>, patches <patches@apm.com>
Subject: RE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system
Date: Tue, 16 Feb 2016 17:56:01 +0700 [thread overview]
Message-ID: <8dd0ee5befa7b1200878af7615e3b22d@mail.gmail.com> (raw)
In-Reply-To: <1453731985-13835-1-git-send-email-tqnguyen@apm.com>
Hi,
Do you have any more feedback on this patch?
Thanks,
Thang Q. Nguyen -
-----Original Message-----
From: Thang Q. Nguyen [mailto:tqnguyen@apm.com]
Sent: Monday, January 25, 2016 9:26 PM
To: Felipe Balbi; Greg Kroah-Hartman; linux-usb@vger.kernel.org;
linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org;
linux-arm@lists.infradead.org
Cc: Thang Nguyen; Phong Vo; Loc Ho; patches@apm.com
Subject: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system
Add 64-bit DMA operation support to the USB DWC3 driver.
First attempt to set the coherent DMA mask for 64-bit DMA.
If that failed, attempt again with 32-bit DMA.
Signed-off-by: Thang Q. Nguyen <tqnguyen@apm.com>
---
Changes from v1:
- Remove WARN_ON if dma_mask is NULL
drivers/usb/dwc3/core.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index
de5e01f..2479c24 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -831,6 +831,21 @@ static int dwc3_probe(struct platform_device *pdev)
dwc->mem = mem;
dwc->dev = dev;
+ /* Try to set 64-bit DMA first */
+ if (!pdev->dev.dma_mask)
+ /* Platform did not initialize dma_mask */
+ ret = dma_coerce_mask_and_coherent(&pdev->dev,
+ DMA_BIT_MASK(64));
+ else
+ ret = dma_set_mask_and_coherent(&pdev->dev,
DMA_BIT_MASK(64));
+
+ /* If seting 64-bit DMA mask fails, fall back to 32-bit DMA mask
*/
+ if (ret) {
+ ret = dma_set_mask_and_coherent(&pdev->dev,
DMA_BIT_MASK(32));
+ if (ret)
+ return ret;
+ }
+
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res) {
dev_err(dev, "missing IRQ\n");
next prev parent reply other threads:[~2016-02-16 10:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 14:26 [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system Thang Q. Nguyen
2016-01-25 14:26 ` [PATCH v2 2/2] usb:dwc3: pass arch data to xhci-hcd child Thang Q. Nguyen
[not found] ` <1453731985-13835-2-git-send-email-tqnguyen-qTEPVZfXA3Y@public.gmane.org>
2016-02-16 10:56 ` Thang Q. Nguyen
2016-03-10 4:10 ` Thang Q. Nguyen
2016-02-16 10:56 ` Thang Q. Nguyen [this message]
2016-03-10 4:09 ` [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system Thang Q. Nguyen
[not found] ` <0167d2d94eb773138609361a34d88f90-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-10 8:15 ` Felipe Balbi
[not found] ` <87ziu6d9zz.fsf-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-03-10 8:47 ` Thang Q. Nguyen
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=8dd0ee5befa7b1200878af7615e3b22d@mail.gmail.com \
--to=tqnguyen@apm.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=lho@apm.com \
--cc=linux-arm@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=patches@apm.com \
--cc=pvo@apm.com \
/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 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).