mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Xose Vazquez Perez <xose.vazquez@gmail.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [BUG] ISIC + 2.6.22 (via-rhine)
Date: Tue, 31 Jul 2007 14:23:33 -0700	[thread overview]
Message-ID: <1185917013.2766.12.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <46AFA576.1060902@gmail.com>


> =================================
> [ INFO: inconsistent lock state ]
> 2.6.22 #1
> ---------------------------------
> inconsistent {in-hardirq-W} -> {hardirq-on-W} usage.
> swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
>   (&rp->lock){++..}, at: [<f8c890db>] rhine_tx_timeout+0x6f/0xf4 [via_rhine]



this is a case of homegrown locking: the via-rhine driver does

        /* protect against concurrent rx interrupts */
        disable_irq(rp->pdev->irq);

        spin_lock(&rp->lock);

        /* clear all descriptors */
        free_tbufs(dev);
        free_rbufs(dev);
        alloc_tbufs(dev);
        alloc_rbufs(dev);

        /* Reinitialize the hardware. */
        rhine_chip_reset(dev);
        init_registers(dev);  

        spin_unlock(&rp->lock);
        enable_irq(rp->pdev->irq);


as a way to protect code against interrupts... rather than using the
normal mechanism.


the annotation is pretty simple (untested, not even compiled):

--- linux-2.6.22/drivers/net/via-rhine.c.org	2007-07-31 14:22:06.000000000 -0700
+++ linux-2.6.22/drivers/net/via-rhine.c	2007-07-31 14:22:26.000000000 -0700
@@ -1191,7 +1191,7 @@
 	       mdio_read(dev, rp->mii_if.phy_id, MII_BMSR));
 
 	/* protect against concurrent rx interrupts */
-	disable_irq(rp->pdev->irq);
+	disable_irq_lockdep(rp->pdev->irq);
 
 	spin_lock(&rp->lock);
 
@@ -1206,7 +1206,7 @@
 	init_registers(dev);
 
 	spin_unlock(&rp->lock);
-	enable_irq(rp->pdev->irq);
+	enable_irq_lockdep(rp->pdev->irq);
 
 	dev->trans_start = jiffies;
 	rp->stats.tx_errors++;



  reply	other threads:[~2007-07-31 21:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-31 21:11 Xose Vazquez Perez
2007-07-31 21:23 ` Arjan van de Ven [this message]
2007-07-31 21:53   ` Xose Vazquez Perez

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=1185917013.2766.12.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xose.vazquez@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®