From: David Miller Subject: Re: [PATCH net v2 0/2] net: phy: fix WoL handling when suspending the PHY Date: Wed, 26 Sep 2018 20:04:35 -0700 (PDT) Message-ID: <20180926.200435.34563447557737934.davem@davemloft.net> References: <43386295-806b-ff32-4c7c-56aaeb87b4db@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: andrew@lunn.ch, f.fainelli@gmail.com, nic_swsd@realtek.com, netdev@vger.kernel.org To: hkallweit1@gmail.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:37384 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727015AbeI0JUi (ORCPT ); Thu, 27 Sep 2018 05:20:38 -0400 In-Reply-To: <43386295-806b-ff32-4c7c-56aaeb87b4db@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Heiner Kallweit Date: Mon, 24 Sep 2018 21:58:04 +0200 > phy_suspend doesn't always recognize that WoL is enabled and therefore > suspends the PHY when it should not. First idea to address the issue > was to reuse checks used in mdio_bus_phy_may_suspend which check > whether relevant devices are wakeup-enabled. > Florian raised some concerns because drivers may enable wakeup even if > WoL isn't enabled (e.g. certain USB network drivers). > > The new approach focuses on reducing the risk to break existing stuff. > We add a flag wol_enabled to struct net_device which is set in > ethtool_set_wol(). Then this flag is checked in phy_suspend(). > This doesn't cover 100% of the cases yet (e.g. if WoL is enabled w/o > explicit configuration), but it covers the most relevant cases with > very little risk of regressions. > > v2: > - Fix a typo Series applied, thanks. Please deal with the extra 4 byte size of net_device in net-next. Thanks.