Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp3881519ybg; Sun, 7 Jun 2020 13:43:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhPXWWQfuVW41dVqkTOlkSNJ94nsIeywqprzup1jvJmc8YD+R03dhH5kETqOe2+1aIT+Uk X-Received: by 2002:aa7:cd6c:: with SMTP id ca12mr19548108edb.36.1591562638906; Sun, 07 Jun 2020 13:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591562638; cv=none; d=google.com; s=arc-20160816; b=VhZUh7eOkuKGBt89iEC/bqH+VAEwP0kKkuraVBRQbeUmTfMW9e5IvQvILMnr3G5plW AP1jHGxfaLMqU4BbhKT/Im56ZHV9T5Qrl7/Jv7MjZFp2+qzI3GD23aAlzlohSyAA8C2X h2ywqXFDcpwKMY1BiJZdoRkh9YrZSVp+eZ6HRTL2d/fSCKXxT39EiFzu41a2/Z94c/YB KofH6UrXY74fKIQugEpSWMFiGvObuhQ4oFEuGvE3NbK7vwImt8MA4fsRc5YuxsVIb+7j 1J7gVuIDuLL5nJUm8Bg1R+QrgnkobfaIIxNYVgxca6T5cuyo1Hj6yfU4YZ6EhSx5yatq 4wug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=84NUuHy/biDFN23zC9Dy12/L7VVgxekJsVRzn8a43iM=; b=NYc935tqswyg75U54weeiLnSlEhFVYhValC99DKvzLvxoBiQBz2jrpDDgfVSFfLF1O 1w8QXyUUjYC6MXfNF2AKHiKtb2FUYabMgCxpY11SIImdGv1rlVDsLCmLdyKANvLimroa uBDOVOavlADSqiFSY8cOihNPS35lJXPeTVkKB6T02kYYpzvI3ZnsB5Dv4UsrtI3N6YRr ocPPj9I1WOvUJdosBKdiFFzdBhMGwI62e6Eg43ggKMLw7JP01zfyW8F4RhPMPZ7gWqIr 2NHMDhlwWjrLa91FltzJtZEC8D6MM6qD7bMvPkkOKfD71YCJtvFLKQwrIL92EB7uu3jB d/XA== ARC-Authentication-Results: i=1; mx.google.com; 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 u24si7788989ejo.396.2020.06.07.13.43.35; Sun, 07 Jun 2020 13:43:58 -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; 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 S1727829AbgFGUjp (ORCPT + 99 others); Sun, 7 Jun 2020 16:39:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:34018 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbgFGUjo (ORCPT ); Sun, 7 Jun 2020 16:39:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 21CEDABCE; Sun, 7 Jun 2020 20:39:45 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id A7FA8602EB; Sun, 7 Jun 2020 22:39:40 +0200 (CEST) Date: Sun, 7 Jun 2020 22:39:40 +0200 From: Michal Kubecek To: Oleksij Rempel Cc: Andrew Lunn , "David S. Miller" , Florian Fainelli , Heiner Kallweit , Jakub Kicinski , Jonathan Corbet , "John W. Linville" , David Jander , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Russell King , mkl@pengutronix.de, Marek Vasut , Christian Herber , Amit Cohen , Petr Machata Subject: Re: [PATCH v2 2/3] netlink: add master/slave configuration support Message-ID: <20200607203940.7ayqe4otoop7mpuw@lion.mk-sys.cz> References: <20200528115414.11516-1-o.rempel@pengutronix.de> <20200528115414.11516-3-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="l7kwu7ebk7fahgx4" Content-Disposition: inline In-Reply-To: <20200528115414.11516-3-o.rempel@pengutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --l7kwu7ebk7fahgx4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 28, 2020 at 01:54:13PM +0200, Oleksij Rempel wrote: > This UAPI is needed for BroadR-Reach 100BASE-T1 devices. Due to lack of > auto-negotiation support, we needed to be able to configure the > MASTER-SLAVE role of the port manually or from an application in user > space. >=20 > The same UAPI can be used for 1000BASE-T or MultiGBASE-T devices to > force MASTER or SLAVE role. See IEEE 802.3-2018: > 22.2.4.3.7 MASTER-SLAVE control register (Register 9) > 22.2.4.3.8 MASTER-SLAVE status register (Register 10) > 40.5.2 MASTER-SLAVE configuration resolution > 45.2.1.185.1 MASTER-SLAVE config value (1.2100.14) > 45.2.7.10 MultiGBASE-T AN control 1 register (Register 7.32) >=20 > The MASTER-SLAVE role affects the clock configuration: >=20 > -------------------------------------------------------------------------= ------ > When the PHY is configured as MASTER, the PMA Transmit function shall > source TX_TCLK from a local clock source. When configured as SLAVE, the > PMA Transmit function shall source TX_TCLK from the clock recovered from > data stream provided by MASTER. >=20 > iMX6Q KSZ9031 XXX > ------\ /-----------\ /------------\ > | | | | | > MAC |<----RGMII----->| PHY Slave |<------>| PHY Master | > |<--- 125 MHz ---+-<------/ | | \ | > ------/ \-----------/ \------------/ > ^ > \-TX_TCLK >=20 > -------------------------------------------------------------------------= ------ >=20 > Since some clock or link related issues are only reproducible in a > specific MASTER-SLAVE-role, MAC and PHY configuration, it is beneficial > to provide generic (not 100BASE-T1 specific) interface to the user space > for configuration flexibility and trouble shooting. >=20 > Signed-off-by: Oleksij Rempel > --- The patch looks good from technical point of view but I don't like the inconsistency of user interface: 1. Similar to what we discussed earlier on kernel side, you use "Port mode" in "ethtool " output but the corresponding command line argument for "ethtool -s ..." is "master-slave". Even if it's documented, it's rather confusing for users. 2. The values for "master-slave" parameter are "master-preferred" and "master-force" (and the same for "slave"). Please use the same form for both, i.e. either "prefer / force" or "preferred / forced". Also, it would be friendlier to users to make the values consistent with "ethtool " output, e.g. if it says "preferred Master", setting should use something as close as possible, i.e. "preferred-master". Michal --l7kwu7ebk7fahgx4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEWN3j3bieVmp26mKO538sG/LRdpUFAl7dUIwACgkQ538sG/LR dpUmpQgAwWvl06RefAuj2JRXHp/zqo4YSDZo1qtI7EshQfSeZJ2v0q+aHpTXbxfd QSDSqyDAYHWB1W5jpcnylaRBzASWzeeHLuOf7JHkud5WqnM+tj/gpOkDNWcZVn7Z KbanU+3GqZwSbtwHue9SaYS+FAPX/W38GZ8Jdc6PJdq0kkqmGSpwse61IdcMc2oD 2ovpaRibYqvhsyAdRTNIAbksSO2jbIubnNsscqoeRti3PwNbsldmIiLIOEv3CZ36 h/WQOTNOlYfCcQ9nK6S/ZBpDhEVR1UckoyhNFQfkZl6yj34QUchADiRZD2bsAOTA Q1Ri0Bo3iWaEfGqHDmt+uFsBxf/cEQ== =+bKp -----END PGP SIGNATURE----- --l7kwu7ebk7fahgx4--