* [PATCH V2] usb:host:xhci-plat: 64-bit dma addressing support
@ 2014-11-04 19:06 Feng Kan
2014-11-14 0:22 ` Feng Kan
0 siblings, 1 reply; 2+ messages in thread
From: Feng Kan @ 2014-11-04 19:06 UTC (permalink / raw)
To: patches, linux-usb, linux-kernel, mathias.nyman; +Cc: Feng Kan, Bao Truong
Use dma_addr_t to support 64-bit plaforms, which access beyond the default
32 bit address range.
Signed-off-by: Bao Truong <btruong@apm.com>
Signed-off-by: Feng Kan <fkan@apm.com>
---
Changes:
V2: fixed GKH's comment regarding not mark up the comment after
code change.
drivers/usb/host/xhci-plat.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 3d78b0c..f75764f 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -96,14 +96,18 @@ static int xhci_plat_probe(struct platform_device *pdev)
return ret;
}
- /* Initialize dma_mask and coherent_dma_mask to 32-bits */
- ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+ /*
+ * Initialize dma_mask and coherent_dma_mask to valid DMA or bus
+ * address for the platform.
+ */
+ ret = dma_set_coherent_mask(&pdev->dev,
+ DMA_BIT_MASK(sizeof(dma_addr_t)*8));
if (ret)
return ret;
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
else
- dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+ dma_set_mask(&pdev->dev, DMA_BIT_MASK(sizeof(dma_addr_t)*8));
hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
if (!hcd)
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH V2] usb:host:xhci-plat: 64-bit dma addressing support
2014-11-04 19:06 [PATCH V2] usb:host:xhci-plat: 64-bit dma addressing support Feng Kan
@ 2014-11-14 0:22 ` Feng Kan
0 siblings, 0 replies; 2+ messages in thread
From: Feng Kan @ 2014-11-14 0:22 UTC (permalink / raw)
To: patches, linux-usb, linux-kernel, mathias.nyman; +Cc: Feng Kan, Bao Truong
Just want to ping this again to see if there is any comments, thanks.
On Tue, Nov 4, 2014 at 11:06 AM, Feng Kan <fkan@apm.com> wrote:
> Use dma_addr_t to support 64-bit plaforms, which access beyond the default
> 32 bit address range.
>
> Signed-off-by: Bao Truong <btruong@apm.com>
> Signed-off-by: Feng Kan <fkan@apm.com>
> ---
> Changes:
> V2: fixed GKH's comment regarding not mark up the comment after
> code change.
>
> drivers/usb/host/xhci-plat.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 3d78b0c..f75764f 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -96,14 +96,18 @@ static int xhci_plat_probe(struct platform_device *pdev)
> return ret;
> }
>
> - /* Initialize dma_mask and coherent_dma_mask to 32-bits */
> - ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
> + /*
> + * Initialize dma_mask and coherent_dma_mask to valid DMA or bus
> + * address for the platform.
> + */
> + ret = dma_set_coherent_mask(&pdev->dev,
> + DMA_BIT_MASK(sizeof(dma_addr_t)*8));
> if (ret)
> return ret;
> if (!pdev->dev.dma_mask)
> pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
> else
> - dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
> + dma_set_mask(&pdev->dev, DMA_BIT_MASK(sizeof(dma_addr_t)*8));
>
> hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
> if (!hcd)
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-14 0:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-04 19:06 [PATCH V2] usb:host:xhci-plat: 64-bit dma addressing support Feng Kan
2014-11-14 0:22 ` Feng Kan
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).