mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Mika Westerberg <mika.westerberg@iki.fi>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"rmallon@gmail.com" <rmallon@gmail.com>,
	Rafal Prylowski <prylowski@metasoft.pl>
Subject: RE: [PATCH 2/2] dma/ep93xx_dma: prevent ep93xx_dma_tasklet() to access empty list
Date: Wed, 23 Nov 2011 16:30:34 +0530	[thread overview]
Message-ID: <1322046034.1516.254.camel@vkoul-udesk3> (raw)
In-Reply-To: <ADE657CA350FB648AAC2C43247A983F001F3E96DA6B7@AUSP01VMBX24.collaborationhost.net>

On Tue, 2011-11-22 at 14:26 -0600, H Hartley Sweeten wrote:
> On Tuesday, November 22, 2011 12:46 PM, Mika Westerberg wrote:
> > From: Rafal Prylowski <prylowski@metasoft.pl>
> >
> > If dma_terminate_all() is called before the ep93xx_dma_tasklet()
> gets to run,
> > it tries to access an empty ->active list causing following OOPS:
> 
> [snip]
> 
> > As we expect that the ->active list is never empty when the
> ep93xx_dma_tasklet()
> > is called, we fix this by adding a new flag per channel
> EP93XX_DMA_IS_RUNNING
> > which determines whether the channel is running or not.
> > 
> > We also add BUG_ON() to ep93xx_dma_get_active() to make sure that
> similar
> > problems will be caught early. 
My $0.02

will you still hit the problem if you do a proper check in tasklet for 
a) if list is empty
b) if _get_active_desc() returns valid desc
and the _get_active_desc() returns NULL on not finding active desc

The point is by adding a flag you are avoiding the condition hence it is
working for you whereas on other approach you exit gracefully without
crashing in all the cases (including potentially uncovered ones)


-- 
~Vinod


  parent reply	other threads:[~2011-11-23 11:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-22 19:45 [PATCH 1/2] dma/ep93xx_dma: fix initialization of M2M control register Mika Westerberg
2011-11-22 19:45 ` [PATCH 2/2] dma/ep93xx_dma: prevent ep93xx_dma_tasklet() to access empty list Mika Westerberg
2011-11-22 20:26   ` H Hartley Sweeten
2011-11-23  5:12     ` Mika Westerberg
2011-11-23 11:00     ` Vinod Koul [this message]
2011-11-24  5:47       ` Mika Westerberg
2011-11-22 20:16 ` [PATCH 1/2] dma/ep93xx_dma: fix initialization of M2M control register H Hartley Sweeten
2011-11-23  9:05 ` Rafal Prylowski

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=1322046034.1516.254.camel@vkoul-udesk3 \
    --to=vinod.koul@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=hartleys@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@iki.fi \
    --cc=prylowski@metasoft.pl \
    --cc=rmallon@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®