]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.4
authorSasha Levin <sashal@kernel.org>
Mon, 29 Jan 2024 13:31:29 +0000 (08:31 -0500)
committerSasha Levin <sashal@kernel.org>
Mon, 29 Jan 2024 13:31:29 +0000 (08:31 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.4/drm-exynos-fix-accidental-on-stack-copy-of-exynos_dr.patch [new file with mode: 0644]
queue-5.4/drm-exynos-gsc-minor-fix-for-loop-iteration-in-gsc_r.patch [new file with mode: 0644]
queue-5.4/gpio-eic-sprd-clear-interrupt-after-set-the-interrup.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/spi-bcm-qspi-fix-sfdp-bfpt-read-by-usig-mspi-read.patch [new file with mode: 0644]

diff --git a/queue-5.4/drm-exynos-fix-accidental-on-stack-copy-of-exynos_dr.patch b/queue-5.4/drm-exynos-fix-accidental-on-stack-copy-of-exynos_dr.patch
new file mode 100644 (file)
index 0000000..e9692af
--- /dev/null
@@ -0,0 +1,66 @@
+From 53acf68e3e4e5d7d12816dc105a4e7c5534ca646 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 14 Dec 2023 13:32:15 +0100
+Subject: drm/exynos: fix accidental on-stack copy of exynos_drm_plane
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+[ Upstream commit 960b537e91725bcb17dd1b19e48950e62d134078 ]
+
+gcc rightfully complains about excessive stack usage in the fimd_win_set_pixfmt()
+function:
+
+drivers/gpu/drm/exynos/exynos_drm_fimd.c: In function 'fimd_win_set_pixfmt':
+drivers/gpu/drm/exynos/exynos_drm_fimd.c:750:1: error: the frame size of 1032 bytes is larger than 1024 byte
+drivers/gpu/drm/exynos/exynos5433_drm_decon.c: In function 'decon_win_set_pixfmt':
+drivers/gpu/drm/exynos/exynos5433_drm_decon.c:381:1: error: the frame size of 1032 bytes is larger than 1024 bytes
+
+There is really no reason to copy the large exynos_drm_plane
+structure to the stack before using one of its members, so just
+use a pointer instead.
+
+Fixes: 6f8ee5c21722 ("drm/exynos: fimd: Make plane alpha configurable")
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
+Signed-off-by: Inki Dae <inki.dae@samsung.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 ++--
+ drivers/gpu/drm/exynos/exynos_drm_fimd.c      | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+index 1061430aced2..78c934a21bd7 100644
+--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
++++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+@@ -318,9 +318,9 @@ static void decon_win_set_bldmod(struct decon_context *ctx, unsigned int win,
+ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win,
+                                struct drm_framebuffer *fb)
+ {
+-      struct exynos_drm_plane plane = ctx->planes[win];
++      struct exynos_drm_plane *plane = &ctx->planes[win];
+       struct exynos_drm_plane_state *state =
+-              to_exynos_plane_state(plane.base.state);
++              to_exynos_plane_state(plane->base.state);
+       unsigned int alpha = state->base.alpha;
+       unsigned int pixel_alpha;
+       unsigned long val;
+diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+index 34e6b22173fa..4fe4ca41665b 100644
+--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
++++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+@@ -637,9 +637,9 @@ static void fimd_win_set_bldmod(struct fimd_context *ctx, unsigned int win,
+ static void fimd_win_set_pixfmt(struct fimd_context *ctx, unsigned int win,
+                               struct drm_framebuffer *fb, int width)
+ {
+-      struct exynos_drm_plane plane = ctx->planes[win];
++      struct exynos_drm_plane *plane = &ctx->planes[win];
+       struct exynos_drm_plane_state *state =
+-              to_exynos_plane_state(plane.base.state);
++              to_exynos_plane_state(plane->base.state);
+       uint32_t pixel_format = fb->format->format;
+       unsigned int alpha = state->base.alpha;
+       u32 val = WINCONx_ENWIN;
+-- 
+2.43.0
+
diff --git a/queue-5.4/drm-exynos-gsc-minor-fix-for-loop-iteration-in-gsc_r.patch b/queue-5.4/drm-exynos-gsc-minor-fix-for-loop-iteration-in-gsc_r.patch
new file mode 100644 (file)
index 0000000..4fe0a18
--- /dev/null
@@ -0,0 +1,39 @@
+From a80d318ce90a3f463151ce75b4000aec19218825 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 20 Dec 2023 12:53:15 +0300
+Subject: drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
+
+From: Fedor Pchelkin <pchelkin@ispras.ru>
+
+[ Upstream commit 4050957c7c2c14aa795dbf423b4180d5ac04e113 ]
+
+Do not forget to call clk_disable_unprepare() on the first element of
+ctx->clocks array.
+
+Found by Linux Verification Center (linuxtesting.org).
+
+Fixes: 8b7d3ec83aba ("drm/exynos: gsc: Convert driver to IPP v2 core API")
+Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
+Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
+Signed-off-by: Inki Dae <inki.dae@samsung.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
+index 45e9aee8366a..bcf830c5b8ea 100644
+--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
++++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
+@@ -1344,7 +1344,7 @@ static int __maybe_unused gsc_runtime_resume(struct device *dev)
+       for (i = 0; i < ctx->num_clocks; i++) {
+               ret = clk_prepare_enable(ctx->clocks[i]);
+               if (ret) {
+-                      while (--i > 0)
++                      while (--i >= 0)
+                               clk_disable_unprepare(ctx->clocks[i]);
+                       return ret;
+               }
+-- 
+2.43.0
+
diff --git a/queue-5.4/gpio-eic-sprd-clear-interrupt-after-set-the-interrup.patch b/queue-5.4/gpio-eic-sprd-clear-interrupt-after-set-the-interrup.patch
new file mode 100644 (file)
index 0000000..73ca1ca
--- /dev/null
@@ -0,0 +1,160 @@
+From 7270973e8acfa55e48677088cbbe2ae1ba102410 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 9 Jan 2024 15:38:48 +0800
+Subject: gpio: eic-sprd: Clear interrupt after set the interrupt type
+
+From: Wenhua Lin <Wenhua.Lin@unisoc.com>
+
+[ Upstream commit 84aef4ed59705585d629e81d633a83b7d416f5fb ]
+
+The raw interrupt status of eic maybe set before the interrupt is enabled,
+since the eic interrupt has a latch function, which would trigger the
+interrupt event once enabled it from user side. To solve this problem,
+interrupts generated before setting the interrupt trigger type are ignored.
+
+Fixes: 25518e024e3a ("gpio: Add Spreadtrum EIC driver support")
+Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
+Signed-off-by: Wenhua Lin <Wenhua.Lin@unisoc.com>
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpio/gpio-eic-sprd.c | 32 ++++++++++++++++++++++++++++----
+ 1 file changed, 28 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
+index a69b3faf51ef..e50e27304c38 100644
+--- a/drivers/gpio/gpio-eic-sprd.c
++++ b/drivers/gpio/gpio-eic-sprd.c
+@@ -318,20 +318,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
+               switch (flow_type) {
+               case IRQ_TYPE_LEVEL_HIGH:
+                       sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 1);
++                      sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
+                       break;
+               case IRQ_TYPE_LEVEL_LOW:
+                       sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 0);
++                      sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
+                       break;
+               case IRQ_TYPE_EDGE_RISING:
+               case IRQ_TYPE_EDGE_FALLING:
+               case IRQ_TYPE_EDGE_BOTH:
+                       state = sprd_eic_get(chip, offset);
+-                      if (state)
++                      if (state) {
+                               sprd_eic_update(chip, offset,
+                                               SPRD_EIC_DBNC_IEV, 0);
+-                      else
++                              sprd_eic_update(chip, offset,
++                                              SPRD_EIC_DBNC_IC, 1);
++                      } else {
+                               sprd_eic_update(chip, offset,
+                                               SPRD_EIC_DBNC_IEV, 1);
++                              sprd_eic_update(chip, offset,
++                                              SPRD_EIC_DBNC_IC, 1);
++                      }
+                       break;
+               default:
+                       return -ENOTSUPP;
+@@ -343,20 +350,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
+               switch (flow_type) {
+               case IRQ_TYPE_LEVEL_HIGH:
+                       sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 0);
++                      sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
+                       break;
+               case IRQ_TYPE_LEVEL_LOW:
+                       sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 1);
++                      sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
+                       break;
+               case IRQ_TYPE_EDGE_RISING:
+               case IRQ_TYPE_EDGE_FALLING:
+               case IRQ_TYPE_EDGE_BOTH:
+                       state = sprd_eic_get(chip, offset);
+-                      if (state)
++                      if (state) {
+                               sprd_eic_update(chip, offset,
+                                               SPRD_EIC_LATCH_INTPOL, 0);
+-                      else
++                              sprd_eic_update(chip, offset,
++                                              SPRD_EIC_LATCH_INTCLR, 1);
++                      } else {
+                               sprd_eic_update(chip, offset,
+                                               SPRD_EIC_LATCH_INTPOL, 1);
++                              sprd_eic_update(chip, offset,
++                                              SPRD_EIC_LATCH_INTCLR, 1);
++                      }
+                       break;
+               default:
+                       return -ENOTSUPP;
+@@ -370,29 +384,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
++                      sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
+                       irq_set_handler_locked(data, handle_edge_irq);
+                       break;
+               case IRQ_TYPE_EDGE_FALLING:
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
++                      sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
+                       irq_set_handler_locked(data, handle_edge_irq);
+                       break;
+               case IRQ_TYPE_EDGE_BOTH:
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 1);
++                      sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
+                       irq_set_handler_locked(data, handle_edge_irq);
+                       break;
+               case IRQ_TYPE_LEVEL_HIGH:
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
++                      sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
+                       irq_set_handler_locked(data, handle_level_irq);
+                       break;
+               case IRQ_TYPE_LEVEL_LOW:
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
++                      sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
+                       irq_set_handler_locked(data, handle_level_irq);
+                       break;
+               default:
+@@ -405,29 +424,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
++                      sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
+                       irq_set_handler_locked(data, handle_edge_irq);
+                       break;
+               case IRQ_TYPE_EDGE_FALLING:
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
++                      sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
+                       irq_set_handler_locked(data, handle_edge_irq);
+                       break;
+               case IRQ_TYPE_EDGE_BOTH:
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 1);
++                      sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
+                       irq_set_handler_locked(data, handle_edge_irq);
+                       break;
+               case IRQ_TYPE_LEVEL_HIGH:
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
++                      sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
+                       irq_set_handler_locked(data, handle_level_irq);
+                       break;
+               case IRQ_TYPE_LEVEL_LOW:
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
+                       sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
++                      sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
+                       irq_set_handler_locked(data, handle_level_irq);
+                       break;
+               default:
+-- 
+2.43.0
+
index f6804bfd334d13ff8eeeb1ca4a0f146f287827d5..c6ea6093acc4026c21e730ab38eee1641c939bc2 100644 (file)
@@ -52,3 +52,7 @@ drm-bridge-nxp-ptn3460-simplify-some-error-checking.patch
 nfsd-modernize-nfsd4_release_lockowner.patch
 nfsd-add-documenting-comment-for-nfsd4_release_locko.patch
 nfsd-fix-release_lockowner.patch
+drm-exynos-fix-accidental-on-stack-copy-of-exynos_dr.patch
+drm-exynos-gsc-minor-fix-for-loop-iteration-in-gsc_r.patch
+gpio-eic-sprd-clear-interrupt-after-set-the-interrup.patch
+spi-bcm-qspi-fix-sfdp-bfpt-read-by-usig-mspi-read.patch
diff --git a/queue-5.4/spi-bcm-qspi-fix-sfdp-bfpt-read-by-usig-mspi-read.patch b/queue-5.4/spi-bcm-qspi-fix-sfdp-bfpt-read-by-usig-mspi-read.patch
new file mode 100644 (file)
index 0000000..022fd3e
--- /dev/null
@@ -0,0 +1,49 @@
+From 4341528213b7ec2599333f93db5cc79f516f68b3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 9 Jan 2024 16:00:32 -0500
+Subject: spi: bcm-qspi: fix SFDP BFPT read by usig mspi read
+
+From: Kamal Dasu <kamal.dasu@broadcom.com>
+
+[ Upstream commit 574bf7bbe83794a902679846770f75a9b7f28176 ]
+
+SFDP read shall use the mspi reads when using the bcm_qspi_exec_mem_op()
+call. This fixes SFDP parameter page read failures seen with parts that
+now use SFDP protocol to read the basic flash parameter table.
+
+Fixes: 5f195ee7d830 ("spi: bcm-qspi: Implement the spi_mem interface")
+Signed-off-by: Kamal Dasu <kamal.dasu@broadcom.com>
+Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
+Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
+Link: https://msgid.link/r/20240109210033.43249-1-kamal.dasu@broadcom.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/spi/spi-bcm-qspi.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c
+index 118d9161a788..b4032d1e7c98 100644
+--- a/drivers/spi/spi-bcm-qspi.c
++++ b/drivers/spi/spi-bcm-qspi.c
+@@ -19,7 +19,7 @@
+ #include <linux/platform_device.h>
+ #include <linux/slab.h>
+ #include <linux/spi/spi.h>
+-#include <linux/spi/spi-mem.h>
++#include <linux/mtd/spi-nor.h>
+ #include <linux/sysfs.h>
+ #include <linux/types.h>
+ #include "spi-bcm-qspi.h"
+@@ -976,7 +976,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,
+       /* non-aligned and very short transfers are handled by MSPI */
+       if (!IS_ALIGNED((uintptr_t)addr, 4) || !IS_ALIGNED((uintptr_t)buf, 4) ||
+-          len < 4)
++          len < 4 || op->cmd.opcode == SPINOR_OP_RDSFDP)
+               mspi_read = true;
+       if (!has_bspi(qspi) || mspi_read)
+-- 
+2.43.0
+