From 7db6ab54b6f9607030fb29a9d60df5e2509fdd5f Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Thu, 4 Jun 2026 14:21:39 +0300 Subject: [PATCH] hi3516cv6xx: disable CONFIG_IO_STRICT_DEVMEM so ipctool can read SoC regs The kernel defconfig added in #2167 ships with both CONFIG_STRICT_DEVMEM=y and CONFIG_IO_STRICT_DEVMEM=y. The latter rejects any /dev/mem mmap whose range overlaps a page that has been claimed by a driver via request_mem_region(), even for root. On Hi3516CV608 that blocks userspace access to every page driven by the kernel -- CRG/clocks @ 0x11010000, I2C @ 0x11060000, SPI @ 0x11070000, GPIO @ 0x11090000+, UART @ 0x11040000+ -- making ipctool, ipcinfo -s and similar hardware-discovery tools unable to read PLL configuration, probe sensors over I2C/SPI, or dump GPIO state. Every other HiSilicon board in the tree that uses CONFIG_STRICT_DEVMEM=y explicitly disables CONFIG_IO_STRICT_DEVMEM (hi3516av100, hi3516dv100, hi3516cv500, hi3516av300, hi3516dv300, hi3516ev200, hi3516ev300, hi3516dv200, hi3536dv100, ...). Align hi3516cv6xx with that convention. The basic devmem hardening (CONFIG_STRICT_DEVMEM=y, requiring CAP_SYS_RAWIO and gating non-RAM regions) is preserved. Only the stronger I/O lockout that conflicts with diagnostic userspace is dropped. Verified on hi3516cv6xx target with kernel 5.10.221: before, every ipctool probe of a claimed page returned EPERM; after, ipctool reads CRG/I2C/SPI/GPIO normally and prints a complete YAML report. Companion userspace patch in OpenIPC/ipctool#172 falls back from a 64 KiB to a single-page mmap on EPERM, which recovers chip-ID detection even on kernels that keep IO_STRICT_DEVMEM on. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../board/hi3516cv6xx/hi3516cv6xx.generic.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/br-ext-chip-hisilicon/board/hi3516cv6xx/hi3516cv6xx.generic.config b/br-ext-chip-hisilicon/board/hi3516cv6xx/hi3516cv6xx.generic.config index 3fc93bbfe..9200f0edd 100644 --- a/br-ext-chip-hisilicon/board/hi3516cv6xx/hi3516cv6xx.generic.config +++ b/br-ext-chip-hisilicon/board/hi3516cv6xx/hi3516cv6xx.generic.config @@ -3582,7 +3582,7 @@ CONFIG_TRACING_SUPPORT=y # CONFIG_SAMPLES is not set CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y CONFIG_STRICT_DEVMEM=y -CONFIG_IO_STRICT_DEVMEM=y +# CONFIG_IO_STRICT_DEVMEM is not set # # arm Debugging