All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Arnd Bergmann <arnd@arndb.de>, Tony Lindgren <tony@atomide.com>,
	Matt Porter <mporter@kernel.crashing.org>,
	dmaengine@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: Stricter legacy checking in dma_request_slave_channel_compat()
Date: Thu, 20 Aug 2015 06:43:36 +0000	[thread overview]
Message-ID: <20150820063136.GD13546@localhost> (raw)
In-Reply-To: <1439816935-27554-1-git-send-email-geert+renesas@glider.be>

On Mon, Aug 17, 2015 at 03:08:55PM +0200, Geert Uytterhoeven wrote:
> dma_request_slave_channel_compat() is meant for drivers that support
> both DT and legacy platform device based probing: if DT channel DMA
> setup fails, it will fall back to platform data based DMA channel setup,
> using hardcoded DMA channel IDs and a filter function.
> 
> However, if the DTS doesn't provide a "dmas" property for the device,
> the fallback is also used. If the legacy filter function is not
> hardcoded in the DMA slave driver, but comes from platform data, it will
> be NULL. Then dma_request_slave_channel_compat() will succeed
> incorrectly, and return a DMA channel, as a NULL legacy filter function
> actually means "all channels are OK", not "do not match".
> 
> Later, when trying to use that DMA channel, it will fail with:
> 
>     rcar-dmac e6700000.dma-controller: rcar_dmac_prep_slave_sg: bad parameter: len=1, id=-22
> 
> To fix this, ensure that both the filter function and the DMA channel ID
> are not NULL before using the legacy fallback.
> 
> Note that some DMA slave drivers can handle this failure, and will fall
> back to PIO.
> 
> See also commit 056f6c87028544de ("dmaengine: shdma: Make dummy
> shdma_chan_filter() always return false"), which fixed the same issue
> for the case where shdma_chan_filter() is hardcoded in a DMA slave
> driver.

Applied, thanks

-- 
~Vinod


WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Arnd Bergmann <arnd@arndb.de>, Tony Lindgren <tony@atomide.com>,
	Matt Porter <mporter@kernel.crashing.org>,
	dmaengine@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: Stricter legacy checking in dma_request_slave_channel_compat()
Date: Thu, 20 Aug 2015 12:01:36 +0530	[thread overview]
Message-ID: <20150820063136.GD13546@localhost> (raw)
In-Reply-To: <1439816935-27554-1-git-send-email-geert+renesas@glider.be>

On Mon, Aug 17, 2015 at 03:08:55PM +0200, Geert Uytterhoeven wrote:
> dma_request_slave_channel_compat() is meant for drivers that support
> both DT and legacy platform device based probing: if DT channel DMA
> setup fails, it will fall back to platform data based DMA channel setup,
> using hardcoded DMA channel IDs and a filter function.
> 
> However, if the DTS doesn't provide a "dmas" property for the device,
> the fallback is also used. If the legacy filter function is not
> hardcoded in the DMA slave driver, but comes from platform data, it will
> be NULL. Then dma_request_slave_channel_compat() will succeed
> incorrectly, and return a DMA channel, as a NULL legacy filter function
> actually means "all channels are OK", not "do not match".
> 
> Later, when trying to use that DMA channel, it will fail with:
> 
>     rcar-dmac e6700000.dma-controller: rcar_dmac_prep_slave_sg: bad parameter: len=1, id=-22
> 
> To fix this, ensure that both the filter function and the DMA channel ID
> are not NULL before using the legacy fallback.
> 
> Note that some DMA slave drivers can handle this failure, and will fall
> back to PIO.
> 
> See also commit 056f6c87028544de ("dmaengine: shdma: Make dummy
> shdma_chan_filter() always return false"), which fixed the same issue
> for the case where shdma_chan_filter() is hardcoded in a DMA slave
> driver.

Applied, thanks

-- 
~Vinod


  reply	other threads:[~2015-08-20  6:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-17 13:08 [PATCH] dmaengine: Stricter legacy checking in dma_request_slave_channel_compat() Geert Uytterhoeven
2015-08-17 13:08 ` Geert Uytterhoeven
2015-08-20  6:31 ` Vinod Koul [this message]
2015-08-20  6:43   ` Vinod Koul

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=20150820063136.GD13546@localhost \
    --to=vinod.koul@intel.com \
    --cc=arnd@arndb.de \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=mporter@kernel.crashing.org \
    --cc=tony@atomide.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.