Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1861550pxb; Sat, 2 Apr 2022 06:17:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfhscb3yf80k4F4WrCBXnIKORUfD6FzbuzYYV28PQOdFkk9W7bR7EwjQjXBNDcvyQJyP0S X-Received: by 2002:a17:907:1b1b:b0:6e4:7fac:6ce0 with SMTP id mp27-20020a1709071b1b00b006e47fac6ce0mr3817399ejc.617.1648905452718; Sat, 02 Apr 2022 06:17:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648905452; cv=none; d=google.com; s=arc-20160816; b=Y7mnINoi2vO8GMuwWtwP4rGoFdKPdKEnFR5+vFAMoR4L/iB1TWqSunbhrIjrnmlNTj mRjcHgrTCZXIiRAS33zwnWCmZ6RWzHcFRWe1gEFKm+qvO78QklzA3O9qa/T+wZhMJtZE IoJ5eAmhbSachRob68PHJZjV6SehyccH7kQFfFq8vCd91x22Ihlg4JnlHcG3aRz7GvrN JgarivNgQ2hgOIdvKyHCLuNd9jmU+fmWug4B68WJ9LgEt1o5TxqTeqZOq6zH2I22G/G7 vKvKhGwx3crNvYtGrwG9AB8KWwRuTytKT7gJyFB6DxIuBvzSQil4cmp7scEMZpbJodGO VfMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1a08m7oCoTyT3vyebCtJrAAbyoaDY0BfUc5X7KZ+S6Y=; b=RNWvYDeRDGlpOuINFQH7F+yjuXpQ0GkkqQL43WxyGOQ7D216k7CvtH1SL2zcIv3yYU KEtn8eR1xoE4Vn/nXwMju3G09zK/W2y08ak6wgVLH/wM8NHIPboaC4rsgxVDNZgerWI3 HREl9S1/8fwdEvz3CtyurFX70yv+uVEqOeyOemqUrhouMQLUJG22HJSQT2VDre7G3ia9 sgDpKroZ3Sb5tBnfwwJqCDL9+XjO1wCGdLXa64UPrB8t1GGE+xGWq6+cFbWWM6xQBfjb iFnXVZj1slji6VUvHh6Ec/NsBHxsEAlxcnv9IGt8HkYCaBpyNmJBRzyllsI170H3Bz9/ a+BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=PgIb6SmN; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a50cf81000000b00418c2b5bd57si3383185edk.57.2022.04.02.06.17.08; Sat, 02 Apr 2022 06:17:32 -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=@lunn.ch header.s=20171124 header.b=PgIb6SmN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245312AbiDAMQi (ORCPT + 99 others); Fri, 1 Apr 2022 08:16:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233311AbiDAMQg (ORCPT ); Fri, 1 Apr 2022 08:16:36 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F0EE48324; Fri, 1 Apr 2022 05:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=1a08m7oCoTyT3vyebCtJrAAbyoaDY0BfUc5X7KZ+S6Y=; b=PgIb6SmNQZkBQNTjnLbSzEwvLj glBM954zE+h6fjwoY+Fjz3HlLAKNbUF3XgBISA2yQXEiBOr+W16eyEwr1b1NDtAecFSiagVZ0zlyh Ccabi4/XSwEnJeHEXgb9vePRH/2c6e40JU0QcOOZt2FBIprAplcqnjKKD1w0yL/qWLaU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1naGAn-00DfLD-5a; Fri, 01 Apr 2022 14:14:37 +0200 Date: Fri, 1 Apr 2022 14:14:37 +0200 From: Andrew Lunn To: Oleksij Rempel Cc: "huangguangbin (A)" , davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lipeng321@huawei.com, chenhao288@hisilicon.com Subject: Re: [PATCH] net: phy: genphy_loopback: fix loopback failed when speed is unknown Message-ID: References: <20220331114819.14929-1-huangguangbin2@huawei.com> <130bb780-0dc1-3819-8f6d-f2daf4d9ece9@huawei.com> <20220401064006.GB4449@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220401064006.GB4449@pengutronix.de> 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_PASS,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 > > O.K. So it should be set into 10M half duplex. But why does this cause > > it not to loopback packets? Does the PHY you are using not actually > > support 10 Half? Why does it need to be the same speed as when the > > link was up? And why does it actually set LSTATUS indicating there is > > link? > > > > Is this a generic problem, all PHYs are like this, or is this specific > > to the PHY you are using? Maybe this PHY needs its own loopback > > function because it does something odd? > > It looks for me like attempt to fix loopback test for setup without active > link partner. Correct? You should not need a link partner for loopback to work. This is local loopback. The PHY is also saying it has link, if the LSTATUS bit is set. So i don't see why previous speed is relevant hear. This seems to me to be an issue for this particular PHY. What i don't like about this patch is that it is not deterministic what mode the PHY will end up in if speed is unknown. Without the patch, it is 10Mbps, which is historically a sensible default. If this PHY has never had link, what speed does it use? Does it still work in that case? Andrew