From: Vinod Koul <vinod.koul@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.jf.intel.com>
Cc: linux-kernel@vger.kernel.org,
spear-devel <spear-devel@list.st.com>,
Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH v2] dw_dmac: apply default dma_mask if needed
Date: Thu, 14 Feb 2013 15:15:16 +0530 [thread overview]
Message-ID: <20130214094515.GC27887@intel.com> (raw)
In-Reply-To: <1360831270-5777-1-git-send-email-andriy.shevchenko@linux.intel.com>
On Thu, Feb 14, 2013 at 10:41:09AM +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.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Applied, thanks
> ---
> Since v1:
> - rebased on top of recent next branch from Vinod
> 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 6694676..4c83f18 100644
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -1661,6 +1661,12 @@ static int dw_probe(struct platform_device *pdev)
> if (!regs)
> return -EBUSY;
>
> + /* 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
>
prev parent reply other threads:[~2013-02-14 9:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-14 8:41 [PATCH v2] dw_dmac: apply default dma_mask if needed Andy Shevchenko
2013-02-14 9:45 ` Vinod Koul [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=20130214094515.GC27887@intel.com \
--to=vinod.koul@intel.com \
--cc=andriy.shevchenko@linux.jf.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=spear-devel@list.st.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