[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1322045269.1516.247.camel@vkoul-udesk3>
Date: Wed, 23 Nov 2011 16:17:49 +0530
From: Vinod Koul <vinod.koul@...el.com>
To: Mika Westerberg <mika.westerberg@....fi>
Cc: Rafal Prylowski <prylowski@...asoft.pl>, rmallon@...il.com,
broonie@...nsource.wolfsonmicro.com, linux-kernel@...r.kernel.org,
grant.likely@...retlab.ca, hsweeten@...ionengravers.com,
dan.j.williams@...el.com, lrg@...com,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2 1/5] dmaengine: add ep93xx DMA support
On Tue, 2011-11-22 at 07:59 +0200, Mika Westerberg wrote:
> On Mon, Nov 21, 2011 at 02:02:06PM +0530, Vinod Koul wrote:
> > On Mon, 2011-11-21 at 10:01 +0200, Mika Westerberg wrote:
> > > On Mon, Nov 21, 2011 at 08:44:07AM +0100, Rafal Prylowski wrote:
> > > >
> > > > I'm calling dma_terminate_all from interrupt. It seems that tasklet_kill is not
> > > > allowed to be called from this context.
> > >
> > > Ah, right.
> > >
> > > One more try - this time we set a flag which prevents the tasktlet from
> > > referencing an empty list.
>
> > Rather than this why not actually check for list_empty and process only
> > when it is not empty?
>
> I was thinking that it should be an error if the active list is empty when the
> tasklet is run.
well where would you return the error from tasklet?
>
> > Also you should check the return of the ep93xx_dma_get_active() which
> > should return NULL if it didn't find anything in active list
>
> Right - if the list is allowed to be empty.
>
> I'll re-check the patch from Rafal. Maybe it's better to adapt with the fact
> that dma_terminate_all() can be called in any context any time and modify the
> driver accordingly (e.g like you say, return NULL if the list is empty handle
> it correctly).
Yes dma_terminate_all() is allowed to be called by the driver in any
context. It may wish to terminate at any point and this can potentially
lead to race condition when you do actual hardware right to terminate
just when hardware sent the interrupt. And your tasklet is scheduled
after the list becomes empty.
So its better approach to check for list in tasklet and return of
ep93xx_dma_get_active() for a valid descriptor
--
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists