From: Andrey Borzenkov <arvidjaar@mail.ru>
To: orinoco-devel@lists.sourceforge.net, linux-wireless@vger.kernel.org
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] orinoco: fix unsafe locking in orinoco_cs_resume
Date: Fri, 10 Oct 2008 20:22:38 +0400 [thread overview]
Message-ID: <200810102022.40027.arvidjaar@mail.ru> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 99 bytes --]
Attached patch should fixe lockdep warning. Unfortunately it is rather
hard to trigger on purpose.
[-- Attachment #1.2: orinoco-fix-unafe-locking-in-orinoco_cs_resume --]
[-- Type: text/x-diff, Size: 2164 bytes --]
Subject: [PATCH] orinoco: fix unsafe locking in orinoco_cs_resume
From: Andrey Borzenkov <arvidjaar@mail.ru>
[ 6972.562035] =================================
[ 6972.562040] [ INFO: inconsistent lock state ]
[ 6972.562048] 2.6.27-1avb #17
[ 6972.562053] ---------------------------------
[ 6972.562060] inconsistent {in-hardirq-W} -> {hardirq-on-W} usage.
[ 6972.562068] pm-suspend/17062 [HC0[0]:SC0[0]:HE1:SE1] takes:
[ 6972.562076] (&priv->lock){++..}, at: [<dfd4f05b>] orinoco_cs_resume+0x5b/0xd0 [orinoco_cs]
[ 6972.562122] {in-hardirq-W} state was registered at:
[ 6972.562128] [<c013ea6b>] __lock_acquire+0x6cb/0x1640
[ 6972.562171] [<c013fa3c>] lock_acquire+0x5c/0x80
[ 6972.562181] [<c02f6e39>] _spin_lock_irqsave+0x49/0x80
[ 6972.562210] [<dfd6425d>] orinoco_interrupt+0x4d/0x16d0 [orinoco]
[ 6972.562257] [<c015a2b1>] handle_IRQ_event+0x31/0x60
[ 6972.562278] [<c015b73e>] handle_level_irq+0x6e/0xe0
[ 6972.562291] [<c0104b20>] do_IRQ+0xb0/0x130
[ 6972.562313] [<ffffffff>] 0xffffffff
Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
---
drivers/net/wireless/orinoco_cs.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index 1ccf5a4..6fc2209 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -403,6 +403,7 @@ static int orinoco_cs_resume(struct pcmcia_device *link)
struct orinoco_private *priv = netdev_priv(dev);
struct orinoco_pccard *card = priv->card;
int err = 0;
+ unsigned long flags;
if (! test_bit(0, &card->hard_reset_in_progress)) {
err = orinoco_reinit_firmware(dev);
@@ -412,7 +413,7 @@ static int orinoco_cs_resume(struct pcmcia_device *link)
return -EIO;
}
- spin_lock(&priv->lock);
+ spin_lock_irqsave(&priv->lock, flags);
netif_device_attach(dev);
priv->hw_unavailable--;
@@ -424,7 +425,7 @@ static int orinoco_cs_resume(struct pcmcia_device *link)
dev->name, err);
}
- spin_unlock(&priv->lock);
+ spin_unlock_irqrestore(&priv->lock, flags);
}
return err;
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next reply other threads:[~2008-10-10 16:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-10 16:22 Andrey Borzenkov [this message]
2008-10-10 21:38 ` [PATCH] orinoco: fix unsafe locking in orinoco_cs_resume Dave
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=200810102022.40027.arvidjaar@mail.ru \
--to=arvidjaar@mail.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=orinoco-devel@lists.sourceforge.net \
/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