]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.4
authorSasha Levin <sashal@kernel.org>
Tue, 6 Sep 2022 03:26:12 +0000 (23:26 -0400)
committerSasha Levin <sashal@kernel.org>
Tue, 6 Sep 2022 03:26:12 +0000 (23:26 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.4/clk-bcm-rpi-fix-error-handling-of-raspberrypi_fw_get.patch [new file with mode: 0644]
queue-5.4/clk-core-fix-runtime-pm-sequence-in-clk_core_unprepa.patch [new file with mode: 0644]
queue-5.4/clk-core-honor-clk_ops_parent_enable-for-clk-gate-op.patch [new file with mode: 0644]
queue-5.4/drm-i915-reg-fix-spelling-mistake-unsupport-unsuppor.patch [new file with mode: 0644]
queue-5.4/gpio-pca953x-add-mutex_lock-for-regcache-sync-in-pm.patch [new file with mode: 0644]
queue-5.4/hwmon-gpio-fan-fix-array-out-of-bounds-access.patch [new file with mode: 0644]
queue-5.4/input-rk805-pwrkey-fix-module-autoloading.patch [new file with mode: 0644]
queue-5.4/revert-clk-core-honor-clk_ops_parent_enable-for-clk-.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/clk-bcm-rpi-fix-error-handling-of-raspberrypi_fw_get.patch b/queue-5.4/clk-bcm-rpi-fix-error-handling-of-raspberrypi_fw_get.patch
new file mode 100644 (file)
index 0000000..fba4f60
--- /dev/null
@@ -0,0 +1,40 @@
+From b97af4e14516b33692ef4712df305da8400f01a0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 25 Jun 2022 10:36:43 +0200
+Subject: clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate
+
+From: Stefan Wahren <stefan.wahren@i2se.com>
+
+[ Upstream commit 35f73cca1cecda0c1f8bb7d8be4ce5cd2d46ae8c ]
+
+The function raspberrypi_fw_get_rate (e.g. used for the recalc_rate
+hook) can fail to get the clock rate from the firmware. In this case
+we cannot return a signed error value, which would be casted to
+unsigned long. Fix this by returning 0 instead.
+
+Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
+Link: https://lore.kernel.org/r/20220625083643.4012-1-stefan.wahren@i2se.com
+Fixes: 4e85e535e6cc ("clk: bcm283x: add driver interfacing with Raspberry Pi's firmware")
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/bcm/clk-raspberrypi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
+index 1654fd0eedc94..a790a8ca02ff4 100644
+--- a/drivers/clk/bcm/clk-raspberrypi.c
++++ b/drivers/clk/bcm/clk-raspberrypi.c
+@@ -113,7 +113,7 @@ static unsigned long raspberrypi_fw_pll_get_rate(struct clk_hw *hw,
+                                        RPI_FIRMWARE_ARM_CLK_ID,
+                                        &val);
+       if (ret)
+-              return ret;
++              return 0;
+       return val * RPI_FIRMWARE_PLLB_ARM_DIV_RATE;
+ }
+-- 
+2.35.1
+
diff --git a/queue-5.4/clk-core-fix-runtime-pm-sequence-in-clk_core_unprepa.patch b/queue-5.4/clk-core-fix-runtime-pm-sequence-in-clk_core_unprepa.patch
new file mode 100644 (file)
index 0000000..89b1204
--- /dev/null
@@ -0,0 +1,50 @@
+From 60c430b71540ce9f862140b58890b1c3b44c522f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 22 Aug 2022 16:14:24 +0800
+Subject: clk: core: Fix runtime PM sequence in clk_core_unprepare()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Chen-Yu Tsai <wenst@chromium.org>
+
+[ Upstream commit 4b592061f7b3971c70e8b72fc42aaead47c24701 ]
+
+In the original commit 9a34b45397e5 ("clk: Add support for runtime PM"),
+the commit message mentioned that pm_runtime_put_sync() would be done
+at the end of clk_core_unprepare(). This mirrors the operations in
+clk_core_prepare() in the opposite order.
+
+However, the actual code that was added wasn't in the order the commit
+message described. Move clk_pm_runtime_put() to the end of
+clk_core_unprepare() so that it is in the correct order.
+
+Fixes: 9a34b45397e5 ("clk: Add support for runtime PM")
+Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
+Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
+Link: https://lore.kernel.org/r/20220822081424.1310926-3-wenst@chromium.org
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/clk.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
+index 13332f89e034b..c002f83adf573 100644
+--- a/drivers/clk/clk.c
++++ b/drivers/clk/clk.c
+@@ -852,10 +852,9 @@ static void clk_core_unprepare(struct clk_core *core)
+       if (core->ops->unprepare)
+               core->ops->unprepare(core->hw);
+-      clk_pm_runtime_put(core);
+-
+       trace_clk_unprepare_complete(core);
+       clk_core_unprepare(core->parent);
++      clk_pm_runtime_put(core);
+ }
+ static void clk_core_unprepare_lock(struct clk_core *core)
+-- 
+2.35.1
+
diff --git a/queue-5.4/clk-core-honor-clk_ops_parent_enable-for-clk-gate-op.patch b/queue-5.4/clk-core-honor-clk_ops_parent_enable-for-clk-gate-op.patch
new file mode 100644 (file)
index 0000000..ea61100
--- /dev/null
@@ -0,0 +1,127 @@
+From 9b42a6b6651d48299cbe150c9995f0bb6ac202a5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 22 Aug 2022 16:14:23 +0800
+Subject: clk: core: Honor CLK_OPS_PARENT_ENABLE for clk gate ops
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Chen-Yu Tsai <wenst@chromium.org>
+
+[ Upstream commit 35b0fac808b95eea1212f8860baf6ad25b88b087 ]
+
+In the previous commits that added CLK_OPS_PARENT_ENABLE, support for
+this flag was only added to rate change operations (rate setting and
+reparent) and disabling unused subtree. It was not added to the
+clock gate related operations. Any hardware driver that needs it for
+these operations will either see bogus results, or worse, hang.
+
+This has been seen on MT8192 and MT8195, where the imp_ii2_* clk
+drivers set this, but dumping debugfs clk_summary would cause it
+to hang.
+
+Fixes: fc8726a2c021 ("clk: core: support clocks which requires parents enable (part 2)")
+Fixes: a4b3518d146f ("clk: core: support clocks which requires parents enable (part 1)")
+Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
+Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
+Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
+Link: https://lore.kernel.org/r/20220822081424.1310926-2-wenst@chromium.org
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/clk.c | 28 ++++++++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+
+diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
+index 13332f89e034b..c5f7a9f9c6c0e 100644
+--- a/drivers/clk/clk.c
++++ b/drivers/clk/clk.c
+@@ -203,6 +203,9 @@ static bool clk_core_rate_is_protected(struct clk_core *core)
+       return core->protect_count;
+ }
++static int clk_core_prepare_enable(struct clk_core *core);
++static void clk_core_disable_unprepare(struct clk_core *core);
++
+ static bool clk_core_is_prepared(struct clk_core *core)
+ {
+       bool ret = false;
+@@ -215,7 +218,11 @@ static bool clk_core_is_prepared(struct clk_core *core)
+               return core->prepare_count;
+       if (!clk_pm_runtime_get(core)) {
++              if (core->flags & CLK_OPS_PARENT_ENABLE)
++                      clk_core_prepare_enable(core->parent);
+               ret = core->ops->is_prepared(core->hw);
++              if (core->flags & CLK_OPS_PARENT_ENABLE)
++                      clk_core_disable_unprepare(core->parent);
+               clk_pm_runtime_put(core);
+       }
+@@ -251,7 +258,13 @@ static bool clk_core_is_enabled(struct clk_core *core)
+               }
+       }
++      if (core->flags & CLK_OPS_PARENT_ENABLE)
++              clk_core_prepare_enable(core->parent);
++
+       ret = core->ops->is_enabled(core->hw);
++
++      if (core->flags & CLK_OPS_PARENT_ENABLE)
++              clk_core_disable_unprepare(core->parent);
+ done:
+       if (core->rpm_enabled)
+               pm_runtime_put(core->dev);
+@@ -824,6 +837,9 @@ int clk_rate_exclusive_get(struct clk *clk)
+ }
+ EXPORT_SYMBOL_GPL(clk_rate_exclusive_get);
++static int clk_core_enable_lock(struct clk_core *core);
++static void clk_core_disable_lock(struct clk_core *core);
++
+ static void clk_core_unprepare(struct clk_core *core)
+ {
+       lockdep_assert_held(&prepare_lock);
+@@ -847,6 +863,9 @@ static void clk_core_unprepare(struct clk_core *core)
+       WARN(core->enable_count > 0, "Unpreparing enabled %s\n", core->name);
++      if (core->flags & CLK_OPS_PARENT_ENABLE)
++              clk_core_enable_lock(core->parent);
++
+       trace_clk_unprepare(core);
+       if (core->ops->unprepare)
+@@ -855,6 +874,9 @@ static void clk_core_unprepare(struct clk_core *core)
+       clk_pm_runtime_put(core);
+       trace_clk_unprepare_complete(core);
++
++      if (core->flags & CLK_OPS_PARENT_ENABLE)
++              clk_core_disable_lock(core->parent);
+       clk_core_unprepare(core->parent);
+ }
+@@ -903,6 +925,9 @@ static int clk_core_prepare(struct clk_core *core)
+               if (ret)
+                       goto runtime_put;
++              if (core->flags & CLK_OPS_PARENT_ENABLE)
++                      clk_core_enable_lock(core->parent);
++
+               trace_clk_prepare(core);
+               if (core->ops->prepare)
+@@ -910,6 +935,9 @@ static int clk_core_prepare(struct clk_core *core)
+               trace_clk_prepare_complete(core);
++              if (core->flags & CLK_OPS_PARENT_ENABLE)
++                      clk_core_disable_lock(core->parent);
++
+               if (ret)
+                       goto unprepare;
+       }
+-- 
+2.35.1
+
diff --git a/queue-5.4/drm-i915-reg-fix-spelling-mistake-unsupport-unsuppor.patch b/queue-5.4/drm-i915-reg-fix-spelling-mistake-unsupport-unsuppor.patch
new file mode 100644 (file)
index 0000000..ddf4bf5
--- /dev/null
@@ -0,0 +1,38 @@
+From c61ee79508ad6b00208874a0f699da241f553336 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 16 Aug 2022 13:02:47 +0800
+Subject: drm/i915/reg: Fix spelling mistake "Unsupport" -> "Unsupported"
+
+From: Colin Ian King <colin.i.king@gmail.com>
+
+[ Upstream commit 233f56745be446b289edac2ba8184c09365c005e ]
+
+There is a spelling mistake in a gvt_vgpu_err error message. Fix it.
+
+Fixes: 695fbc08d80f ("drm/i915/gvt: replace the gvt_err with gvt_vgpu_err")
+Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
+Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
+Link: http://patchwork.freedesktop.org/patch/msgid/20220315202449.2952845-1-colin.i.king@gmail.com
+Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>
+Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/i915/gvt/handlers.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
+index 245c20d36f1b2..45ffccdcd50e7 100644
+--- a/drivers/gpu/drm/i915/gvt/handlers.c
++++ b/drivers/gpu/drm/i915/gvt/handlers.c
+@@ -654,7 +654,7 @@ static int update_fdi_rx_iir_status(struct intel_vgpu *vgpu,
+       else if (FDI_RX_IMR_TO_PIPE(offset) != INVALID_INDEX)
+               index = FDI_RX_IMR_TO_PIPE(offset);
+       else {
+-              gvt_vgpu_err("Unsupport registers %x\n", offset);
++              gvt_vgpu_err("Unsupported registers %x\n", offset);
+               return -EINVAL;
+       }
+-- 
+2.35.1
+
diff --git a/queue-5.4/gpio-pca953x-add-mutex_lock-for-regcache-sync-in-pm.patch b/queue-5.4/gpio-pca953x-add-mutex_lock-for-regcache-sync-in-pm.patch
new file mode 100644 (file)
index 0000000..ce3c389
--- /dev/null
@@ -0,0 +1,65 @@
+From af44a835c93015f8f78d30895d70dc90bac9301a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 31 Aug 2022 18:37:35 +0800
+Subject: gpio: pca953x: Add mutex_lock for regcache sync in PM
+
+From: Haibo Chen <haibo.chen@nxp.com>
+
+[ Upstream commit 518e26f11af2fe4f5bebf9a0351595d508c7077f ]
+
+The regcache sync will set the cache_bypass = true, at that
+time, when there is regmap write operation, it will bypass
+the regmap cache, then the regcache sync will write back the
+value from cache to register, which is not as our expectation.
+
+Though regmap already use its internal lock to avoid such issue,
+but this driver force disable the regmap internal lock in its
+regmap config: disable_locking = true
+
+To avoid this issue, use the driver's own lock to do the protect
+in system PM.
+
+Fixes: b76574300504 ("gpio: pca953x: Restore registers after suspend/resume cycle")
+Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
+Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpio/gpio-pca953x.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
+index 317f54f19477e..c81d73d5e0159 100644
+--- a/drivers/gpio/gpio-pca953x.c
++++ b/drivers/gpio/gpio-pca953x.c
+@@ -1198,7 +1198,9 @@ static int pca953x_suspend(struct device *dev)
+ {
+       struct pca953x_chip *chip = dev_get_drvdata(dev);
++      mutex_lock(&chip->i2c_lock);
+       regcache_cache_only(chip->regmap, true);
++      mutex_unlock(&chip->i2c_lock);
+       if (atomic_read(&chip->wakeup_path))
+               device_set_wakeup_path(dev);
+@@ -1221,13 +1223,17 @@ static int pca953x_resume(struct device *dev)
+               }
+       }
++      mutex_lock(&chip->i2c_lock);
+       regcache_cache_only(chip->regmap, false);
+       regcache_mark_dirty(chip->regmap);
+       ret = pca953x_regcache_sync(dev);
+-      if (ret)
++      if (ret) {
++              mutex_unlock(&chip->i2c_lock);
+               return ret;
++      }
+       ret = regcache_sync(chip->regmap);
++      mutex_unlock(&chip->i2c_lock);
+       if (ret) {
+               dev_err(dev, "Failed to restore register map: %d\n", ret);
+               return ret;
+-- 
+2.35.1
+
diff --git a/queue-5.4/hwmon-gpio-fan-fix-array-out-of-bounds-access.patch b/queue-5.4/hwmon-gpio-fan-fix-array-out-of-bounds-access.patch
new file mode 100644 (file)
index 0000000..172b505
--- /dev/null
@@ -0,0 +1,100 @@
+From 1701a3a6ba597ac31b2598c1c9e7d43245d2396a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 30 Aug 2022 03:11:01 +0200
+Subject: hwmon: (gpio-fan) Fix array out of bounds access
+
+From: Armin Wolf <W_Armin@gmx.de>
+
+[ Upstream commit f233d2be38dbbb22299192292983037f01ab363c ]
+
+The driver does not check if the cooling state passed to
+gpio_fan_set_cur_state() exceeds the maximum cooling state as
+stored in fan_data->num_speeds. Since the cooling state is later
+used as an array index in set_fan_speed(), an array out of bounds
+access can occur.
+This can be exploited by setting the state of the thermal cooling device
+to arbitrary values, causing for example a kernel oops when unavailable
+memory is accessed this way.
+
+Example kernel oops:
+[  807.987276] Unable to handle kernel paging request at virtual address ffffff80d0588064
+[  807.987369] Mem abort info:
+[  807.987398]   ESR = 0x96000005
+[  807.987428]   EC = 0x25: DABT (current EL), IL = 32 bits
+[  807.987477]   SET = 0, FnV = 0
+[  807.987507]   EA = 0, S1PTW = 0
+[  807.987536]   FSC = 0x05: level 1 translation fault
+[  807.987570] Data abort info:
+[  807.987763]   ISV = 0, ISS = 0x00000005
+[  807.987801]   CM = 0, WnR = 0
+[  807.987832] swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000001165000
+[  807.987872] [ffffff80d0588064] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
+[  807.987961] Internal error: Oops: 96000005 [#1] PREEMPT SMP
+[  807.987992] Modules linked in: cmac algif_hash aes_arm64 algif_skcipher af_alg bnep hci_uart btbcm bluetooth ecdh_generic ecc 8021q garp stp llc snd_soc_hdmi_codec brcmfmac vc4 brcmutil cec drm_kms_helper snd_soc_core cfg80211 snd_compress bcm2835_codec(C) snd_pcm_dmaengine syscopyarea bcm2835_isp(C) bcm2835_v4l2(C) sysfillrect v4l2_mem2mem bcm2835_mmal_vchiq(C) raspberrypi_hwmon sysimgblt videobuf2_dma_contig videobuf2_vmalloc fb_sys_fops videobuf2_memops rfkill videobuf2_v4l2 videobuf2_common i2c_bcm2835 snd_bcm2835(C) videodev snd_pcm snd_timer snd mc vc_sm_cma(C) gpio_fan uio_pdrv_genirq uio drm fuse drm_panel_orientation_quirks backlight ip_tables x_tables ipv6
+[  807.988508] CPU: 0 PID: 1321 Comm: bash Tainted: G         C        5.15.56-v8+ #1575
+[  807.988548] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT)
+[  807.988574] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
+[  807.988608] pc : set_fan_speed.part.5+0x34/0x80 [gpio_fan]
+[  807.988654] lr : gpio_fan_set_cur_state+0x34/0x50 [gpio_fan]
+[  807.988691] sp : ffffffc008cf3bd0
+[  807.988710] x29: ffffffc008cf3bd0 x28: ffffff80019edac0 x27: 0000000000000000
+[  807.988762] x26: 0000000000000000 x25: 0000000000000000 x24: ffffff800747c920
+[  807.988787] x23: 000000000000000a x22: ffffff800369f000 x21: 000000001999997c
+[  807.988854] x20: ffffff800369f2e8 x19: ffffff8002ae8080 x18: 0000000000000000
+[  807.988877] x17: 0000000000000000 x16: 0000000000000000 x15: 000000559e271b70
+[  807.988938] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
+[  807.988960] x11: 0000000000000000 x10: ffffffc008cf3c20 x9 : ffffffcfb60c741c
+[  807.989018] x8 : 000000000000000a x7 : 00000000ffffffc9 x6 : 0000000000000009
+[  807.989040] x5 : 000000000000002a x4 : 0000000000000000 x3 : ffffff800369f2e8
+[  807.989062] x2 : 000000000000e780 x1 : 0000000000000001 x0 : ffffff80d0588060
+[  807.989084] Call trace:
+[  807.989091]  set_fan_speed.part.5+0x34/0x80 [gpio_fan]
+[  807.989113]  gpio_fan_set_cur_state+0x34/0x50 [gpio_fan]
+[  807.989199]  cur_state_store+0x84/0xd0
+[  807.989221]  dev_attr_store+0x20/0x38
+[  807.989262]  sysfs_kf_write+0x4c/0x60
+[  807.989282]  kernfs_fop_write_iter+0x130/0x1c0
+[  807.989298]  new_sync_write+0x10c/0x190
+[  807.989315]  vfs_write+0x254/0x378
+[  807.989362]  ksys_write+0x70/0xf8
+[  807.989379]  __arm64_sys_write+0x24/0x30
+[  807.989424]  invoke_syscall+0x4c/0x110
+[  807.989442]  el0_svc_common.constprop.3+0xfc/0x120
+[  807.989458]  do_el0_svc+0x2c/0x90
+[  807.989473]  el0_svc+0x24/0x60
+[  807.989544]  el0t_64_sync_handler+0x90/0xb8
+[  807.989558]  el0t_64_sync+0x1a0/0x1a4
+[  807.989579] Code: b9403801 f9402800 7100003f 8b35cc00 (b9400416)
+[  807.989627] ---[ end trace 8ded4c918658445b ]---
+
+Fix this by checking the cooling state and return an error if it
+exceeds the maximum cooling state.
+
+Tested on a Raspberry Pi 3.
+
+Fixes: b5cf88e46bad ("(gpio-fan): Add thermal control hooks")
+Signed-off-by: Armin Wolf <W_Armin@gmx.de>
+Link: https://lore.kernel.org/r/20220830011101.178843-1-W_Armin@gmx.de
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/hwmon/gpio-fan.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
+index 3ea4021f267cf..d96e435cc42b1 100644
+--- a/drivers/hwmon/gpio-fan.c
++++ b/drivers/hwmon/gpio-fan.c
+@@ -391,6 +391,9 @@ static int gpio_fan_set_cur_state(struct thermal_cooling_device *cdev,
+       if (!fan_data)
+               return -EINVAL;
++      if (state >= fan_data->num_speed)
++              return -EINVAL;
++
+       set_fan_speed(fan_data, state);
+       return 0;
+ }
+-- 
+2.35.1
+
diff --git a/queue-5.4/input-rk805-pwrkey-fix-module-autoloading.patch b/queue-5.4/input-rk805-pwrkey-fix-module-autoloading.patch
new file mode 100644 (file)
index 0000000..3d26290
--- /dev/null
@@ -0,0 +1,37 @@
+From cc6bcf66c50b7fe786694218dd61135147c3beb7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 22 Aug 2022 16:33:18 -0700
+Subject: Input: rk805-pwrkey - fix module autoloading
+
+From: Peter Robinson <pbrobinson@gmail.com>
+
+[ Upstream commit 99077ad668ddd9b4823cc8ce3f3c7a3fc56f6fd9 ]
+
+Add the module alias so the rk805-pwrkey driver will
+autoload when built as a module.
+
+Fixes: 5a35b85c2d92 ("Input: add power key driver for Rockchip RK805 PMIC")
+Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
+Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
+Link: https://lore.kernel.org/r/20220612225437.3628788-1-pbrobinson@gmail.com
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/input/misc/rk805-pwrkey.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/input/misc/rk805-pwrkey.c b/drivers/input/misc/rk805-pwrkey.c
+index 3fb64dbda1a21..76873aa005b41 100644
+--- a/drivers/input/misc/rk805-pwrkey.c
++++ b/drivers/input/misc/rk805-pwrkey.c
+@@ -98,6 +98,7 @@ static struct platform_driver rk805_pwrkey_driver = {
+ };
+ module_platform_driver(rk805_pwrkey_driver);
++MODULE_ALIAS("platform:rk805-pwrkey");
+ MODULE_AUTHOR("Joseph Chen <chenjh@rock-chips.com>");
+ MODULE_DESCRIPTION("RK805 PMIC Power Key driver");
+ MODULE_LICENSE("GPL");
+-- 
+2.35.1
+
diff --git a/queue-5.4/revert-clk-core-honor-clk_ops_parent_enable-for-clk-.patch b/queue-5.4/revert-clk-core-honor-clk_ops_parent_enable-for-clk-.patch
new file mode 100644 (file)
index 0000000..1e753bb
--- /dev/null
@@ -0,0 +1,117 @@
+From aa732ae09bcb9b3320db0e5e49e51fa786b7b179 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 31 Aug 2022 10:53:25 -0700
+Subject: Revert "clk: core: Honor CLK_OPS_PARENT_ENABLE for clk gate ops"
+
+From: Stephen Boyd <sboyd@kernel.org>
+
+[ Upstream commit abb5f3f4b1f5f0ad50eb067a00051d3587dec9fb ]
+
+This reverts commit 35b0fac808b95eea1212f8860baf6ad25b88b087. Alexander
+reports that it causes boot failures on i.MX8M Plus based boards
+(specifically imx8mp-tqma8mpql-mba8mpxl.dts).
+
+Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
+Cc: Chen-Yu Tsai <wenst@chromium.org>
+Fixes: 35b0fac808b9 ("clk: core: Honor CLK_OPS_PARENT_ENABLE for clk gate ops")
+Link: https://lore.kernel.org/r/12115951.O9o76ZdvQC@steina-w
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Link: https://lore.kernel.org/r/20220831175326.2523912-1-sboyd@kernel.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/clk.c | 28 ----------------------------
+ 1 file changed, 28 deletions(-)
+
+diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
+index c5f7a9f9c6c0e..13332f89e034b 100644
+--- a/drivers/clk/clk.c
++++ b/drivers/clk/clk.c
+@@ -203,9 +203,6 @@ static bool clk_core_rate_is_protected(struct clk_core *core)
+       return core->protect_count;
+ }
+-static int clk_core_prepare_enable(struct clk_core *core);
+-static void clk_core_disable_unprepare(struct clk_core *core);
+-
+ static bool clk_core_is_prepared(struct clk_core *core)
+ {
+       bool ret = false;
+@@ -218,11 +215,7 @@ static bool clk_core_is_prepared(struct clk_core *core)
+               return core->prepare_count;
+       if (!clk_pm_runtime_get(core)) {
+-              if (core->flags & CLK_OPS_PARENT_ENABLE)
+-                      clk_core_prepare_enable(core->parent);
+               ret = core->ops->is_prepared(core->hw);
+-              if (core->flags & CLK_OPS_PARENT_ENABLE)
+-                      clk_core_disable_unprepare(core->parent);
+               clk_pm_runtime_put(core);
+       }
+@@ -258,13 +251,7 @@ static bool clk_core_is_enabled(struct clk_core *core)
+               }
+       }
+-      if (core->flags & CLK_OPS_PARENT_ENABLE)
+-              clk_core_prepare_enable(core->parent);
+-
+       ret = core->ops->is_enabled(core->hw);
+-
+-      if (core->flags & CLK_OPS_PARENT_ENABLE)
+-              clk_core_disable_unprepare(core->parent);
+ done:
+       if (core->rpm_enabled)
+               pm_runtime_put(core->dev);
+@@ -837,9 +824,6 @@ int clk_rate_exclusive_get(struct clk *clk)
+ }
+ EXPORT_SYMBOL_GPL(clk_rate_exclusive_get);
+-static int clk_core_enable_lock(struct clk_core *core);
+-static void clk_core_disable_lock(struct clk_core *core);
+-
+ static void clk_core_unprepare(struct clk_core *core)
+ {
+       lockdep_assert_held(&prepare_lock);
+@@ -863,9 +847,6 @@ static void clk_core_unprepare(struct clk_core *core)
+       WARN(core->enable_count > 0, "Unpreparing enabled %s\n", core->name);
+-      if (core->flags & CLK_OPS_PARENT_ENABLE)
+-              clk_core_enable_lock(core->parent);
+-
+       trace_clk_unprepare(core);
+       if (core->ops->unprepare)
+@@ -874,9 +855,6 @@ static void clk_core_unprepare(struct clk_core *core)
+       clk_pm_runtime_put(core);
+       trace_clk_unprepare_complete(core);
+-
+-      if (core->flags & CLK_OPS_PARENT_ENABLE)
+-              clk_core_disable_lock(core->parent);
+       clk_core_unprepare(core->parent);
+ }
+@@ -925,9 +903,6 @@ static int clk_core_prepare(struct clk_core *core)
+               if (ret)
+                       goto runtime_put;
+-              if (core->flags & CLK_OPS_PARENT_ENABLE)
+-                      clk_core_enable_lock(core->parent);
+-
+               trace_clk_prepare(core);
+               if (core->ops->prepare)
+@@ -935,9 +910,6 @@ static int clk_core_prepare(struct clk_core *core)
+               trace_clk_prepare_complete(core);
+-              if (core->flags & CLK_OPS_PARENT_ENABLE)
+-                      clk_core_disable_lock(core->parent);
+-
+               if (ret)
+                       goto unprepare;
+       }
+-- 
+2.35.1
+
index bf86ebcdc254fb766b43a6da0f2f40563b43d401..4250b3c21839a70cbca3605c8e8d17088f9567b7 100644 (file)
@@ -24,3 +24,11 @@ misc-fastrpc-fix-memory-corruption-on-open.patch
 usb-serial-ftdi_sio-add-omron-cs1w-cif31-device-id.patch
 binder-fix-uaf-of-ref-proc-caused-by-race-condition.patch
 usb-dwc3-qcom-fix-use-after-free-on-runtime-pm-wakeu.patch
+drm-i915-reg-fix-spelling-mistake-unsupport-unsuppor.patch
+clk-core-honor-clk_ops_parent_enable-for-clk-gate-op.patch
+revert-clk-core-honor-clk_ops_parent_enable-for-clk-.patch
+clk-core-fix-runtime-pm-sequence-in-clk_core_unprepa.patch
+input-rk805-pwrkey-fix-module-autoloading.patch
+clk-bcm-rpi-fix-error-handling-of-raspberrypi_fw_get.patch
+hwmon-gpio-fan-fix-array-out-of-bounds-access.patch
+gpio-pca953x-add-mutex_lock-for-regcache-sync-in-pm.patch