Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3517806pxb; Mon, 4 Apr 2022 19:37:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsTzDtkUQgiZGq8rZv8CiMDjzAB7eUxwb19M1Ei9BFklpjRGl3Q4JH0lGy58wCpPpcoG9E X-Received: by 2002:a17:902:ce0a:b0:156:72e2:f191 with SMTP id k10-20020a170902ce0a00b0015672e2f191mr1268108plg.76.1649126224044; Mon, 04 Apr 2022 19:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649126224; cv=none; d=google.com; s=arc-20160816; b=FV+PgC3ksLN3BJoIjfiYmkHNVh4wHYIx6DpzHmEZQMFXYr9Q2BwTTCff2CA3HWjjj+ VpBxe0ETSzrmVL54SS6nWyXzIENdgRUt7/+UQR8YVwn6rlod98qiG13P8M2X3iwm2aRZ ez9ZzGnAmKOrRhy2GNQoWYiID9GDDA/tpzhxdiynv9vQwzf8HtjE8Y9W+5KJLvWRE9Eu 3SgR7OT0CvP+RB0geyldJsFVRafswk1qPvseZGaqupY26r/dfq5Zi45NVAl6iKNXwHDL g2Ysqjp8abeVe1cppPeTHyQtLVn44fqQ3Q2zAq+QbXT0a8aE6xERnKGEBUU1/AsbnGDe jUfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=yH+DsAVHJoPUpxqpOuNNREqkfn9V93zsQKED4av7FYs=; b=nIMCNc3hbpe93YBumoc3hVsZaT3ndaa1ab+mFPl9iGB3VSQppFHesrVOIpExM7P4s1 f9p67bGX/8LTUpwfXqPxZrnrPzsJYeJZJ2vRt4faQZzHlxvC/H+R8XW1DruNebglN8vk vEBeO5CHHE8E2cb/X1a9P5spJLeH07cKr5lRyO3ZVgz8/58LoFxEzQy1kyMuT+jdaahX r7PjEMU2ZkJLEZatQQeoSec0498RN9X4I4pchu0MNYoUx39D11vp8fa5RZDUs4wYGaWe pP4JysRagO6TervwLmd3bxjB7n68HledlxHIy1XSIqYYFhdBfID8WWGwzSqXodFWR/db iyTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JA0eHd50; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u15-20020a170903124f00b00153b2d164fasi7403628plh.258.2022.04.04.19.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 19:37:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JA0eHd50; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D62603901A1; Mon, 4 Apr 2022 18:00:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353710AbiDBEn5 (ORCPT + 99 others); Sat, 2 Apr 2022 00:43:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238032AbiDBEnx (ORCPT ); Sat, 2 Apr 2022 00:43:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A2D21EFE3B; Fri, 1 Apr 2022 21:42:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5747D6091C; Sat, 2 Apr 2022 04:42:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 211B8C340EC; Sat, 2 Apr 2022 04:42:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648874520; bh=AzLgAuzRNBRAOdspDj61I0XCgtewRY+rH2B0NSOl6VA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JA0eHd50KJdwsMRw7rUatj0KDIw390Mr/6jV9svpoQn1axyWHVDwFS6V8v8zGo103 5PpISDOUEAxU15XZcBFKbInEtuhu8M6o99wUTRfjJvTTQt/ajYh2nkWDbPrzZxK67h 1ipdXJzJADUvVNJKcGLdjkliUl1owXZPIjL9mTf42VfvkcfjybrdFnffa2vv3MEBJk Lwt7MhvRmLG4/fx+rT+RoUMUavewp810I+8hMATUs9sxT3QDnw/gX+UR0bLrNA92hr bNDEbVLcBiu/RrgEurXbXcJ4/zTsRxj55S64a02E1uk7QcySc2VgA3JqqPaEHrWddS S64LAPy1PBpuA== Date: Fri, 1 Apr 2022 21:41:58 -0700 From: Jakub Kicinski To: Chen-Yu Tsai Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Paolo Abeni , Chen-Yu Tsai , Srinivas Kandagatla , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Russell King Subject: Re: [PATCH RESEND2] net: stmmac: Fix unset max_speed difference between DT and non-DT platforms Message-ID: <20220401214158.7346bd62@kernel.org> In-Reply-To: <20220331184832.16316-1-wens@kernel.org> References: <20220331184832.16316-1-wens@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Fri, 1 Apr 2022 02:48:32 +0800 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) > --- > > 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. This patch got marked Changes Requested in pw, but I can't see why, so I went on a limb and applied it. LMK if that was a mistake, otherwise its commit c21cabb0fd0b ("net: stmmac: Fix unset max_speed difference between DT and non-DT platforms") in net.