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 BE67AC433F5 for ; Fri, 1 Apr 2022 12:14:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345788AbiDAMQk (ORCPT ); Fri, 1 Apr 2022 08:16:40 -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> 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