Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752600AbdI0Qkl convert rfc822-to-8bit (ORCPT ); Wed, 27 Sep 2017 12:40:41 -0400 Received: from smtp-out4.electric.net ([192.162.216.185]:61586 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752510AbdI0Qki (ORCPT ); Wed, 27 Sep 2017 12:40:38 -0400 From: David Laight To: "'Andrew Lunn'" CC: "'Vivien Didelot'" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel@savoirfairelinux.com" , "David S. Miller" , Florian Fainelli Subject: RE: [PATCH net v2] net: dsa: mv88e6xxx: lock mutex when freeing IRQs Thread-Topic: [PATCH net v2] net: dsa: mv88e6xxx: lock mutex when freeing IRQs Thread-Index: AQHTNvoRC2MIqJKxfEejJa8Gks5D0qLIcX3AgAAy2oCAAEw7IA== Date: Wed, 27 Sep 2017 16:40:34 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DD00829F0@AcuExch.aculab.com> References: <20170926185721.12187-1-vivien.didelot@savoirfairelinux.com> <063D6719AE5E284EB5DD2968C1650D6DD00822B6@AcuExch.aculab.com> <20170927130711.GD13516@lunn.ch> In-Reply-To: <20170927130711.GD13516@lunn.ch> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1452 Lines: 39 From: Andrew Lunn > Sent: 27 September 2017 14:07 > To: David Laight > 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 > > > --- > > > 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? Looks like I was missing some coffee :-) David