Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp7023082ybn; Mon, 30 Sep 2019 07:31:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIqvLlfOaEd8bI+RVYvDADlDZJV8mH5RNav1R8EN3BxwK7fSshPkeYOX7zaooskYwO2HPx X-Received: by 2002:a17:906:3294:: with SMTP id 20mr19429048ejw.19.1569853894512; Mon, 30 Sep 2019 07:31:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569853894; cv=none; d=google.com; s=arc-20160816; b=Sx7eowYLszQCz+RfSsMBTp2ojNTbWigE40VkOT8jDGY8lqXBgCFP9OUlTILzsDMwFu 4yK2b1CYCfwFNu2hQoZW8NU2vu2MVbAkyIv5u4AtRw0DT50Om8PHlVviSx2RB8JVzKEI tTt3uxt55eLhcS3PhaGkM2jpbZ/jHY+oLG/EBrzMo2lGDrCLEwVg6ORTHYaOs4Azanme Gh6ssX0SXx/XvyfDVcm0YM8m9McBwWF1ER8L2/WImyMHsUeSQ2Ud29uelguPswz/EUSm rJTY2BejSPSDHvpQcrDc/Jh7Czf560IZdTFBykGerOPkiFWCQzwlG3ajSJHbynCIav0p fzcw== 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=v6TbbNHnOB3Lx5fLib4zuDP0qiqUX3OhrpKJ4Pk+NHQ=; b=BWLhm0h+nlkBH8y6OiBowdTJHkakArU3m7ylFvW2ZjSBWR6JrFweq5syoKIGft+C21 Mo+YT0tCZd2Zn+/RQQQpPNhD1gkkGVWABdyFWKVnjG1diaqzhgGNGdxRk6lij+KD0Ty4 73t3FOUpFx/6ayWfn94b8QzhZXK5aM6qAYgx+LCg2VXFJ79ZpzFz9AmnF6bJJvfbtr+F UbasaEeMn9TDlBqmos3ehBip6pm0X/Gt2M8xLsPxiBk0/mafaXV0IRMMaMXWBxe77SPf XNLbLcO6gy+l/1EWCrwbNucUmBI3YwCKESaGEqXoWKmjvcmVaOlbsB99pMu7doFPAlYD JkVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1si7081381ejf.305.2019.09.30.07.31.08; Mon, 30 Sep 2019 07:31:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731441AbfI3O3K (ORCPT + 99 others); Mon, 30 Sep 2019 10:29:10 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:35473 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726314AbfI3O3K (ORCPT ); Mon, 30 Sep 2019 10:29:10 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iEwfl-0006uw-0T; Mon, 30 Sep 2019 16:29:09 +0200 Received: from ore by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iEwfj-0006TF-S1; Mon, 30 Sep 2019 16:29:07 +0200 Date: Mon, 30 Sep 2019 16:29:07 +0200 From: Oleksij Rempel To: Andrew Lunn Cc: Jay Cliburn , Chris Snook , linux-kernel@vger.kernel.org, Pengutronix Kernel Team , netdev@vger.kernel.org, "David S. Miller" Subject: Re: [PATCH v1] net: ag71xx: fix mdio subnode support Message-ID: <20190930142907.wo3tahtg7g7mvfmp@pengutronix.de> References: <20190930093310.10762-1-o.rempel@pengutronix.de> <20190930134209.GB14745@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190930134209.GB14745@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: 16:18:43 up 135 days, 20:36, 87 users, load average: 0.00, 0.02, 0.00 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 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, Sep 30, 2019 at 03:42:09PM +0200, Andrew Lunn wrote: > On Mon, Sep 30, 2019 at 11:33:10AM +0200, Oleksij Rempel wrote: > > The driver was working with fixed phy without any noticeable issues. This bug > > was uncovered by introducing dsa ar9331-switch driver. > > > > Signed-off-by: Oleksij Rempel > > --- > > drivers/net/ethernet/atheros/ag71xx.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c > > index 6703960c7cf5..d1101eea15c2 100644 > > --- a/drivers/net/ethernet/atheros/ag71xx.c > > +++ b/drivers/net/ethernet/atheros/ag71xx.c > > @@ -526,7 +526,7 @@ static int ag71xx_mdio_probe(struct ag71xx *ag) > > struct device *dev = &ag->pdev->dev; > > struct net_device *ndev = ag->ndev; > > static struct mii_bus *mii_bus; > > - struct device_node *np; > > + struct device_node *np, *mnp; > > int err; > > > > np = dev->of_node; > > @@ -571,7 +571,9 @@ static int ag71xx_mdio_probe(struct ag71xx *ag) > > msleep(200); > > } > > > > - err = of_mdiobus_register(mii_bus, np); > > + mnp = of_get_child_by_name(np, "mdio"); > > + err = of_mdiobus_register(mii_bus, mnp); > > + of_node_put(mnp); > > if (err) > > goto mdio_err_put_clk; > > Hi Oleksij > > You need to keep backwards compatibility here. If you find an mdio > node, use it, but if not, you need to still register np. > > This is also extending the driver binding, so you need to update the > binding documentation. Hi Andrew, Normally i would agree. But in this case: - this driver is freshly added to the kernel and is different to OpenWrt implementation any way. No users from this side. - Devicetree binding says: Documentation/devicetree/bindings/net/qca,ar71xx.txt |Optional properties: |- phy-handle : phandle to the PHY device connected to this device. |- fixed-link : Assume a fixed link. See fixed-link.txt in the same directory. | Use instead of phy-handle. | |Optional subnodes: |- mdio : specifies the mdio bus, used as a container for phy nodes | according to phy.txt in the same directory So, it is driver bug ...ooOO (my personal bug :D) I would say: if some one already started to use this driver, didn't used documentation and didn't reported this bug, can't really blame any one here :) Regards, Oleksij -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |