From: Andrey Borzenkov Date: Fri, 10 Oct 2008 16:22:38 +0000 (+0400) Subject: orinoco: fix unsafe locking in orinoco_cs_resume X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=552a71515eef5cba9af8bfe608149557059c4463;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git orinoco: fix unsafe locking in orinoco_cs_resume [ 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: [] orinoco_cs_resume+0x5b/0xd0 [orinoco_cs] [ 6972.562122] {in-hardirq-W} state was registered at: [ 6972.562128] [] __lock_acquire+0x6cb/0x1640 [ 6972.562171] [] lock_acquire+0x5c/0x80 [ 6972.562181] [] _spin_lock_irqsave+0x49/0x80 [ 6972.562210] [] orinoco_interrupt+0x4d/0x16d0 [orinoco] [ 6972.562257] [] handle_IRQ_event+0x31/0x60 [ 6972.562278] [] handle_level_irq+0x6e/0xe0 [ 6972.562291] [] do_IRQ+0xb0/0x130 [ 6972.562313] [] 0xffffffff Signed-off-by: Andrey Borzenkov Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c index 9eaa252c2430..65fd054e0172 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;