Skip to contentSkip to conversation

FAILED: patch "[PATCH] spi: mpc52xx: fix controller deregistration" failed to apply to 6.1-stable tree

PATCH [email protected] 1 participant 1 message May 15

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.1-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 <[email protected]>.

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-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 0f997fdae819a8c2cc83bd4ff7d935ad76c727c9
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026051520-pluck-freeing-2437@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

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

From 0f997fdae819a8c2cc83bd4ff7d935ad76c727c9 Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Tue, 14 Apr 2026 15:43:14 +0200
Subject: [PATCH] spi: mpc52xx: fix controller deregistration

Make sure to deregister the controller before disabling and releasing underlying resources like interrupts and gpios during driver unbind.

Fixes 42bbb70980f3 ("powerpc/5200: Add mpc5200-spi (non-PSC) device driver")
Fixes b8d4e2ce60b6 ("mpc52xx_spi: add gpio chipselect")
Cc [email protected] # 2.6.33
Cc Grant Likely <[email protected]>
Cc Luotao Fu <[email protected]>
drivers/spi/spi-mpc52xx.c +2 -1
index 05bbd3795e7d..823b49f8ece2 100644
@@ -517,6 +517,8 @@ static void mpc52xx_spi_remove(struct platform_device *op)
 	struct mpc52xx_spi *ms = spi_controller_get_devdata(host);
 	int i;
 
+	spi_unregister_controller(host);
+
 	cancel_work_sync(&ms->work);
 	free_irq(ms->irq0, ms);
 	free_irq(ms->irq1, ms);
@@ -525,7 +527,6 @@ static void mpc52xx_spi_remove(struct platform_device *op)
 		gpiod_put(ms->gpio_cs[i]);
 
 	kfree(ms->gpio_cs);
-	spi_unregister_controller(host);
 	iounmap(ms->regs);
 	spi_controller_put(host);
 }