linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system
@ 2016-01-25 14:26 Thang Q. Nguyen
  2016-01-25 14:26 ` [PATCH v2 2/2] usb:dwc3: pass arch data to xhci-hcd child Thang Q. Nguyen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Thang Q. Nguyen @ 2016-01-25 14:26 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-omap,
	linux-kernel, linux-arm
  Cc: Thang Nguyen, Phong Vo, Loc Ho, patches

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] usb:dwc3: pass arch data to xhci-hcd child
  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 ` Thang Q. Nguyen
  2016-02-16 10:56   ` Thang Q. Nguyen
  2016-03-10  4:10   ` Thang Q. Nguyen
  2016-02-16 10:56 ` [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system Thang Q. Nguyen
  2016-03-10  4:09 ` Thang Q. Nguyen
  2 siblings, 2 replies; 8+ messages in thread
From: Thang Q. Nguyen @ 2016-01-25 14:26 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-omap,
	linux-kernel, linux-arm
  Cc: Thang Nguyen, Phong Vo, Loc Ho, patches

The xhci-hcd child node needs to inherit archdata attribute to use
dma_ops functions and attributes. This patch enables the USB DWC3
driver to pass archdata attributes to its xhci-hcd child node.

Signed-off-by: Thang Q. Nguyen <tqnguyen@apm.com>
---
Changes from v1:
	- None

 drivers/usb/dwc3/host.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index c679f63..661fbae 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -37,6 +37,7 @@ int dwc3_host_init(struct dwc3 *dwc)
 	xhci->dev.parent	= dwc->dev;
 	xhci->dev.dma_mask	= dwc->dev->dma_mask;
 	xhci->dev.dma_parms	= dwc->dev->dma_parms;
+	xhci->dev.archdata      = dwc->dev->archdata;
 
 	dwc->xhci = xhci;
 
-- 
2.2.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system
  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
@ 2016-02-16 10:56 ` Thang Q. Nguyen
  2016-03-10  4:09 ` Thang Q. Nguyen
  2 siblings, 0 replies; 8+ messages in thread
From: Thang Q. Nguyen @ 2016-02-16 10:56 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-omap,
	linux-kernel, linux-arm
  Cc: Phong Vo, Loc Ho, patches

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v2 2/2] usb:dwc3: pass arch data to xhci-hcd child
  2016-01-25 14:26 ` [PATCH v2 2/2] usb:dwc3: pass arch data to xhci-hcd child Thang Q. Nguyen
@ 2016-02-16 10:56   ` Thang Q. Nguyen
  2016-03-10  4:10   ` Thang Q. Nguyen
  1 sibling, 0 replies; 8+ messages in thread
From: Thang Q. Nguyen @ 2016-02-16 10:56 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-omap,
	linux-kernel, linux-arm
  Cc: Phong Vo, Loc Ho, patches

Hi,
Do you have any feedback on this change?

Regards,
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 2/2] usb:dwc3: pass arch data to xhci-hcd child

The xhci-hcd child node needs to inherit archdata attribute to use dma_ops
functions and attributes. This patch enables the USB DWC3 driver to pass
archdata attributes to its xhci-hcd child node.

Signed-off-by: Thang Q. Nguyen <tqnguyen@apm.com>
---
Changes from v1:
	- None

 drivers/usb/dwc3/host.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index
c679f63..661fbae 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -37,6 +37,7 @@ int dwc3_host_init(struct dwc3 *dwc)
 	xhci->dev.parent	= dwc->dev;
 	xhci->dev.dma_mask	= dwc->dev->dma_mask;
 	xhci->dev.dma_parms	= dwc->dev->dma_parms;
+	xhci->dev.archdata      = dwc->dev->archdata;

 	dwc->xhci = xhci;

--
2.2.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system
  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
  2016-02-16 10:56 ` [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system Thang Q. Nguyen
@ 2016-03-10  4:09 ` Thang Q. Nguyen
  2016-03-10  8:15   ` Felipe Balbi
  2 siblings, 1 reply; 8+ messages in thread
From: Thang Q. Nguyen @ 2016-03-10  4:09 UTC (permalink / raw)
  To: Thang Q. Nguyen, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-omap, linux-kernel, linux-arm
  Cc: Phong Vo, Loc Ho, patches

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v2 2/2] usb:dwc3: pass arch data to xhci-hcd child
  2016-01-25 14:26 ` [PATCH v2 2/2] usb:dwc3: pass arch data to xhci-hcd child Thang Q. Nguyen
  2016-02-16 10:56   ` Thang Q. Nguyen
@ 2016-03-10  4:10   ` Thang Q. Nguyen
  1 sibling, 0 replies; 8+ messages in thread
From: Thang Q. Nguyen @ 2016-03-10  4:10 UTC (permalink / raw)
  To: Thang Q. Nguyen, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-omap, linux-kernel, linux-arm
  Cc: Phong Vo, Loc Ho, patches

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 2/2] usb:dwc3: pass arch data to xhci-hcd child

The xhci-hcd child node needs to inherit archdata attribute to use dma_ops
functions and attributes. This patch enables the USB DWC3 driver to pass
archdata attributes to its xhci-hcd child node.

Signed-off-by: Thang Q. Nguyen <tqnguyen@apm.com>
---
Changes from v1:
	- None

 drivers/usb/dwc3/host.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index
c679f63..661fbae 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -37,6 +37,7 @@ int dwc3_host_init(struct dwc3 *dwc)
 	xhci->dev.parent	= dwc->dev;
 	xhci->dev.dma_mask	= dwc->dev->dma_mask;
 	xhci->dev.dma_parms	= dwc->dev->dma_parms;
+	xhci->dev.archdata      = dwc->dev->archdata;

 	dwc->xhci = xhci;

--
2.2.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system
  2016-03-10  4:09 ` Thang Q. Nguyen
@ 2016-03-10  8:15   ` Felipe Balbi
  2016-03-10  8:47     ` Thang Q. Nguyen
  0 siblings, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2016-03-10  8:15 UTC (permalink / raw)
  To: Thang Q. Nguyen, Thang Q. Nguyen, Felipe Balbi,
	Greg Kroah-Hartman, linux-usb, linux-omap, linux-kernel,
	linux-arm
  Cc: Phong Vo, Loc Ho, patches

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]


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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system
  2016-03-10  8:15   ` Felipe Balbi
@ 2016-03-10  8:47     ` Thang Q. Nguyen
  0 siblings, 0 replies; 8+ messages in thread
From: Thang Q. Nguyen @ 2016-03-10  8:47 UTC (permalink / raw)
  To: Felipe Balbi, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-omap, linux-kernel, linux-arm
  Cc: Phong Vo, Loc Ho, patches

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-03-10  8:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2016-02-16 10:56   ` Thang Q. Nguyen
2016-03-10  4:10   ` Thang Q. Nguyen
2016-02-16 10:56 ` [PATCH v2 1/2] usb:dwc3: Enable support for 64-bit system Thang Q. Nguyen
2016-03-10  4:09 ` Thang Q. Nguyen
2016-03-10  8:15   ` Felipe Balbi
2016-03-10  8:47     ` Thang Q. Nguyen

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