lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 16 Dec 2018 09:57:50 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Heiner Kallweit <hkallweit1@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        David Miller <davem@...emloft.net>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH v3 net-next] net: phy: improve phy state checking

Le 12/16/18 à 9:30 AM, Heiner Kallweit a écrit :
> Add helpers phy_is_started() and __phy_is_started() to avoid open-coded
> checks whether PHY has been started. To make the check easier move
> PHY_HALTED before PHY_UP in enum phy_state. Further improvements:
> 
> phy_start_aneg():
> Return -EBUSY and print warning if function is called from a non-started
> state (DOWN, READY, HALTED). Better check because function is exported
> and drivers may use it incorrectly.
> 
> phy_interrupt():
> Return IRQ_NONE also if state is DOWN or READY. We should never receive
> an interrupt in one of these states, but better play safe.
> 
> phy_stop():
> Just return and print a warning if PHY is in a non-started state.
> This warning should help to identify drivers with unbalanced calls to
> phy_start() / phy_stop().
> 
> phy_state_machine():
> Schedule state machine run only if PHY is in a started state.
> E.g. if state is READY we don't need the state machine, it will be
> started by phy_start().
> 
> v2:
> - don't use __func__ within phy_warn_state
> v3:
> - use WARN() instead of printing error message to facilitate debugging
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>

Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ