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=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 95393C433DB for ; Wed, 17 Feb 2021 13:27:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5227264E63 for ; Wed, 17 Feb 2021 13:27:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232967AbhBQN0s (ORCPT ); Wed, 17 Feb 2021 08:26:48 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:45756 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232944AbhBQN0d (ORCPT ); Wed, 17 Feb 2021 08:26:33 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lCMpw-006tfi-Fw; Wed, 17 Feb 2021 14:25:48 +0100 Date: Wed, 17 Feb 2021 14:25:48 +0100 From: Andrew Lunn To: Nathan Rossi Cc: Florian Fainelli , netdev@vger.kernel.org, Nathan Rossi , Heiner Kallweit , "David S. Miller" , Jakub Kicinski Subject: Re: [PATCH] of: of_mdio: Handle properties for non-phy mdio devices Message-ID: References: <20210215070218.1188903-1-nathan@nathanrossi.com> <55c94cf4-f660-f0f5-fb04-f51f4d175f53@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Feb 17, 2021 at 02:48:30PM +1000, Nathan Rossi wrote: > On Wed, 17 Feb 2021 at 13:19, Andrew Lunn wrote: > > > > > > The patch does make sense though, Broadcom 53125 switches have a broken > > > > turn around and are mdio_device instances, the broken behavior may not > > > > show up with all MDIO controllers used to interface though. For the > > > > > > Yes the reason we needed this change was to enable broken turn around, > > > specifically with a Marvell 88E6390. > > > > Ah, odd. I've never had problems with the 6390, either connected to a > > Freecale FEC, or the Linux bit banging MDIO bus. > > > > What are you using for an MDIO bus controller? Did it already support > > broken turn around, or did you need to add it? > > Using bit bang MDIO to access the 88e6390. I suspect the issue is > specific to the board design, another similar design we have uses bit > bang MDIO but a 88e6193x switch and does not have any issue with turn > around. So to me, it sounds like changing the data pin, by the host, from being driven to high impedance, is taking too long. So this is a bus problem, not a per device on the bus problem. You need to indicate to the bus controller that all addresses on the bus have broken turn around, not just one. If you look at mdio-bitbang.c it has: /* check the turnaround bit: the PHY should be driving it to zero, if this * PHY is listed in phy_ignore_ta_mask as having broken TA, skip that */ if (mdiobb_get_bit(ctrl) != 0 && !(bus->phy_ignore_ta_mask & (1 << phy))) { /* PHY didn't drive TA low -- flush any bits it * may be trying to send. */ for (i = 0; i < 32; i++) mdiobb_get_bit(ctrl); return 0xffff; } So the property it specific to one address. And the mv88e6xxx normally takes up multiple addresses on the bus. So i would do this differently. Add a new property to "mdio-gpio" to indicate the host has broken turn around, and it needs to set all 32 bits of bus->phy_ignore_ta_mask. Andrew