linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Vinod Koul <vinod.koul@intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.jf.intel.com>,
	linux-kernel@vger.kernel.org,
	spear-devel <spear-devel@list.st.com>,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH] dw_dmac: apply default dma_mask if needed
Date: Tue, 12 Feb 2013 18:53:22 +0200	[thread overview]
Message-ID: <CAHp75VdST2ik2Bj3EC0dk_Xmv+=DNdUBOM3KoXvF3iJoWp7t_Q@mail.gmail.com> (raw)
In-Reply-To: <20130212161604.GO3789@intel.com>

On Tue, Feb 12, 2013 at 6:16 PM, Vinod Koul <vinod.koul@intel.com> wrote:
> 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.

I've tested this against linux-next. The problem apparently in the
patch which Greg submits earlier:
7331205a "dma: Convert to devm_ioremap_resource()". If you want I
could rebase it against your next branch. I thought you'd seen that
patch already.

>
>> 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
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko

      reply	other threads:[~2013-02-12 16:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29 15:06 [PATCH] dw_dmac: apply default dma_mask if needed Andy Shevchenko
2013-01-29 15:23 ` Viresh Kumar
2013-01-29 16:12   ` Arnd Bergmann
2013-01-30  2:06 ` Viresh Kumar
2013-02-12 16:16 ` Vinod Koul
2013-02-12 16:53   ` Andy Shevchenko [this message]

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='CAHp75VdST2ik2Bj3EC0dk_Xmv+=DNdUBOM3KoXvF3iJoWp7t_Q@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=andriy.shevchenko@linux.jf.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spear-devel@list.st.com \
    --cc=vinod.koul@intel.com \
    --cc=viresh.kumar@linaro.org \
    /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).