lkml.org 
[lkml]   [2018]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] net: smsc911x: Fix unload crash when link is up
From
Date
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.

\
 
 \ /
  Last update: 2018-03-06 16:41    [W:0.109 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site