lkml.org 
[lkml]   [2013]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dw_dmac: apply default dma_mask if needed
On Tue, Jan 29, 2013 at 05:06:24PM +0200, Andy Shevchenko wrote:
> In some cases we got the device without dma_mask configured. We have to apply
> the default value to avoid crashes during memory mapping.
>
what was this generated against, it fails to apply for me.

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/dma/dw_dmac.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> index e8d0679..a572a1e 100644
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -1673,6 +1673,12 @@ static int dw_probe(struct platform_device *pdev)
> if (IS_ERR(regs))
> return PTR_ERR(regs);
>
> + /* Apply default dma_mask if needed */
> + if (!pdev->dev.dma_mask) {
> + pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
> + pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> + }
> +
> dw_params = dma_read_byaddr(regs, DW_PARAMS);
> autocfg = dw_params >> DW_PARAMS_EN & 0x1;
>
> --
> 1.7.10.4
>


\
 
 \ /
  Last update: 2013-02-12 18:21    [W:0.162 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site