From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82B34C04AB6 for ; Tue, 28 May 2019 15:31:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B118206E0 for ; Tue, 28 May 2019 15:31:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="dmzRWfZr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727033AbfE1Pb3 (ORCPT ); Tue, 28 May 2019 11:31:29 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:35678 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbfE1Pb3 (ORCPT ); Tue, 28 May 2019 11:31:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender: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=pQmCnrgUrKdkpeL0zToWxhvhTOp0gWpr7+IEj+29RPk=; b=dmzRWfZr3zZcYCBwR+3FlXrG4M erWgoC2eUi46EVf2x6cBFAwvsvmGecQYQLru+ozGbEzkSg9DVxEEWk7BwdMENbpL59hbsLvi98y1w /oRQgW20+V5upmr4DGoOAwTgmcmL6fsJI0JMunQQ89S19Zhosuno1p4IPJ7uXjlutGwE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hVe4T-0007tE-07; Tue, 28 May 2019 17:31:24 +0200 Date: Tue, 28 May 2019 17:31:24 +0200 From: Andrew Lunn To: Russell King - ARM Linux admin Cc: Vladimir Oltean , "David S. Miller" , Florian Fainelli , Heiner Kallweit , netdev Subject: Re: [PATCH net-next 3/5] net: phy: allow Clause 45 access via mii ioctl Message-ID: <20190528153124.GM18059@lunn.ch> References: <20190528095639.kqalmvffsmc5ebs7@shell.armlinux.org.uk> <20190528132745.m4iuh6ggib3a5kiq@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190528132745.m4iuh6ggib3a5kiq@shell.armlinux.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > > Hi Russell, > > > > I find the SIOCGMIIREG/SIOCGMIIPHY ioctls useful for C45 just as much > > as they are for C22, but I think the way they work is a big hack and > > for that reason they're less than useful when you need them most. > > These ioctls work by hijacking the MDIO bus driver of a PHY that is > > attached to a net_device. Hence they can be used to access at most a > > PHY that lies on the same MDIO bus as one you already have a > > phy-handle to. > > If you have a PHY issue that makes of_phy_connect fail and the > > net_device to fail to probe, basically you're SOL because you lose > > that one handle that userspace had to the MDIO bus. > > Similarly if you're doing a bring-up and all PHY interfaces are fixed-link. > > Maybe it would be better to rethink this and expose some sysfs nodes > > for raw MDIO access in the bus drivers. > > I don't see how putting some attributes in sysfs helps > What would be better would be for the MDIO layer to have /dev nodes > that userspace could use to access the bus independent of the PHY, > much the same as we have /dev/i2c-* - but I'm not sure if we really > want to invent a whole new interface to MDIO buses. There is work on re-implementing ethtool using a netlink socket. The proposed code supports the current MII interface. However, it should be possible to extend it to pass some other identifier for the PHY, rather than going via the network interface it is attached to. Once ethtool netlink gets merged, i will take a look at this. Andrew