This is a note to let you know that I've just added the patch titled driver core: fw_devlink: Avoid spurious error message to the 6.1-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: driver-core-fw_devlink-avoid-spurious-error-message.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 321a308175c4fd3598d972f34d5cac4ed49486f7 Author: Saravana Kannan <saravanak@xxxxxxxxxx> Date: Fri Feb 24 22:41:47 2023 -0800 driver core: fw_devlink: Avoid spurious error message [ Upstream commit 6309872413f14f3d58c13ae4dc85b1a7004b4193 ] fw_devlink can sometimes try to create a device link with the consumer and supplier as the same device. These attempts will fail (correctly), but are harmless. So, avoid printing an error for these cases. Also, add more detail to the error message. Fixes: 3fb16866b51d ("driver core: fw_devlink: Make cycle detection more robust") Reported-by: Vladimir Oltean <vladimir.oltean@xxxxxxx> Reported-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> Signed-off-by: Saravana Kannan <saravanak@xxxxxxxxxx> Link: https://lore.kernel.org/r/20230225064148.274376-1-saravanak@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/base/core.c b/drivers/base/core.c index ac08d475e2828..e30223c2672fc 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -2087,9 +2087,9 @@ static int fw_devlink_create_devlink(struct device *con, goto out; } - if (!device_link_add(con, sup_dev, flags)) { - dev_err(con, "Failed to create device link with %s\n", - dev_name(sup_dev)); + if (con != sup_dev && !device_link_add(con, sup_dev, flags)) { + dev_err(con, "Failed to create device link (0x%x) with %s\n", + flags, dev_name(sup_dev)); ret = -EINVAL; }