Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp412781pxb; Tue, 19 Oct 2021 05:36:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyszoYPsyHYD6MRgQ3bgAr+ozlAjF8j7UfBh1Szz2CbYSjs/ltgL7lM5cQAw3jfDKi0zfyd X-Received: by 2002:a50:bf07:: with SMTP id f7mr53595103edk.288.1634646989466; Tue, 19 Oct 2021 05:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634646989; cv=none; d=google.com; s=arc-20160816; b=M95tKpZwM7if9++i09+7dF4BcD4WYZ6dlpZIrYYygKG9LF8PnBYnsrA8VxE2a9L9FG SyMcT/H+xZQJD2CMAAkYCFNmxRRCDSJRlNiyI9Xw8aGVbYW1bmjjdsZt9Unr82P2aq/c kxVJdETdxVkCJWjiPrU3Gue6m5hBYoJzd+cWAyWJFoixKABBEFPVh2YEJspiYt/TzFDp xCF66QJHSqfhlrLPU1xRRbwqqUhmywgBhVQ0ZAXW9WtS75J+VEhYECmyY6LmN53rS/q8 vJLG1mHiBMGCPSt/6QkWlUNJDa0Nsf0aTD6XuM1qvv2fiD/hH8Ms0IHpq1tV4RqWEoBN su2Q== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=naCPatSPieFjm2idIBaHbGp+IymFwGkWn28jPFF7KI0=; b=qaF7whmgqYZ/kEufASxZBOFXOB9n/xzD71IPVU9aeGs6u9oEBJuMR+mwOtCbTkS/la n0akbVmSQUOCHj3FWfdR4BEQFckBeIwYlcG5iG9bDjsUdVcY294NTe+PQZ5KlNe5p1fC Vdc9g3U6IqurEiG60Vxe7icQXvbUZxIKwRMuq7ZZYYKGt6wPIXXS/uBzSlnlMxjY/uC0 aDEbthvS7ZGeb7H6cxlx6vRYQdvoOKjNfBGgW5UkZPhoKfdmY67E4pn7UyV6vUu8Y+Dp 6WGedfISLnBkrJZ8Xi8bSGU5C7bBkmrC+43kt6c8hA1R6fI5R3mdIlIWUDYWVaTZdQpg 0LjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=uOtUMMJv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs11si23354226ejb.438.2021.10.19.05.36.02; Tue, 19 Oct 2021 05:36:29 -0700 (PDT) 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=@lunn.ch header.s=20171124 header.b=uOtUMMJv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235607AbhJSMeT (ORCPT + 99 others); Tue, 19 Oct 2021 08:34:19 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:46520 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbhJSMeS (ORCPT ); Tue, 19 Oct 2021 08:34:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding: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=naCPatSPieFjm2idIBaHbGp+IymFwGkWn28jPFF7KI0=; b=uO tUMMJv9BIdVH2emRu5mLcEcSC9Hm1vOnC7j01Qws+ZecyjE3t5JEyTGU/LCMT6HXkbv9LS48mZ8X4 Sc0+Q7peY8uioYke6w1/G2J/YE9Lch5XfBqpS9bygP/M1fAITutQ8bynnbScRDgzODK4aqPQm7SNQ 4MsVO0aUVozyWGA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mcoHd-00B4in-O5; Tue, 19 Oct 2021 14:31:57 +0200 Date: Tue, 19 Oct 2021 14:31:57 +0200 From: Andrew Lunn To: Jie Luo Cc: Luo Jie , hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sricharan@codeaurora.org Subject: Re: [PATCH v3 06/13] net: phy: add qca8081 read_status Message-ID: References: <20211018033333.17677-1-luoj@codeaurora.org> <20211018033333.17677-7-luoj@codeaurora.org> <0472b75b-9fd7-55e3-dc1b-f33786643103@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0472b75b-9fd7-55e3-dc1b-f33786643103@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 19, 2021 at 08:10:15PM +0800, Jie Luo wrote: > > On 10/19/2021 5:42 AM, Andrew Lunn wrote: > > > +static int qca808x_read_status(struct phy_device *phydev) > > > +{ > > > + int ret; > > > + > > > + ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_STAT); > > > + if (ret < 0) > > > + return ret; > > > + > > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->lp_advertising, > > > + ret & MDIO_AN_10GBT_STAT_LP2_5G); > > > + > > Could genphy_c45_read_lpa() be used here? > > > > Andrew > > Hi Andrew, > > Thanks for the comments,? the MDIO_STAT1 of PHY does not follow the > standard, bit0~bit6 of MDIO_STAT1 are > > always 0, genphy_c45_read_lpa can't be used. O.K. It is a shame the hardware partially follow the standard, but breaks it as well. Why go to the effort of partially following it, when you don't gain anything from it because you need custom code anyway? Andrew