Re: [PATCH] net: macb: Fix regression breaking non-MDIO fixed-link PHYs

2018-08-14 Thread Brad Mouring
_unregister_bus: > > mdiobus_unregister(bp->mii_bus); > > +err_out_free_mdiobus: > > if (np && of_phy_is_fixed_link(np)) > > of_phy_deregister_fixed_link(np); > > -err_out_free_mdiobus: > > of_node_put(bp->phy_node); > > mdiobus_free(bp->mii_bus); > > err_out: > > -- > > 2.18.0 > > > > > > > > -- > Pengutronix e.K. | Uwe Kleine-König| > Industrial Linux Solutions | > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.pengutronix.de_=DwIDAw=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA=8iZb7YNOSMVIG_mTIHDL03ZcObgQI_gGlWrSewdGETA=IQAK1YsKs7Z2bvZxuajiSXw3asFiEztQKYkvy-LpBn8=XKrOhFxQshoEcDxMZVSATnJW2cbaD16mQofKdEbJVW0= > | -- Brad Mouring Senior Software Engineer National Instruments 512-683-6610 / bmour...@ni.com

[PATCH v5 net-next 0/4] net: macb: Introduce phy-handle DT functionality

2018-03-13 Thread Brad Mouring
Consider the situation where a macb netdev is connected through a phydev that sits on a mii bus other than the one provided to this particular netdev. This situation is what this patchset aims to accomplish through the existing phy-handle optional binding. This optional binding (as described in

[PATCH v5 net-next 4/4] Documentation: macb: Document phy-handle binding

2018-03-13 Thread Brad Mouring
Document the existence of the optional binding, directing to the general ethernet document that describes this binding. Signed-off-by: Brad Mouring <brad.mour...@ni.com> Reviewed-by: Florian Fainelli <f.faine...@gmail.com> --- Documentation/devicetree/bindings/net/macb.txt | 1 + 1

[PATCH v5 net-next 1/4] net: macb: Reorganize macb_mii bringup

2018-03-13 Thread Brad Mouring
The macb mii setup (mii_probe() and mii_init()) previously was somewhat interspersed, likely a result of organic growth and hacking. This change moves mii bus registration into mii_init and probing the bus for devices into mii_probe. Signed-off-by: Brad Mouring <brad.mour...@ni.com> Sug

[PATCH v5 net-next 2/4] net: macb: Remove redundant poll irq assignment

2018-03-13 Thread Brad Mouring
In phy_device's general probe, this device will already be set for phy register polling, rendering this code redundant. Signed-off-by: Brad Mouring <brad.mour...@ni.com> Suggested-by: Andrew Lunn <and...@lunn.ch> Reviewed-by: Florian Fainelli <f.faine...@gmail.com> --- dr

[PATCH v5 net-next 3/4] net: macb: Add phy-handle DT support

2018-03-13 Thread Brad Mouring
ly) ... } The work done to add the phy_node in the first place (dacdbb4dfc1a1: "net: macb: add fixed-link node support") will consume the device_node (if found). Signed-off-by: Brad Mouring <brad.mour...@ni.com> --- drivers/net/ethernet/cadence/macb_main.c | 8 +--- 1

Re: [PATCH v4 net-next 3/4] net: macb: Add phy-handle DT support

2018-03-13 Thread Brad Mouring
On Mon, Mar 12, 2018 at 03:30:53PM -0700, Florian Fainelli wrote: > On 03/12/2018 02:57 PM, Andrew Lunn wrote: > >> + /* attempt to find a phy-handle */ > >> + if (!(bp->phy_node = of_parse_phandle(np, "phy-handle", > >> 0))) { > >> + > >> +

[PATCH v4 net-next 2/4] net: macb: Remove redundant poll irq assignment

2018-03-12 Thread Brad Mouring
In phy_device's general probe, this device will already be set for phy register polling, rendering this code redundant. Signed-off-by: Brad Mouring <brad.mour...@ni.com> Suggested-by: Andrew Lunn <and...@lunn.ch> Reviewed-by: Florian Fainelli <f.faine...@gmail.com> --- dr

[PATCH v4 net-next 3/4] net: macb: Add phy-handle DT support

2018-03-12 Thread Brad Mouring
ly) ... } The work done to add the phy_node in the first place (dacdbb4dfc1a1: "net: macb: add fixed-link node support") will consume the device_node (if found). Signed-off-by: Brad Mouring <brad.mour...@ni.com> --- drivers/net/ethernet/cadence/macb_main.c | 34 +

[PATCH v4 net-next 4/4] Documentation: macb: Document phy-handle binding

2018-03-12 Thread Brad Mouring
Document the existance of the optional binding, directing to the general ethernet document that describes this binding. Signed-off-by: Brad Mouring <brad.mour...@ni.com> Reviewed-by: Florian Fainelli <f.faine...@gmail.com> --- Documentation/devicetree/bindings/net/macb.txt | 1 + 1

[PATCH v4 net-next 1/4] net: macb: Reorganize macb_mii bringup

2018-03-12 Thread Brad Mouring
The macb mii setup (mii_probe() and mii_init()) previously was somewhat interspersed, likely a result of organic growth and hacking. This change moves mii bus registration into mii_init and probing the bus for devices into mii_probe. Signed-off-by: Brad Mouring <brad.mour...@ni.com> Sug

[PATCH v4 net-next 0/4]

2018-03-12 Thread Brad Mouring
Consider the situation where a macb netdev is connected through a phydev that sits on a mii bus other than the one provided to this particular netdev. This situation is what this patchset aims to accomplish through the existing phy-handle optional binding. This optional binding (as described in

[PATCH v3 net-next 1/4] net: macb: Reorganize macb_mii bringup

2018-03-12 Thread Brad Mouring
The macb mii setup (mii_probe() and mii_init()) previously was somewhat interspersed, likely a result of organic growth and hacking. This change moves mii bus registration into mii_init and probing the bus for devices into mii_probe. Signed-off-by: Brad Mouring <brad.mour...@ni.com> Sug

[PATCH v3 net-next 2/4] net: macb: Remove redundant poll irq assignment

2018-03-12 Thread Brad Mouring
In phy_device's general probe, this device will already be set for phy register polling, rendering this code redundant. Signed-off-by: Brad Mouring <brad.mour...@ni.com> Suggested-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/ethernet/cadence/macb_main.c | 3 --- 1 file changed,

[PATCH v3 net-next 0/4] macb: Introduce phy-handle DT functionality

2018-03-12 Thread Brad Mouring
Consider the situation where a macb netdev is connected through a phydev that sits on a mii bus other than the one provided to this particular netdev. This situation is what this patchset aims to accomplish through the existing phy-handle optional binding. This optional binding (as described in

[PATCH v3 net-next 4/4] Documentation: macb: Document phy-handle binding

2018-03-12 Thread Brad Mouring
Document the existance of the optional binding, directing to the general ethernet document that describes this binding. Signed-off-by: Brad Mouring <brad.mour...@ni.com> --- Documentation/devicetree/bindings/net/macb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documen

[PATCH v3 net-next 3/4] net: macb: Add phy-handle DT support

2018-03-12 Thread Brad Mouring
ly) ... } The work done to add the phy_node in the first place (dacdbb4dfc1a1: "net: macb: add fixed-link node support") will consume the device_node (if found). Signed-off-by: Brad Mouring <brad.mour...@ni.com> --- drivers/net/ethernet/cadence/macb_main.c | 3 +++

Re: [PATCH v2 net-next 1/3] net: macb: Reorganize macb_mii bringup

2018-03-10 Thread Brad Mouring
Hi Andrew, On Sat, Mar 10, 2018 at 05:17:18PM +0100, Andrew Lunn wrote: > On Fri, Mar 09, 2018 at 04:12:31PM -0600, Brad Mouring wrote: > > The macb mii setup (mii_probe() and mii_init()) previously was > > somewhat interspersed, likely a result of organic growth and hackin

[PATCH v2 net-next 1/3] net: macb: Reorganize macb_mii bringup

2018-03-09 Thread Brad Mouring
The macb mii setup (mii_probe() and mii_init()) previously was somewhat interspersed, likely a result of organic growth and hacking. This change moves mii bus registration into mii_init and probing the bus for devices into mii_probe. Signed-off-by: Brad Mouring <brad.mour...@ni.com> Sug

[PATCH v2 net-next 3/3] Documentation: macb: Document phy-handle optional binding

2018-03-09 Thread Brad Mouring
Signed-off-by: Brad Mouring <brad.mour...@ni.com> --- Documentation/devicetree/bindings/net/macb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt index 27966ae741e0..457d5ae16f23

[PATCH v2 net-next 2/3] net: macb: Add phy-handle DT support

2018-03-09 Thread Brad Mouring
ly) ... } The work done to add the phy_node in the first place (dacdbb4dfc1a1: "net: macb: add fixed-link node support") will consume the device_node (if found). Signed-off-by: Brad Mouring <brad.mour...@ni.com> --- drivers/net/ethernet/cadence/macb_main.c | 3 +++

[PATCH net v3] net: phy: Tell caller result of phy_change()

2018-03-08 Thread Brad Mouring
source. Signed-off-by: Brad Mouring <brad.mour...@ni.com> --- drivers/net/phy/phy.c | 145 +- include/linux/phy.h | 1 - 2 files changed, 72 insertions(+), 74 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c

Re: [1/2] net: macb: Add phy-handle DT support

2018-03-08 Thread Brad Mouring
On Thu, Mar 08, 2018 at 06:32:47PM +0100, Andrew Lunn wrote: > On Wed, Mar 07, 2018 at 04:42:56PM -0600, Brad Mouring wrote: > > This optional binding (as described in the ethernet DT bindings doc) > > directs the netdev to the phydev to use. This is useful for a phy > >

[PATCH] net: phy: Tell caller result of phy_change()

2018-03-08 Thread Brad Mouring
source. Signed-off-by: Brad Mouring <brad.mour...@ni.com> --- drivers/net/phy/phy.c | 13 +++-- include/linux/phy.h | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index e3e29c2b028b..ebce9f2b2742 100644 --- a/d

Re: [PATCH] net: phy: Move interrupt check from phy_check to phy_interrupt

2018-03-08 Thread Brad Mouring
Thanks for the feedback, Sergei. On Thu, Mar 08, 2018 at 10:41:04PM +0300, Sergei Shtylyov wrote: > Hello! > > On 03/08/2018 01:50 AM, Brad Mouring wrote: > > > If multiple phys share the same interrupt (e.g. a multi-phy chip), > > the first device registered

Re: [PATCH] net: phy: Move interrupt check from phy_check to phy_interrupt

2018-03-08 Thread Brad Mouring
On Thu, Mar 08, 2018 at 05:29:05PM +0100, Andrew Lunn wrote: > On Wed, Mar 07, 2018 at 04:50:42PM -0600, Brad Mouring wrote: > > If multiple phys share the same interrupt (e.g. a multi-phy chip), > > the first device registered is the only one checked as phy_interrupt > &g

[PATCH] net: phy: Move interrupt check from phy_check to phy_interrupt

2018-03-07 Thread Brad Mouring
to allow other devices on this irq a chance to check if it was their interrupt. Signed-off-by: Brad Mouring <brad.mour...@ni.com> --- drivers/net/phy/phy.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c

[PATCH 1/2] net: macb: Add phy-handle DT support

2018-03-07 Thread Brad Mouring
ly) ... } The work done to add the phy_node in the first place (dacdbb4dfc1a1: "net: macb: add fixed-link node support") will consume the device_node (if found). Signed-off-by: Brad Mouring <brad.mour...@ni.com> --- drivers/net/ethernet/cadence/macb_main.c | 3 +++

[PATCH 2/2] Documentation: macb: Document phy-handle optional binding

2018-03-07 Thread Brad Mouring
Signed-off-by: Brad Mouring <brad.mour...@ni.com> --- Documentation/devicetree/bindings/net/macb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt index 27966ae741e0..457d5ae16f23