From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753420AbbJ0VVF (ORCPT ); Tue, 27 Oct 2015 17:21:05 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:56764 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752413AbbJ0VVD (ORCPT ); Tue, 27 Oct 2015 17:21:03 -0400 Date: Tue, 27 Oct 2015 22:20:45 +0100 From: Andrew Lunn To: Florian Fainelli Cc: Frode Isaksen , Neil Armstrong , "David S. Miller" , Guenter Roeck , vivien.didelot@savoirfairelinux.com, Fabian Frederick , Pavel Nakonechny , Joe Perches , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/6] net: phy: Stop 'phy-state-machine' and 'phy_change' work on remove Message-ID: <20151027212045.GC2307@lunn.ch> References: <562F8EF1.5090504@baylibre.com> <562F9AEE.5050708@gmail.com> <562F9F06.7040402@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <562F9F06.7040402@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2015 at 08:57:58AM -0700, Florian Fainelli wrote: > (don't top post please) > > On 27/10/15 08:53, Frode Isaksen wrote: > > What will you need in the oops ? I presume you don' want everything or ? > > > > The PHY state machine is not stopped with a PHY disconnect. > > It is stopped with a phy_disconnect(): > > /** > * phy_disconnect - disable interrupts, stop state machine, and detach a PHY > * device > * @phydev: target phy_device struct > */ > void phy_disconnect(struct phy_device *phydev) > { > if (phydev->irq > 0) > phy_stop_interrupts(phydev); > > phy_stop_machine(phydev); > > phydev->adjust_link = NULL; > > phy_detach(phydev); > } And this does not yet get called. It probably needs to be in dsa_switch_destroy() just before unregister_netdev() of the slave devices. However, the ordering in dsa_switch_destroy() looks wrong. The fixed phys are destroyed before the slave devices. They should probably be destroyed after the slave devices, or at least after the phy_disconnect() is called. Andrew