Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1553500ybh; Tue, 14 Jul 2020 00:28:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrAx49GssQEKCgd6gU/RoF3cRZnWPDnTHyWUpqoa7VwAmDApDXDdTtPm/La1F6PJ99TJnX X-Received: by 2002:aa7:d693:: with SMTP id d19mr3251171edr.317.1594711682043; Tue, 14 Jul 2020 00:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594711682; cv=none; d=google.com; s=arc-20160816; b=JC1XWmHoaSBEiwMxzpDJSp8oySB7a7LznfRbJ3WN7qQSFa0kXqn2LYEanKiALkHoux BgtmU2vROAyYyOCvvYYK3gLaWioIbuLLRgbTUQM5q1CoXSnBXjT+fEoZgldNmsv/sKl+ VCqch/EVOGiPD7WfXth2DQ+EbnsbR3TOaTJUAdsZJA2O5bmgMzBvpedqEyASZEBNNUSk pfbmY9H9/S7DEEKMaPVYJHHIVZHlCWiBbHgp0gldW9orLaVXrNDiyy3zNLRYxwCoiNUJ Lm0oGZe1OWRRNgD5jMqLkoAMaMpHbe7Njd3XTCDvkaRP8gTVL0xCuZ8FUtbgDmy4AHsv T97g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=LcQhS5qp7UCEfLtEDz/biqiSKlAB80RZQ+Nk4sc94JU=; b=rhmQAXK0tXjy3Myf86Pm/LUDhvLbe5QwuUpYqCuTzjYTQOkiqZ9+akyvn+cD3U2K1K av571tTPtK23kg2JBSkQvcCurIiFQaZk+dPsaTjqO3AMtGxeXcSvBNaaKXx7OcEW/poc KpPj2JPFp/3gHn+hMVkF9uv/f69O96K5jRSxKsxwWH2KjjTK4HNq+pCXg13+x3d2B/JJ aXMUhsx3Mo8jmU3DTM6Lt8p3Pu7m3ResxWzbF04BkJs/HIFOT2MNA5qJe+AB3qMsQB0C nQGexkG9ASqhi/G61dLHm0ei1ckqLdEFU/P+yBlDcH4EMRXW291OOmzFExLTTBbRK1nH OOqQ== 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 z3si9965422ejc.547.2020.07.14.00.27.39; Tue, 14 Jul 2020 00:28:02 -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 S1725816AbgGNHZI (ORCPT + 99 others); Tue, 14 Jul 2020 03:25:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbgGNHZH (ORCPT ); Tue, 14 Jul 2020 03:25:07 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44EB9C061755 for ; Tue, 14 Jul 2020 00:25:07 -0700 (PDT) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jvFJJ-0003dJ-03; Tue, 14 Jul 2020 09:25:05 +0200 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1jvFJF-00021h-7T; Tue, 14 Jul 2020 09:25:01 +0200 Date: Tue, 14 Jul 2020 09:25:01 +0200 From: Oleksij Rempel To: Andrew Lunn Cc: Florian Fainelli , Heiner Kallweit , "David S. Miller" , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Philippe Schenker Subject: Re: [PATCH net-next v1 5/5] net: phy: micrel: ksz886x/ksz8081: add cabletest support Message-ID: <20200714072501.GA5072@pengutronix.de> References: <20200710120851.28984-1-o.rempel@pengutronix.de> <20200710120851.28984-6-o.rempel@pengutronix.de> <20200711182912.GP1014141@lunn.ch> <20200713041129.gyoldkmsti4vl4m2@pengutronix.de> <20200713151719.GE1078057@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200713151719.GE1078057@lunn.ch> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 09:17:19 up 35 days, 15:44, 130 users, load average: 0.20, 0.35, 0.35 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 13, 2020 at 05:17:19PM +0200, Andrew Lunn wrote: > > > Hi Oleksij > > > > > > Do the PHY register read/writes pass through the DSA driver for the > > > 8873? I was wondering if the switch could intercept reads/writes on > > > port1 for KSZ8081_LMD and return EOPNOTSUPP? That would be a more > > > robust solution than DT properties, which are going to get forgotten. > > > > Yes, it was my first idea as well. But this switch allows direct MDIO > > access to the PHYs and this PHY driver could be used without DSA driver. > > Not sure if we should support both variants? > > > > Beside, the Port 1 need at least one more quirk. The pause souport is > > announced but is not working. Should we some how clear Puase bit in the PHY and > > tell PHY framework to not use it? What is the best way to do it? > > It all seems rather odd, the way one PHY is messed up, but the other > works. Does this PHY exist as a standalone device, not integrated into > the switch? Do the same erratas apply to such a standalone device? I found multiple microchip devices with same PHYid: KSZ8463, KSZ8851 KSZ8463 - switch. Would be covered by DSA driver KSZ8851 - single MAC device with PHY. Supported by ethernet/micrel driver. This erratum is not documented for other devices. So it may exist or not. > If the issues are just limited to integrated PHYs, there is maybe > something you can do via DSA: > > in slave.c: > > static int dsa_slave_phy_setup(struct net_device *slave_dev) > { > ... > if (ds->ops->get_phy_flags) > phy_flags = ds->ops->get_phy_flags(ds, dp->index); > > ret = phylink_of_phy_connect(dp->pl, port_dn, phy_flags); > > It is either B53 or SF2 which uses this, i forget which. flags get > or'ed into phydev->dev_flags. These are device specific flags. So you > could define a bit to represent this errata. And then in the PHY > driver do whatever needs to be done when you see the flag set for a > specific PHY. > > If Pause is broken, then yes, it would be good to remove the Pause > from the available features, and return an error if requested to use > it. OK. So, i'll cover both errata with separate flags? Set flags in the DSA driver and apply workarounds in the PHY. ACK? Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |