From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5919EC433FE for ; Sat, 2 Apr 2022 04:42:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353660AbiDBEnz (ORCPT ); Sat, 2 Apr 2022 00:43:55 -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 Precedence: bulk List-ID: X-Mailing-List: netdev@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.