Linux kernel -stable discussions
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] i2c: core: fix adapter probe deferral loop" failed to apply to 5.10-stable tree
@ 2026-07-16 12:40 gregkh
  2026-07-22 10:30 ` [PATCH 5.10.y 1/7] device property: Add fwnode_irq_get_byname Sasha Levin
  0 siblings, 1 reply; 8+ messages in thread
From: gregkh @ 2026-07-16 12:40 UTC (permalink / raw)
  To: johan, codrin.ciubotariu, wsa+renesas; +Cc: stable


The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 158efa411c57111d87bf265a3776614f32d70007
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026071657-book-manhandle-a0e6@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'

Possible dependencies:



thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 158efa411c57111d87bf265a3776614f32d70007 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@kernel.org>
Date: Mon, 11 May 2026 16:37:09 +0200
Subject: [PATCH] i2c: core: fix adapter probe deferral loop

Drivers must not probe defer after having registered devices as that
will trigger a probe loop if the devices bind to a driver (cf. commit
fbc35b45f9f6 ("Add documentation on meaning of -EPROBE_DEFER")).

Move the recovery initialisation, where the GPIO lookup may fail, before
registering the adapter to prevent this.

Fixes: 75820314de26 ("i2c: core: add generic I2C GPIO recovery")
Cc: stable@vger.kernel.org	# 5.9
Cc: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index fa9db415e219..1caaa3b3ee10 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -1562,6 +1562,10 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 	adap->dev.type = &i2c_adapter_type;
 	device_initialize(&adap->dev);
 
+	res = i2c_init_recovery(adap);
+	if (res == -EPROBE_DEFER)
+		goto err_put_adap;
+
 	/*
 	 * This adapter can be used as a parent immediately after device_add(),
 	 * setup runtime-pm (especially ignore-children) before hand.
@@ -1583,10 +1587,6 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 	if (res)
 		goto out_reg;
 
-	res = i2c_init_recovery(adap);
-	if (res == -EPROBE_DEFER)
-		goto out_reg;
-
 	dev_dbg(&adap->dev, "adapter [%s] registered\n", adap->name);
 
 	/* create pre-declared device nodes */


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-07-22 10:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 12:40 FAILED: patch "[PATCH] i2c: core: fix adapter probe deferral loop" failed to apply to 5.10-stable tree gregkh
2026-07-22 10:30 ` [PATCH 5.10.y 1/7] device property: Add fwnode_irq_get_byname Sasha Levin
2026-07-22 10:30   ` [PATCH 5.10.y 2/7] i2c: smbus: Use device_*() functions instead of of_*() Sasha Levin
2026-07-22 10:30   ` [PATCH 5.10.y 3/7] i2c: core: Setup i2c_adapter runtime-pm before calling device_add() Sasha Levin
2026-07-22 10:30   ` [PATCH 5.10.y 4/7] i2c: core: fix reference leak in i2c_register_adapter() Sasha Levin
2026-07-22 10:30   ` [PATCH 5.10.y 5/7] i2c: core: fix irq domain leak on adapter registration failure Sasha Levin
2026-07-22 10:30   ` [PATCH 5.10.y 6/7] i2c: core: fix NULL-deref " Sasha Levin
2026-07-22 10:30   ` [PATCH 5.10.y 7/7] i2c: core: fix adapter probe deferral loop Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox