linux/arch
Xianting Tian e61bf5c071
RISC-V: Mark IORESOURCE_EXCLUSIVE for reserved mem instead of IORESOURCE_BUSY
Commit 00ab027a3b ("RISC-V: Add kernel image sections to the resource tree")
marked IORESOURCE_BUSY for reserved memory, which caused resource map
failed in subsequent operations of related driver, so remove the
IORESOURCE_BUSY flag. In order to prohibit userland mapping reserved
memory, mark IORESOURCE_EXCLUSIVE for it.

The code to reproduce the issue,
dts:
        mem0: memory@a0000000 {
                reg = <0x0 0xa0000000 0 0x1000000>;
                no-map;
        };

        &test {
                status = "okay";
                memory-region = <&mem0>;
        };

code:
        np = of_parse_phandle(pdev->dev.of_node, "memory-region", 0);
        ret = of_address_to_resource(np, 0, &r);
        base = devm_ioremap_resource(&pdev->dev, &r);
        // base = -EBUSY

Fixes: 00ab027a3b ("RISC-V: Add kernel image sections to the resource tree")
Reported-by: Huaming Jiang <jianghuaming.jhm@alibaba-inc.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Co-developed-by: Nick Kossifidis <mick@ics.forth.gr>
Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220518013428.1338983-1-xianting.tian@linux.alibaba.com
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-06-01 22:03:50 -07:00
..
alpha Not a lot of material this cycle. Many singleton patches against various 2022-05-27 11:22:03 -07:00
arc
arm More power management updates for 5.19-rc1 2022-05-30 11:37:26 -07:00
arm64 RISC-V Patches for the 5.19 Merge Window, Part 1 2022-05-31 14:10:54 -07:00
csky More power management updates for 5.19-rc1 2022-05-30 11:37:26 -07:00
hexagon
ia64 More power management updates for 5.19-rc1 2022-05-30 11:37:26 -07:00
m68k More power management updates for 5.19-rc1 2022-05-30 11:37:26 -07:00
microblaze
mips RISC-V Patches for the 5.19 Merge Window, Part 1 2022-05-31 14:10:54 -07:00
nios2 Kbuild updates for v5.19 2022-05-26 12:09:50 -07:00
openrisc OpenRISC updates for 5.19 2022-05-26 17:27:49 -07:00
parisc RISC-V Patches for the 5.19 Merge Window, Part 1 2022-05-31 14:10:54 -07:00
powerpc RISC-V Patches for the 5.19 Merge Window, Part 1 2022-05-31 14:10:54 -07:00
riscv RISC-V: Mark IORESOURCE_EXCLUSIVE for reserved mem instead of IORESOURCE_BUSY 2022-06-01 22:03:50 -07:00
s390 RISC-V Patches for the 5.19 Merge Window, Part 1 2022-05-31 14:10:54 -07:00
sh More power management updates for 5.19-rc1 2022-05-30 11:37:26 -07:00
sparc RISC-V Patches for the 5.19 Merge Window, Part 1 2022-05-31 14:10:54 -07:00
um Kbuild updates for v5.19 2022-05-26 12:09:50 -07:00
x86 RISC-V Patches for the 5.19 Merge Window, Part 1 2022-05-31 14:10:54 -07:00
xtensa Random number generator updates for Linux 5.19-rc1. 2022-05-24 11:58:10 -07:00
.gitignore
Kconfig powerpc updates for 5.19 2022-05-28 11:27:17 -07:00