--- /dev/null
+From 7eb1e47696aa231b1a567846bbe3a1e1befe1854 Mon Sep 17 00:00:00 2001
+From: Michael Schmitz <schmitzmic@gmail.com>
+Date: Wed, 5 Jul 2023 11:38:08 +1200
+Subject: block/partition: fix signedness issue for Amiga partitions
+
+From: Michael Schmitz <schmitzmic@gmail.com>
+
+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 <chzigotzky@xenosoft.de>
+Link: https://lore.kernel.org/r/024ce4fa-cc6d-50a2-9aae-3701d0ebf668@xenosoft.de
+Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
+Reviewed-by: Martin Steigerwald <martin@lichtvoll.de>
+Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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",
wireguard-netlink-send-staged-packets-when-setting-initial-private-key.patch
tty-serial-fsl_lpuart-add-earlycon-for-imx8ulp-platform.patch
io_uring-use-io_schedule-in-cqring-wait.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
--- /dev/null
+From 7c28a35e19fafa1d3b367bcd3ec4021427a9397b Mon Sep 17 00:00:00 2001
+From: Artur Rojek <contact@artur-rojek.eu>
+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 <contact@artur-rojek.eu>
+
+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 <contact@artur-rojek.eu>
+Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Link: https://lore.kernel.org/r/20230710233132.69734-1-contact@artur-rojek.eu
+Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/sh/cchips/Kconfig | 4 ++--
+ arch/sh/include/asm/hd64461.h | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+--- 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.
+
+--- 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)
--- /dev/null
+From 3d20f7a6eb76afdf9d4ad9cb864c2e2da9c38e1f Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Sun, 9 Jul 2023 15:10:43 +0200
+Subject: sh: mach-dreamcast: Handle virq offset in cascaded IRQ demux
+
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+
+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 <geert+renesas@glider.be>
+Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Link: https://lore.kernel.org/r/7d0cb246c9f1cd24bb1f637ec5cb67e799a4c3b8.1688908227.git.geert+renesas@glider.be
+Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/sh/boards/mach-dreamcast/irq.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- 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:
--- /dev/null
+From a2601b8d8f077368c6d113b4d496559415c6d495 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Sun, 9 Jul 2023 15:10:23 +0200
+Subject: sh: mach-highlander: Handle virq offset in cascaded IRL demux
+
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+
+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 <geert+renesas@glider.be>
+Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Link: https://lore.kernel.org/r/4fcb0d08a2b372431c41e04312742dc9e41e1be4.1688908186.git.geert+renesas@glider.be
+Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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)
--- /dev/null
+From ab8aa4f0956d2e0fb8344deadb823ef743581795 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Sun, 9 Jul 2023 13:15:49 +0200
+Subject: sh: mach-r2d: Handle virq offset in cascaded IRL demux
+
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+
+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 <linux@roeck-us.net>
+Closes: https://lore.kernel.org/r/fbfea3ad-d327-4ad5-ac9c-648c7ca3fe1f@roeck-us.net
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Tested-by: Guenter Roeck <linux@roeck-us.net>
+Link: https://lore.kernel.org/r/2c99d5df41c40691f6c407b7b6a040d406bc81ac.1688901306.git.geert+renesas@glider.be
+Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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];
+ }
+
+ /*