From: Francois Romieu Subject: Re: [PATCH net-next] r8169: perform reset synchronously in __rtl8169_resume Date: Wed, 23 May 2018 00:51:55 +0200 Message-ID: <20180522225155.GB2945@electric-eye.fr.zoreil.com> References: <040eb6ae-bb21-2d27-14e0-b291cb4cc1c9@gmail.com> <20180522.135905.2272754708817453523.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Miller , nic_swsd@realtek.com, netdev@vger.kernel.org To: hkallweit1@gmail.com Return-path: Received: from violet.fr.zoreil.com ([92.243.8.30]:46997 "EHLO violet.fr.zoreil.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753036AbeEVWwI (ORCPT ); Tue, 22 May 2018 18:52:08 -0400 Content-Disposition: inline In-Reply-To: <20180522.135905.2272754708817453523.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: David Miller : > From: Heiner Kallweit > Date: Mon, 21 May 2018 19:01:19 +0200 > > > The driver uses pm_runtime_get_sync() in few places and relies on the > > device being fully runtime-resumed after this call. So far however > > the runtime resume callback triggers an asynchronous reset. > > Avoid this and perform the reset synchronously. [...] > Given what we know about ->ndo_open() and the checks by the callers of > __rtl8169_resume(), the netif_running() test seems superfluous or > wrong. > > Either way you need to resolve this somehow. Actually I do not see why the asynchronous reset would be a problem. Aforementioned places that use pm_runtime_get_sync() are rtl_{open/close} 1. I understand that rtl_open needs to reach synchronously something like a D0 state but it does not need anything else, whence the current no-op in the driver runtime suspend/resume handlers (that I should have remembered btw). 2. rtl_close() needs the same D0 state to perform the hw counters update but it should neither need nor care about rtl_reset_work. rtl_close even disables itself the deferred work queue right after the hw counter update. If it's also worth making the code more palatable, more explicit symmetry between rtl8169_net_suspend and __rtl8169_resume would be welcome. -- Ueimor