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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8985802d-1faa-abd3-0188-49d73fed7a09@gmail.com>
Date:   Fri, 17 Mar 2023 10:47:14 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Andrew Lunn <andrew@...n.ch>,
        "Russell King (Oracle)" <linux@...linux.org.uk>
Cc:     Shenwei Wang <shenwei.wang@....com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Jose Abreu <joabreu@...opsys.com>, netdev@...r.kernel.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-arm-kernel@...ts.infradead.org, imx@...ts.linux.dev
Subject: Re: [PATCH 1/1] net: stmmac: start PHY early in __stmmac_open

On 3/17/23 10:34, Andrew Lunn wrote:
>> NAK. A patch similar to this has already been sent.
>>
>> The problem with just moving this is that phylink can call the
>> mac_link_up() method *before* phylink_start() has returned - and as
>> this driver has not completed the setup, it doesn't expect the link
>> to come up at that point.
>>
>> There are several issues with this driver wanting the PHY clock early,
>> and there have been two people working on addressing this previously,
>> proposing two different changes to phylink.
>>
>> I sent them away to talk to each other and come back with a unified
>> solution. Shock horror, they never came back.
>>
>> Now we seem to be starting again from the beginning.
>>
>> stmmac folk really need to get a handle on this so reviewers are not
>> having to NAK similar patches time and time again, resulting in the
>> problem not being solved.
> 
> And just adding to that, Developers should also get into the habit of
> searching to see if somebody has already tried and failed to solve the
> problem.
> 
> “Those Who Do Not Learn History Are Doomed To Repeat It.”
> 
> Try avoiding wasting everybody's times by learning a bit of history.

This is a tough problem to solve though, we have had similar issues in 
the past with the GENET driver whereby we need the PHY clock in order to 
clock certain parts of the MAC's receive path to ensure it completes its 
reset. This is a terrible design that unfortunately a lot of designers 
get wrong.

Eventually we found that we had this "auto-configure" feature which 
could kick in when the PHY is up and running which solved it:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=88f6c8bf1aaed5039923fb4c701cab4d42176275

though it took a few attempts to get there:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=612eb1c3b9e504de24136c947ed7c07bc342f3aa

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3a55402c93877d291b0a612d25edb03d1b4b93ac

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=28c2d1a7a0bf

Does something similar exit on stmmac? Can you somehow utilize the MAC's 
TX clock and loop it back to the RX clock to satisfy any clocking 
requirements?
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ