netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Laight <David.Laight@ACULAB.COM>
Cc: 'Vivien Didelot' <vivien.didelot@savoirfairelinux.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel@savoirfairelinux.com" <kernel@savoirfairelinux.com>,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net v2] net: dsa: mv88e6xxx: lock mutex when freeing IRQs
Date: Wed, 27 Sep 2017 15:07:11 +0200	[thread overview]
Message-ID: <20170927130711.GD13516@lunn.ch> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DD00822B6@AcuExch.aculab.com>

On Wed, Sep 27, 2017 at 09:06:01AM +0000, David Laight wrote:
> From: Vivien Didelot
> > Sent: 26 September 2017 19:57
> > mv88e6xxx_g2_irq_free locks the registers mutex, but not
> > mv88e6xxx_g1_irq_free, which results in a stack trace from
> > assert_reg_lock when unloading the mv88e6xxx module. Fix this.
> > 
> > Fixes: 3460a5770ce9 ("net: dsa: mv88e6xxx: Mask g1 interrupts and free interrupt")
> > Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> > ---
> >  drivers/net/dsa/mv88e6xxx/chip.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> > index c6678aa9b4ef..e7ff7483d2fb 100644
> > --- a/drivers/net/dsa/mv88e6xxx/chip.c
> > +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> > @@ -3947,7 +3947,9 @@ static void mv88e6xxx_remove(struct mdio_device *mdiodev)
> >  	if (chip->irq > 0) {
> >  		if (chip->info->g2_irqs > 0)
> >  			mv88e6xxx_g2_irq_free(chip);
> > +		mutex_lock(&chip->reg_lock);
> >  		mv88e6xxx_g1_irq_free(chip);
> > +		mutex_unlock(&chip->reg_lock);
> 
> Isn't the irq_free code likely to have to sleep waiting for any
> ISR to complete??

Hi David

Possibly. But this is a mutex, not a spinlock. So sleeping is O.K.
Or am i missing something?

	  Andrew

  reply	other threads:[~2017-09-27 13:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26 18:57 [PATCH net v2] net: dsa: mv88e6xxx: lock mutex when freeing IRQs Vivien Didelot
2017-09-26 19:05 ` Florian Fainelli
2017-09-27  9:06 ` David Laight
2017-09-27 13:07   ` Andrew Lunn [this message]
2017-09-27 16:40     ` David Laight
2017-09-28 17:29 ` David Miller

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=20170927130711.GD13516@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.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;
as well as URLs for NNTP newsgroup(s).