From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiner Kallweit Subject: Re: [PATCH net-next] net: phy: consider PHY_IGNORE_INTERRUPT in state machine PHY_NOLINK handling Date: Fri, 1 Jun 2018 08:13:34 +0200 Message-ID: <0d27a9e7-84a9-6663-b67f-bb9a0510d731@gmail.com> References: <0a4e472d-cb7f-ef1f-420c-1327fa41e8cd@gmail.com> <20180531.212616.129115220944192049.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: f.fainelli@gmail.com, andrew@lunn.ch, netdev@vger.kernel.org To: David Miller Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:55966 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751258AbeFAGNo (ORCPT ); Fri, 1 Jun 2018 02:13:44 -0400 Received: by mail-wm0-f68.google.com with SMTP id a8-v6so730753wmg.5 for ; Thu, 31 May 2018 23:13:43 -0700 (PDT) In-Reply-To: <20180531.212616.129115220944192049.davem@davemloft.net> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01.06.2018 03:26, David Miller wrote: > From: Heiner Kallweit > Date: Wed, 30 May 2018 22:13:20 +0200 > >> We can bail out immediately also in case of PHY_IGNORE_INTERRUPT because >> phy_mac_interupt() informs us once the link is up. >> >> Signed-off-by: Heiner Kallweit > > When state is PHY_NOLINK, the phy_mac_interrupt() code paths > will change the state to PHY_CHANGELINK before queueing up > the state machine invocation. > > So I can't even see how we can enter phy_state_machine with > ->state == PHY_NOLINK is the mac interrupt paths are being > used properly. > We could enter the state machine with PHY_NOLINK in case any other activity triggers a state machine run whilst the link is down. But I'm not sure whether such a scenario exists. > Therefore it looks like the code as written is harmless. > > Did you actually hit a problem with this test or is this > a change based purely upon code inspection? > Right, there is no actual problem, the existing code is harmless and the change is just based on code inspection. Small benefit is that it makes clearer that this code path is applicable in polling mode only.