From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966410AbbJ1N5n (ORCPT ); Wed, 28 Oct 2015 09:57:43 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:35771 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966323AbbJ1Nym (ORCPT ); Wed, 28 Oct 2015 09:54:42 -0400 Subject: Re: [PATCH 6/6] net: phy: Stop 'phy-state-machine' and 'phy_change' work on remove To: Frode Isaksen , Andrew Lunn References: <562F8EF1.5090504@baylibre.com> <562F9AEE.5050708@gmail.com> <562F9F06.7040402@gmail.com> <20151027212045.GC2307@lunn.ch> Cc: Florian Fainelli , "David S. Miller" , Guenter Roeck , vivien.didelot@savoirfairelinux.com, Fabian Frederick , Pavel Nakonechny , Joe Perches , netdev@vger.kernel.org, linux-kernel@vger.kernel.org From: Neil Armstrong Organization: Baylibre Message-ID: <5630D39B.2090306@baylibre.com> Date: Wed, 28 Oct 2015 14:54:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > 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 > Andrew, Florian, Thanks for the review, a call to phy_disconnect was missing in dsa_switch_destroy. I will post a new patchset with the correct fix, a switch to delayed_work and a separate dsa_slave_destroy function for sake of maintenance ease. Neil