From: Andrew Lunn Subject: Re: [PATCH net] net: phy: fix resume handling Date: Wed, 13 Dec 2017 18:19:09 +0100 Message-ID: <20171213171909.GJ28466@lunn.ch> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Florian Fainelli , netdev@vger.kernel.org To: Russell King Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:59846 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752816AbdLMRTL (ORCPT ); Wed, 13 Dec 2017 12:19:11 -0500 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Tue, Dec 12, 2017 at 10:45:36AM +0000, Russell King wrote: > When a PHY has the BMCR_PDOWN bit set, it may decide to ignore writes > to other registers, or reset the registers to power-on defaults. > Micrel PHYs do this for their interrupt registers. > > The current structure of phylib tries to enable interrupts before > resuming (and releasing) the BMCR_PDOWN bit. This fails, causing > Micrel PHYs to stop working after a suspend/resume sequence if they > are using interrupts. > > Fix this by ensuring that the PHY driver resume methods do not take > the phydev->lock mutex themselves, but the callers of phy_resume() > take that lock. This then allows us to move the call to phy_resume() > before we enable interrupts in phy_start(). > > Signed-off-by: Russell King Reviewed-by: Andrew Lunn Andrew