mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierluigi Passaro <pierluigi.p@variscite.com>
To: Simon Horman <simon.horman@corigine.com>
Cc: "andrew@lunn.ch" <andrew@lunn.ch>,
	"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Eran Matityahu <eran.m@variscite.com>,
	Nate Drude <Nate.D@variscite.com>,
	Francesco Ferraro <francesco.f@variscite.com>,
	"pierluigi.passaro@gmail.com" <pierluigi.passaro@gmail.com>
Subject: Re: [PATCH v2] net: mdio: force deassert MDIO reset signal
Date: Mon, 16 Jan 2023 13:13:49 +0000	[thread overview]
Message-ID: <AM6PR08MB43764E8EB99B48897327CFCCFFC19@AM6PR08MB4376.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <Y8UwrzenvgGw8dns@corigine.com>

On Mon, Jan 16, 2023 at 12:10 PM Simon Horman <simon.horman@corigine.com> wrote:
> On Sun, Jan 15, 2023 at 10:37:46PM +0100, Pierluigi Passaro wrote:
> > When the reset gpio is defined within the node of the device tree
> > describing the PHY, the reset is initialized and managed only after
> > calling the fwnode_mdiobus_phy_device_register function.
> > However, before calling it, the MDIO communication is checked by the
> > get_phy_device function.
> > When this happens and the reset GPIO was somehow previously set down,
> > the get_phy_device function fails, preventing the PHY detection.
> > These changes force the deassert of the MDIO reset signal before
> > checking the MDIO channel.
> > The PHY may require a minimum deassert time before being responsive:
> > use a reasonable sleep time after forcing the deassert of the MDIO
> > reset signal.
> > Once done, free the gpio descriptor to allow managing it later.
> >
> > Signed-off-by: Pierluigi Passaro <pierluigi.p@variscite.com>
> > Signed-off-by: FrancescoFerraro <francesco.f@variscite.com>
> > ---
> >  drivers/net/mdio/fwnode_mdio.c | 25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> >
> > diff --git a/drivers/net/mdio/fwnode_mdio.c b/drivers/net/mdio/fwnode_mdio.c
> > index b782c35c4ac1..1f4b8c4c1f60 100644
> > --- a/drivers/net/mdio/fwnode_mdio.c
> > +++ b/drivers/net/mdio/fwnode_mdio.c
> > @@ -8,6 +8,8 @@
> >
> >  #include <linux/acpi.h>
> >  #include <linux/fwnode_mdio.h>
> > +#include <linux/gpio/consumer.h>
> > +#include <linux/gpio/driver.h>
> >  #include <linux/of.h>
> >  #include <linux/phy.h>
> >  #include <linux/pse-pd/pse.h>
> > @@ -118,6 +120,8 @@ int fwnode_mdiobus_register_phy(struct mii_bus *bus,
> >       bool is_c45 = false;
> >       u32 phy_id;
> >       int rc;
> > +     int reset_deassert_delay = 0;
>
> nit: it looks like scope of reset_deassert_delay could be reduced
>      to the else clause where it is used.
>
no problem.
>
> > +     struct gpio_desc *reset_gpio;
>
> nit: reverse xmas tree for local variable declarations
>
I'm worried I'm asking something stupid: what do you mean by
"reverse xmas tree" ?> ...
>
> Also, if reposting, the target tree for this should be in the subject.
> Assuming net-next, that would mean "[PATCH net-next v3]"
>
no problem

  reply	other threads:[~2023-01-16 13:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-15 21:37 Pierluigi Passaro
2023-01-16 11:10 ` Simon Horman
2023-01-16 13:13   ` Pierluigi Passaro [this message]
2023-01-16 13:36     ` Russell King (Oracle)
2023-01-16 13:52       ` Simon Horman

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=AM6PR08MB43764E8EB99B48897327CFCCFFC19@AM6PR08MB4376.eurprd08.prod.outlook.com \
    --to=pierluigi.p@variscite.com \
    --cc=Nate.D@variscite.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eran.m@variscite.com \
    --cc=francesco.f@variscite.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pierluigi.passaro@gmail.com \
    --cc=simon.horman@corigine.com \
    /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

all inboxes | Powered by JetHome®