From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiner Kallweit Subject: [PATCH net-next 0/5] net: phy: improve and simplify phylib state machine Date: Wed, 7 Nov 2018 20:41:52 +0100 Message-ID: <922c223b-7bc0-e0ec-345d-2034b796af91@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "netdev@vger.kernel.org" To: Florian Fainelli , Andrew Lunn , David Miller Return-path: Received: from mail-wr1-f67.google.com ([209.85.221.67]:42901 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726359AbeKHFNu (ORCPT ); Thu, 8 Nov 2018 00:13:50 -0500 Received: by mail-wr1-f67.google.com with SMTP id y15-v6so18683809wru.9 for ; Wed, 07 Nov 2018 11:42:02 -0800 (PST) Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: This patch series is based on two axioms: - During autoneg a PHY always reports the link being down - Info in clause 22/45 registers doesn't allow to differentiate between these two states: 1. Link is physically down 2. A link partner is connected and PHY is autonegotiating In both cases "link up" and "aneg finished" bits aren't set. One consequence is that having separate states PHY_NOLINK and PHY_AN isn't needed. By using these two axioms the state machine can be significantly simplified. Heiner Kallweit (5): net: phy: remove useless check in state machine case PHY_NOLINK net: phy: remove useless check in state machine case PHY_RESUMING net: phy: add phy_check_link_status net: phy: remove state PHY_AN net: phy: use phy_check_link_status in more places in the state machine drivers/net/phy/phy.c | 172 +++++++++++------------------------------- include/linux/phy.h | 19 +---- 2 files changed, 46 insertions(+), 145 deletions(-) -- 2.19.1