Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752605AbdHUIKr (ORCPT ); Mon, 21 Aug 2017 04:10:47 -0400 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]:50732 "EHLO smtp.csie.ntu.edu.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbdHUIKp (ORCPT ); Mon, 21 Aug 2017 04:10:45 -0400 MIME-Version: 1.0 In-Reply-To: <20170820142545.GB24150@lunn.ch> References: <20170818122118.4925-1-clabbe.montjoie@gmail.com> <20170818122118.4925-4-clabbe.montjoie@gmail.com> <20170819185025.GB13266@Red> <20170819203836.GA21567@lunn.ch> <20170820065757.GA6081@Red> <20170820142545.GB24150@lunn.ch> From: Chen-Yu Tsai Date: Mon, 21 Aug 2017 16:10:17 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 3/4] net: stmmac: register parent MDIO node for sun8i-h3-emac To: Andrew Lunn Cc: Corentin Labbe , Chen-Yu Tsai , Rob Herring , Mark Rutland , Russell King , Maxime Ripard , Giuseppe Cavallaro , Alexandre Torgue , devicetree , linux-arm-kernel , linux-kernel , netdev Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1168 Lines: 29 On Sun, Aug 20, 2017 at 10:25 PM, Andrew Lunn wrote: >> I think we cannot use mdio-mux-mmioreg since the register for doing >> the switch is in middle of the "System Control" and shared with >> other functions. This is why we use a sycon/regmap for selecting >> the MDIO. > > You could add a mdio-mux-regmap.c. > > However, it probably need restructuring of the stmmac mdio code, to > make the mdio bus usable as a separate driver. You need stmmac mdio > to probe first, then mdio-mux-remap should probe, and then lastly > stmmmac mac driver. > > With stmmac mdio and stmmac mac being in one driver, there is no time > in the middle to allow the mux driver to probe. > > It is some effort, but a nice cleanup and generalization. I'm not sure mdio-mux is the right thing here. Looking at mdio-mux, it seems to provide a way to access multiplexed MDIO buses. It says nothing about the MAC<->PHY connection. With our hardware, and likely Rockchip's as well, the muxed connections include the MDIO and MII connections, which are muxed at the same time. It's likely to cause some confusion or even bugs if we implement it as a separate driver. ChenYu