mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joachim Fenkes <fenkes@de.ibm.com>
To: LinuxPPC-Dev <linuxppc-dev@ozlabs.org>,
	LKML <linux-kernel@vger.kernel.org>,
	OF-General <general@lists.openfabrics.org>,
	Roland Dreier <rolandd@cisco.com>,
	OF-EWG <ewg@lists.openfabrics.org>
Cc: Stefan Roscher <stefan.roscher@de.ibm.com>,
	Christoph Raisch <raisch@de.ibm.com>,
	"Hoang-Nam Nguyen" <hnguyen@de.ibm.com>
Subject: [PATCH] IB/ehca: Fix lockdep failures for shca_list_lock
Date: Fri, 21 Nov 2008 16:37:14 +0100	[thread overview]
Message-ID: <200811211637.15300.fenkes@de.ibm.com> (raw)
In-Reply-To: <48499C11.7030504@gmail.com>

From: Michael Ellerman <michael@ellerman.id.au>

shca_list_lock is taken from softirq context in ehca_poll_eqs, so we need to
lock IRQ safe elsewhere.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Joachim Fenkes <fenkes@de.ibm.com>
---
 drivers/infiniband/hw/ehca/ehca_main.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index bb02a86..021c454 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -717,6 +717,7 @@ static int __devinit ehca_probe(struct of_device *dev,
 	const u64 *handle;
 	struct ib_pd *ibpd;
 	int ret, i, eq_size;
+	u64 flags;
 
 	handle = of_get_property(dev->node, "ibm,hca-handle", NULL);
 	if (!handle) {
@@ -830,9 +831,9 @@ static int __devinit ehca_probe(struct of_device *dev,
 		ehca_err(&shca->ib_device,
 			 "Cannot create device attributes  ret=%d", ret);
 
-	spin_lock(&shca_list_lock);
+	spin_lock_irqsave(&shca_list_lock, flags);
 	list_add(&shca->shca_list, &shca_list);
-	spin_unlock(&shca_list_lock);
+	spin_unlock_irqrestore(&shca_list_lock, flags);
 
 	return 0;
 
@@ -878,6 +879,7 @@ probe1:
 static int __devexit ehca_remove(struct of_device *dev)
 {
 	struct ehca_shca *shca = dev->dev.driver_data;
+	u64 flags;
 	int ret;
 
 	sysfs_remove_group(&dev->dev.kobj, &ehca_dev_attr_grp);
@@ -915,9 +917,9 @@ static int __devexit ehca_remove(struct of_device *dev)
 
 	ib_dealloc_device(&shca->ib_device);
 
-	spin_lock(&shca_list_lock);
+	spin_lock_irqsave(&shca_list_lock, flags);
 	list_del(&shca->shca_list);
-	spin_unlock(&shca_list_lock);
+	spin_unlock_irqrestore(&shca_list_lock, flags);
 
 	return ret;
 }
@@ -975,6 +977,7 @@ static int ehca_mem_notifier(struct notifier_block *nb,
 			     unsigned long action, void *data)
 {
 	static unsigned long ehca_dmem_warn_time;
+	unsigned long flags;
 
 	switch (action) {
 	case MEM_CANCEL_OFFLINE:
@@ -985,12 +988,12 @@ static int ehca_mem_notifier(struct notifier_block *nb,
 	case MEM_GOING_ONLINE:
 	case MEM_GOING_OFFLINE:
 		/* only ok if no hca is attached to the lpar */
-		spin_lock(&shca_list_lock);
+		spin_lock_irqsave(&shca_list_lock, flags);
 		if (list_empty(&shca_list)) {
-			spin_unlock(&shca_list_lock);
+			spin_unlock_irqrestore(&shca_list_lock, flags);
 			return NOTIFY_OK;
 		} else {
-			spin_unlock(&shca_list_lock);
+			spin_unlock_irqrestore(&shca_list_lock, flags);
 			if (printk_timed_ratelimit(&ehca_dmem_warn_time,
 						   30 * 1000))
 				ehca_gen_err("DMEM operations are not allowed"
-- 
1.5.5




  parent reply	other threads:[~2008-11-21 15:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 16:35 IB/ehca: Reject send WRs only for RESET, INIT and RTR state Joachim Fenkes
2008-06-06 18:22 ` Roland Dreier
2008-06-06 20:20 ` [ofa-general] " Dotan Barak
2008-06-09 11:24   ` [PATCH] IB/ehca: Reject recv WRs if QP is in RESET state Joachim Fenkes
2008-06-20 17:26     ` Roland Dreier
2008-07-01 14:14   ` [PATCH] IB/ehca: Make device table externally visible Joachim Fenkes
2008-07-01 17:55     ` Roland Dreier
2008-11-07 16:42   ` [PATCH] IB/ehca: Fix suppression of port activation events Joachim Fenkes
2008-11-10 20:36     ` Roland Dreier
2008-11-11  9:04       ` Joachim Fenkes
2008-11-21 15:37   ` Joachim Fenkes [this message]
2008-11-21 16:02     ` [PATCH] IB/ehca: Fix lockdep failures for shca_list_lock Johannes Berg
2008-11-21 16:18       ` [PATCH] IB/ehca: Fix locking " Joachim Fenkes
2008-11-21 18:28         ` Roland Dreier
2008-11-22  3:41       ` [PATCH] IB/ehca: Fix lockdep failures " Michael Ellerman
2008-11-25 12:58   ` [PATCH] IB/ehca: Change misleading error message Joachim Fenkes
2008-11-25 23:13     ` Roland Dreier
2008-11-26 13:44       ` Joachim Fenkes
2009-06-03 14:28   ` [PATCH] IB/ehca: Remove superfluous bitmasks from QP control block Joachim Fenkes
2009-06-03 20:26     ` Roland Dreier
2009-09-01 11:55   ` [PATCH] IB/ehca: Fix CQE flags reporting Joachim Fenkes
2009-09-01 19:55     ` Roland Dreier

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=200811211637.15300.fenkes@de.ibm.com \
    --to=fenkes@de.ibm.com \
    --cc=ewg@lists.openfabrics.org \
    --cc=general@lists.openfabrics.org \
    --cc=hnguyen@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=raisch@de.ibm.com \
    --cc=rolandd@cisco.com \
    --cc=stefan.roscher@de.ibm.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®