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] [day] [month] [year] [list]
Date:   Sat, 10 Oct 2020 10:45:08 +0200
From:   Marek Vasut <marex@...x.de>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org,
        Christoph Niedermaier <cniedermaier@...electronics.com>,
        "David S . Miller" <davem@...emloft.net>,
        NXP Linux Team <linux-imx@....com>,
        Richard Leitner <richard.leitner@...data.com>,
        Shawn Guo <shawnguo@...nel.org>, Andrew Lunn <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>
Subject: Re: [PATCH] net: fec: Fix phy_device lookup for
 phy_reset_after_clk_enable()

On 10/9/20 8:02 PM, Jakub Kicinski wrote:
> On Fri, 9 Oct 2020 19:34:10 +0200 Marek Vasut wrote:
>>>>> To an untrained eye this looks pretty weird.    
>>>>
>>>> I see, I'm not quite sure how to address this comment.  
>>>
>>> If ndev->phydev sometimes is not-NULL on open, then that's a valid
>>> state to be in. Why not make sure that we're always in that state 
>>> and can depend on ndev->phydev rather than rummaging around for 
>>> the phy_device instance.  
>>
>> Nope, the problem is in probe() in this case.
> 
> In that case it would be cleaner to pass fep and phydev as arguments
> into fec_enet_clk_enable(), rather than netdev, and have only probe()
> do the necessary dance.

So correction, the problem does only happen in open(), in probe() the
phydev->drv is still NULL so the PHY reset cannot be triggered. In
open(), first the clock have to be enabled, then the reset must toggle,
then the PHY IDs can be reliably read.

I suspect reset in probe() will need another patch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ