lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YwaAZAXcXhGmu7r9@lunn.ch>
Date:   Wed, 24 Aug 2022 21:47:48 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Horatiu Vultur <horatiu.vultur@...rochip.com>
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        michael@...le.cc, UNGLinuxDriver@...rochip.com,
        maxime.chevallier@...tlin.com
Subject: Re: [PATCH net] net: phy: micrel: Make the GPIO to be non-exclusive

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@...rochip.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ