Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp99796ybl; Tue, 7 Jan 2020 02:57:55 -0800 (PST) X-Google-Smtp-Source: APXvYqwrmj7F8X2T1uF0dP1T/fE1OAMrJLHbmKE5Jb951lv8vbsLLkKWF7Xg+0iOPupFV+3mPJmz X-Received: by 2002:a9d:1e4:: with SMTP id e91mr117741024ote.324.1578394674345; Tue, 07 Jan 2020 02:57:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578394674; cv=none; d=google.com; s=arc-20160816; b=pWOpky8UePinMLbn5ByIgiSz//4ncuUOIKi+aZBGhDko4Is9rltRsb927LIFYC9YTz RhP0wNzxNgc7ZyhSX9FHQC1hluVXV3NEIdrVy79mUDFbElMXCHMhEGvOrmZqwLyi8+2+ PczEItUh2IxynurnBTBJIhLaKx68RE8phowqQzQCgxMBvbEa18wRI8nrgt3tOmNiajiB JFI1U78BVg9mYgyd1Yik1WoXbw+XDpkNE5aup0+Koz/fE123KNrRZp8NkxF7srH7umMK QjccgS1GL1fwZ75pjZHqj+GLoQ8CaLVrEbnJog5+Ky0Rwx2p25I2zFQGsQhZ1ntQ2JkA Dyfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=e9CvgOSqTtIBsTQc9+E8J1ayutX61lgtjaKL7tiiJhc=; b=dl1vCXeCbYvWL9ipGN2SrJDvVbmaQSnrjk5OJsgtg1KKfS8ac+STseI9Ku9uoWWUx8 JSwCUxPBVfGPphOKzclzrxCWIgXi9AvL9z/yWLzvLYo/169QAMrc6RsMcZ8TsnIFUTvD tNszI2cDDvQ5xxqSAiLJCEt9C7P3fh4ou6oLy9bZpECeWFuBH67lU1B6ftW//HaV5Ak5 l1bRhMEQCUN6p40ebbVStU0mxFHHT/UfFdCV2P78KlROrRPs5CJ+ySy10zOSGEoPW6Sa yFUSkUe85f8qDdSyERBGHTDcyfe5KbNdYGevhkS58OXuIKidd8vECeQ662VTESdthp6h tukg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si33261613otf.91.2020.01.07.02.57.41; Tue, 07 Jan 2020 02:57:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727787AbgAGK4Y (ORCPT + 99 others); Tue, 7 Jan 2020 05:56:24 -0500 Received: from foss.arm.com ([217.140.110.172]:55780 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726690AbgAGK4X (ORCPT ); Tue, 7 Jan 2020 05:56:23 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0A884328; Tue, 7 Jan 2020 02:56:23 -0800 (PST) Received: from [10.1.196.37] (e121345-lin.cambridge.arm.com [10.1.196.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 644873F534; Tue, 7 Jan 2020 02:56:20 -0800 (PST) Subject: Re: [PATCH net] Revert "net: stmmac: platform: Fix MDIO init for platforms without PHY" To: Sriram Dash , 'Florian Fainelli' , netdev@vger.kernel.org Cc: 'Jose Abreu' , 'Jayati Sahu' , 'Alexandre Torgue' , tomeu.vizoso@collabora.com, rcsekar@samsung.com, khilman@baylibre.com, mgalka@collabora.com, linux-kernel@vger.kernel.org, 'Padmanabhan Rajanbabu' , linux-stm32@st-md-mailman.stormreply.com, broonie@kernel.org, pankaj.dubey@samsung.com, 'Maxime Coquelin' , guillaume.tucker@collabora.com, enric.balletbo@collabora.com, 'Giuseppe Cavallaro' , "'David S. Miller'" , linux-arm-kernel@lists.infradead.org, heiko@sntech.de References: <20200107050846.16838-1-f.fainelli@gmail.com> <011a01d5c51d$d7482290$85d867b0$@samsung.com> From: Robin Murphy Message-ID: <59cb4087-6a71-9684-c4cf-d203600b45a9@arm.com> Date: Tue, 7 Jan 2020 10:56:18 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <011a01d5c51d$d7482290$85d867b0$@samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/01/2020 5:46 am, Sriram Dash wrote: >> From: Florian Fainelli >> 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 >> Reported-by: kernelci.org bot >> Signed-off-by: Florian Fainelli > Nacked-by: Sriram Dash > >> --- >> 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@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >