Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp888603rdb; Tue, 30 Jan 2024 01:21:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFV/YM9/0uXklW6lxN4VCwY++CbeQtHtwm0JU2FU3V2osWc+vfIsWbwLtmfxQ+u+dn9TEpr X-Received: by 2002:a17:906:81d0:b0:a28:d1f9:976 with SMTP id e16-20020a17090681d000b00a28d1f90976mr6188144ejx.65.1706606462591; Tue, 30 Jan 2024 01:21:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706606462; cv=pass; d=google.com; s=arc-20160816; b=bQrW6kOASHKVm3Wu+HDC6T0rf5YND8+3MZyhAUADLIE45EKjd7Tha0oRBmQbc5lNwx j6y7A3tkcElj8E/oRbIpYAtvLvUYGge+d6sNLECF0BHvKz2Oyc+tmzS/s3LtozTAOghV 5jOhb3rQHXHkNIX5UQ0qTmbkmxQmJnLJ3RialWKhTR3Ec61Ol1G97lPZpnl/mnnKndlz D6VP7YtxNn6vucHEKunzjsiQk8l8ssVpwNdd/9YLAOOMK+rnPX83TBr2jsQsD1ojeTMv +usHseLAvea9bcNx42tGzv4oGTYi5Pvg0roim5xDFiZjTvZA9ngPW1u8gXoSCro+5OnF Ow0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=kU36CYdnPcH+FrO8kgFOVGAhAwd9owDMjxmJHm6nww0=; fh=KvBHHZGJoFls+G+9LNHeNjQQ2yGvj8Bfte4Sdrm11Nc=; b=CiNWvURxhWB+BbMLgqAlrK87DVQuEU5d9hzxql4pG2+W1/CEfkUPzvoj020AMcUhCy rK1jebEcYEmsj10tCXQnPUEXg60fUzQKl4sD4h0jvyuYmP5yq2tuUM8H/Nsh2QYH+hOQ XyDktPJVY/1K5e7VJcJUUjd1POfebeUHyN8LVECS6PrylMVN/LLwX3mACReWDKCIGyg2 FPuYugfsNyov9xHPYx7hoVisR0VCtSoUZwP3msyOyagWyd157AUpQit9pyeQysa9rHgl rYfuhES+yKmiKXg0OU5vbUhRw5dDhs5LjG/P4V7kjFpwfsdpE7LdLAvpr7G8lWssA3KX ZgiA== ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=xF12tB6u; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-44240-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44240-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r14-20020a170906350e00b00a3605794828si795604eja.125.2024.01.30.01.21.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 01:21:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44240-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=xF12tB6u; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-44240-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44240-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5882E1F2913F for ; Tue, 30 Jan 2024 09:21:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80B0A605B7; Tue, 30 Jan 2024 09:19:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="xF12tB6u" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1736565BD1; Tue, 30 Jan 2024 09:19:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706606378; cv=none; b=mg2TBW2X8e9J8iFuC/9keHgmT3EbfDHQJQlg9wHtW3EUPbKy71eU2MYvM7yZTMcGwWtteDme6sA1VWtCpNd/VevnN9+cvbiotTMhAOPRoWqe5gqsPmA7oZKomYDNDUdoWm3bFpZGoAlhTqPUTDdgvT3BV+aljENjfjiLCo8UyA4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706606378; c=relaxed/simple; bh=mZEotDZ+SGxElmOQBjckvcNfNNM2pdGS73nEJ+umJ9c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aTGcAProQDqjQJBnJCXTX/8sSyhzXK7IiUyK6KpO/y/oG+OkoF/h+aavRwN5aJ++GHaULdrTnhOFDxoT7N7lP3ZbNyarIoHcYRTTRmlOLPR2eag7R5nQ6aOiPa1eifz8TxY3mvhGz/S+j+c17zNC2VK+wZG1RXzicCucm4j/OWc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=xF12tB6u; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kU36CYdnPcH+FrO8kgFOVGAhAwd9owDMjxmJHm6nww0=; b=xF12tB6utNFsLwI11k2Rhw2bFF zhzjR638ZTG/PznXjSSPmesH6QDSGNANbH6YdKQxpt7Fnsj1N2BW4D4hsQ9nI0lMw9UXEIKQvJLQK bN5DwlJ3h7zarhJAb1YDz69K90AJxRfxjAVDbAq4UVvzuqscI3kPMP/rLZ9tz3M2W0pFSKqMVxG2d J2/IPsWJYGZTx9IzSyjLteQ5lg3sX2HMbFViiePGxFFeKSHgTednvFMWA/dfXuIyF1bgF8NKqt1bl 6NX3+1xoEHPXda6UBymKGxfCdJ/F667BF4o0+xW5RPPkLoqDrzWn8TdfDmI0Eqoj6jql+Tlaz4re2 X1l1TrbQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48146) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rUkHE-0001V1-1T; Tue, 30 Jan 2024 09:19:32 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rUkHC-0005OK-Re; Tue, 30 Jan 2024 09:19:30 +0000 Date: Tue, 30 Jan 2024 09:19:30 +0000 From: "Russell King (Oracle)" To: Dimitri Fedrau Cc: Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Stefan Eichenberger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 net-next 09/13] net: phy: marvell-88q2xxx: add cable test support Message-ID: References: <20240122212848.3645785-1-dima.fedrau@gmail.com> <20240122212848.3645785-10-dima.fedrau@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240122212848.3645785-10-dima.fedrau@gmail.com> Sender: Russell King (Oracle) On Mon, Jan 22, 2024 at 10:28:42PM +0100, Dimitri Fedrau wrote: > +static int mv88q222x_cable_test_get_status(struct phy_device *phydev, > + bool *finished) > +{ > + int ret; > + u32 dist; > + > + ret = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_MMD_PCS_MV_TDR_STATUS); > + if (ret < 0) > + return ret; > + > + *finished = true; > + /* fault length in meters */ > + dist = ((ret & MDIO_MMD_PCS_MV_TDR_STATUS_DIST_MASK) >> > + MDIO_MMD_PCS_MV_TDR_STATUS_DIST_SHIFT) * 100; dist = FIELD_GET(MDIO_MMD_PCS_MV_TDR_STATUS_DIST_MASK, ret) * 100; -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!