From: Greg Kroah-Hartman Date: Fri, 15 May 2026 07:47:44 +0000 (+0200) Subject: 6.12-stable patches X-Git-Tag: v5.10.256~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=830a510d15b2d4f515f1e51d92bacd2cb6639328;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: media-dib8000-avoid-division-by-0-in-dib8000_set_dds.patch media-i2c-imx412-assert-reset-gpio-during-probe.patch media-i2c-ov08d10-fix-image-vertical-start-setting.patch media-omap3isp-drop-the-use-count-of-v4l2-pipeline.patch media-pci-zoran-fix-potential-memory-leak-in-zoran_probe.patch media-staging-imx-request-mbus_config-in-csi_start.patch spi-dln2-fix-controller-deregistration.patch spi-fsl-espi-fix-controller-deregistration.patch spi-mtk-nor-fix-controller-deregistration.patch spi-mxs-fix-controller-deregistration.patch spi-omap2-mcspi-fix-controller-deregistration.patch spi-pic32-fix-controller-deregistration.patch spi-pl022-fix-controller-deregistration.patch spi-s3c64xx-fix-controller-deregistration.patch --- diff --git a/queue-6.12/media-dib8000-avoid-division-by-0-in-dib8000_set_dds.patch b/queue-6.12/media-dib8000-avoid-division-by-0-in-dib8000_set_dds.patch new file mode 100644 index 0000000000..88b8f577db --- /dev/null +++ b/queue-6.12/media-dib8000-avoid-division-by-0-in-dib8000_set_dds.patch @@ -0,0 +1,47 @@ +From dde3c37af95cd6fa301c4906f33d627bc9dd874c Mon Sep 17 00:00:00 2001 +From: Sergey Shtylyov +Date: Fri, 6 Feb 2026 17:22:26 +0300 +Subject: media: dib8000: avoid division by 0 in dib8000_set_dds() + +From: Sergey Shtylyov + +commit dde3c37af95cd6fa301c4906f33d627bc9dd874c upstream. + +In dib8000_set_dds(), 1 << 26 (67108864) divided by e.g. 1 apparently can't +fit into 16-bit variable unit_khz_dds_val, being truncated to 0; this will +cause division by 0 while calling dprintk() with debugging enabled (via the +module parameter). Use s32 instead of s16 to declare the variable, getting +rid of the cast to u16 in the *else* branch as well... + +Found by Linux Verification Center (linuxtesting.org) with the Svace static +analysis tool. + +Fixes: 173a64cb3fcf ("[media] dib8000: enhancement") +Cc: stable@vger.kernel.org +Signed-off-by: Sergey Shtylyov +Signed-off-by: Hans Verkuil +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/dvb-frontends/dib8000.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/media/dvb-frontends/dib8000.c ++++ b/drivers/media/dvb-frontends/dib8000.c +@@ -2694,7 +2694,7 @@ static void dib8000_viterbi_state(struct + + static void dib8000_set_dds(struct dib8000_state *state, s32 offset_khz) + { +- s16 unit_khz_dds_val; ++ s32 unit_khz_dds_val; + u32 abs_offset_khz = abs(offset_khz); + u32 dds = state->cfg.pll->ifreq & 0x1ffffff; + u8 invert = !!(state->cfg.pll->ifreq & (1 << 25)); +@@ -2715,7 +2715,7 @@ static void dib8000_set_dds(struct dib80 + dds = (1<<26) - dds; + } else { + ratio = 2; +- unit_khz_dds_val = (u16) (67108864 / state->cfg.pll->internal); ++ unit_khz_dds_val = 67108864 / state->cfg.pll->internal; + + if (offset_khz < 0) + unit_khz_dds_val *= -1; diff --git a/queue-6.12/media-i2c-imx412-assert-reset-gpio-during-probe.patch b/queue-6.12/media-i2c-imx412-assert-reset-gpio-during-probe.patch new file mode 100644 index 0000000000..d941b1f3ed --- /dev/null +++ b/queue-6.12/media-i2c-imx412-assert-reset-gpio-during-probe.patch @@ -0,0 +1,34 @@ +From 8467c5ff5acae28513bc1e0af535e06b41b04344 Mon Sep 17 00:00:00 2001 +From: Wenmeng Liu +Date: Fri, 23 Jan 2026 17:19:55 +0800 +Subject: media: i2c: imx412: Assert reset GPIO during probe + +From: Wenmeng Liu + +commit 8467c5ff5acae28513bc1e0af535e06b41b04344 upstream. + +Assert the reset GPIO before first power up. This avoids a mismatch where +the first power up (when the reset GPIO defaults deasserted) differs from +subsequent cycles. + +Signed-off-by: Wenmeng Liu +Fixes: 9214e86c0cc1 ("media: i2c: Add imx412 camera sensor driver") +Cc: stable@vger.kernel.org +Signed-off-by: Sakari Ailus +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/i2c/imx412.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/i2c/imx412.c ++++ b/drivers/media/i2c/imx412.c +@@ -925,7 +925,7 @@ static int imx412_parse_hw_config(struct + + /* Request optional reset pin */ + imx412->reset_gpio = devm_gpiod_get_optional(imx412->dev, "reset", +- GPIOD_OUT_LOW); ++ GPIOD_OUT_HIGH); + if (IS_ERR(imx412->reset_gpio)) { + dev_err(imx412->dev, "failed to get reset gpio %ld\n", + PTR_ERR(imx412->reset_gpio)); diff --git a/queue-6.12/media-i2c-ov08d10-fix-image-vertical-start-setting.patch b/queue-6.12/media-i2c-ov08d10-fix-image-vertical-start-setting.patch new file mode 100644 index 0000000000..aad41c8739 --- /dev/null +++ b/queue-6.12/media-i2c-ov08d10-fix-image-vertical-start-setting.patch @@ -0,0 +1,67 @@ +From 5d150fa0f16096d736bd24d13e04495da5116fab Mon Sep 17 00:00:00 2001 +From: Matthias Fend +Date: Tue, 24 Mar 2026 11:41:36 +0100 +Subject: media: i2c: ov08d10: fix image vertical start setting + +From: Matthias Fend + +commit 5d150fa0f16096d736bd24d13e04495da5116fab upstream. + +The current settings for the "image vertical start" register appear to be +incorrect. While this only results in an incorrect start line for native +modes, this faulty setting causes actual problems in binning mode. At least +on an i.MX8MP test system, only corrupted frames could be received. +To correct this, the recommended settings from the reference register sets +are used for all modes. Since this shifts the start by one line, the Bayer +pattern also changes, which has also been corrected. + +Fixes: 7be91e02ed57 ("media: i2c: Add ov08d10 camera sensor driver") +Cc: stable@vger.kernel.org +Signed-off-by: Matthias Fend +Signed-off-by: Sakari Ailus +Signed-off-by: Hans Verkuil +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/i2c/ov08d10.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/media/i2c/ov08d10.c ++++ b/drivers/media/i2c/ov08d10.c +@@ -217,7 +217,7 @@ static const struct ov08d10_reg lane_2_m + {0x9a, 0x30}, + {0xa8, 0x02}, + {0xfd, 0x02}, +- {0xa1, 0x01}, ++ {0xa1, 0x00}, + {0xa2, 0x09}, + {0xa3, 0x9c}, + {0xa5, 0x00}, +@@ -335,7 +335,7 @@ static const struct ov08d10_reg lane_2_m + {0x9a, 0x30}, + {0xa8, 0x02}, + {0xfd, 0x02}, +- {0xa1, 0x09}, ++ {0xa1, 0x08}, + {0xa2, 0x09}, + {0xa3, 0x90}, + {0xa5, 0x08}, +@@ -467,7 +467,7 @@ static const struct ov08d10_reg lane_2_m + {0xaa, 0xd0}, + {0xab, 0x06}, + {0xac, 0x68}, +- {0xa1, 0x09}, ++ {0xa1, 0x04}, + {0xa2, 0x04}, + {0xa3, 0xc8}, + {0xa5, 0x04}, +@@ -612,8 +612,8 @@ static const struct ov08d10_lane_cfg lan + static u32 ov08d10_get_format_code(struct ov08d10 *ov08d10) + { + static const u32 codes[2][2] = { +- { MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SRGGB10_1X10}, +- { MEDIA_BUS_FMT_SBGGR10_1X10, MEDIA_BUS_FMT_SGBRG10_1X10}, ++ { MEDIA_BUS_FMT_SBGGR10_1X10, MEDIA_BUS_FMT_SGBRG10_1X10 }, ++ { MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SRGGB10_1X10 }, + }; + + return codes[ov08d10->vflip->val][ov08d10->hflip->val]; diff --git a/queue-6.12/media-omap3isp-drop-the-use-count-of-v4l2-pipeline.patch b/queue-6.12/media-omap3isp-drop-the-use-count-of-v4l2-pipeline.patch new file mode 100644 index 0000000000..03a46c95ec --- /dev/null +++ b/queue-6.12/media-omap3isp-drop-the-use-count-of-v4l2-pipeline.patch @@ -0,0 +1,32 @@ +From 9da49bd9d4224035cff39b40d7395310abb10201 Mon Sep 17 00:00:00 2001 +From: Haoxiang Li +Date: Mon, 26 Jan 2026 09:44:12 +0800 +Subject: media: omap3isp: drop the use count of v4l2 pipeline + +From: Haoxiang Li + +commit 9da49bd9d4224035cff39b40d7395310abb10201 upstream. + +In isp_video_open(), drop the use count of v4l2 +pipeline if vb2_queue_init() fails. + +Fixes: 8fd390b89cc8 ("media: Split v4l2_pipeline_pm_use into v4l2_pipeline_pm_{get, put}") +Cc: stable@vger.kernel.org +Signed-off-by: Haoxiang Li +Signed-off-by: Sakari Ailus +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/platform/ti/omap3isp/ispvideo.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/media/platform/ti/omap3isp/ispvideo.c ++++ b/drivers/media/platform/ti/omap3isp/ispvideo.c +@@ -1324,6 +1324,7 @@ static int isp_video_open(struct file *f + + ret = vb2_queue_init(&handle->queue); + if (ret < 0) { ++ v4l2_pipeline_pm_put(&video->video.entity); + omap3isp_put(video->isp); + goto done; + } diff --git a/queue-6.12/media-pci-zoran-fix-potential-memory-leak-in-zoran_probe.patch b/queue-6.12/media-pci-zoran-fix-potential-memory-leak-in-zoran_probe.patch new file mode 100644 index 0000000000..a853de9257 --- /dev/null +++ b/queue-6.12/media-pci-zoran-fix-potential-memory-leak-in-zoran_probe.patch @@ -0,0 +1,33 @@ +From 8ea21435fe36fb853706f4935d78bc11beb63fb4 Mon Sep 17 00:00:00 2001 +From: Abdun Nihaal +Date: Thu, 12 Mar 2026 18:02:56 +0530 +Subject: media: pci: zoran: fix potential memory leak in zoran_probe() + +From: Abdun Nihaal + +commit 8ea21435fe36fb853706f4935d78bc11beb63fb4 upstream. + +The memory allocated for codec in videocodec_attach() is not freed in +one of the error paths, due to an incorrect goto label. Fix the label +to free it on error. + +Fixes: 8f7cc5c0b0eb ("media: staging: media: zoran: introduce zoran_i2c_init") +Cc: stable@vger.kernel.org +Signed-off-by: Abdun Nihaal +Signed-off-by: Hans Verkuil +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/pci/zoran/zoran_card.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/pci/zoran/zoran_card.c ++++ b/drivers/media/pci/zoran/zoran_card.c +@@ -1377,7 +1377,7 @@ static int zoran_probe(struct pci_dev *p + } + if (zr->codec->type != zr->card.video_codec) { + pci_err(pdev, "%s - wrong codec\n", __func__); +- goto zr_unreg_videocodec; ++ goto zr_detach_codec; + } + } + if (zr->card.video_vfe != 0) { diff --git a/queue-6.12/media-staging-imx-request-mbus_config-in-csi_start.patch b/queue-6.12/media-staging-imx-request-mbus_config-in-csi_start.patch new file mode 100644 index 0000000000..5342eadb33 --- /dev/null +++ b/queue-6.12/media-staging-imx-request-mbus_config-in-csi_start.patch @@ -0,0 +1,170 @@ +From 9df2aaa64890c0b6226057eb6fcb6352bd2df432 Mon Sep 17 00:00:00 2001 +From: Michael Tretter +Date: Fri, 7 Nov 2025 11:34:33 +0100 +Subject: media: staging: imx: request mbus_config in csi_start + +From: Michael Tretter + +commit 9df2aaa64890c0b6226057eb6fcb6352bd2df432 upstream. + +Request the upstream mbus_config in csi_start, which starts the stream, +instead of caching it in link_validate. + +This allows to get rid of the mbus_cfg field in the struct csi_priv and +avoids state in the driver. + +Fixes: 4a34ec8e470c ("[media] media: imx: Add CSI subdev driver") +Cc: stable@vger.kernel.org +Reviewed-by: Frank Li +Signed-off-by: Michael Tretter +Reviewed-by: Philipp Zabel +Signed-off-by: Frank Li +Signed-off-by: Hans Verkuil +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/media/imx/imx-media-csi.c | 40 ++++++++++++++++++------------ + 1 file changed, 24 insertions(+), 16 deletions(-) + +--- a/drivers/staging/media/imx/imx-media-csi.c ++++ b/drivers/staging/media/imx/imx-media-csi.c +@@ -97,9 +97,6 @@ struct csi_priv { + /* the mipi virtual channel number at link validate */ + int vc_num; + +- /* media bus config of the upstream subdevice CSI is receiving from */ +- struct v4l2_mbus_config mbus_cfg; +- + spinlock_t irqlock; /* protect eof_irq handler */ + struct timer_list eof_timeout_timer; + int eof_irq; +@@ -403,7 +400,8 @@ static void csi_idmac_unsetup_vb2_buf(st + } + + /* init the SMFC IDMAC channel */ +-static int csi_idmac_setup_channel(struct csi_priv *priv) ++static int csi_idmac_setup_channel(struct csi_priv *priv, ++ struct v4l2_mbus_config *mbus_cfg) + { + struct imx_media_video_dev *vdev = priv->vdev; + const struct imx_media_pixfmt *incc; +@@ -432,7 +430,7 @@ static int csi_idmac_setup_channel(struc + image.phys0 = phys[0]; + image.phys1 = phys[1]; + +- passthrough = requires_passthrough(&priv->mbus_cfg, infmt, incc); ++ passthrough = requires_passthrough(mbus_cfg, infmt, incc); + passthrough_cycles = 1; + + /* +@@ -572,11 +570,12 @@ static void csi_idmac_unsetup(struct csi + csi_idmac_unsetup_vb2_buf(priv, state); + } + +-static int csi_idmac_setup(struct csi_priv *priv) ++static int csi_idmac_setup(struct csi_priv *priv, ++ struct v4l2_mbus_config *mbus_cfg) + { + int ret; + +- ret = csi_idmac_setup_channel(priv); ++ ret = csi_idmac_setup_channel(priv, mbus_cfg); + if (ret) + return ret; + +@@ -595,7 +594,8 @@ static int csi_idmac_setup(struct csi_pr + return 0; + } + +-static int csi_idmac_start(struct csi_priv *priv) ++static int csi_idmac_start(struct csi_priv *priv, ++ struct v4l2_mbus_config *mbus_cfg) + { + struct imx_media_video_dev *vdev = priv->vdev; + int ret; +@@ -619,7 +619,7 @@ static int csi_idmac_start(struct csi_pr + priv->last_eof = false; + priv->nfb4eof = false; + +- ret = csi_idmac_setup(priv); ++ ret = csi_idmac_setup(priv, mbus_cfg); + if (ret) { + v4l2_err(&priv->sd, "csi_idmac_setup failed: %d\n", ret); + goto out_free_dma_buf; +@@ -701,7 +701,8 @@ static void csi_idmac_stop(struct csi_pr + } + + /* Update the CSI whole sensor and active windows */ +-static int csi_setup(struct csi_priv *priv) ++static int csi_setup(struct csi_priv *priv, ++ struct v4l2_mbus_config *mbus_cfg) + { + struct v4l2_mbus_framefmt *infmt, *outfmt; + const struct imx_media_pixfmt *incc; +@@ -719,7 +720,7 @@ static int csi_setup(struct csi_priv *pr + * if cycles is set, we need to handle this over multiple cycles as + * generic/bayer data + */ +- if (is_parallel_bus(&priv->mbus_cfg) && incc->cycles) { ++ if (is_parallel_bus(mbus_cfg) && incc->cycles) { + if_fmt.width *= incc->cycles; + crop.width *= incc->cycles; + } +@@ -730,7 +731,7 @@ static int csi_setup(struct csi_priv *pr + priv->crop.width == 2 * priv->compose.width, + priv->crop.height == 2 * priv->compose.height); + +- ipu_csi_init_interface(priv->csi, &priv->mbus_cfg, &if_fmt, outfmt); ++ ipu_csi_init_interface(priv->csi, mbus_cfg, &if_fmt, outfmt); + + ipu_csi_set_dest(priv->csi, priv->dest); + +@@ -745,9 +746,17 @@ static int csi_setup(struct csi_priv *pr + + static int csi_start(struct csi_priv *priv) + { ++ struct v4l2_mbus_config mbus_cfg = { .type = 0 }; + struct v4l2_fract *input_fi, *output_fi; + int ret; + ++ ret = csi_get_upstream_mbus_config(priv, &mbus_cfg); ++ if (ret) { ++ v4l2_err(&priv->sd, ++ "failed to get upstream media bus configuration\n"); ++ return ret; ++ } ++ + input_fi = &priv->frame_interval[CSI_SINK_PAD]; + output_fi = &priv->frame_interval[priv->active_output_pad]; + +@@ -758,7 +767,7 @@ static int csi_start(struct csi_priv *pr + return ret; + + /* Skip first few frames from a BT.656 source */ +- if (priv->mbus_cfg.type == V4L2_MBUS_BT656) { ++ if (mbus_cfg.type == V4L2_MBUS_BT656) { + u32 delay_usec, bad_frames = 20; + + delay_usec = DIV_ROUND_UP_ULL((u64)USEC_PER_SEC * +@@ -769,12 +778,12 @@ static int csi_start(struct csi_priv *pr + } + + if (priv->dest == IPU_CSI_DEST_IDMAC) { +- ret = csi_idmac_start(priv); ++ ret = csi_idmac_start(priv, &mbus_cfg); + if (ret) + goto stop_upstream; + } + +- ret = csi_setup(priv); ++ ret = csi_setup(priv, &mbus_cfg); + if (ret) + goto idmac_stop; + +@@ -1138,7 +1147,6 @@ static int csi_link_validate(struct v4l2 + + mutex_lock(&priv->lock); + +- priv->mbus_cfg = mbus_cfg; + is_csi2 = !is_parallel_bus(&mbus_cfg); + if (is_csi2) { + /* diff --git a/queue-6.12/series b/queue-6.12/series index 5b7b453151..e90470fd87 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -30,3 +30,17 @@ media-saa7164-add-ioremap-return-checks-and-cleanups.patch spi-aspeed-smc-fix-controller-deregistration.patch platform-x86-hp-wmi-ignore-backlight-and-fnlock-events.patch vsock-virtio-fix-msg_peek-ignoring-skb-offset-when-calculating-bytes-to-copy.patch +media-pci-zoran-fix-potential-memory-leak-in-zoran_probe.patch +media-dib8000-avoid-division-by-0-in-dib8000_set_dds.patch +media-i2c-imx412-assert-reset-gpio-during-probe.patch +media-staging-imx-request-mbus_config-in-csi_start.patch +media-i2c-ov08d10-fix-image-vertical-start-setting.patch +media-omap3isp-drop-the-use-count-of-v4l2-pipeline.patch +spi-mxs-fix-controller-deregistration.patch +spi-dln2-fix-controller-deregistration.patch +spi-s3c64xx-fix-controller-deregistration.patch +spi-fsl-espi-fix-controller-deregistration.patch +spi-omap2-mcspi-fix-controller-deregistration.patch +spi-pic32-fix-controller-deregistration.patch +spi-mtk-nor-fix-controller-deregistration.patch +spi-pl022-fix-controller-deregistration.patch diff --git a/queue-6.12/spi-dln2-fix-controller-deregistration.patch b/queue-6.12/spi-dln2-fix-controller-deregistration.patch new file mode 100644 index 0000000000..52751f003c --- /dev/null +++ b/queue-6.12/spi-dln2-fix-controller-deregistration.patch @@ -0,0 +1,51 @@ +From c353020fbfa8514ee91a6de2d88de4e5edca5803 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 9 Apr 2026 14:04:10 +0200 +Subject: spi: dln2: fix controller deregistration + +From: Johan Hovold + +commit c353020fbfa8514ee91a6de2d88de4e5edca5803 upstream. + +Make sure to deregister the controller before disabling it to allow +SPI device drivers to do I/O during deregistration. + +Fixes: 3d8c0d749da3 ("spi: add support for DLN-2 USB-SPI adapter") +Cc: stable@vger.kernel.org # 4.0 +Cc: Laurentiu Palcu +Signed-off-by: Johan Hovold +Link: https://patch.msgid.link/20260409120419.388546-12-johan@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-dln2.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/spi/spi-dln2.c ++++ b/drivers/spi/spi-dln2.c +@@ -761,7 +761,7 @@ static int dln2_spi_probe(struct platfor + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); + +- ret = devm_spi_register_controller(&pdev->dev, host); ++ ret = spi_register_controller(host); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to register host\n"); + goto exit_register; +@@ -786,10 +786,16 @@ static void dln2_spi_remove(struct platf + struct spi_controller *host = platform_get_drvdata(pdev); + struct dln2_spi *dln2 = spi_controller_get_devdata(host); + ++ spi_controller_get(host); ++ ++ spi_unregister_controller(host); ++ + pm_runtime_disable(&pdev->dev); + + if (dln2_spi_enable(dln2, false) < 0) + dev_err(&pdev->dev, "Failed to disable SPI module\n"); ++ ++ spi_controller_put(host); + } + + #ifdef CONFIG_PM_SLEEP diff --git a/queue-6.12/spi-fsl-espi-fix-controller-deregistration.patch b/queue-6.12/spi-fsl-espi-fix-controller-deregistration.patch new file mode 100644 index 0000000000..46637bcbcd --- /dev/null +++ b/queue-6.12/spi-fsl-espi-fix-controller-deregistration.patch @@ -0,0 +1,51 @@ +From e506a700a7ad229f5c8f01f4b8350119cccb4158 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 9 Apr 2026 14:04:12 +0200 +Subject: spi: fsl-espi: fix controller deregistration + +From: Johan Hovold + +commit e506a700a7ad229f5c8f01f4b8350119cccb4158 upstream. + +Make sure to deregister the controller before disabling runtime PM +(which can leave the controller disabled) to allow SPI device drivers to +do I/O during deregistration. + +Fixes: e9abb4db8d10 ("spi: fsl-espi: add runtime PM") +Cc: stable@vger.kernel.org # 4.3 +Cc: Heiner Kallweit +Signed-off-by: Johan Hovold +Link: https://patch.msgid.link/20260409120419.388546-14-johan@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-fsl-espi.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/spi/spi-fsl-espi.c ++++ b/drivers/spi/spi-fsl-espi.c +@@ -720,7 +720,7 @@ static int fsl_espi_probe(struct device + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); + +- ret = devm_spi_register_controller(dev, host); ++ ret = spi_register_controller(host); + if (ret < 0) + goto err_pm; + +@@ -785,7 +785,15 @@ static int of_fsl_espi_probe(struct plat + + static void of_fsl_espi_remove(struct platform_device *dev) + { ++ struct spi_controller *host = platform_get_drvdata(dev); ++ ++ spi_controller_get(host); ++ ++ spi_unregister_controller(host); ++ + pm_runtime_disable(&dev->dev); ++ ++ spi_controller_put(host); + } + + #ifdef CONFIG_PM_SLEEP diff --git a/queue-6.12/spi-mtk-nor-fix-controller-deregistration.patch b/queue-6.12/spi-mtk-nor-fix-controller-deregistration.patch new file mode 100644 index 0000000000..0173b6ad6f --- /dev/null +++ b/queue-6.12/spi-mtk-nor-fix-controller-deregistration.patch @@ -0,0 +1,43 @@ +From 76336f24934621db286cabb20b483773ee01dcaa Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Fri, 10 Apr 2026 10:17:32 +0200 +Subject: spi: mtk-nor: fix controller deregistration + +From: Johan Hovold + +commit 76336f24934621db286cabb20b483773ee01dcaa upstream. + +Make sure to deregister the controller before disabling underlying +resources like clocks during driver unbind. + +Fixes: 881d1ee9fe81 ("spi: add support for mediatek spi-nor controller") +Cc: stable@vger.kernel.org # 5.7 +Cc: Chuanhong Guo +Signed-off-by: Johan Hovold +Link: https://patch.msgid.link/20260410081757.503099-3-johan@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-mtk-nor.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/spi/spi-mtk-nor.c ++++ b/drivers/spi/spi-mtk-nor.c +@@ -914,7 +914,7 @@ static int mtk_nor_probe(struct platform + pm_runtime_enable(&pdev->dev); + pm_runtime_get_noresume(&pdev->dev); + +- ret = devm_spi_register_controller(&pdev->dev, ctlr); ++ ret = spi_register_controller(ctlr); + if (ret < 0) + goto err_probe; + +@@ -940,6 +940,8 @@ static void mtk_nor_remove(struct platfo + struct spi_controller *ctlr = dev_get_drvdata(&pdev->dev); + struct mtk_nor *sp = spi_controller_get_devdata(ctlr); + ++ spi_unregister_controller(ctlr); ++ + pm_runtime_disable(&pdev->dev); + pm_runtime_set_suspended(&pdev->dev); + pm_runtime_dont_use_autosuspend(&pdev->dev); diff --git a/queue-6.12/spi-mxs-fix-controller-deregistration.patch b/queue-6.12/spi-mxs-fix-controller-deregistration.patch new file mode 100644 index 0000000000..dd7274a795 --- /dev/null +++ b/queue-6.12/spi-mxs-fix-controller-deregistration.patch @@ -0,0 +1,52 @@ +From 8b0d0011af20fb547aa67a1cefbf320992fd5e92 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Fri, 10 Apr 2026 10:17:33 +0200 +Subject: spi: mxs: fix controller deregistration + +From: Johan Hovold + +commit 8b0d0011af20fb547aa67a1cefbf320992fd5e92 upstream. + +Make sure to deregister the controller before releasing underlying +resources like DMA during driver unbind. + +Fixes: 33e195acf268 ("spi: mxs: use devm_spi_register_master()") +Cc: stable@vger.kernel.org # 3.13 +Cc: Jingoo Han +Signed-off-by: Johan Hovold +Link: https://patch.msgid.link/20260410081757.503099-4-johan@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-mxs.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/spi/spi-mxs.c ++++ b/drivers/spi/spi-mxs.c +@@ -617,7 +617,7 @@ static int mxs_spi_probe(struct platform + if (ret) + goto out_pm_runtime_put; + +- ret = devm_spi_register_controller(&pdev->dev, host); ++ ret = spi_register_controller(host); + if (ret) { + dev_err(&pdev->dev, "Cannot register SPI host, %d\n", ret); + goto out_pm_runtime_put; +@@ -648,11 +648,17 @@ static void mxs_spi_remove(struct platfo + spi = spi_controller_get_devdata(host); + ssp = &spi->ssp; + ++ spi_controller_get(host); ++ ++ spi_unregister_controller(host); ++ + pm_runtime_disable(&pdev->dev); + if (!pm_runtime_status_suspended(&pdev->dev)) + mxs_spi_runtime_suspend(&pdev->dev); + + dma_release_channel(ssp->dmach); ++ ++ spi_controller_put(host); + } + + static struct platform_driver mxs_spi_driver = { diff --git a/queue-6.12/spi-omap2-mcspi-fix-controller-deregistration.patch b/queue-6.12/spi-omap2-mcspi-fix-controller-deregistration.patch new file mode 100644 index 0000000000..96c60affc7 --- /dev/null +++ b/queue-6.12/spi-omap2-mcspi-fix-controller-deregistration.patch @@ -0,0 +1,51 @@ +From fb45f95c377e4a4bdece2c5e17643b459c9c13e7 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Fri, 10 Apr 2026 10:17:35 +0200 +Subject: spi: omap2-mcspi: fix controller deregistration + +From: Johan Hovold + +commit fb45f95c377e4a4bdece2c5e17643b459c9c13e7 upstream. + +Make sure to deregister the controller before releasing underlying +resources like DMA during driver unbind. + +Fixes: ccdc7bf92573 ("SPI: omap2_mcspi driver") +Cc: stable@vger.kernel.org # 2.6.23 +Signed-off-by: Johan Hovold +Link: https://patch.msgid.link/20260410081757.503099-6-johan@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-omap2-mcspi.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/spi/spi-omap2-mcspi.c ++++ b/drivers/spi/spi-omap2-mcspi.c +@@ -1587,7 +1587,7 @@ static int omap2_mcspi_probe(struct plat + if (status < 0) + goto disable_pm; + +- status = devm_spi_register_controller(&pdev->dev, ctlr); ++ status = spi_register_controller(ctlr); + if (status < 0) + goto disable_pm; + +@@ -1608,11 +1608,17 @@ static void omap2_mcspi_remove(struct pl + struct spi_controller *ctlr = platform_get_drvdata(pdev); + struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr); + ++ spi_controller_get(ctlr); ++ ++ spi_unregister_controller(ctlr); ++ + omap2_mcspi_release_dma(ctlr); + + pm_runtime_dont_use_autosuspend(mcspi->dev); + pm_runtime_put_sync(mcspi->dev); + pm_runtime_disable(&pdev->dev); ++ ++ spi_controller_put(ctlr); + } + + /* work with hotplug and coldplug */ diff --git a/queue-6.12/spi-pic32-fix-controller-deregistration.patch b/queue-6.12/spi-pic32-fix-controller-deregistration.patch new file mode 100644 index 0000000000..c95ca26a61 --- /dev/null +++ b/queue-6.12/spi-pic32-fix-controller-deregistration.patch @@ -0,0 +1,53 @@ +From 6b627bfe0c44e064aba464839e430dc1ca2b0bb8 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Fri, 10 Apr 2026 10:17:36 +0200 +Subject: spi: pic32: fix controller deregistration + +From: Johan Hovold + +commit 6b627bfe0c44e064aba464839e430dc1ca2b0bb8 upstream. + +Make sure to deregister the controller before releasing underlying +resources like DMA during driver unbind. + +Fixes: 1bcb9f8ceb67 ("spi: spi-pic32: Add PIC32 SPI master driver") +Cc: stable@vger.kernel.org # 4.7 +Cc: Purna Chandra Mandal +Signed-off-by: Johan Hovold +Link: https://patch.msgid.link/20260410081757.503099-7-johan@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-pic32.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +--- a/drivers/spi/spi-pic32.c ++++ b/drivers/spi/spi-pic32.c +@@ -821,7 +821,7 @@ static int pic32_spi_probe(struct platfo + } + + /* register host */ +- ret = devm_spi_register_controller(&pdev->dev, host); ++ ret = spi_register_controller(host); + if (ret) { + dev_err(&host->dev, "failed registering spi host\n"); + goto err_bailout; +@@ -840,11 +840,16 @@ err_host: + + static void pic32_spi_remove(struct platform_device *pdev) + { +- struct pic32_spi *pic32s; ++ struct pic32_spi *pic32s = platform_get_drvdata(pdev); ++ ++ spi_controller_get(pic32s->host); ++ ++ spi_unregister_controller(pic32s->host); + +- pic32s = platform_get_drvdata(pdev); + pic32_spi_disable(pic32s); + pic32_spi_dma_unprep(pic32s); ++ ++ spi_controller_put(pic32s->host); + } + + static const struct of_device_id pic32_spi_of_match[] = { diff --git a/queue-6.12/spi-pl022-fix-controller-deregistration.patch b/queue-6.12/spi-pl022-fix-controller-deregistration.patch new file mode 100644 index 0000000000..9fdc9cd719 --- /dev/null +++ b/queue-6.12/spi-pl022-fix-controller-deregistration.patch @@ -0,0 +1,54 @@ +From 994b33366be9148240690e3e94bffe17c4d89458 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Fri, 10 Apr 2026 10:17:38 +0200 +Subject: spi: pl022: fix controller deregistration + +From: Johan Hovold + +commit 994b33366be9148240690e3e94bffe17c4d89458 upstream. + +Make sure to deregister the controller before releasing underlying +resources like DMA during driver unbind. + +Fixes: b43d65f7e818 ("[ARM] 5546/1: ARM PL022 SSP/SPI driver v3") +Cc: stable@vger.kernel.org # 2.6.31 +Cc: Linus Walleij +Signed-off-by: Johan Hovold +Link: https://patch.msgid.link/20260410081757.503099-9-johan@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-pl022.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/spi/spi-pl022.c ++++ b/drivers/spi/spi-pl022.c +@@ -1960,7 +1960,7 @@ 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); ++ status = spi_register_controller(host); + if (status != 0) { + dev_err_probe(&adev->dev, status, + "problem registering spi host\n"); +@@ -2001,6 +2001,10 @@ pl022_remove(struct amba_device *adev) + if (!pl022) + return; + ++ spi_controller_get(pl022->host); ++ ++ spi_unregister_controller(pl022->host); ++ + /* + * undo pm_runtime_put() in probe. I assume that we're not + * accessing the primecell here. +@@ -2012,6 +2016,8 @@ pl022_remove(struct amba_device *adev) + pl022_dma_remove(pl022); + + amba_release_regions(adev); ++ ++ spi_controller_put(pl022->host); + } + + #ifdef CONFIG_PM_SLEEP diff --git a/queue-6.12/spi-s3c64xx-fix-controller-deregistration.patch b/queue-6.12/spi-s3c64xx-fix-controller-deregistration.patch new file mode 100644 index 0000000000..429b043a2d --- /dev/null +++ b/queue-6.12/spi-s3c64xx-fix-controller-deregistration.patch @@ -0,0 +1,43 @@ +From c1446b61e472da24d1547525193467b4bea4a7cb Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Fri, 10 Apr 2026 10:17:41 +0200 +Subject: spi: s3c64xx: fix controller deregistration + +From: Johan Hovold + +commit c1446b61e472da24d1547525193467b4bea4a7cb upstream. + +Make sure to deregister the controller before releasing underlying +resources like DMA during driver unbind. + +Fixes: 91800f0e9005 ("spi/s3c64xx: Use managed registration") +Cc: stable@vger.kernel.org # 3.13: 76fbad410c0f +Cc: stable@vger.kernel.org # 3.13 +Signed-off-by: Johan Hovold +Link: https://patch.msgid.link/20260410081757.503099-12-johan@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-s3c64xx.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/spi/spi-s3c64xx.c ++++ b/drivers/spi/spi-s3c64xx.c +@@ -1371,7 +1371,7 @@ static int s3c64xx_spi_probe(struct plat + S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN, + sdd->regs + S3C64XX_SPI_INT_EN); + +- ret = devm_spi_register_controller(&pdev->dev, host); ++ ret = spi_register_controller(host); + if (ret != 0) { + dev_err(&pdev->dev, "cannot register SPI host: %d\n", ret); + goto err_pm_put; +@@ -1402,6 +1402,8 @@ static void s3c64xx_spi_remove(struct pl + + pm_runtime_get_sync(&pdev->dev); + ++ spi_unregister_controller(host); ++ + writel(0, sdd->regs + S3C64XX_SPI_INT_EN); + + pm_runtime_put_noidle(&pdev->dev);