Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp801699pxb; Wed, 3 Nov 2021 12:38:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMHZPvDkWZ+rQP4RgB9o9oOw+DDj8i87FBQ3+T6aRYt12LyNTPVey4xtRBj7VCrCPEAHh8 X-Received: by 2002:a5d:9d85:: with SMTP id ay5mr22561224iob.203.1635968295577; Wed, 03 Nov 2021 12:38:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635968295; cv=none; d=google.com; s=arc-20160816; b=W+NhtWQdAYltUEzL5PEITLakTPUHKsB76JBw5b12wk0MIBW8sW7tarISi29dzWS4WL 1u8fvlH4MurOJWKCSPUyCnBaiS/pw8ZEttkxcIzwkWQS/BQVaDmkF7Y3F6cRNmwcXeRN lvFHJBF8fffNymfYgEmhS8flK0w/vauYAKzpP3Ini+Q15Dom0hbhzqTxASyPFcPwZENy zu5xfjFLfv9dFOzTLp/a/dOw6q/xcXtcreWwdEN7YVZLmeeJJLrkJU0hN/9YG1ZQEJMz aJFPJswgCHE0omDk82m42KNgG8e+MuioDXkkpsPKW8su7GNlqtqPS4SXZvu7zE7xrbW6 z9MQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2u8+xxOn4g/JbmCkvm/SX9mKAxPVHUs+JVNIris0Gow=; b=fuOfsf8K/0Xkm+NwiZ7W3mtuUz1y/rd8W60P33OcVdFGxxwR/7EF1BUxKt3w/kg4nu AQ4cMrSkZfoFvq1wCf3Am/kYxTcMk2Q6dpUkr9nlhcexRDsSRqaDG+KHXcQc0tB3Itri qVSHllyiV3oTNKQWDKaFLCVylYyXcIRo2Bj5z3UaEa/4wrJAn0SYLPKwLdxFiaTRK0m1 6m2jxaNbU1VaqeE+CFo8ikZM2nufo14MVaSf/jjXhofcjtSyXCtReLuirk0vXbz1RRzm Gy079nmVCaFwaaOUjcCBC+FNIApTqouo8DE5wVmgnTxmmBedA+VjekqEKgLAhkxbE1ak binA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=BpO8NbkM; 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 s12si5205876ilv.119.2021.11.03.12.38.02; Wed, 03 Nov 2021 12:38:15 -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=BpO8NbkM; 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 S230281AbhKCTjg (ORCPT + 99 others); Wed, 3 Nov 2021 15:39:36 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:45662 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbhKCTjg (ORCPT ); Wed, 3 Nov 2021 15:39:36 -0400 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=2u8+xxOn4g/JbmCkvm/SX9mKAxPVHUs+JVNIris0Gow=; b=BpO8NbkMDafRWlcCmDTJzWtcUn AwNNb5RB9Jb6rwd5bXnjP+ZcisWRxogdevk8RoQAnFDP4O+9SO/doPtrCgiwD8SS9WbA1Bl4W5BF5 tYAYuy3cO8VqZPrBMvGSdzzNGBUtv6ZATTfvzX3dOgOr0PHBD10LDPI9TYYpQFhuh/1s=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1miM41-00CXAU-QW; Wed, 03 Nov 2021 20:36:49 +0100 Date: Wed, 3 Nov 2021 20:36:49 +0100 From: Andrew Lunn To: Grygorii Strashko Cc: "Russell King (Oracle)" , "David S. Miller" , netdev@vger.kernel.org, Jakub Kicinski , Heiner Kallweit , Florian Fainelli , linux-kernel@vger.kernel.org, Vignesh Raghavendra Subject: Re: [RFC PATCH] net: phy/mdio: enable mmd indirect access through phy_mii_ioctl() Message-ID: References: <828e2d69-be15-fe69-48d8-9cfc29c4e76e@ti.com> <8d24c421-064c-9fee-577a-cbbf089cdf33@ti.com> <01a0ebf9-5d3f-e886-4072-acb9bf418b12@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01a0ebf9-5d3f-e886-4072-acb9bf418b12@ti.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 03, 2021 at 08:42:07PM +0200, Grygorii Strashko wrote: > > > On 03/11/2021 02:27, Andrew Lunn wrote: > > > > What i find interesting is that you and the other resent requester are > > > > using the same user space tool. If you implement C45 over C22 in that > > > > tool, you get your solution, and it will work for older kernels as > > > > well. Also, given the diverse implementations of this IOTCL, it > > > > probably works for more drivers than just those using phy_mii_ioctl(). > > > > > > Do you mean change uapi, like > > > add mdio_phy_id_is_c45_over_c22() and > > > flag #define MDIO_PHY_ID_C45_OVER_C22 0x4000? > > > > No, i mean user space implements C45 over C22. Make phytool write > > MII_MMD_CTRL and MII_MMD_DATA to perform a C45 over C22. > > Now I give up - as mentioned there is now way to sync User space vs Kernel > MMD transactions and so no way to get trusted results. Except that it will probably work 99% of the time, which is enough for a debug tool. phylib is pretty idle most of the time, it just polls the PHY once a second to see if the link status has changed. And does not poll at all if interrupts are wired up. And you can always do a read three times and see if you get the same answer, or do a write followed by a read to see if the write actually happened correctly, or corrupted some other register. Andrew