mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeremy Linton <jeremy.linton@arm.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"steve.glendinning@shawell.net" <steve.glendinning@shawell.net>,
	Matt Sealey <Matt.Sealey@arm.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: smsc911x: Fix unload crash when link is up
Date: Tue, 6 Mar 2018 09:40:39 -0600	[thread overview]
Message-ID: <166f6d54-4079-50a1-144d-b68afba5a7a6@arm.com> (raw)
In-Reply-To: <20180306152345.GD30557@lunn.ch>

Hi,

On 03/06/2018 09:23 AM, Andrew Lunn wrote:
>> This is caused by the mdiobus being unregistered/free'd
>> and the code in phy_detach() attempting to manipulate mdio
>> related structures from unregister_netdev() calling close()
>>
>> To fix this, we delay the mdiobus teardown until after
>> the netdev is deregistered.
>>
>> Reported-by: Matt Sealey <matt.sealey@arm.com>
>> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
>> ---
>>   drivers/net/ethernet/smsc/smsc911x.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
>> index 012fb66eed8d..f0afb88d7bc2 100644
>> --- a/drivers/net/ethernet/smsc/smsc911x.c
>> +++ b/drivers/net/ethernet/smsc/smsc911x.c
>> @@ -2335,14 +2335,14 @@ static int smsc911x_drv_remove(struct platform_device *pdev)
>>   	pdata = netdev_priv(dev);
>>   	BUG_ON(!pdata);
>>   	BUG_ON(!pdata->ioaddr);
>> -	WARN_ON(dev->phydev);
> 
> Hi Jeremy
> 
> I assume this WARN_ON() also fired? It would be good to comment about
> why you removed it, that the code now handles that case.

Yes, the phydev is started and assigned in the netdev _open and 
stopped/set to null in the _stop. Since the module remove is not blocked 
by having the netdev active, and unregister_netdev closes out active 
connections, the WARN_ON would needlessly trigger if the netdev was 
still open.

> 
> Apart from that
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Thanks for looking at this.

  reply	other threads:[~2018-03-06 15:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06 15:00 Jeremy Linton
2018-03-06 15:23 ` Andrew Lunn
2018-03-06 15:40   ` Jeremy Linton [this message]
2018-03-07 18:23 ` 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=166f6d54-4079-50a1-144d-b68afba5a7a6@arm.com \
    --to=jeremy.linton@arm.com \
    --cc=Matt.Sealey@arm.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=steve.glendinning@shawell.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

all inboxes | Powered by JetHome®