From: Marc Gonzalez Subject: Re: [RFC net-next 4/4] net: phy: Correctly process PHY_HALTED in phy_stop_machine() Date: Mon, 4 Dec 2017 16:08:19 +0100 Message-ID: References: <20171025232124.14120-1-f.fainelli@gmail.com> <20171025232124.14120-5-f.fainelli@gmail.com> <2630f8f3-9c07-cfe4-6d03-d8e3a746556f@gmail.com> <4a784794-ffd7-4556-d8f9-05cf39d3eb91@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: netdev , "David S. Miller" , Andrew Lunn , Doug Berger , Mason , David Daney , Geert Uytterhoeven To: Geert Uytterhoeven , Florian Fainelli Return-path: Received: from us-smtp-delivery-107.mimecast.com ([63.128.21.107]:49782 "EHLO us-smtp-delivery-107.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752163AbdLDPI0 (ORCPT ); Mon, 4 Dec 2017 10:08:26 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On 27/11/2017 08:48, Geert Uytterhoeven wrote: > The MDIO bus callback is not called from the network device ... > >>> smsc hangs of [fec10000.bus, which is started only here ---> >>> >>> Workqueue: events_power_efficient phy_state_machine >>> [] (unwind_backtrace) from [] (show_stack+0x10/0x14) >>> [] (show_stack) from [] (dump_stack+0xa4/0xdc) >>> [] (dump_stack) from [] (__warn+0xcc/0xfc) >>> [] (__warn) from [] (warn_slowpath_null+0x1c/0x24) >>> [] (warn_slowpath_null) from [] (__smsc911x_reg_read+0x1c/0x88) >>> [] (__smsc911x_reg_read) from [] (smsc911x_mac_read+0x4c/0x118) >>> [] (smsc911x_mac_read) from [] (smsc911x_mii_read+0x2c/0xa4) >>> [] (smsc911x_mii_read) from [] (mdiobus_read+0x58/0x70) >>> [] (mdiobus_read) from [] (genphy_update_link+0x18/0x50) >>> [] (genphy_update_link) from [] (genphy_read_status+0xc/0x1cc) >>> [] (genphy_read_status) from [] (phy_state_machine+0xa8/0x3f4) >>> [] (phy_state_machine) from [] (process_one_work+0x240/0x3fc) >>> [] (process_one_work) from [] (worker_thread+0x2cc/0x40c) >>> [] (worker_thread) from [] (kthread+0x124/0x144) > > ... but from the worker thread, which is unaware of PM states, unless it is > a freezable workqueue. > > Cfr. my patch "[1/2] net: phy: Freeze PHY polling before suspending devices" > (https://patchwork.kernel.org/patch/9915901/), which made it a freezable > workqueue, like was done on PCI to solve similar issues with PME scanning. Hello Geert, Florian, Is there something I can do to help this patch move forward? Should we look for a different solution than a synchronous call to phy_state_machine() ? (Or should I call it from the device driver, instead of expecting the phy framework to do it?) Regards.