Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1216299pxb; Fri, 1 Apr 2022 07:37:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF9+aE2E7nXDMrypsalg4zShpjaqQwhb2uMwO6kZtTVzQB1uN5pXihYskF/lPVA+SFryFz X-Received: by 2002:aa7:cac4:0:b0:418:85b7:adec with SMTP id l4-20020aa7cac4000000b0041885b7adecmr21316660edt.231.1648823850205; Fri, 01 Apr 2022 07:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648823850; cv=none; d=google.com; s=arc-20160816; b=P32J8WVD7peFGBQ04KENKuuZvkYARC1mx6/IOqT4dGMZeTmKlvLIM1qUzQz0QSNftb Q+XG8C5b/pFeAaUMIOrhJz+Jmp9qGMx7wW0rqzlQEmy/HpLCh8OdGtfhqZwRcywi8C9x 87MLzJX+cNlECe4cYF7e6seC60HyPWPHS6cMhaoeeWdqzkqJC4/M/W93gs+khbSVnKcA 2HYd4BpiDtyXQf4zoxRkTbp83ZH1D/WMqZNENfJZcifMywtMv2rR02X+ph0eKBhHB4VW THttDuAxptZR3ahX8EqNqUpqJUnR3I9k3YKXwZfy/BPRegD8GKO6vEWZGWnbhqmoAPGF TnPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=l5Za89XufRVMoXWzTHqu1+JIk2bJtPxePB/E1tQlqeg=; b=zQi69ArgeEr5j1L1ydVTIl0YMV/YjhmUxZpJLkbDouWlgwSTOyF00FO6zdQx5UG0FM eQ2q9mNInrNgAj2dnP3VJK8skVtxfMbCT4XPZ6mmfEsr+rKPonqu5V4LPf4xsc7ADs7J 3Etm/diavn2Pws2RPI4QBzyYN/baBmtAZMKzudP2ItoV3lQNY9KPuX3pintjqTKN2XZA P6IR/eyyee7cZC1mirY/BPm9+JazUq2+/t9zh+SfgtER+q/3dNhO5GxzzEN7HsqoVpw2 O567EbCea8Xg4Dq0y7QyWcwvmTIbJ+PLi5LVntNB6aijlyO0LuE9uZaghjFlDWfplkWq 4wxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=fxH+ppUa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t20-20020a170906949400b006df7cdba9e4si1693203ejx.385.2022.04.01.07.37.04; Fri, 01 Apr 2022 07:37:30 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=fxH+ppUa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236671AbiCaSrH (ORCPT + 99 others); Thu, 31 Mar 2022 14:47:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234572AbiCaSrC (ORCPT ); Thu, 31 Mar 2022 14:47:02 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E060F62A2D; Thu, 31 Mar 2022 11:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=l5Za89XufRVMoXWzTHqu1+JIk2bJtPxePB/E1tQlqeg=; b=fxH+ppUa9P02Ibmw/erIDWbMZw UCMgrKDDQz7tY5RsESoCgiwTkRIbqkVjU6SewdfM7PX2lB65upgzJjdFziEQRxntXo7gKFfzfRT8b hy2NxzCyCn2qh8vIjnMcWjn8WpdoQZiKsfJzf02qkyNeM5/JazA9mDuKQUb68zUgrylC2aauii08F p+urwvF378clcP77ZVrRDJeqEtZLMu4Z2fwTQopMfGPAXiHcZmYnr+R6QItvwaZu5u7BpaCtztEBO OGqQ8YgcveoiG/C0qMpouw6B9Rv3YGV8a2/xVSLeZ5VIL5D7o5Iycf7DssXBfr3H9jJAgUD99xJAT ImNRK6Tw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58070) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nZzmj-0005Ci-L4; Thu, 31 Mar 2022 19:44:41 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nZzmZ-0007rv-UA; Thu, 31 Mar 2022 19:44:31 +0100 Date: Thu, 31 Mar 2022 19:44:31 +0100 From: "Russell King (Oracle)" To: Chen-Yu Tsai Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Chen-Yu Tsai , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: stmmac: Fix unset max_speed difference between DT and non-DT platforms Message-ID: References: <20220331171827.12483-1-wens@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220331171827.12483-1-wens@kernel.org> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, 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 Fri, Apr 01, 2022 at 01:18:27AM +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. Sounds like it's got to complicated... > 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. And this kind of proves that point - if deleting code fixes it... Acked-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!