From 9d77ce4e5f9133970c59938c9056c2927913ba22 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 17 Jul 2023 21:50:47 +0200 Subject: [PATCH] 6.1-stable patches added patches: block-partition-fix-signedness-issue-for-amiga-partitions.patch sh-hd64461-handle-virq-offset-for-offchip-irq-base-and-hd64461-irq.patch sh-mach-dreamcast-handle-virq-offset-in-cascaded-irq-demux.patch sh-mach-highlander-handle-virq-offset-in-cascaded-irl-demux.patch sh-mach-r2d-handle-virq-offset-in-cascaded-irl-demux.patch --- ...ignedness-issue-for-amiga-partitions.patch | 39 ++++++++++++ queue-6.1/series | 5 ++ ...for-offchip-irq-base-and-hd64461-irq.patch | 59 +++++++++++++++++++ ...le-virq-offset-in-cascaded-irq-demux.patch | 45 ++++++++++++++ ...le-virq-offset-in-cascaded-irl-demux.patch | 37 ++++++++++++ ...le-virq-offset-in-cascaded-irl-demux.patch | 48 +++++++++++++++ 6 files changed, 233 insertions(+) create mode 100644 queue-6.1/block-partition-fix-signedness-issue-for-amiga-partitions.patch create mode 100644 queue-6.1/sh-hd64461-handle-virq-offset-for-offchip-irq-base-and-hd64461-irq.patch create mode 100644 queue-6.1/sh-mach-dreamcast-handle-virq-offset-in-cascaded-irq-demux.patch create mode 100644 queue-6.1/sh-mach-highlander-handle-virq-offset-in-cascaded-irl-demux.patch create mode 100644 queue-6.1/sh-mach-r2d-handle-virq-offset-in-cascaded-irl-demux.patch diff --git a/queue-6.1/block-partition-fix-signedness-issue-for-amiga-partitions.patch b/queue-6.1/block-partition-fix-signedness-issue-for-amiga-partitions.patch new file mode 100644 index 00000000000..c26118dc666 --- /dev/null +++ b/queue-6.1/block-partition-fix-signedness-issue-for-amiga-partitions.patch @@ -0,0 +1,39 @@ +From 7eb1e47696aa231b1a567846bbe3a1e1befe1854 Mon Sep 17 00:00:00 2001 +From: Michael Schmitz +Date: Wed, 5 Jul 2023 11:38:08 +1200 +Subject: block/partition: fix signedness issue for Amiga partitions + +From: Michael Schmitz + +commit 7eb1e47696aa231b1a567846bbe3a1e1befe1854 upstream. + +Making 'blk' sector_t (i.e. 64 bit if LBD support is active) fails the +'blk>0' test in the partition block loop if a value of (signed int) -1 is +used to mark the end of the partition block list. + +Explicitly cast 'blk' to signed int to allow use of -1 to terminate the +partition block linked list. + +Fixes: b6f3f28f604b ("block: add overflow checks for Amiga partition support") +Reported-by: Christian Zigotzky +Link: https://lore.kernel.org/r/024ce4fa-cc6d-50a2-9aae-3701d0ebf668@xenosoft.de +Signed-off-by: Michael Schmitz +Reviewed-by: Martin Steigerwald +Tested-by: Christian Zigotzky +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + block/partitions/amiga.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/block/partitions/amiga.c ++++ b/block/partitions/amiga.c +@@ -90,7 +90,7 @@ int amiga_partition(struct parsed_partit + } + blk = be32_to_cpu(rdb->rdb_PartitionList); + put_dev_sector(sect); +- for (part = 1; blk>0 && part<=16; part++, put_dev_sector(sect)) { ++ for (part = 1; (s32) blk>0 && part<=16; part++, put_dev_sector(sect)) { + /* Read in terms partition table understands */ + if (check_mul_overflow(blk, (sector_t) blksize, &blk)) { + pr_err("Dev %s: overflow calculating partition block %llu! Skipping partitions %u and beyond\n", diff --git a/queue-6.1/series b/queue-6.1/series index 4dca943aaa2..31a7c1f41cb 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -583,3 +583,8 @@ netfilter-nf_tables-prevent-oob-access-in-nft_byteorder_eval.patch wireguard-queueing-use-saner-cpu-selection-wrapping.patch wireguard-netlink-send-staged-packets-when-setting-initial-private-key.patch tty-serial-fsl_lpuart-add-earlycon-for-imx8ulp-platform.patch +block-partition-fix-signedness-issue-for-amiga-partitions.patch +sh-mach-r2d-handle-virq-offset-in-cascaded-irl-demux.patch +sh-mach-highlander-handle-virq-offset-in-cascaded-irl-demux.patch +sh-mach-dreamcast-handle-virq-offset-in-cascaded-irq-demux.patch +sh-hd64461-handle-virq-offset-for-offchip-irq-base-and-hd64461-irq.patch diff --git a/queue-6.1/sh-hd64461-handle-virq-offset-for-offchip-irq-base-and-hd64461-irq.patch b/queue-6.1/sh-hd64461-handle-virq-offset-for-offchip-irq-base-and-hd64461-irq.patch new file mode 100644 index 00000000000..5cd5622c5fd --- /dev/null +++ b/queue-6.1/sh-hd64461-handle-virq-offset-for-offchip-irq-base-and-hd64461-irq.patch @@ -0,0 +1,59 @@ +From 7c28a35e19fafa1d3b367bcd3ec4021427a9397b Mon Sep 17 00:00:00 2001 +From: Artur Rojek +Date: Tue, 11 Jul 2023 01:31:32 +0200 +Subject: sh: hd64461: Handle virq offset for offchip IRQ base and HD64461 IRQ + +From: Artur Rojek + +commit 7c28a35e19fafa1d3b367bcd3ec4021427a9397b upstream. + +A recent change to start counting SuperH IRQ #s from 16 breaks support +for the Hitachi HD64461 companion chip. + +Move the offchip IRQ base and HD64461 IRQ # by 16 in order to +accommodate for the new virq numbering rules. + +Fixes: a8ac2961148e ("sh: Avoid using IRQ0 on SH3 and SH4") +Signed-off-by: Artur Rojek +Reviewed-by: Geert Uytterhoeven +Reviewed-by: John Paul Adrian Glaubitz +Link: https://lore.kernel.org/r/20230710233132.69734-1-contact@artur-rojek.eu +Signed-off-by: John Paul Adrian Glaubitz +Signed-off-by: Greg Kroah-Hartman +--- + arch/sh/cchips/Kconfig | 4 ++-- + arch/sh/include/asm/hd64461.h | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/sh/cchips/Kconfig b/arch/sh/cchips/Kconfig +index efde2edb5627..9659a0bc58de 100644 +--- a/arch/sh/cchips/Kconfig ++++ b/arch/sh/cchips/Kconfig +@@ -29,9 +29,9 @@ endchoice + config HD64461_IRQ + int "HD64461 IRQ" + depends on HD64461 +- default "36" ++ default "52" + help +- The default setting of the HD64461 IRQ is 36. ++ The default setting of the HD64461 IRQ is 52. + + Do not change this unless you know what you are doing. + +diff --git a/arch/sh/include/asm/hd64461.h b/arch/sh/include/asm/hd64461.h +index afb24cb034b1..d2c485fa333b 100644 +--- a/arch/sh/include/asm/hd64461.h ++++ b/arch/sh/include/asm/hd64461.h +@@ -229,7 +229,7 @@ + #define HD64461_NIMR HD64461_IO_OFFSET(0x5002) + + #define HD64461_IRQBASE OFFCHIP_IRQ_BASE +-#define OFFCHIP_IRQ_BASE 64 ++#define OFFCHIP_IRQ_BASE (64 + 16) + #define HD64461_IRQ_NUM 16 + + #define HD64461_IRQ_UART (HD64461_IRQBASE+5) +-- +2.41.0 + diff --git a/queue-6.1/sh-mach-dreamcast-handle-virq-offset-in-cascaded-irq-demux.patch b/queue-6.1/sh-mach-dreamcast-handle-virq-offset-in-cascaded-irq-demux.patch new file mode 100644 index 00000000000..ca462c48fa0 --- /dev/null +++ b/queue-6.1/sh-mach-dreamcast-handle-virq-offset-in-cascaded-irq-demux.patch @@ -0,0 +1,45 @@ +From 3d20f7a6eb76afdf9d4ad9cb864c2e2da9c38e1f Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Sun, 9 Jul 2023 15:10:43 +0200 +Subject: sh: mach-dreamcast: Handle virq offset in cascaded IRQ demux + +From: Geert Uytterhoeven + +commit 3d20f7a6eb76afdf9d4ad9cb864c2e2da9c38e1f upstream. + +Take into account the virq offset when translating cascaded interrupts. + +Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4") +Signed-off-by: Geert Uytterhoeven +Reviewed-by: John Paul Adrian Glaubitz +Link: https://lore.kernel.org/r/7d0cb246c9f1cd24bb1f637ec5cb67e799a4c3b8.1688908227.git.geert+renesas@glider.be +Signed-off-by: John Paul Adrian Glaubitz +Signed-off-by: Greg Kroah-Hartman +--- + arch/sh/boards/mach-dreamcast/irq.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c +index cc06e4cdb4cd..0eec82fb85e7 100644 +--- a/arch/sh/boards/mach-dreamcast/irq.c ++++ b/arch/sh/boards/mach-dreamcast/irq.c +@@ -108,13 +108,13 @@ int systemasic_irq_demux(int irq) + __u32 j, bit; + + switch (irq) { +- case 13: ++ case 13 + 16: + level = 0; + break; +- case 11: ++ case 11 + 16: + level = 1; + break; +- case 9: ++ case 9 + 16: + level = 2; + break; + default: +-- +2.41.0 + diff --git a/queue-6.1/sh-mach-highlander-handle-virq-offset-in-cascaded-irl-demux.patch b/queue-6.1/sh-mach-highlander-handle-virq-offset-in-cascaded-irl-demux.patch new file mode 100644 index 00000000000..2260a42435f --- /dev/null +++ b/queue-6.1/sh-mach-highlander-handle-virq-offset-in-cascaded-irl-demux.patch @@ -0,0 +1,37 @@ +From a2601b8d8f077368c6d113b4d496559415c6d495 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Sun, 9 Jul 2023 15:10:23 +0200 +Subject: sh: mach-highlander: Handle virq offset in cascaded IRL demux + +From: Geert Uytterhoeven + +commit a2601b8d8f077368c6d113b4d496559415c6d495 upstream. + +Take into account the virq offset when translating cascaded IRL +interrupts. + +Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4") +Signed-off-by: Geert Uytterhoeven +Reviewed-by: John Paul Adrian Glaubitz +Link: https://lore.kernel.org/r/4fcb0d08a2b372431c41e04312742dc9e41e1be4.1688908186.git.geert+renesas@glider.be +Signed-off-by: John Paul Adrian Glaubitz +Signed-off-by: Greg Kroah-Hartman +--- + arch/sh/boards/mach-highlander/setup.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/sh/boards/mach-highlander/setup.c ++++ b/arch/sh/boards/mach-highlander/setup.c +@@ -389,10 +389,10 @@ static unsigned char irl2irq[HL_NR_IRL]; + + static int highlander_irq_demux(int irq) + { +- if (irq >= HL_NR_IRL || irq < 0 || !irl2irq[irq]) ++ if (irq >= HL_NR_IRL + 16 || irq < 16 || !irl2irq[irq - 16]) + return irq; + +- return irl2irq[irq]; ++ return irl2irq[irq - 16]; + } + + static void __init highlander_init_irq(void) diff --git a/queue-6.1/sh-mach-r2d-handle-virq-offset-in-cascaded-irl-demux.patch b/queue-6.1/sh-mach-r2d-handle-virq-offset-in-cascaded-irl-demux.patch new file mode 100644 index 00000000000..b8f39ba9de8 --- /dev/null +++ b/queue-6.1/sh-mach-r2d-handle-virq-offset-in-cascaded-irl-demux.patch @@ -0,0 +1,48 @@ +From ab8aa4f0956d2e0fb8344deadb823ef743581795 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Sun, 9 Jul 2023 13:15:49 +0200 +Subject: sh: mach-r2d: Handle virq offset in cascaded IRL demux + +From: Geert Uytterhoeven + +commit ab8aa4f0956d2e0fb8344deadb823ef743581795 upstream. + +When booting rts7751r2dplus_defconfig on QEMU, the system hangs due to +an interrupt storm on IRQ 20. IRQ 20 aka event 0x280 is a cascaded IRL +interrupt, which maps to IRQ_VOYAGER, the interrupt used by the Silicon +Motion SM501 multimedia companion chip. As rts7751r2d_irq_demux() does +not take into account the new virq offset, the interrupt is no longer +translated, leading to an unhandled interrupt. + +Fix this by taking into account the virq offset when translating +cascaded IRL interrupts. + +Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4") +Reported-by: Guenter Roeck +Closes: https://lore.kernel.org/r/fbfea3ad-d327-4ad5-ac9c-648c7ca3fe1f@roeck-us.net +Signed-off-by: Geert Uytterhoeven +Reviewed-by: John Paul Adrian Glaubitz +Tested-by: John Paul Adrian Glaubitz +Tested-by: Guenter Roeck +Link: https://lore.kernel.org/r/2c99d5df41c40691f6c407b7b6a040d406bc81ac.1688901306.git.geert+renesas@glider.be +Signed-off-by: John Paul Adrian Glaubitz +Signed-off-by: Greg Kroah-Hartman +--- + arch/sh/boards/mach-r2d/irq.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/sh/boards/mach-r2d/irq.c ++++ b/arch/sh/boards/mach-r2d/irq.c +@@ -117,10 +117,10 @@ static unsigned char irl2irq[R2D_NR_IRL] + + int rts7751r2d_irq_demux(int irq) + { +- if (irq >= R2D_NR_IRL || irq < 0 || !irl2irq[irq]) ++ if (irq >= R2D_NR_IRL + 16 || irq < 16 || !irl2irq[irq - 16]) + return irq; + +- return irl2irq[irq]; ++ return irl2irq[irq - 16]; + } + + /* -- 2.47.3