linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christian Zigotzky <chzigotzky@xenosoft.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: PA Semi PWRficient Gigabit Ethernet doesn't work anymore since the first networking updates for the kernel 4.16
Date: Mon, 5 Feb 2018 10:38:34 +0100	[thread overview]
Message-ID: <93dcb6c1-75d5-539c-c867-09266d43dbd0@xenosoft.de> (raw)
In-Reply-To: <20180204171626.GE10544@lunn.ch>

Hello Andrew,

Many thanks for your patch. I compiled the latest git kernel today and 
the PA Semi PWRficient Gigabit Ethernet works with your patch.

Have a nice week!

Thanks,
Christian


On 04 February 2018 at 6:16PM, Andrew Lunn wrote:
 > On Sun, Feb 04, 2018 at 05:47:03PM +0100, Christian Zigotzky wrote:
 >> Hello,
 >>
 >> The PA Semi PWRficient Gigabit Ethernet doesn't work anymore since 
the first
 >> networking updates [1] for the kernel 4.16.
 >>
 >> Error messages:
 >>
 >> [    0.634241] libphy: pasemi gpio mdio bus: probed
 >> [    0.634749] pasemi gpio mdio bus: Cannot register as MDIO bus, 
err -38
 >
 > -38 is ENOSYS.
 >
 >> --- a/drivers/net/phy/mdio_bus.c    2018-02-03 17:34:46.973045321 +0100
 >> +++ b/drivers/net/phy/mdio_bus.c    2018-02-04 11:03:14.909093360 +0100
 >> @@ -47,41 +47,11 @@
 >>
 >>  #include "mdio-boardinfo.h"
 >>
 >> -static int mdiobus_register_gpiod(struct mdio_device *mdiodev)
 >> -{
 >> -    struct gpio_desc *gpiod = NULL;
 >> -
 >> -    /* Deassert the optional reset signal */
 >> -    if (mdiodev->dev.of_node)
 >> -        gpiod = fwnode_get_named_gpiod(&mdiodev->dev.of_node->fwnode,
 >> -                           "reset-gpios", 0, GPIOD_OUT_LOW,
 >> -                           "PHY reset");
 >
 > So i think you don't have GPIOLIB enabled. Hence you are hitting
 >
 > 
http://elixir.free-electrons.com/linux/latest/source/include/linux/gpio/consumer.h#L470
 >
 > static inline
 > struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
 >                      const char *propname, int index,
 >                      enum gpiod_flags dflags,
 >                      const char *label)
 > {
 >     return ERR_PTR(-ENOSYS);
 > }
 >
 > So rather than just deleting all this code, breaking other platforms
 > that need this gpio, lets try a real fix. Please try this. If it
 > works, i will formally submit it.
 >
 >    Andrew
 >
 > >From a4210ba306948497d7360927c1e532eb903c58b2 Mon Sep 17 00:00:00 2001
 > From: Andrew Lunn <andrew@lunn.ch>
 > Date: Sun, 4 Feb 2018 11:09:20 -0600
 > Subject: [PATCH] net: phy: Handle not having GPIO enabled in the kernel
 >
 > If CONFIG_GPIOLIB is disabled, fwnode_get_named_gpiod() becomes a stub
 > function, which return -ENOSYS. Handle this in the same way as
 > -ENOENT, i.e. assume there is no GPIO used to reset the PHYs.
 >
 > Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
 > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
 > ---
 >  drivers/net/phy/mdio_bus.c | 3 ++-
 >  1 file changed, 2 insertions(+), 1 deletion(-)
 >
 > diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
 > index 88272b3ac2e2..24b5511222c8 100644
 > --- a/drivers/net/phy/mdio_bus.c
 > +++ b/drivers/net/phy/mdio_bus.c
 > @@ -56,7 +56,8 @@ static int mdiobus_register_gpiod(struct 
mdio_device *mdiodev)
 >          gpiod = fwnode_get_named_gpiod(&mdiodev->dev.of_node->fwnode,
 >                             "reset-gpios", 0, GPIOD_OUT_LOW,
 >                             "PHY reset");
 > -    if (PTR_ERR(gpiod) == -ENOENT)
 > +    if (PTR_ERR(gpiod) == -ENOENT ||
 > +        PTR_ERR(gpiod) == -ENOSYS)
 >          gpiod = NULL;
 >      else if (IS_ERR(gpiod))
 >          return PTR_ERR(gpiod);

  parent reply	other threads:[~2018-02-05  9:38 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10 20:39 DPAA Ethernet traffice troubles with Linux kernel mad skateman
2018-01-15 16:38 ` Madalin-cristian Bucur
2018-01-15 16:59   ` Joakim Tjernlund
2018-01-15 19:03     ` Christian Zigotzky
2018-01-15 19:09       ` Christian Zigotzky
2018-01-15 20:21         ` mad skateman
2018-01-15 21:32         ` mad skateman
2018-01-16 15:04           ` Andrew Lunn
2018-01-16 17:07             ` Madalin-cristian Bucur
2018-01-16 14:38     ` Andrew Lunn
2018-01-16 17:57       ` Joakim Tjernlund
2018-01-16 18:16         ` mad skateman
2018-01-16 18:38         ` mad skateman
2018-01-16 18:39         ` mad skateman
2018-01-17  5:54           ` Christian Zigotzky
2018-01-16 18:44         ` mad skateman
2018-01-16 21:00           ` Andrew Lunn
2018-01-16 21:15             ` mad skateman
2018-01-16 20:53         ` Andrew Lunn
2018-01-17 11:47           ` Joakim Tjernlund
2018-01-17 12:06             ` mad skateman
2018-01-17 13:43             ` Andrew Lunn
2018-01-17 14:15               ` Madalin-cristian Bucur
2018-01-17 14:24                 ` Madalin-cristian Bucur
2018-01-17 14:43                   ` Madalin-cristian Bucur
2018-02-03 11:54                     ` mad skateman
2018-02-06 11:20                       ` Christian Zigotzky
2018-02-07 21:00                         ` mad skateman
2018-02-07 21:17                           ` Andrew Lunn
2018-02-07 22:13                             ` Christian Zigotzky
2018-01-17 14:11         ` Madalin-cristian Bucur
2018-01-17 15:00           ` Joakim Tjernlund
2018-01-18  9:04             ` Joakim Tjernlund
2018-01-19  8:00           ` Joakim Tjernlund
2018-01-19 13:22             ` Andrew Lunn
2018-01-19 13:42               ` Joakim Tjernlund
2018-02-04 16:47               ` PA Semi PWRficient Gigabit Ethernet doesn't work anymore since the first networking updates for the kernel 4.16 Christian Zigotzky
2018-02-04 17:16                 ` Andrew Lunn
2018-02-04 20:01                   ` Florian Fainelli
2018-02-05  9:38                   ` Christian Zigotzky [this message]
2018-02-05 14:29                     ` Andrew Lunn
2018-02-05 15:27                       ` Christian Zigotzky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93dcb6c1-75d5-539c-c867-09266d43dbd0@xenosoft.de \
    --to=chzigotzky@xenosoft.de \
    --cc=andrew@lunn.ch \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).