Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp98648pxw; Fri, 8 Apr 2022 02:09:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoqwWtobYLj39bUHgLtN9y463g2+CYZOI0cyWD+FQAkF0aexo703rJ0wGrbaYeA1atbJxN X-Received: by 2002:a17:907:9811:b0:6e8:d7:7bf5 with SMTP id ji17-20020a170907981100b006e800d77bf5mr17927612ejc.381.1649408970547; Fri, 08 Apr 2022 02:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649408970; cv=none; d=google.com; s=arc-20160816; b=RwDyXmmQo2+3UbHs+bbSJflNRo8dFsuNnMaxVdl/Wofe8ssHt4+ryNraGvQWD+aOF9 YTDekjpBL47CsxLz9uFgDXhWFX0ldP7RbA0s+EovOVfPmHT/ocLlJZGWErVW8FifVBPP hafYih+uH4Vcbzlz/JAuBTs46MYzhpr0e1vUEhxyZCVGX1AKh693Xki9o8JwsQ1FdjST 9FTQ7fs5xPzaw4CUpml/J5TVGgBi+GJcDjxp6f+RxspuoV6BrbhRh4ATUJaA+YWYUT6h PNFJOlFrxaairFMC6cU0fX7znhTwAIqJdGhArPf5lMyFF76MDGmUiwH4vvQ7bePRMHfR NwvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vrB2woSNk//dprWm4OCiSyEUyjKlCWg91U2Ht1JxGp4=; b=YGkidEmARYLUIPdRfCSrFB/9PT+5yZqZafSsO4q5fc/4sP8TP8Nlk2yBi/l8rYd6o2 YzMyLRnVQuqQyPVhW9ILd+VQuhctrmky1x2dmpUVYkT2PR/oQXye2SBcV/dFy1JdyJ1v TdKAHwCxXSZ3tl+FHNzjfsHVc7Bvinr1vcEVuF3m7+2NjavdnEJVcJ5lbSj9unj7f2br wTFoKO4SdKpZ4wJsYBujn8plqgS1x20knm480gO5Iwkif3vVi9eB0mhNQ+BHWmoIfGya 9PQpK2zxBxwUyxAXmt1s0KwfDfcPf5XAcjLR7/uE+fbOoqaBbcNJsuBGTxZvJaU67uU1 9jhw== ARC-Authentication-Results: i=1; mx.google.com; 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 z5-20020a1709064e0500b006df76385d0esi607966eju.430.2022.04.08.02.09.06; Fri, 08 Apr 2022 02:09: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; 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 S231464AbiDHIUs (ORCPT + 99 others); Fri, 8 Apr 2022 04:20:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231466AbiDHIUn (ORCPT ); Fri, 8 Apr 2022 04:20:43 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C47037C7B3 for ; Fri, 8 Apr 2022 01:18:38 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncjp5-0001Q8-SX; Fri, 08 Apr 2022 10:18:27 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1ncjp2-0002vy-IV; Fri, 08 Apr 2022 10:18:24 +0200 Date: Fri, 8 Apr 2022 10:18:24 +0200 From: Oleksij Rempel To: Andrew Lunn 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: <20220408081824.GF25348@pengutronix.de> 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=utf-8 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 10:16:38 up 8 days, 20:46, 67 users, load average: 0.19, 0.26, 0.25 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Thu, Apr 07, 2022 at 04:45:03PM +0200, Andrew Lunn wrote: > > Hi Andrew, > > The PHY we test is RTL8211F, it supports 10 half. This problem actually is, > > our board has MAC connected with PHY, when loopback test, packet flow is > > MAC->PHY->MAC, it needs speed of MAC and PHY should be same when they work. > > > > If PHY speed is unknown when PHY goes down, we will not set MAC speed in > > adjust_link interface. In this case, we hope that PHY speed should not be > > changed, as the old code of function genphy_loopback() before patch > > "net: phy: genphy_loopback: add link speed configuration". > > > > If PHY has never link, MAC speed has never be set in adjust_link interface, > > yeah, in this case, MAC and PHY may has different speed, and they can not work. > > I think we can accept this situation. > > > > I think it is general problem if there is MAC connected with PHY. > > Thanks for investigating. Looks like we are getting close the real > solution. And it is a generic problem, that the MAC and PHY might not > be using the same configuration. > > So it looks like if the link is down, or speed is UNKNOWN, we need to > set phydev->link true, speed 10, duplex half... Hm, i was thinking, is it impossible to run loopback test on half duplex link. Do I missing something? Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |