]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2023 13:27:03 +0000 (15:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2023 13:27:03 +0000 (15:27 +0200)
added patches:
drm-exynos-move-to-use-request_irq-by-irqf_no_autoen-flag.patch
drm-msm-adreno-fix-null-ptr-access-in-adreno_gpu_cleanup.patch
drm-msm-fix-double-pm_runtime_disable-call.patch
firmware-raspberrypi-fix-possible-memory-leak-in-rpi_firmware_probe.patch
pm-domains-restore-comment-indentation-for-generic_pm_domain.child_links.patch
spi-imx-fix-reference-leak-in-two-imx-operations.patch
spi-imx-fix-runtime-pm-support-for-config_pm.patch

queue-5.4/drm-exynos-move-to-use-request_irq-by-irqf_no_autoen-flag.patch [new file with mode: 0644]
queue-5.4/drm-msm-adreno-fix-null-ptr-access-in-adreno_gpu_cleanup.patch [new file with mode: 0644]
queue-5.4/drm-msm-fix-double-pm_runtime_disable-call.patch [new file with mode: 0644]
queue-5.4/firmware-raspberrypi-fix-possible-memory-leak-in-rpi_firmware_probe.patch [new file with mode: 0644]
queue-5.4/pm-domains-restore-comment-indentation-for-generic_pm_domain.child_links.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/spi-imx-fix-reference-leak-in-two-imx-operations.patch [new file with mode: 0644]
queue-5.4/spi-imx-fix-runtime-pm-support-for-config_pm.patch [new file with mode: 0644]

diff --git a/queue-5.4/drm-exynos-move-to-use-request_irq-by-irqf_no_autoen-flag.patch b/queue-5.4/drm-exynos-move-to-use-request_irq-by-irqf_no_autoen-flag.patch
new file mode 100644 (file)
index 0000000..e47e2f2
--- /dev/null
@@ -0,0 +1,67 @@
+From a4e5eed2c6a689ef2b6ad8d7ae86665c69039379 Mon Sep 17 00:00:00 2001
+From: Tian Tao <tiantao6@hisilicon.com>
+Date: Mon, 15 Mar 2021 19:49:37 +0800
+Subject: drm/exynos: move to use request_irq by IRQF_NO_AUTOEN flag
+
+From: Tian Tao <tiantao6@hisilicon.com>
+
+commit a4e5eed2c6a689ef2b6ad8d7ae86665c69039379 upstream.
+
+After this patch cbe16f35bee68 genirq: Add IRQF_NO_AUTOEN for
+request_irq/nmi() is merged. request_irq() after setting
+IRQ_NOAUTOEN as below
+
+irq_set_status_flags(irq, IRQ_NOAUTOEN);
+request_irq(dev, irq...);
+can be replaced by request_irq() with IRQF_NO_AUTOEN flag.
+
+v2:
+Fix the problem of using wrong flags
+
+Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
+Signed-off-by: Inki Dae <inki.dae@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/exynos/exynos5433_drm_decon.c |    4 ++--
+ drivers/gpu/drm/exynos/exynos_drm_dsi.c       |    7 +++----
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
++++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+@@ -775,8 +775,8 @@ static int decon_conf_irq(struct decon_c
+                       return irq;
+               }
+       }
+-      irq_set_status_flags(irq, IRQ_NOAUTOEN);
+-      ret = devm_request_irq(ctx->dev, irq, handler, flags, "drm_decon", ctx);
++      ret = devm_request_irq(ctx->dev, irq, handler,
++                             flags | IRQF_NO_AUTOEN, "drm_decon", ctx);
+       if (ret < 0) {
+               dev_err(ctx->dev, "IRQ %s request failed\n", name);
+               return ret;
+--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
++++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+@@ -1350,10 +1350,9 @@ static int exynos_dsi_register_te_irq(st
+       }
+       te_gpio_irq = gpio_to_irq(dsi->te_gpio);
+-      irq_set_status_flags(te_gpio_irq, IRQ_NOAUTOEN);
+       ret = request_threaded_irq(te_gpio_irq, exynos_dsi_te_irq_handler, NULL,
+-                                      IRQF_TRIGGER_RISING, "TE", dsi);
++                                 IRQF_TRIGGER_RISING | IRQF_NO_AUTOEN, "TE", dsi);
+       if (ret) {
+               dev_err(dsi->dev, "request interrupt failed with %d\n", ret);
+               gpio_free(dsi->te_gpio);
+@@ -1792,9 +1791,9 @@ static int exynos_dsi_probe(struct platf
+               return dsi->irq;
+       }
+-      irq_set_status_flags(dsi->irq, IRQ_NOAUTOEN);
+       ret = devm_request_threaded_irq(dev, dsi->irq, NULL,
+-                                      exynos_dsi_irq, IRQF_ONESHOT,
++                                      exynos_dsi_irq,
++                                      IRQF_ONESHOT | IRQF_NO_AUTOEN,
+                                       dev_name(dev), dsi);
+       if (ret) {
+               dev_err(dev, "failed to request dsi irq\n");
diff --git a/queue-5.4/drm-msm-adreno-fix-null-ptr-access-in-adreno_gpu_cleanup.patch b/queue-5.4/drm-msm-adreno-fix-null-ptr-access-in-adreno_gpu_cleanup.patch
new file mode 100644 (file)
index 0000000..c323bc6
--- /dev/null
@@ -0,0 +1,81 @@
+From dbeedbcb268d055d8895aceca427f897e12c2b50 Mon Sep 17 00:00:00 2001
+From: Akhil P Oommen <quic_akhilpo@quicinc.com>
+Date: Wed, 21 Dec 2022 20:39:56 +0530
+Subject: drm/msm/adreno: Fix null ptr access in adreno_gpu_cleanup()
+
+From: Akhil P Oommen <quic_akhilpo@quicinc.com>
+
+commit dbeedbcb268d055d8895aceca427f897e12c2b50 upstream.
+
+Fix the below kernel panic due to null pointer access:
+[   18.504431] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000048
+[   18.513464] Mem abort info:
+[   18.516346]   ESR = 0x0000000096000005
+[   18.520204]   EC = 0x25: DABT (current EL), IL = 32 bits
+[   18.525706]   SET = 0, FnV = 0
+[   18.528878]   EA = 0, S1PTW = 0
+[   18.532117]   FSC = 0x05: level 1 translation fault
+[   18.537138] Data abort info:
+[   18.540110]   ISV = 0, ISS = 0x00000005
+[   18.544060]   CM = 0, WnR = 0
+[   18.547109] user pgtable: 4k pages, 39-bit VAs, pgdp=0000000112826000
+[   18.553738] [0000000000000048] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
+[   18.562690] Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP
+**Snip**
+[   18.696758] Call trace:
+[   18.699278]  adreno_gpu_cleanup+0x30/0x88
+[   18.703396]  a6xx_destroy+0xc0/0x130
+[   18.707066]  a6xx_gpu_init+0x308/0x424
+[   18.710921]  adreno_bind+0x178/0x288
+[   18.714590]  component_bind_all+0xe0/0x214
+[   18.718797]  msm_drm_bind+0x1d4/0x614
+[   18.722566]  try_to_bring_up_aggregate_device+0x16c/0x1b8
+[   18.728105]  __component_add+0xa0/0x158
+[   18.732048]  component_add+0x20/0x2c
+[   18.735719]  adreno_probe+0x40/0xc0
+[   18.739300]  platform_probe+0xb4/0xd4
+[   18.743068]  really_probe+0xfc/0x284
+[   18.746738]  __driver_probe_device+0xc0/0xec
+[   18.751129]  driver_probe_device+0x48/0x110
+[   18.755421]  __device_attach_driver+0xa8/0xd0
+[   18.759900]  bus_for_each_drv+0x90/0xdc
+[   18.763843]  __device_attach+0xfc/0x174
+[   18.767786]  device_initial_probe+0x20/0x2c
+[   18.772090]  bus_probe_device+0x40/0xa0
+[   18.776032]  deferred_probe_work_func+0x94/0xd0
+[   18.780686]  process_one_work+0x190/0x3d0
+[   18.784805]  worker_thread+0x280/0x3d4
+[   18.788659]  kthread+0x104/0x1c0
+[   18.791981]  ret_from_fork+0x10/0x20
+[   18.795654] Code: f9400408 aa0003f3 aa1f03f4 91142015 (f9402516)
+[   18.801913] ---[ end trace 0000000000000000 ]---
+[   18.809039] Kernel panic - not syncing: Oops: Fatal exception
+
+Fixes: 17e822f7591f ("drm/msm: fix unbalanced pm_runtime_enable in adreno_gpu_{init, cleanup}")
+Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
+Patchwork: https://patchwork.freedesktop.org/patch/515605/
+Link: https://lore.kernel.org/r/20221221203925.v2.1.Ib978de92c4bd000b515486aad72e96c2481f84d0@changeid
+Signed-off-by: Rob Clark <robdclark@chromium.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/msm/adreno/adreno_gpu.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
++++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+@@ -907,13 +907,13 @@ int adreno_gpu_init(struct drm_device *d
+ void adreno_gpu_cleanup(struct adreno_gpu *adreno_gpu)
+ {
+       struct msm_gpu *gpu = &adreno_gpu->base;
+-      struct msm_drm_private *priv = gpu->dev->dev_private;
++      struct msm_drm_private *priv = gpu->dev ? gpu->dev->dev_private : NULL;
+       unsigned int i;
+       for (i = 0; i < ARRAY_SIZE(adreno_gpu->info->fw); i++)
+               release_firmware(adreno_gpu->fw[i]);
+-      if (pm_runtime_enabled(&priv->gpu_pdev->dev))
++      if (priv && pm_runtime_enabled(&priv->gpu_pdev->dev))
+               pm_runtime_disable(&priv->gpu_pdev->dev);
+       icc_put(gpu->icc_path);
diff --git a/queue-5.4/drm-msm-fix-double-pm_runtime_disable-call.patch b/queue-5.4/drm-msm-fix-double-pm_runtime_disable-call.patch
new file mode 100644 (file)
index 0000000..bc69843
--- /dev/null
@@ -0,0 +1,65 @@
+From ce0db505bc0c51ef5e9ba446c660de7e26f78f29 Mon Sep 17 00:00:00 2001
+From: Maximilian Luz <luzmaximilian@gmail.com>
+Date: Mon, 6 Jun 2022 23:13:05 +0200
+Subject: drm/msm: Fix double pm_runtime_disable() call
+
+From: Maximilian Luz <luzmaximilian@gmail.com>
+
+commit ce0db505bc0c51ef5e9ba446c660de7e26f78f29 upstream.
+
+Following commit 17e822f7591f ("drm/msm: fix unbalanced
+pm_runtime_enable in adreno_gpu_{init, cleanup}"), any call to
+adreno_unbind() will disable runtime PM twice, as indicated by the call
+trees below:
+
+  adreno_unbind()
+   -> pm_runtime_force_suspend()
+   -> pm_runtime_disable()
+
+  adreno_unbind()
+   -> gpu->funcs->destroy() [= aNxx_destroy()]
+   -> adreno_gpu_cleanup()
+   -> pm_runtime_disable()
+
+Note that pm_runtime_force_suspend() is called right before
+gpu->funcs->destroy() and both functions are called unconditionally.
+
+With recent addition of the eDP AUX bus code, this problem manifests
+itself when the eDP panel cannot be found yet and probing is deferred.
+On the first probe attempt, we disable runtime PM twice as described
+above. This then causes any later probe attempt to fail with
+
+  [drm:adreno_load_gpu [msm]] *ERROR* Couldn't power up the GPU: -13
+
+preventing the driver from loading.
+
+As there seem to be scenarios where the aNxx_destroy() functions are not
+called from adreno_unbind(), simply removing pm_runtime_disable() from
+inside adreno_unbind() does not seem to be the proper fix. This is what
+commit 17e822f7591f ("drm/msm: fix unbalanced pm_runtime_enable in
+adreno_gpu_{init, cleanup}") intended to fix. Therefore, instead check
+whether runtime PM is still enabled, and only disable it in that case.
+
+Fixes: 17e822f7591f ("drm/msm: fix unbalanced pm_runtime_enable in adreno_gpu_{init, cleanup}")
+Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
+Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
+Reviewed-by: Rob Clark <robdclark@gmail.com>
+Link: https://lore.kernel.org/r/20220606211305.189585-1-luzmaximilian@gmail.com
+Signed-off-by: Rob Clark <robdclark@chromium.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/msm/adreno/adreno_gpu.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
++++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+@@ -913,7 +913,8 @@ void adreno_gpu_cleanup(struct adreno_gp
+       for (i = 0; i < ARRAY_SIZE(adreno_gpu->info->fw); i++)
+               release_firmware(adreno_gpu->fw[i]);
+-      pm_runtime_disable(&priv->gpu_pdev->dev);
++      if (pm_runtime_enabled(&priv->gpu_pdev->dev))
++              pm_runtime_disable(&priv->gpu_pdev->dev);
+       icc_put(gpu->icc_path);
diff --git a/queue-5.4/firmware-raspberrypi-fix-possible-memory-leak-in-rpi_firmware_probe.patch b/queue-5.4/firmware-raspberrypi-fix-possible-memory-leak-in-rpi_firmware_probe.patch
new file mode 100644 (file)
index 0000000..8948915
--- /dev/null
@@ -0,0 +1,32 @@
+From 7b51161696e803fd5f9ad55b20a64c2df313f95c Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang@huawei.com>
+Date: Thu, 17 Nov 2022 15:06:36 +0800
+Subject: firmware: raspberrypi: fix possible memory leak in rpi_firmware_probe()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+commit 7b51161696e803fd5f9ad55b20a64c2df313f95c upstream.
+
+In rpi_firmware_probe(), if mbox_request_channel() fails, the 'fw' will
+not be freed through rpi_firmware_delete(), fix this leak by calling
+kfree() in the error path.
+
+Fixes: 1e7c57355a3b ("firmware: raspberrypi: Keep count of all consumers")
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Link: https://lore.kernel.org/r/20221117070636.3849773-1-yangyingliang@huawei.com
+Acked-by: Joel Savitz <jsavitz@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/firmware/raspberrypi.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/firmware/raspberrypi.c
++++ b/drivers/firmware/raspberrypi.c
+@@ -261,6 +261,7 @@ static int rpi_firmware_probe(struct pla
+               int ret = PTR_ERR(fw->chan);
+               if (ret != -EPROBE_DEFER)
+                       dev_err(dev, "Failed to get mbox channel: %d\n", ret);
++              kfree(fw);
+               return ret;
+       }
diff --git a/queue-5.4/pm-domains-restore-comment-indentation-for-generic_pm_domain.child_links.patch b/queue-5.4/pm-domains-restore-comment-indentation-for-generic_pm_domain.child_links.patch
new file mode 100644 (file)
index 0000000..98790b2
--- /dev/null
@@ -0,0 +1,33 @@
+From afb0367a80553e795e7ad055299096544454f3f6 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Tue, 14 Jul 2020 14:56:25 +0200
+Subject: PM: domains: Restore comment indentation for generic_pm_domain.child_links
+
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+
+commit afb0367a80553e795e7ad055299096544454f3f6 upstream.
+
+The rename of generic_pm_domain.slave_links to
+generic_pm_domain.child_links accidentally dropped the TAB to align the
+member's comment.  Re-add the lost TAB to restore indentation.
+
+Fixes: 8d87ae48ced2dffd ("PM: domains: Fix up terminology with parent/child")
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+[ rjw: Minor subject edit ]
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/pm_domain.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/include/linux/pm_domain.h
++++ b/include/linux/pm_domain.h
+@@ -96,7 +96,7 @@ struct generic_pm_domain {
+       struct dev_pm_domain domain;    /* PM domain operations */
+       struct list_head gpd_list_node; /* Node in the global PM domains list */
+       struct list_head parent_links;  /* Links with PM domain as a parent */
+-      struct list_head child_links;/* Links with PM domain as a child */
++      struct list_head child_links;   /* Links with PM domain as a child */
+       struct list_head dev_list;      /* List of devices */
+       struct dev_power_governor *gov;
+       struct work_struct power_off_work;
index b6db023dd7428093c323076ea8a1961fbb71260d..3b048c9e3fda5a05c78790076c1ccdc5c43d70ab 100644 (file)
@@ -271,3 +271,10 @@ drbd-correctly-submit-flush-bio-on-barrier.patch
 pci-pciehp-use-down_read-write_nested-reset_lock-to-fix-lockdep-errors.patch
 pci-pciehp-fix-ab-ba-deadlock-between-reset_lock-and-device_lock.patch
 printk-declare-printk_deferred_-enter-safe-in-include-linux-printk.h.patch
+pm-domains-restore-comment-indentation-for-generic_pm_domain.child_links.patch
+spi-imx-fix-runtime-pm-support-for-config_pm.patch
+spi-imx-fix-reference-leak-in-two-imx-operations.patch
+drm-msm-fix-double-pm_runtime_disable-call.patch
+firmware-raspberrypi-fix-possible-memory-leak-in-rpi_firmware_probe.patch
+drm-msm-adreno-fix-null-ptr-access-in-adreno_gpu_cleanup.patch
+drm-exynos-move-to-use-request_irq-by-irqf_no_autoen-flag.patch
diff --git a/queue-5.4/spi-imx-fix-reference-leak-in-two-imx-operations.patch b/queue-5.4/spi-imx-fix-reference-leak-in-two-imx-operations.patch
new file mode 100644 (file)
index 0000000..6820ae9
--- /dev/null
@@ -0,0 +1,33 @@
+From 1dcbdd944824369d4569959f8130336fe6fe5f39 Mon Sep 17 00:00:00 2001
+From: Zhang Qilong <zhangqilong3@huawei.com>
+Date: Mon, 2 Nov 2020 22:58:35 +0800
+Subject: spi: imx: fix reference leak in two imx operations
+
+From: Zhang Qilong <zhangqilong3@huawei.com>
+
+commit 1dcbdd944824369d4569959f8130336fe6fe5f39 upstream.
+
+pm_runtime_get_sync will increment pm usage counter even it
+failed. Forgetting to pm_runtime_put_noidle will result in
+reference leak in callers(spi_imx_prepare_message and
+spi_imx_remove), so we should fix it.
+
+Fixes: 525c9e5a32bd7 ("spi: imx: enable runtime pm support")
+Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
+Link: https://lore.kernel.org/r/20201102145835.4765-1-zhangqilong3@huawei.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/spi/spi-imx.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/spi/spi-imx.c
++++ b/drivers/spi/spi-imx.c
+@@ -1538,6 +1538,7 @@ spi_imx_prepare_message(struct spi_maste
+       ret = pm_runtime_resume_and_get(spi_imx->dev);
+       if (ret < 0) {
++              pm_runtime_put_noidle(spi_imx->dev);
+               dev_err(spi_imx->dev, "failed to enable clock\n");
+               return ret;
+       }
diff --git a/queue-5.4/spi-imx-fix-runtime-pm-support-for-config_pm.patch b/queue-5.4/spi-imx-fix-runtime-pm-support-for-config_pm.patch
new file mode 100644 (file)
index 0000000..1155fc6
--- /dev/null
@@ -0,0 +1,68 @@
+From 43b6bf406cd0319e522638f97c9086b7beebaeaa Mon Sep 17 00:00:00 2001
+From: Sascha Hauer <s.hauer@pengutronix.de>
+Date: Wed, 21 Oct 2020 12:45:13 +0200
+Subject: spi: imx: fix runtime pm support for !CONFIG_PM
+
+From: Sascha Hauer <s.hauer@pengutronix.de>
+
+commit 43b6bf406cd0319e522638f97c9086b7beebaeaa upstream.
+
+525c9e5a32bd introduced pm_runtime support for the i.MX SPI driver. With
+this pm_runtime is used to bring up the clocks initially. When CONFIG_PM
+is disabled the clocks are no longer enabled and the driver doesn't work
+anymore. Fix this by enabling the clocks in the probe function and
+telling pm_runtime that the device is active using
+pm_runtime_set_active().
+
+Fixes: 525c9e5a32bd spi: imx: enable runtime pm support
+Tested-by: Christian Eggers <ceggers@arri.de> [tested for !CONFIG_PM only]
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+Link: https://lore.kernel.org/r/20201021104513.21560-1-s.hauer@pengutronix.de
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/spi/spi-imx.c |   23 +++++++++++++++--------
+ 1 file changed, 15 insertions(+), 8 deletions(-)
+
+--- a/drivers/spi/spi-imx.c
++++ b/drivers/spi/spi-imx.c
+@@ -1676,15 +1676,18 @@ static int spi_imx_probe(struct platform
+               goto out_master_put;
+       }
+-      pm_runtime_enable(spi_imx->dev);
++      ret = clk_prepare_enable(spi_imx->clk_per);
++      if (ret)
++              goto out_master_put;
++
++      ret = clk_prepare_enable(spi_imx->clk_ipg);
++      if (ret)
++              goto out_put_per;
++
+       pm_runtime_set_autosuspend_delay(spi_imx->dev, MXC_RPM_TIMEOUT);
+       pm_runtime_use_autosuspend(spi_imx->dev);
+-
+-      ret = pm_runtime_get_sync(spi_imx->dev);
+-      if (ret < 0) {
+-              dev_err(spi_imx->dev, "failed to enable clock\n");
+-              goto out_runtime_pm_put;
+-      }
++      pm_runtime_set_active(spi_imx->dev);
++      pm_runtime_enable(spi_imx->dev);
+       spi_imx->spi_clk = clk_get_rate(spi_imx->clk_per);
+       /*
+@@ -1721,8 +1724,12 @@ static int spi_imx_probe(struct platform
+ out_runtime_pm_put:
+       pm_runtime_dont_use_autosuspend(spi_imx->dev);
+-      pm_runtime_put_sync(spi_imx->dev);
++      pm_runtime_set_suspended(&pdev->dev);
+       pm_runtime_disable(spi_imx->dev);
++
++      clk_disable_unprepare(spi_imx->clk_ipg);
++out_put_per:
++      clk_disable_unprepare(spi_imx->clk_per);
+ out_master_put:
+       spi_master_put(master);