Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1354839 > unrolled thread

RE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system

Started by"Thang Q. Nguyen" <tqnguyen@apm.com>
First post2016-03-10 05:10 +0100
Last post2016-03-10 09:50 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system "Thang Q. Nguyen" <tqnguyen@apm.com> - 2016-03-10 05:10 +0100
    RE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system Felipe Balbi <felipe.balbi@linux.intel.com> - 2016-03-10 09:20 +0100
      RE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system "Thang Q. Nguyen" <tqnguyen@apm.com> - 2016-03-10 09:50 +0100

#1354839 — RE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system

From"Thang Q. Nguyen" <tqnguyen@apm.com>
Date2016-03-10 05:10 +0100
SubjectRE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system
Message-ID<rb05c-1w0-9@gated-at.bofh.it>
Hi,
I would like to ask if I need to update anything else for this change?

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");
--
2.2.0

[toc] | [next] | [standalone]


#1354910

FromFelipe Balbi <felipe.balbi@linux.intel.com>
Date2016-03-10 09:20 +0100
Message-ID<rb3Z7-47H-3@gated-at.bofh.it>
In reply to#1354839

[Multipart message — attachments visible in raw view] — view raw

Hi,

"Thang Q. Nguyen" <tqnguyen@apm.com> writes:
> [ text/plain ]
> Hi,
> I would like to ask if I need to update anything else for this change?

seems like I don't have original patch in my inbox. Please resend.

-- 
balbi

[toc] | [prev] | [next] | [standalone]


#1354927

From"Thang Q. Nguyen" <tqnguyen@apm.com>
Date2016-03-10 09:50 +0100
Message-ID<rb4sa-4iX-9@gated-at.bofh.it>
In reply to#1354910
Thanks Felipe for your feedback.
I will re-generate patches and resend.

Regards,
Thang Q. Nguyen -
-----Original Message-----
From: Felipe Balbi [mailto:felipe.balbi@linux.intel.com]
Sent: Thursday, March 10, 2016 3:15 PM
To: Thang Q. Nguyen; Thang Q. Nguyen; 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: Phong Vo; Loc Ho; patches
Subject: RE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system


Hi,

"Thang Q. Nguyen" <tqnguyen@apm.com> writes:
> [ text/plain ]
> Hi,
> I would like to ask if I need to update anything else for this change?

seems like I don't have original patch in my inbox. Please resend.

-- 
balbi

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web