-LINUX_VERSION-6.18 = .31
-LINUX_KERNEL_HASH-6.18.31 = a0a0b86d485d409cfcc6be3fe85cdf23b8a5996b78d7a232c0e03d2a8bf258b6
+LINUX_VERSION-6.18 = .32
+LINUX_KERNEL_HASH-6.18.32 = 067dadd445578284ea6158f312f7970d8940fed3e094dbe49cff66d188d3bda4
0, "pl022", pl022);
if (status < 0) {
dev_err(&adev->dev, "probe - cannot get IRQ (%d)\n", status);
-@@ -1972,7 +2006,10 @@ static int pl022_probe(struct amba_devic
-
- /* Register with the SPI framework */
- amba_set_drvdata(adev, pl022);
-- status = devm_spi_register_controller(&adev->dev, host);
-+ if (platform_flag)
-+ status = spi_register_controller(host);
-+ else
-+ status = devm_spi_register_controller(&adev->dev, host);
- if (status != 0) {
- dev_err_probe(&adev->dev, status,
- "problem registering spi host\n");
-@@ -1997,13 +2034,24 @@ static int pl022_probe(struct amba_devic
+@@ -1997,13 +2031,24 @@ static int pl022_probe(struct amba_devic
if (platform_info->enable_dma)
pl022_dma_remove(pl022);
err_no_irq:
return status;
}
-@@ -2202,6 +2250,89 @@ static void __exit pl022_exit(void)
+@@ -2208,6 +2253,89 @@ static void __exit pl022_exit(void)
}
module_exit(pl022_exit);
/*
* This macro is used to define some register default values.
-@@ -2016,7 +2018,8 @@ static int pl022_probe(struct amba_devic
+@@ -2013,7 +2015,8 @@ static int pl022_probe(struct amba_devic
goto err_spi_register;
}
dev_dbg(dev, "probe succeeded\n");
/* let runtime pm put suspend */
if (platform_info->autosuspend_delay > 0) {
dev_info(&adev->dev,
-@@ -2026,7 +2029,10 @@ static int pl022_probe(struct amba_devic
+@@ -2023,7 +2026,10 @@ static int pl022_probe(struct amba_devic
platform_info->autosuspend_delay);
pm_runtime_use_autosuspend(dev);
}
return 0;
-@@ -2280,8 +2286,33 @@ static int starfive_of_pl022_probe(struc
+@@ -2283,8 +2289,33 @@ static int starfive_of_pl022_probe(struc
ret = -EINVAL;
}
return ret;
}
-@@ -2311,6 +2342,7 @@ static void starfive_of_pl022_remove(str
+@@ -2314,6 +2345,7 @@ static void starfive_of_pl022_remove(str
size = resource_size(pdev->resource);
release_mem_region(pdev->resource->start, size);
0, "pl022", pl022);
if (status < 0) {
dev_err(&adev->dev, "probe - cannot get IRQ (%d)\n", status);
-@@ -2008,18 +2135,16 @@ static int pl022_probe(struct amba_devic
-
- /* Register with the SPI framework */
- amba_set_drvdata(adev, pl022);
-- if (platform_flag)
-- status = spi_register_controller(host);
-- else
-- status = devm_spi_register_controller(&adev->dev, host);
-+
-+ status = devm_spi_register_controller(&adev->dev, host);
- if (status != 0) {
- dev_err_probe(&adev->dev, status,
- "problem registering spi host\n");
+@@ -2015,8 +2142,8 @@ static int pl022_probe(struct amba_devic
goto err_spi_register;
}
dev_dbg(dev, "probe succeeded\n");
/* let runtime pm put suspend */
if (platform_info->autosuspend_delay > 0) {
dev_info(&adev->dev,
-@@ -2029,10 +2154,8 @@ static int pl022_probe(struct amba_devic
+@@ -2026,10 +2153,8 @@ static int pl022_probe(struct amba_devic
platform_info->autosuspend_delay);
pm_runtime_use_autosuspend(dev);
}
return 0;
-@@ -2040,24 +2163,15 @@ static int pl022_probe(struct amba_devic
+@@ -2037,24 +2162,15 @@ static int pl022_probe(struct amba_devic
if (platform_info->enable_dma)
pl022_dma_remove(pl022);
err_no_irq:
return status;
}
-@@ -2269,23 +2383,8 @@ static int starfive_of_pl022_probe(struc
+@@ -2272,23 +2388,8 @@ static int starfive_of_pl022_probe(struc
.mask = 0x000fffff,
.data = &vendor_arm
};
ret = of_clk_set_defaults(dev->of_node, false);
if (ret < 0)
goto err_probe;
-@@ -2294,16 +2393,11 @@ static int starfive_of_pl022_probe(struc
+@@ -2297,16 +2398,11 @@ static int starfive_of_pl022_probe(struc
if (ret)
goto err_probe;
if (ret) {
pm_runtime_disable(dev);
-@@ -2318,31 +2412,25 @@ err_probe:
+@@ -2321,31 +2417,25 @@ err_probe:
static void starfive_of_pl022_remove(struct platform_device *pdev)
{
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
-@@ -2362,7 +2362,11 @@ static int __init pl022_init(void)
+@@ -2367,7 +2367,11 @@ static int __init pl022_init(void)
{
return amba_driver_register(&pl022_driver);
}
static void __exit pl022_exit(void)
{
-@@ -2449,7 +2453,9 @@ static struct platform_driver starfive_o
+@@ -2454,7 +2458,9 @@ static struct platform_driver starfive_o
.remove = starfive_of_pl022_remove,
};
host->handle_err = pl022_handle_err;
host->unprepare_transfer_hardware = pl022_unprepare_transfer_hardware;
host->rt = platform_info->rt;
-@@ -2432,8 +2431,6 @@ static void starfive_of_pl022_remove(str
+@@ -2437,8 +2436,6 @@ static void starfive_of_pl022_remove(str
if (pl022->host_info->enable_dma)
pl022_dma_remove(pl022);
--- /dev/null
+From: Zhihao Xu <ngc7331@outlook.com>
+Date: Mon, 18 May 2026 14:03:55 +0800
+Subject: [PATCH] spi-pl022-starfive: fix controller deregistration
+
+Use manually managed spi_register_controller instead of device managed.
+
+Link: https://lore.kernel.org/all/20260410081757.503099-1-johan@kernel.org/
+
+Signed-off-by: Zhihao Xu <ngc7331@outlook.com>
+--- a/drivers/spi/spi-pl022.c
++++ b/drivers/spi/spi-pl022.c
+@@ -1991,7 +1991,7 @@ static int pl022_platform_probe(struct p
+ /* Register with the SPI framework */
+ dev_set_drvdata(dev, pl022);
+
+- status = devm_spi_register_controller(dev, host);
++ status = spi_register_controller(host);
+ if (status != 0) {
+ dev_err(dev,
+ "probe - problem registering spi host\n");
+@@ -2429,6 +2429,10 @@ static void starfive_of_pl022_remove(str
+ if (!pl022)
+ return;
+
++ spi_controller_get(pl022->host);
++
++ spi_unregister_controller(pl022->host);
++
+ pm_runtime_get_sync(&pdev->dev);
+ pm_runtime_get_noresume(&pdev->dev);
+
+@@ -2441,6 +2445,8 @@ static void starfive_of_pl022_remove(str
+ pm_runtime_set_suspended(&pdev->dev);
+ pm_runtime_put_noidle(&pdev->dev);
+ dev_pm_domain_detach(&pdev->dev, true);
++
++ spi_controller_put(pl022->host);
+ }
+
+ static const struct of_device_id starfive_of_pl022_match[] = {