Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1300798

Re: [PATCH] dma: Revert "dmaengine: mic_x100: add missing spin_unlock"

From Vinod Koul <vinod.koul@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] dma: Revert "dmaengine: mic_x100: add missing spin_unlock"
Date 2016-01-04 16:10 +0100
Message-ID <qNeVJ-55l-31@gated-at.bofh.it> (permalink)
References <qIHYl-49a-7@gated-at.bofh.it> <qN49X-69R-3@gated-at.bofh.it> <qNesG-4F6-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jan 04, 2016 at 03:35:34PM +0100, Lars-Peter Clausen wrote:
> On 01/04/2016 04:35 AM, Vinod Koul wrote:
> > On Tue, Dec 22, 2015 at 07:35:23PM -0800, Ashutosh Dixit wrote:
> >> This reverts commit e958e079e254 ("dmaengine: mic_x100: add missing
> >> spin_unlock").
> >>
> >> The above patch is incorrect. There is nothing wrong with the original
> >> code. The spin_lock is acquired in the "prep" functions and released
> >> in "submit".
> > 
> > And going by dmaengine sematics, I do not think that is entrely right.
> > 
> > A user may choose to prepare multiple desciptors and then sumbit later,
> > looking at code I do not see how that will work.
> 
> The DMAengine API actually mandates that prep and submit must always be
> called in pairs, without any other DMAengine calls in between. The patch is
> correct.
> 
> Quoting from Documentation/dmaengine/client.txt:
> 
>    Once a descriptor has been obtained, the callback information can be
>    added and the descriptor must then be submitted.  Some DMA engine
>    drivers may hold a spinlock between a successful preparation and
>    submission so it is important that these two operations are closely
>    paired.

This is true for slave cases as has been made clear in the Documentation.
For non slave cases that is not entirely right. mic_x100 falls in latter
category.

Thanks
-- 
~Vinod
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] dma: Revert "dmaengine: mic_x100: add missing  spin_unlock" Vinod Koul <vinod.koul@intel.com> - 2016-01-04 04:40 +0100
  Re: [PATCH] dma: Revert "dmaengine: mic_x100: add missing  spin_unlock" Lars-Peter Clausen <lars@metafoo.de> - 2016-01-04 15:40 +0100
    Re: [PATCH] dma: Revert "dmaengine: mic_x100: add missing  spin_unlock" Vinod Koul <vinod.koul@intel.com> - 2016-01-04 16:10 +0100
  Re: [PATCH] dma: Revert "dmaengine: mic_x100: add missing spin_unlock" Ashutosh Dixit <ashutosh.dixit@intel.com> - 2016-01-04 23:50 +0100
    Re: [PATCH] dma: Revert "dmaengine: mic_x100: add missing  spin_unlock" Vinod Koul <vinod.koul@intel.com> - 2016-01-06 11:10 +0100

csiph-web