From dd23516a03b5256f8b8df7cd08223cb2cfc50a1b Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 18 Sep 2022 19:17:51 -0400 Subject: [PATCH] Fixes for 5.4 Signed-off-by: Sasha Levin --- ...eson-correct-osd1-global-alpha-value.patch | 40 +++++++++++ ...on-fix-osd1-rgb-to-ycbcr-coefficient.patch | 47 +++++++++++++ ...-support-for-irq_type_level_low-flow.patch | 48 +++++++++++++ ...pen-by-filehandle-and-nfs-re-export-.patch | 69 +++++++++++++++++++ ...f-by-one-error-in-unflatten_dt_nodes.patch | 41 +++++++++++ queue-5.4/series | 5 ++ 6 files changed, 250 insertions(+) create mode 100644 queue-5.4/drm-meson-correct-osd1-global-alpha-value.patch create mode 100644 queue-5.4/drm-meson-fix-osd1-rgb-to-ycbcr-coefficient.patch create mode 100644 queue-5.4/gpio-mpc8xxx-fix-support-for-irq_type_level_low-flow.patch create mode 100644 queue-5.4/nfsv4-turn-off-open-by-filehandle-and-nfs-re-export-.patch create mode 100644 queue-5.4/of-fdt-fix-off-by-one-error-in-unflatten_dt_nodes.patch diff --git a/queue-5.4/drm-meson-correct-osd1-global-alpha-value.patch b/queue-5.4/drm-meson-correct-osd1-global-alpha-value.patch new file mode 100644 index 00000000000..a08c709ae23 --- /dev/null +++ b/queue-5.4/drm-meson-correct-osd1-global-alpha-value.patch @@ -0,0 +1,40 @@ +From cfa7726fe7536ae925a6e9ea4db42129f53db54e 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 ed543227b00d..53f5d0581c35 100644 +--- a/drivers/gpu/drm/meson/meson_plane.c ++++ b/drivers/gpu/drm/meson/meson_plane.c +@@ -128,7 +128,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; + + canvas_id_osd1 = priv->canvas_id_osd1; +-- +2.35.1 + diff --git a/queue-5.4/drm-meson-fix-osd1-rgb-to-ycbcr-coefficient.patch b/queue-5.4/drm-meson-fix-osd1-rgb-to-ycbcr-coefficient.patch new file mode 100644 index 00000000000..7fda39833b4 --- /dev/null +++ b/queue-5.4/drm-meson-fix-osd1-rgb-to-ycbcr-coefficient.patch @@ -0,0 +1,47 @@ +From a54b65092f901913981313234cf1c0ab1fa30652 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Sep 2022 16:52:43 +0100 +Subject: drm/meson: Fix OSD1 RGB to YCbCr coefficient + +From: Stuart Menefy + +[ Upstream commit 6463d3930ba5b6addcfc8f80a4543976a2fc7656 ] + +VPP_WRAP_OSD1_MATRIX_COEF22.Coeff22 is documented as being bits 0-12, +not 16-28. + +Without this the output tends to have a pink hue, changing it results +in better color accuracy. + +The vendor kernel doesn't use this register. However the code which +sets VIU2_OSD1_MATRIX_COEF22 also uses bits 0-12. There is a slightly +different style of registers for configuring some of the other matrices, +which do use bits 16-28 for this coefficient, but those have names +ending in MATRIX_COEF22_30, and this is not one of those. + +Signed-off-by: Stuart Menefy +Fixes: 728883948b0d ("drm/meson: Add G12A Support for VIU setup") +Reviewed-by: Neil Armstrong +Signed-off-by: Neil Armstrong +Link: https://patchwork.freedesktop.org/patch/msgid/20220908155243.687143-1-stuart.menefy@mathembedded.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/meson/meson_viu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/meson/meson_viu.c b/drivers/gpu/drm/meson/meson_viu.c +index 9991f0a43b1a..8d0938525978 100644 +--- a/drivers/gpu/drm/meson/meson_viu.c ++++ b/drivers/gpu/drm/meson/meson_viu.c +@@ -91,7 +91,7 @@ static void meson_viu_set_g12a_osd1_matrix(struct meson_drm *priv, + priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_COEF11_12)); + writel(((m[9] & 0x1fff) << 16) | (m[10] & 0x1fff), + priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_COEF20_21)); +- writel((m[11] & 0x1fff) << 16, ++ writel((m[11] & 0x1fff), + priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_COEF22)); + + writel(((m[18] & 0xfff) << 16) | (m[19] & 0xfff), +-- +2.35.1 + diff --git a/queue-5.4/gpio-mpc8xxx-fix-support-for-irq_type_level_low-flow.patch b/queue-5.4/gpio-mpc8xxx-fix-support-for-irq_type_level_low-flow.patch new file mode 100644 index 00000000000..3b33a1e6797 --- /dev/null +++ b/queue-5.4/gpio-mpc8xxx-fix-support-for-irq_type_level_low-flow.patch @@ -0,0 +1,48 @@ +From 4be39934c0ed6f29090e975df8e09ac0ce085990 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 d72a3a5507b0..f3bf82efea8e 100644 +--- a/drivers/gpio/gpio-mpc8xxx.c ++++ b/drivers/gpio/gpio-mpc8xxx.c +@@ -190,6 +190,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-5.4/nfsv4-turn-off-open-by-filehandle-and-nfs-re-export-.patch b/queue-5.4/nfsv4-turn-off-open-by-filehandle-and-nfs-re-export-.patch new file mode 100644 index 00000000000..b35b08a7bdb --- /dev/null +++ b/queue-5.4/nfsv4-turn-off-open-by-filehandle-and-nfs-re-export-.patch @@ -0,0 +1,69 @@ +From a6cf75d7c8034b60099dc7485a22ce250ba5e7ae Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Aug 2022 14:49:05 -0400 +Subject: NFSv4: Turn off open-by-filehandle and NFS re-export for NFSv4.0 + +From: Trond Myklebust + +[ Upstream commit 2a9d683b48c8a87e61a4215792d44c90bcbbb536 ] + +The NFSv4.0 protocol only supports open() by name. It cannot therefore +be used with open_by_handle() and friends, nor can it be re-exported by +knfsd. + +Reported-by: Chuck Lever III +Fixes: 20fa19027286 ("nfs: add export operations") +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + fs/nfs/super.c | 27 ++++++++++++++++++--------- + 1 file changed, 18 insertions(+), 9 deletions(-) + +diff --git a/fs/nfs/super.c b/fs/nfs/super.c +index a84df7d63403..ecc7277b3eda 100644 +--- a/fs/nfs/super.c ++++ b/fs/nfs/super.c +@@ -2375,22 +2375,31 @@ void nfs_fill_super(struct super_block *sb, struct nfs_mount_info *mount_info) + if (data && data->bsize) + sb->s_blocksize = nfs_block_size(data->bsize, &sb->s_blocksize_bits); + +- if (server->nfs_client->rpc_ops->version != 2) { +- /* The VFS shouldn't apply the umask to mode bits. We will do +- * so ourselves when necessary. ++ switch (server->nfs_client->rpc_ops->version) { ++ case 2: ++ sb->s_time_gran = 1000; ++ sb->s_time_min = 0; ++ sb->s_time_max = U32_MAX; ++ break; ++ case 3: ++ /* ++ * The VFS shouldn't apply the umask to mode bits. ++ * We will do so ourselves when necessary. + */ + sb->s_flags |= SB_POSIXACL; + sb->s_time_gran = 1; +- sb->s_export_op = &nfs_export_ops; +- } else +- sb->s_time_gran = 1000; +- +- if (server->nfs_client->rpc_ops->version != 4) { + sb->s_time_min = 0; + sb->s_time_max = U32_MAX; +- } else { ++ sb->s_export_op = &nfs_export_ops; ++ break; ++ case 4: ++ sb->s_flags |= SB_POSIXACL; ++ sb->s_time_gran = 1; + sb->s_time_min = S64_MIN; + sb->s_time_max = S64_MAX; ++ if (server->caps & NFS_CAP_ATOMIC_OPEN_V1) ++ sb->s_export_op = &nfs_export_ops; ++ break; + } + + nfs_initialise_sb(sb); +-- +2.35.1 + diff --git a/queue-5.4/of-fdt-fix-off-by-one-error-in-unflatten_dt_nodes.patch b/queue-5.4/of-fdt-fix-off-by-one-error-in-unflatten_dt_nodes.patch new file mode 100644 index 00000000000..4886c089f49 --- /dev/null +++ b/queue-5.4/of-fdt-fix-off-by-one-error-in-unflatten_dt_nodes.patch @@ -0,0 +1,41 @@ +From 456810ac4f1f9ab58e9080f08b6be28a246d9dd8 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 943d2a60bfdf..6d519ef3c5da 100644 +--- a/drivers/of/fdt.c ++++ b/drivers/of/fdt.c +@@ -315,7 +315,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; + + if (!IS_ENABLED(CONFIG_OF_KOBJ) && +-- +2.35.1 + diff --git a/queue-5.4/series b/queue-5.4/series index 663b1ea239e..adc182106bd 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -12,3 +12,8 @@ mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch net-dp83822-disable-rx-error-interrupt.patch soc-fsl-select-fsl_guts-driver-for-dpio.patch tracefs-only-clobber-mode-uid-gid-on-remount-if-asked.patch +of-fdt-fix-off-by-one-error-in-unflatten_dt_nodes.patch +nfsv4-turn-off-open-by-filehandle-and-nfs-re-export-.patch +gpio-mpc8xxx-fix-support-for-irq_type_level_low-flow.patch +drm-meson-correct-osd1-global-alpha-value.patch +drm-meson-fix-osd1-rgb-to-ycbcr-coefficient.patch -- 2.47.3