Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1913511pxb; Sat, 2 Apr 2022 08:03:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFGHBo9QkSSE/rmd9mx1iebgUp/DyYPDujoz6xUMwhebvfXJFM1UTMuIWrJIMoANsV02nV X-Received: by 2002:a65:6e88:0:b0:382:3851:50c8 with SMTP id bm8-20020a656e88000000b00382385150c8mr19827993pgb.270.1648911800319; Sat, 02 Apr 2022 08:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648911800; cv=none; d=google.com; s=arc-20160816; b=JW9z+Ne/vLEJ62dmUDu3CbBjNQm4BGU+mb6PEWogc9nhEaO9w239Tw2c+aLvQwggGt HrIHpwjh1MVS8FD6m5j4COxGFxlmtQs2XNhZfE4wZCq9Ud0IfBHPP4TkGgyzihuLaPnG o1fFCDCllqSQVoc9hYLAjrDHebsnEVrGHE0FyKpXK/WfvYkdG9jxsQPjDOTcYpkdUmDK cAgTGC7bN42EBJpvp5Cc5L6eBTaPkb/8FrOu23J382RHLOgnZRwByb87eB7K+ma4KIdW raVFDlZRg7ChapaTOtmHrPIbmCtmCiUHQb52Z1l2jWy7916ZKrX+eD5qVdoxlVLbHNdS QmnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=knarY0P/HR9VLQQwSOZKVbQpfKOi+mXAWn23v+UHOuU=; b=W6kD/Xn30YtRzFP3NLYOLH74y/jujgo4YVTNDbm3cgYwSH7j423mN1Fp7mfqlk3rTf aB5TD/JijZ8DFd1l5EmafvgnXdEEjI3w/h3OisvPiZe/jMY3Hbp354PQ5yOm/P7WAZq+ ZIPomzErdpvhMSXMWlCqz1w4SnX4yxjIN2628SNUCvZFfZtUkPqpgbkHKllQXdwyV/L1 rpI34z/Mxl6VG+D+iUq1pOzrk/xt/t7VwREPJk3nqiHCTNjiO4HFAWKpEPG1DQZHG4I+ AcFPMIDpPG7eG2U1XrKeHoS0Fz4Op0yFpLO5BnLwZWZxSrdyv9AqfICYnn/0YleD9hSH pS3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=es3vNB+g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w25-20020a634759000000b003986443b1f0si5091842pgk.832.2022.04.02.08.03.05; Sat, 02 Apr 2022 08:03:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=es3vNB+g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241810AbiDAMbf (ORCPT + 99 others); Fri, 1 Apr 2022 08:31:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243390AbiDAMbe (ORCPT ); Fri, 1 Apr 2022 08:31:34 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16BA635AB8 for ; Fri, 1 Apr 2022 05:29:45 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 8-20020a1c0208000000b0038ccb70e239so105442wmc.3 for ; Fri, 01 Apr 2022 05:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=knarY0P/HR9VLQQwSOZKVbQpfKOi+mXAWn23v+UHOuU=; b=es3vNB+gmwleXUR7l3lIqpohW+v8Dt5oOPi/d27WUddaSeFFBuAu9BlbXS8CkgsnUz xX9p93HJSwkLh/pszTghxMozVeCn/KeSZLXtv0iO38kVLLNuQRFpjj56IJEKBvyUBi4p +MOT83oOqz6fCWpZs5JlmKXLPOfI7okx9BFbMuMLQ8GZl281jTbbDK6xEW2OdAxglyR9 A2imFYdhQdX1+cHktz80HFIsTZmrD6FCIcegrU9FVr5NeAVEm9v7fFYR2WDz9eWhaHiP xTUlGgs7dQMZccji8ThdGwpLtiqmRju7+5vSt4ro7FAC4hVVq/yiDODDqlebMBJCh4kL 4low== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=knarY0P/HR9VLQQwSOZKVbQpfKOi+mXAWn23v+UHOuU=; b=bsma3QQJ6cea8Q91Ue3Lcrw/6SJcV6vv7gkzvc3IcD/duWq8WgQ6+jEBr57BGyX6/N 8I56sYHFQHl7JneTaviPPyuR4cOzWx3NB37lIgOMX5IO469zBOUsYKHQaARijP6U0ghV U2d8qX9YPGOnlap4ZSg67FYO+5SxAj0XAa76jusob5wUUrOxkBSeeNTdIkKxzh6UJ1U8 +A9G/cBeZJMYXwiTTWXtOinVnFieasxc45Ajc/8bEquZsG9vgYWgLs86gEOpVUBHB7SP AOTl2yL7TIy35xzg9xh7+v9PNJDXeeHqlmcJUarJB3gz3P1gAz6jMFHEbIlT1zchvqby YXXA== X-Gm-Message-State: AOAM531eDgYhc9nhfkaGb1ygQ+OmfLZF3iwCUoqvDlFsLWg2HLX0r1Ay 4wCLhKNIcPv71VoTFEfluto0pw== X-Received: by 2002:a05:600c:1e85:b0:38c:ef05:ba5d with SMTP id be5-20020a05600c1e8500b0038cef05ba5dmr8462294wmb.119.1648816183627; Fri, 01 Apr 2022 05:29:43 -0700 (PDT) Received: from [192.168.86.34] (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.googlemail.com with ESMTPSA id v13-20020adfe28d000000b0020375f27a5asm2036360wri.4.2022.04.01.05.29.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Apr 2022 05:29:43 -0700 (PDT) Message-ID: <9fd2c36d-0ac2-357e-23da-9d20397dbb67@linaro.org> Date: Fri, 1 Apr 2022 13:29:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH RESEND2] net: stmmac: Fix unset max_speed difference between DT and non-DT platforms Content-Language: en-US To: Chen-Yu Tsai , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Paolo Abeni Cc: Chen-Yu Tsai , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Russell King References: <20220331184832.16316-1-wens@kernel.org> From: Srinivas Kandagatla In-Reply-To: <20220331184832.16316-1-wens@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31/03/2022 19:48, Chen-Yu Tsai wrote: > From: Chen-Yu Tsai > > In commit 9cbadf094d9d ("net: stmmac: support max-speed device tree > property"), when DT platforms don't set "max-speed", max_speed is set to > -1; for non-DT platforms, it stays the default 0. > > Prior to commit eeef2f6b9f6e ("net: stmmac: Start adding phylink support"), > the check for a valid max_speed setting was to check if it was greater > than zero. This commit got it right, but subsequent patches just checked > for non-zero, which is incorrect for DT platforms. > > In commit 92c3807b9ac3 ("net: stmmac: convert to phylink_get_linkmodes()") > the conversion switched completely to checking for non-zero value as a > valid value, which caused 1000base-T to stop getting advertised by > default. > > Instead of trying to fix all the checks, simply leave max_speed alone if > DT property parsing fails. > > Fixes: 9cbadf094d9d ("net: stmmac: support max-speed device tree property") > Fixes: 92c3807b9ac3 ("net: stmmac: convert to phylink_get_linkmodes()") > Signed-off-by: Chen-Yu Tsai > Acked-by: Russell King (Oracle) > --- LGTM, Reviewed-by: Srinivas Kandagatla --srini > > Resend2: CC Srinivas at Linaro instead of ST. Collected Russell's ack. > Resend: added Srinivas (author of first fixed commit) to CC list. > > This was first noticed on ROC-RK3399-PC, and also observed on ROC-RK3328-CC. > The fix was tested on ROC-RK3328-CC and Libre Computer ALL-H5-ALL-CC. > > drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c > index 5d29f336315b..11e1055e8260 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c > @@ -431,8 +431,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) > plat->phylink_node = np; > > /* Get max speed of operation from device tree */ > - if (of_property_read_u32(np, "max-speed", &plat->max_speed)) > - plat->max_speed = -1; > + of_property_read_u32(np, "max-speed", &plat->max_speed); > > plat->bus_id = of_alias_get_id(np, "ethernet"); > if (plat->bus_id < 0)