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


Groups > linux.kernel > #1720140 > unrolled thread

[PATCH] net: stmmac: Handle possible fixed-link with need_mdio_ids

Started byCorentin Labbe <clabbe.montjoie@gmail.com>
First post2017-08-25 16:50 +0200
Last post2017-08-26 09:30 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: stmmac: Handle possible fixed-link with need_mdio_ids Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-08-25 16:50 +0200
    Re: [PATCH] net: stmmac: Handle possible fixed-link with  need_mdio_ids Andrew Lunn <andrew@lunn.ch> - 2017-08-25 18:30 +0200
      Re: [PATCH] net: stmmac: Handle possible fixed-link with  need_mdio_ids Florian Fainelli <f.fainelli@gmail.com> - 2017-08-25 18:50 +0200
        Re: [PATCH] net: stmmac: Handle possible fixed-link with  need_mdio_ids Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-08-26 09:30 +0200

#1720140 — [PATCH] net: stmmac: Handle possible fixed-link with need_mdio_ids

FromCorentin Labbe <clabbe.montjoie@gmail.com>
Date2017-08-25 16:50 +0200
Subject[PATCH] net: stmmac: Handle possible fixed-link with need_mdio_ids
Message-ID<uio5R-5gL-27@gated-at.bofh.it>
In case of fixed link, there are no mdio node.
This patch add a test for fixed-link for bypassing MDIO node register.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index a366b3747eeb..e1be5735365b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -332,7 +332,7 @@ static int stmmac_dt_phy(struct plat_stmmacenet_data *plat,
 		mdio = false;
 	}
 
-	if (of_match_node(need_mdio_ids, np)) {
+	if (of_match_node(need_mdio_ids, np) && !of_phy_is_fixed_link(np)) {
 		plat->mdio_node = of_get_child_by_name(np, "mdio");
 	} else {
 		/**
-- 
2.13.5

[toc] | [next] | [standalone]


#1720246 — Re: [PATCH] net: stmmac: Handle possible fixed-link with need_mdio_ids

FromAndrew Lunn <andrew@lunn.ch>
Date2017-08-25 18:30 +0200
SubjectRe: [PATCH] net: stmmac: Handle possible fixed-link with need_mdio_ids
Message-ID<uipEB-6ki-5@gated-at.bofh.it>
In reply to#1720140
On Fri, Aug 25, 2017 at 04:42:08PM +0200, Corentin Labbe wrote:
> In case of fixed link, there are no mdio node.
> This patch add a test for fixed-link for bypassing MDIO node register.

The two are not mutually exclusive. E.g.
vf610-zii-dev.dtsi/vf610-zii-dev-rev-b.dts.  It has a fixed-link on
the FEC ethernet controller, and an Ethernet switch on the MDIO bus.

If anybody ever wants to use a switch with the stmmac, this will be
required.

	Andrew

[toc] | [prev] | [next] | [standalone]


#1720276 — Re: [PATCH] net: stmmac: Handle possible fixed-link with need_mdio_ids

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2017-08-25 18:50 +0200
SubjectRe: [PATCH] net: stmmac: Handle possible fixed-link with need_mdio_ids
Message-ID<uipXY-6qR-21@gated-at.bofh.it>
In reply to#1720246
On 08/25/2017 09:28 AM, Andrew Lunn wrote:
> On Fri, Aug 25, 2017 at 04:42:08PM +0200, Corentin Labbe wrote:
>> In case of fixed link, there are no mdio node.
>> This patch add a test for fixed-link for bypassing MDIO node register.
> 
> The two are not mutually exclusive. E.g.
> vf610-zii-dev.dtsi/vf610-zii-dev-rev-b.dts.  It has a fixed-link on
> the FEC ethernet controller, and an Ethernet switch on the MDIO bus.
> 
> If anybody ever wants to use a switch with the stmmac, this will be
> required.

This is already done in the Lamobo R1 DTS file so it would be nice not
to break this use case:

&gmac {
        pinctrl-names = "default";
        pinctrl-0 = <&gmac_pins_rgmii_a>;
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;
        status = "okay";

        fixed-link {
                speed = <1000>;
                full-duplex;
        };

        mdio {
                compatible = "snps,dwmac-mdio";
                #address-cells = <1>;
                #size-cells = <0>;

                switch: ethernet-switch@1e {
                        compatible = "brcm,bcm53125";
                        reg = <30>;
                        #address-cells = <1>;
                        #size-cells = <0>;


> 
> 	Andrew
> 


-- 
Florian

[toc] | [prev] | [next] | [standalone]


#1720562 — Re: [PATCH] net: stmmac: Handle possible fixed-link with need_mdio_ids

FromCorentin Labbe <clabbe.montjoie@gmail.com>
Date2017-08-26 09:30 +0200
SubjectRe: [PATCH] net: stmmac: Handle possible fixed-link with need_mdio_ids
Message-ID<uiDHA-6Hs-23@gated-at.bofh.it>
In reply to#1720276
On Fri, Aug 25, 2017 at 09:45:23AM -0700, Florian Fainelli wrote:
> On 08/25/2017 09:28 AM, Andrew Lunn wrote:
> > On Fri, Aug 25, 2017 at 04:42:08PM +0200, Corentin Labbe wrote:
> >> In case of fixed link, there are no mdio node.
> >> This patch add a test for fixed-link for bypassing MDIO node register.
> > 
> > The two are not mutually exclusive. E.g.
> > vf610-zii-dev.dtsi/vf610-zii-dev-rev-b.dts.  It has a fixed-link on
> > the FEC ethernet controller, and an Ethernet switch on the MDIO bus.
> > 
> > If anybody ever wants to use a switch with the stmmac, this will be
> > required.
> 
> This is already done in the Lamobo R1 DTS file so it would be nice not
> to break this use case:
> 
> &gmac {
>         pinctrl-names = "default";
>         pinctrl-0 = <&gmac_pins_rgmii_a>;
>         phy-mode = "rgmii";
>         phy-supply = <&reg_gmac_3v3>;
>         status = "okay";
> 
>         fixed-link {
>                 speed = <1000>;
>                 full-duplex;
>         };
> 
>         mdio {
>                 compatible = "snps,dwmac-mdio";
>                 #address-cells = <1>;
>                 #size-cells = <0>;
> 
>                 switch: ethernet-switch@1e {
>                         compatible = "brcm,bcm53125";
>                         reg = <30>;
>                         #address-cells = <1>;
>                         #size-cells = <0>;
> 
> 
> > 
> > 	Andrew
> > 
> 

Sorry, I have made a bad commit message.
This commit only change behaviour for nodes that match need_mdio_ids.
The behaviour for snps,dwmac-mdio does not change as it is handled in follow up of the "ifthenelse"
I will resent it with correct commit message.

Regards

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web