From 64a765325600d5592fad74562403d4eb5df52fe0 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 18 Sep 2022 19:17:52 -0400 Subject: [PATCH] Fixes for 4.14 Signed-off-by: Sasha Levin --- ...eson-correct-osd1-global-alpha-value.patch | 40 ++++++++++++++++ ...-support-for-irq_type_level_low-flow.patch | 48 +++++++++++++++++++ ...f-by-one-error-in-unflatten_dt_nodes.patch | 41 ++++++++++++++++ queue-4.14/series | 3 ++ 4 files changed, 132 insertions(+) create mode 100644 queue-4.14/drm-meson-correct-osd1-global-alpha-value.patch create mode 100644 queue-4.14/gpio-mpc8xxx-fix-support-for-irq_type_level_low-flow.patch create mode 100644 queue-4.14/of-fdt-fix-off-by-one-error-in-unflatten_dt_nodes.patch diff --git a/queue-4.14/drm-meson-correct-osd1-global-alpha-value.patch b/queue-4.14/drm-meson-correct-osd1-global-alpha-value.patch new file mode 100644 index 00000000000..ffc5861cbf8 --- /dev/null +++ b/queue-4.14/drm-meson-correct-osd1-global-alpha-value.patch @@ -0,0 +1,40 @@ +From c2a539a46d95cc0032f863364a80e8476c792ef6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Sep 2022 16:51:03 +0100 +Subject: drm/meson: Correct OSD1 global alpha value + +From: Stuart Menefy + +[ Upstream commit 6836829c8ea453c9e3e518e61539e35881c8ed5f ] + +VIU_OSD1_CTRL_STAT.GLOBAL_ALPHA is a 9 bit field, so the maximum +value is 0x100 not 0xff. + +This matches the vendor kernel. + +Signed-off-by: Stuart Menefy +Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller") +Reviewed-by: Neil Armstrong +Signed-off-by: Neil Armstrong +Link: https://patchwork.freedesktop.org/patch/msgid/20220908155103.686904-1-stuart.menefy@mathembedded.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/meson/meson_plane.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c +index 85fa39e2be34..75132d0c5c28 100644 +--- a/drivers/gpu/drm/meson/meson_plane.c ++++ b/drivers/gpu/drm/meson/meson_plane.c +@@ -105,7 +105,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane, + + /* Enable OSD and BLK0, set max global alpha */ + priv->viu.osd1_ctrl_stat = OSD_ENABLE | +- (0xFF << OSD_GLOBAL_ALPHA_SHIFT) | ++ (0x100 << OSD_GLOBAL_ALPHA_SHIFT) | + OSD_BLK0_ENABLE; + + /* Set up BLK0 to point to the right canvas */ +-- +2.35.1 + diff --git a/queue-4.14/gpio-mpc8xxx-fix-support-for-irq_type_level_low-flow.patch b/queue-4.14/gpio-mpc8xxx-fix-support-for-irq_type_level_low-flow.patch new file mode 100644 index 00000000000..dc359aa0fcd --- /dev/null +++ b/queue-4.14/gpio-mpc8xxx-fix-support-for-irq_type_level_low-flow.patch @@ -0,0 +1,48 @@ +From 315d4c4983d6ef371856ba5121a1ceecb8c013ee Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Sep 2022 12:54:31 +0200 +Subject: gpio: mpc8xxx: Fix support for IRQ_TYPE_LEVEL_LOW flow_type in + mpc85xx +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +[ Upstream commit 279c12df8d2efb28def9d037f288cbfb97c30fe2 ] + +Commit e39d5ef67804 ("powerpc/5xxx: extend mpc8xxx_gpio driver to support +mpc512x gpios") implemented support for IRQ_TYPE_LEVEL_LOW flow type in +mpc512x via falling edge type. Do same for mpc85xx which support was added +in commit 345e5c8a1cc3 ("powerpc: Add interrupt support to mpc8xxx_gpio"). + +Fixes probing of lm90 hwmon driver on mpc85xx based board which use level +interrupt. Without it kernel prints error and refuse lm90 to work: + + [ 15.258370] genirq: Setting trigger mode 8 for irq 49 failed (mpc8xxx_irq_set_type+0x0/0xf8) + [ 15.267168] lm90 0-004c: cannot request IRQ 49 + [ 15.272708] lm90: probe of 0-004c failed with error -22 + +Fixes: 345e5c8a1cc3 ("powerpc: Add interrupt support to mpc8xxx_gpio") +Signed-off-by: Pali Rohár +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + drivers/gpio/gpio-mpc8xxx.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c +index d5f735ce0dd4..1b213c49ec0f 100644 +--- a/drivers/gpio/gpio-mpc8xxx.c ++++ b/drivers/gpio/gpio-mpc8xxx.c +@@ -157,6 +157,7 @@ static int mpc8xxx_irq_set_type(struct irq_data *d, unsigned int flow_type) + + switch (flow_type) { + case IRQ_TYPE_EDGE_FALLING: ++ case IRQ_TYPE_LEVEL_LOW: + raw_spin_lock_irqsave(&mpc8xxx_gc->lock, flags); + gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR, + gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR) +-- +2.35.1 + diff --git a/queue-4.14/of-fdt-fix-off-by-one-error-in-unflatten_dt_nodes.patch b/queue-4.14/of-fdt-fix-off-by-one-error-in-unflatten_dt_nodes.patch new file mode 100644 index 00000000000..21302560bf1 --- /dev/null +++ b/queue-4.14/of-fdt-fix-off-by-one-error-in-unflatten_dt_nodes.patch @@ -0,0 +1,41 @@ +From cfb1ca26f15562b1a924bb14c76f7eb3bbc4c3bf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 13 Aug 2022 23:34:16 +0300 +Subject: of: fdt: fix off-by-one error in unflatten_dt_nodes() + +From: Sergey Shtylyov + +[ Upstream commit 2f945a792f67815abca26fa8a5e863ccf3fa1181 ] + +Commit 78c44d910d3e ("drivers/of: Fix depth when unflattening devicetree") +forgot to fix up the depth check in the loop body in unflatten_dt_nodes() +which makes it possible to overflow the nps[] buffer... + +Found by Linux Verification Center (linuxtesting.org) with the SVACE static +analysis tool. + +Fixes: 78c44d910d3e ("drivers/of: Fix depth when unflattening devicetree") +Signed-off-by: Sergey Shtylyov +Signed-off-by: Rob Herring +Link: https://lore.kernel.org/r/7c354554-006f-6b31-c195-cdfe4caee392@omp.ru +Signed-off-by: Sasha Levin +--- + drivers/of/fdt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c +index 512d3a8439c9..cc9b8c699da4 100644 +--- a/drivers/of/fdt.c ++++ b/drivers/of/fdt.c +@@ -425,7 +425,7 @@ static int unflatten_dt_nodes(const void *blob, + for (offset = 0; + offset >= 0 && depth >= initial_depth; + offset = fdt_next_node(blob, offset, &depth)) { +- if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH)) ++ if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH - 1)) + continue; + + fpsizes[depth+1] = populate_node(blob, offset, &mem, +-- +2.35.1 + diff --git a/queue-4.14/series b/queue-4.14/series index 1e5ffbe9bf1..48ddecb382d 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -5,3 +5,6 @@ tg3-disable-tg3-device-on-system-reboot-to-avoid-tri.patch ieee802154-cc2520-add-rc-code-in-cc2520_tx.patch platform-x86-acer-wmi-acer-aspire-one-aod270-packard.patch tracefs-only-clobber-mode-uid-gid-on-remount-if-asked.patch +of-fdt-fix-off-by-one-error-in-unflatten_dt_nodes.patch +gpio-mpc8xxx-fix-support-for-irq_type_level_low-flow.patch +drm-meson-correct-osd1-global-alpha-value.patch -- 2.47.3