All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-raid@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/4] iop-adma: fix lockdep false positive
Date: Mon, 31 Aug 2009 08:40:47 -0700	[thread overview]
Message-ID: <20090831154047.1068.35013.stgit@dwillia2-linux.ch.intel.com> (raw)
In-Reply-To: <20090831153946.1068.86702.stgit@dwillia2-linux.ch.intel.com>

lockdep correctly identifies a potential recursive locking case for
iop_chan->lock, but in the dependency submission case we expect that the same
class will be acquired for both the parent dependency and the child channel.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/dma/iop-adma.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index ce45f3f..9c752bd 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -288,7 +288,12 @@ static void iop_adma_tasklet(unsigned long data)
 {
 	struct iop_adma_chan *iop_chan = (struct iop_adma_chan *) data;
 
-	spin_lock(&iop_chan->lock);
+	/* lockdep will flag depedency submissions as potentially
+	 * recursive locking, this is not the case as a dependency
+	 * submission will never recurse a channels submit routine.
+	 * There are checks in async_tx.c to prevent this.
+	 */
+	spin_lock_nested(&iop_chan->lock, SINGLE_DEPTH_NESTING);
 	__iop_adma_slot_cleanup(iop_chan);
 	spin_unlock(&iop_chan->lock);
 }


WARNING: multiple messages have this Message-ID (diff)
From: dan.j.williams@intel.com (Dan Williams)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/4] iop-adma: fix lockdep false positive
Date: Mon, 31 Aug 2009 08:40:47 -0700	[thread overview]
Message-ID: <20090831154047.1068.35013.stgit@dwillia2-linux.ch.intel.com> (raw)
In-Reply-To: <20090831153946.1068.86702.stgit@dwillia2-linux.ch.intel.com>

lockdep correctly identifies a potential recursive locking case for
iop_chan->lock, but in the dependency submission case we expect that the same
class will be acquired for both the parent dependency and the child channel.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/dma/iop-adma.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index ce45f3f..9c752bd 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -288,7 +288,12 @@ static void iop_adma_tasklet(unsigned long data)
 {
 	struct iop_adma_chan *iop_chan = (struct iop_adma_chan *) data;
 
-	spin_lock(&iop_chan->lock);
+	/* lockdep will flag depedency submissions as potentially
+	 * recursive locking, this is not the case as a dependency
+	 * submission will never recurse a channels submit routine.
+	 * There are checks in async_tx.c to prevent this.
+	 */
+	spin_lock_nested(&iop_chan->lock, SINGLE_DEPTH_NESTING);
 	__iop_adma_slot_cleanup(iop_chan);
 	spin_unlock(&iop_chan->lock);
 }

  parent reply	other threads:[~2009-08-31 15:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-31 15:40 [PATCH v2 0/4] Asynchronous raid6 acceleration (part 2 of 3) Dan Williams
2009-08-31 15:40 ` Dan Williams
2009-08-31 15:40 ` [PATCH v2 1/4] iop-adma: cleanup iop_adma_run_tx_complete_actions Dan Williams
2009-08-31 15:40   ` Dan Williams
2009-08-31 15:40 ` Dan Williams [this message]
2009-08-31 15:40   ` [PATCH v2 2/4] iop-adma: fix lockdep false positive Dan Williams
2009-08-31 15:40 ` [PATCH v2 3/4] iop-adma: P+Q support for iop13xx adma engines Dan Williams
2009-08-31 15:40   ` Dan Williams
2009-08-31 15:40 ` [PATCH v2 4/4] iop-adma: P+Q self test Dan Williams
2009-08-31 15:40   ` Dan Williams

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=20090831154047.1068.35013.stgit@dwillia2-linux.ch.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-raid@vger.kernel.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 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.