Skip to contentSkip to conversation

Patch "mdio_bus: fix mdio_register_device when RESET_CONTROLLER is disabled" has been added to the 5.3-stable tree

DISCUSSION Marek Behún 2 participants 2 messages Nov 25, 2019 – Nov 26, 2019 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Upstream reverted this commit (2c61e821da7a) and then used 6e4ff1c94a04 instead.

Marek

Quoted 77 lines · On Mon, 25 Nov 2019 14:28:31 +0100 <[email protected]> wrote:

This is a note to let you know that I've just added the patch titled

mdio_bus: fix mdio_register_device when RESET_CONTROLLER is
disabled

to the 5.3-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
mdio_bus-fix-mdio_register_device-when-reset_controller-is-disabled.patch
and it can be found in the queue-5.3 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From foo@baz Mon 25 Nov 2019 02:27:19 PM CET
From: "Marek Behún" <[email protected]>
Date: Mon, 18 Nov 2019 19:15:05 +0100
Subject: mdio_bus: fix mdio_register_device when RESET_CONTROLLER is disabled

From: "Marek Behún" <[email protected]>

[ Upstream commit 075e238d12c21c8bde700d21fb48be7a3aa80194 ]

When CONFIG_RESET_CONTROLLER is disabled, the devm_reset_control_get_exclusive function returns -ENOTSUPP. This is not handled in subsequent check and then the mdio device fails to probe.

When CONFIG_RESET_CONTROLLER is enabled, its code checks in OF for reset device, and since it is not present, returns -ENOENT. -ENOENT is handled. Add -ENOTSUPP also.

This happened to me when upgrading kernel on Turris Omnia. You either have to enable CONFIG_RESET_CONTROLLER or use this patch.

Fixes 71dd6c0dff51b ("net: phy: add support for reset-controller")
Cc Dmitry Torokhov <[email protected]>
Cc Andrew Lunn <[email protected]>
Cc Andy Shevchenko <[email protected]>
---
 drivers/net/phy/mdio_bus.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/phy/mdio_bus.c +6 -6
@@ -68,11 +68,12 @@ static int mdiobus_register_reset(struct
 	if (mdiodev->dev.of_node)
 		reset =
 devm_reset_control_get_exclusive(&mdiodev->dev, "phy");
-	if (PTR_ERR(reset) == -ENOENT ||
-	    PTR_ERR(reset) == -ENOTSUPP)
-		reset = NULL;
-	else if (IS_ERR(reset))
-		return PTR_ERR(reset);
+	if (IS_ERR(reset)) {
+		if (PTR_ERR(reset) == -ENOENT || PTR_ERR(reset) ==
-ENOTSUPP)
+			reset = NULL;
+		else
+			return PTR_ERR(reset);
+	}
 
 	mdiodev->reset_ctrl = reset;

Patches currently in stable-queue which might be from [email protected] are

queue-5.3/mdio_bus-fix-mdio_register_device-when-reset_controller-is-disabled.patch

maintainer
#2 lore raw
Quoted 2 lines · Marek Behún

Upstream reverted this commit (2c61e821da7a) and then used 6e4ff1c94a04 instead.

Thanks for the info, I'll go make that change here too.

greg k-h