Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1387419

Re: [PATCH 1/6] bus: Add shared MDIO bus framework

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH 1/6] bus: Add shared MDIO bus framework
Date Tue, 26 Apr 2016 14:20:02 +0200
Message-ID <rsa8a-7In-7@gated-at.bofh.it> (permalink)
References <rqiWe-6OB-7@gated-at.bofh.it> <rqj5U-6Uw-19@gated-at.bofh.it> <rrVLQ-3EY-13@gated-at.bofh.it> <rs6Hf-4gv-7@gated-at.bofh.it>
X-Original-To Pramod Kumar <pramod.kumar@broadcom.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 63
Organization linux.* mail to news gateway
X-Original-Cc Rob Herring <robh+dt@kernel.org>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, Masahiro Yamada <yamada.masahiro@socionext.com>, Chen-Yu Tsai <wens@csie.org>, Mark Rutland <mark.rutland@arm.com>, devicetree@vger.kernel.org, Pawel Moll <pawel.moll@arm.com>, Arnd Bergmann <arnd@arndb.de>, Suzuki K Poulose <suzuki.poulose@arm.com>, netdev@vger.kernel.org, Punit Agrawal <punit.agrawal@arm.com>, linux-kernel@vger.kernel.org, BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>, linux-arm-kernel@lists.infradead.org, Anup Patel <anup.patel@broadcom.com>
X-Original-Date Tue, 26 Apr 2016 14:13:35 +0200
X-Original-Message-ID <20160426121335.GC11668@lunn.ch>
X-Original-References <1461230323-27891-1-git-send-email-pramod.kumar@broadcom.com> <1461230323-27891-2-git-send-email-pramod.kumar@broadcom.com> <20160425205650.GA31129@lunn.ch> <666dffb41a922b0c8638f2f002a2de08@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1387419

Show key headers only | View raw


On Tue, Apr 26, 2016 at 02:03:27PM +0530, Pramod Kumar wrote:
> Hi Andrew,
> 
> Thanks for reviewing. I really appreciate your effort it.
> 
> I am already aware of MDIO mux framework but did not see it fit for our
> use case due to below limitations:
> 
> 1.  Current MDIO mux framework is Ethernet centric and it is only meant to
> mux multiple MII buses using same MDIO controller.  This means it is only
> meant for MII-compliant PHY devices (i.e. PHY devices having registers
> as-per MII specs).

Nope, this is wrong. You can have a mixture of PHYs and other MDIO
devices on the MII bus. The framework does not care. A PHY is a
special case of an MDIO device.

> 2.  The MDIO mux framework registers each child bus as MII bus. The Linux
> Ethernet MDIO framework will scan for all attached PHY devices on given
> MII bus and try to read MII PHY_ID register which is not present in all
> Broadcom non-ethernet PHYs.

It only performs a scan if you don't list the devices in the device
tree. If you do list devices, and include the address on the bus, it
never scans.

A good example of this is Ethernet switches. They occupy multiple
addresses on the MDIO bus, and also do not implement the PHY_ID
register at each address. Yet the MDIO layer is happy with this.

> 3. Let's say we ignore point1 and point2 above  and go ahead and use MDIO
> mux framework then we will still have to emulated MII PHY_ID read for
> non-ethernet PHYs.

Nope. Not at all. You have an MDIO device on the bus, not an Ethernet
PHY. Hence the device is not liked to the PHY state machine, etc.

The key concept to get here is that there are MDIO devices, and a
subset of MDIO devices are Ethernet PHYs.....

> 4. Apart from these, by using MDIO mux framework we are making our
> non-ethernet PHYs dependent on Linux network drivers which is not
> acceptable. What if some product line does not need network subsystem at
> all?

This is your only valid point. However, does Broadcom have a product
line which does not include networking? Is not Broadcom a network SoC
vendor?

> 
> As you can see from above points, trying to re-use Linux Ethernet MDIO mux
> framework for non-Ethernet PHYs is not the right way.

And as i pointed out, all your arguments are wrong, bar one. And i
doubt that one argument is sufficient to duplicate a lot of code which
already exists and does 95% of what you need.

> I'll add PCIe PHYs driver based on Shared MDIO framework in next patch
> revision to get a feel of its need.

Great. Lets then see what is needed to turn it into an MDIO device.

       Andrew

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Add Shared MDIO framework for iProc based SoCs Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-21 11:20 +0200
  [PATCH 1/6] bus: Add shared MDIO bus framework Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-21 11:30 +0200
    Re: [PATCH 1/6] bus: Add shared MDIO bus framework David Miller <davem@davemloft.net> - 2016-04-24 20:20 +0200
      RE: [PATCH 1/6] bus: Add shared MDIO bus framework Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-25 06:20 +0200
    Re: [PATCH 1/6] bus: Add shared MDIO bus framework Andrew Lunn <andrew@lunn.ch> - 2016-04-25 23:00 +0200
      RE: [PATCH 1/6] bus: Add shared MDIO bus framework Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-26 10:40 +0200
        Re: [PATCH 1/6] bus: Add shared MDIO bus framework Andrew Lunn <andrew@lunn.ch> - 2016-04-26 14:20 +0200
          Re: [PATCH 1/6] bus: Add shared MDIO bus framework David Miller <davem@davemloft.net> - 2016-04-26 18:30 +0200
          Re: [PATCH 1/6] bus: Add shared MDIO bus framework Florian Fainelli <f.fainelli@gmail.com> - 2016-04-26 19:30 +0200
            Re: [PATCH 1/6] bus: Add shared MDIO bus framework Andrew Lunn <andrew@lunn.ch> - 2016-04-26 19:50 +0200
            Re: [PATCH 1/6] bus: Add shared MDIO bus framework Arnd Bergmann <arnd@arndb.de> - 2016-04-26 20:00 +0200
              Re: [PATCH 1/6] bus: Add shared MDIO bus framework Andrew Lunn <andrew@lunn.ch> - 2016-04-26 20:30 +0200
                Re: [PATCH 1/6] bus: Add shared MDIO bus framework Arnd Bergmann <arnd@arndb.de> - 2016-04-26 21:30 +0200
                Re: [PATCH 1/6] bus: Add shared MDIO bus framework Andrew Lunn <andrew@lunn.ch> - 2016-04-26 21:50 +0200
                Re: [PATCH 1/6] bus: Add shared MDIO bus framework Anup Patel <anup.patel@broadcom.com> - 2016-04-27 06:50 +0200
                Re: [PATCH 1/6] bus: Add shared MDIO bus framework Arnd Bergmann <arnd@arndb.de> - 2016-04-27 11:30 +0200
  [PATCH 6/6] net:phy: Add Ethernet Master for iProc Shared MDIO Controller Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-21 11:30 +0200
  [PATCH 5/6] Documentation: Binding doc for ethernet master in NS2 Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-21 11:30 +0200
    Re: [PATCH 5/6] Documentation: Binding doc for ethernet master in NS2 Rob Herring <robh@kernel.org> - 2016-04-22 22:20 +0200
      RE: [PATCH 5/6] Documentation: Binding doc for ethernet master in NS2 Pramod Kumar <pramod.kumar@broadcom.com> - 2016-04-25 06:50 +0200
  Re: [PATCH 0/6] Add Shared MDIO framework for iProc based SoCs Andrew Lunn <andrew@lunn.ch> - 2016-04-25 17:30 +0200

csiph-web