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>
---
v1->v2:
- add comment describing that there should not be anyone putting back
the phy in coma mode.
---
drivers/net/phy/micrel.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
@@ -2873,12 +2873,18 @@ static int lan8814_config_init(struct phy_device *phydev)return0;}+/* It is expected that there will not be any 'lan8814_take_coma_mode'+*functioncalledinsuspend.BecausetheGPIOlinecanbeshared,soifoneof+*thephysgoesbackincomamode,thenalltheotherPHYswillgo,whichis+*wrong.+*/staticintlan8814_release_coma_mode(structphy_device*phydev){structgpio_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);if(IS_ERR(gpiod))returnPTR_ERR(gpiod);
From: Andrew Lunn <andrew@lunn.ch> Date: 2022-08-25 20:16:41
On Thu, Aug 25, 2022 at 10:14:47PM +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>
From: Jakub Kicinski <kuba@kernel.org> Date: 2022-08-27 01:37:21
On Thu, 25 Aug 2022 22:16:31 +0200 Andrew Lunn wrote:
On Thu, Aug 25, 2022 at 10:14:47PM +0200, Horatiu Vultur wrote:
quoted
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>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
The tree name switch in the subject compared to v1 is unintentional?
The 08/26/2022 18:37, Jakub Kicinski wrote:
Hi Jakub,
On Thu, 25 Aug 2022 22:16:31 +0200 Andrew Lunn wrote:
quoted
On Thu, Aug 25, 2022 at 10:14:47PM +0200, Horatiu Vultur wrote:
quoted
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>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
The tree name switch in the subject compared to v1 is unintentional?
Yes I have switch it by mistake.
It should be net. I can send a new version if it is needed.
--
/Horatiu