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:   Tue, 7 Jan 2020 10:56:18 +0000
From:   Robin Murphy <robin.murphy@....com>
To:     Sriram Dash <sriram.dash@...sung.com>,
        'Florian Fainelli' <f.fainelli@...il.com>,
        netdev@...r.kernel.org
Cc:     'Jose Abreu' <Jose.Abreu@...opsys.com>,
        'Jayati Sahu' <jayati.sahu@...sung.com>,
        'Alexandre Torgue' <alexandre.torgue@...com>,
        tomeu.vizoso@...labora.com, rcsekar@...sung.com,
        khilman@...libre.com, mgalka@...labora.com,
        linux-kernel@...r.kernel.org,
        'Padmanabhan Rajanbabu' <p.rajanbabu@...sung.com>,
        linux-stm32@...md-mailman.stormreply.com, broonie@...nel.org,
        pankaj.dubey@...sung.com,
        'Maxime Coquelin' <mcoquelin.stm32@...il.com>,
        guillaume.tucker@...labora.com, enric.balletbo@...labora.com,
        'Giuseppe Cavallaro' <peppe.cavallaro@...com>,
        "'David S. Miller'" <davem@...emloft.net>,
        linux-arm-kernel@...ts.infradead.org, heiko@...ech.de
Subject: Re: [PATCH net] Revert "net: stmmac: platform: Fix MDIO init for
 platforms without PHY"

On 07/01/2020 5:46 am, Sriram Dash wrote:
>> From: Florian Fainelli <f.fainelli@...il.com>
>> Subject: [PATCH net] Revert "net: stmmac: platform: Fix MDIO init for
> platforms
>> without PHY"
>>
>> This reverts commit d3e014ec7d5ebe9644b5486bc530b91e62bbf624 ("net:
>> stmmac: platform: Fix MDIO init for platforms without PHY") because it
> breaks
>> existing systems with stmmac which do not have a MDIO bus sub-node nor a
>> 'phy-handle' property declared in their Device Tree. On those systems, the
>> stmmac MDIO bus is expected to be created and then scanned by
>> of_mdiobus_register() to create PHY devices.
>>
>> While these systems should arguably make use of a more accurate Device
> Tree
>> reprensentation with the use of the MDIO bus sub-node an appropriate 'phy-
>> handle', we cannot break them, therefore restore the behavior prior to the
> said
>> commit.
>>
>> Fixes: d3e014ec7d5e ("net: stmmac: platform: Fix MDIO init for platforms
>> without PHY")
>> Reported-by: Heiko Stuebner <heiko@...ech.de>
>> Reported-by: kernelci.org bot <bot@...nelci.org>
>> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> Nacked-by: Sriram Dash <Sriram.dash@...sung.com>
> 
>> ---
>> Heiko,
>>
>> I did not add the Tested-by because the patch is a little bit different
> from what
>> you tested, even if you most likely were not hitting the other part that I
> was
>> changing. Thanks!
>>
>>   drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> index cc8d7e7bf9ac..bedaff0c13bd 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> @@ -320,7 +320,7 @@ static int stmmac_mtl_setup(struct platform_device
>> *pdev,  static int stmmac_dt_phy(struct plat_stmmacenet_data *plat,
>>   			 struct device_node *np, struct device *dev)  {
>> -	bool mdio = false;
>> +	bool mdio = true;
> 
> 
> This is breaking for the platforms with fixed-link.
> stih418-b2199.dts and 169445.dts to name a few.
> 
> For the newer platforms, they should provide the mdio/ snps,dwmac-mdio
> property in the device tree as we are checking the mdio/ snps,dwmac-mdio
> property in the stmmac_platform driver for the mdio bus memory allocation.
> For existing platforms, I agree we should not break them, but we should make
> the code correct. And make the existing platforms adapt to the proper code.
> There is a proposed solution.
> https://lkml.org/lkml/2020/1/7/14
> 
> What do you think?

The binding says that the phy handle and mdio child node are optional, 
so "update all of the DTBs!" is not a viable solution. I'm far from an 
expert here, but AFAICS the fault of the current code is that it assumes 
the lack of a phy handle implies a fixed link, so the obvious answer is 
to actually check whether the "fixed-link" property is present.

Robin.

> 
>>   	static const struct of_device_id need_mdio_ids[] = {
>>   		{ .compatible = "snps,dwc-qos-ethernet-4.10" },
>>   		{},
>> --
>> 2.19.1
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ