Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2056346pxu; Tue, 24 Nov 2020 16:04:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlbWNm7k4RwamKMwHiDBOloWjfyQG3zL+TFePMgg5/jTOpgW5Dg+FrA1Coe6AqhXA//yyi X-Received: by 2002:a50:fe02:: with SMTP id f2mr1036365edt.97.1606262695482; Tue, 24 Nov 2020 16:04:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606262695; cv=none; d=google.com; s=arc-20160816; b=DoIhxhrx48LPUdR0Uap1wZhhEBVxFVjGW1E6CfizvJi38O1ttZcSAn9cIAdr63JqY7 rdqLSLniYa/m4VjeQHhrxbfcbj2kznnyDW5TNRepcxKaEYvqCyiaZsbJNBihCnSorbT5 08IixkKyDniA0Pn1XhFcTRl6bqHAucgFMVIcWqRNsksDTpAuC68Ja2UD0ZXQF4M8HzCc 26wPZRAaLO+5qe3XQRqfRewfXzxxyJ4+fj0U+Cw7QHD68tH0rzNFUKkf42/cqApXECUh iBES8oV10S6o8CFTcS34PWAad+/PBAFWFieQx5u1/NY415pXVmYHHouSuXAvO8CKdR9S mxOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QAkLzTxi1cCFRODth/HCdCshTccKPJIINXpw8g7Xads=; b=jwIq0qEZihRhN2aav4uFG57x7P4e6yrtqtM+tpMAYMt86y1jRVOj3MbTHE95aCHQaN pYwN9Ra09mWktOBQisutAt5eKu4rdVBuqK+rKCPMCap8XNkESUbgq2boQPf97Zafj5p6 1u9pTVwG7jOphL/uMvgw+ZayvfLKL0cJC7TmCdfWc5cuRTUV/Fd4m0g9Y5u6tkrUUFJC EYU9vUd8aVJIx7hXuSzR3vCD4DqMZxU3fOyJcbBAdcEBTbLF9lO9uvoJ+RPJQ7qH1peJ imkvrT0YonBtqpZxq3jnrS0qqxtjRmo+4zR18AyeP1rNIOCJyN3ltnIvbUmUyRQjKFtt aH0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="Ur6PNBa/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs15si148976edb.427.2020.11.24.16.04.32; Tue, 24 Nov 2020 16:04:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="Ur6PNBa/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732168AbgKXXJZ (ORCPT + 99 others); Tue, 24 Nov 2020 18:09:25 -0500 Received: from mx07-00178001.pphosted.com ([185.132.182.106]:42434 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729256AbgKXXJZ (ORCPT ); Tue, 24 Nov 2020 18:09:25 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 0AON1xiR004892; Wed, 25 Nov 2020 00:08:51 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=STMicroelectronics; bh=QAkLzTxi1cCFRODth/HCdCshTccKPJIINXpw8g7Xads=; b=Ur6PNBa/NdJ837vaSD1xgrT6ge+z6oTDMgnc1q52wKQi98zhiXUJX+dPtKNEVkgGHiNh JrujujtmgtellCd6FnwGxgq8rk6lFoNuyQ5yA5CS/301ncdynJ7zxWjcNqsNG6ryHx5l Cup4/8HyQx84gX5Pz4s0PJghm/whL+bdMxsYtrdo0xRn9ATJ6wJU5G7JcPSSUspztO8u K8zyQ6+5rZC1Enrj/f3XmMZ3TrCAeCStcnRIYwMBsOlUhndzcZWdNsRwc0q3RX3Av6p2 omHaPO/dXqHIvIHSHV2F/ZHEKBnoy+8eRcuUy39YO5YAVLtogOOptZD+2IH9wwJJsB6N Ig== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 34y01cj470-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Nov 2020 00:08:51 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 780F5100034; Wed, 25 Nov 2020 00:08:50 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag1node3.st.com [10.75.127.3]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 5D24620C019; Wed, 25 Nov 2020 00:08:50 +0100 (CET) Received: from localhost (10.75.127.47) by SFHDAG1NODE3.st.com (10.75.127.3) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 25 Nov 2020 00:08:49 +0100 From: Antonio Borneo To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Jakub Kicinski , , Yonglong Liu , Willy Liu CC: Antonio Borneo , , Salil Mehta , , Subject: [PATCH v3 net-next] net: phy: realtek: read actual speed on rtl8211f to detect downshift Date: Wed, 25 Nov 2020 00:07:56 +0100 Message-ID: <20201124230756.887925-1-antonio.borneo@st.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124143848.874894-1-antonio.borneo@st.com> References: <20201124143848.874894-1-antonio.borneo@st.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG1NODE1.st.com (10.75.127.1) To SFHDAG1NODE3.st.com (10.75.127.3) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-24_10:2020-11-24,2020-11-24 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The rtl8211f supports downshift and before commit 5502b218e001 ("net: phy: use phy_resolve_aneg_linkmode in genphy_read_status") the read-back of register MII_CTRL1000 was used to detect the negotiated link speed. The code added in commit d445dff2df60 ("net: phy: realtek: read actual speed to detect downshift") is working fine also for this phy and it's trivial re-using it to restore the downshift detection on rtl8211f. Add the phy specific read_status() pointing to the existing function rtlgen_read_status(). Signed-off-by: Antonio Borneo Link: https://lore.kernel.org/r/478f871a-583d-01f1-9cc5-2eea56d8c2a7@huawei.com --- To: Andrew Lunn To: Heiner Kallweit To: Russell King To: "David S. Miller" To: Jakub Kicinski To: netdev@vger.kernel.org To: Yonglong Liu To: Willy Liu Cc: linuxarm@huawei.com Cc: Salil Mehta Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-kernel@vger.kernel.org In-Reply-To: <20201124143848.874894-1-antonio.borneo@st.com> V1 => V2 move from a generic implementation affecting every phy to a rtl8211f specific implementation V2 => V3 rebase on netdev-next, resolving minor conflict after merge of 8b43357fff61 --- drivers/net/phy/realtek.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index f71eda945c6a..99ecd6c4c15a 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -729,6 +729,7 @@ static struct phy_driver realtek_drvs[] = { PHY_ID_MATCH_EXACT(0x001cc916), .name = "RTL8211F Gigabit Ethernet", .config_init = &rtl8211f_config_init, + .read_status = rtlgen_read_status, .config_intr = &rtl8211f_config_intr, .handle_interrupt = rtl8211f_handle_interrupt, .suspend = genphy_suspend, base-commit: 1d155dfdf50efc2b0793bce93c06d1a5b23d0877 -- 2.29.2