public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	michael@walle.cc, UNGLinuxDriver@microchip.com,
	maxime.chevallier@bootlin.com
Subject: Re: [PATCH net] net: phy: micrel: Make the GPIO to be non-exclusive
Date: Wed, 24 Aug 2022 21:47:48 +0200	[thread overview]
Message-ID: <YwaAZAXcXhGmu7r9@lunn.ch> (raw)
In-Reply-To: <20220824192827.437095-1-horatiu.vultur@microchip.com>

On Wed, Aug 24, 2022 at 09:28:27PM +0200, Horatiu Vultur wrote:
> The same GPIO line can be shared by multiple phys for the coma mode pin.
> If that is the case then, all the other phys that share the same line
> will failed to be probed because the access to the gpio line is not
> non-exclusive.
> Fix this by making access to the gpio line to be nonexclusive using flag
> GPIOD_FLAGS_BIT_NONEXCLUSIVE. This allows all the other PHYs to be
> probed.
> 
> Fixes: 738871b09250ee ("net: phy: micrel: add coma mode GPIO")
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
>  drivers/net/phy/micrel.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index e78d0bf69bc3..ea72ff64ad33 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -2878,7 +2878,8 @@ static int lan8814_release_coma_mode(struct phy_device *phydev)
>  	struct gpio_desc *gpiod;
>  
>  	gpiod = devm_gpiod_get_optional(&phydev->mdio.dev, "coma-mode",
> -					GPIOD_OUT_HIGH_OPEN_DRAIN);
> +					GPIOD_OUT_HIGH_OPEN_DRAIN |
> +					GPIOD_FLAGS_BIT_NONEXCLUSIVE);

I would suggest putting a comment here. You are assuming the driver
never gains a lan8814_take_coma_mode() when the PHY is put into
suspend, since it sounds like that will put all PHYs on the shared
GPIO into coma mode.

     Andrew

  reply	other threads:[~2022-08-24 19:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 19:28 [PATCH net] net: phy: micrel: Make the GPIO to be non-exclusive Horatiu Vultur
2022-08-24 19:47 ` Andrew Lunn [this message]
2022-08-25  6:54   ` Horatiu Vultur

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=YwaAZAXcXhGmu7r9@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=michael@walle.cc \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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