[BUG] lib/logic_pio.c: 6.6.0-19 kernel panic when using legacy I/O port function.

From: 冯俊

Date: Mon Mar 23 2026 - 07:38:32 EST


Kernel panic when using legacy method to access I/O port such as 'inb/outb'in arm64.

Problem Description:
Based on the open‑source 6.6 kernel, when we boot the OS normally on an ARM64 platform, a panic occurs. The error call trace is as follows (see the attached log file).

Problem Analysis:
Our ACPI table describes a device with HID PNP0C09, so during the ACPI enumeration phase the EC driver is matched and loaded. The problem appears in drivers/acpi/ec.c in the function acpi_ec_read_status() which executes u8 x = inb(ec->command_addr). Here ec->command_addr equals 0x62, ultimately calling the logic_inb interface in logic_pio.c. The source code is as follows:

#if defined(CONFIG_INDIRECT_PIO) && defined(PCI_IOBASE)
#define BUILD_LOGIC_IO(bwl, type) \
type logic_in##bwl(unsigned long addr) \
{ \
type ret = (type)~0; \
\
if (addr < MMIO_UPPER_LIMIT) { \
ret = _in##bwl(addr); \
} else if (addr >= MMIO_UPPER_LIMIT && addr < IO_SPACE_LIMIT) { \
struct logic_pio_hwaddr *entry = find_io_range(addr); \
\
if (entry) \
ret = entry->ops->in(entry->hostdata, \
addr, sizeof(type)); \
else \
WARN_ON_ONCE(1); \
} \
return ret; \
}
The condition if (addr < MMIO_UPPER_LIMIT) is true, so ret = _in##bwl(addr) is executed.

The _inb function is implemented as:

static inline u8 _inb(unsigned long addr)
{
u8 val;

__io_pbr();
val = __raw_readb(PCI_IOBASE + addr);
__io_par(val);
return val;
}

On our platform, the EC is not a PCIe device, and eventually we see Kernel panic - not syncing: Oops: Fatal exception.

We would like to confirm whether the EC driver cannot use logic_pio to access I/O ports on ARM64, or whether there is a compatibility bug in our logic_pio implementation.
[ 0.214745][ T0] Detected PIPT I-cache on CPU1
[ 0.214762][ T0] GICv3: CPU1: found redistributor 100 region 1:0x0000000026880000
[ 0.214767][ T0] GICv3: CPU1: using allocated LPI pending table @0x00000020a22e0000
[ 0.214781][ T0] CPU1: Booted secondary processor 0x0000000100 [0x700f8620]
[ 0.244732][ T0] Detected PIPT I-cache on CPU2
[ 0.244744][ T0] GICv3: CPU2: found redistributor 200 region 2:0x00000000268a0000
[ 0.244748][ T0] GICv3: CPU2: using allocated LPI pending table @0x00000020a22f0000
[ 0.244759][ T0] CPU2: Booted secondary processor 0x0000000200 [0x700f8620]
[ 0.274709][ T0] Detected PIPT I-cache on CPU3
[ 0.274717][ T0] GICv3: CPU3: found redistributor 300 region 3:0x00000000268c0000
[ 0.274720][ T0] GICv3: CPU3: using allocated LPI pending table @0x00000020a2300000
[ 0.274728][ T0] CPU3: Booted secondary processor 0x0000000300 [0x700f8620]
[ 0.304746][ T0] Detected PIPT I-cache on CPU4
[ 0.304763][ T0] GICv3: CPU4: found redistributor 10000 region 4:0x00000000268e0000
[ 0.304767][ T0] GICv3: CPU4: using allocated LPI pending table @0x00000020a2310000
[ 0.304779][ T0] CPU4: Booted secondary processor 0x0000010000 [0x700f8620]
[ 0.334748][ T0] Detected PIPT I-cache on CPU5
[ 0.334760][ T0] GICv3: CPU5: found redistributor 10100 region 5:0x0000000026900000
[ 0.334764][ T0] GICv3: CPU5: using allocated LPI pending table @0x00000020a2320000
[ 0.334774][ T0] CPU5: Booted secondary processor 0x0000010100 [0x700f8620]
[ 0.364734][ T0] Detected PIPT I-cache on CPU6
[ 0.364747][ T0] GICv3: CPU6: found redistributor 10200 region 6:0x0000000026920000
[ 0.364751][ T0] GICv3: CPU6: using allocated LPI pending table @0x00000020a2330000
[ 0.364760][ T0] CPU6: Booted secondary processor 0x0000010200 [0x700f8620]
[ 0.394767][ T0] Detected PIPT I-cache on CPU7
[ 0.394776][ T0] GICv3: CPU7: found redistributor 10300 region 7:0x0000000026940000
[ 0.394779][ T0] GICv3: CPU7: using allocated LPI pending table @0x00000020a2340000
[ 0.394788][ T0] CPU7: Booted secondary processor 0x0000010300 [0x700f8620]
[ 0.394836][ T1] smp: Brought up 1 node, 8 CPUs
[ 0.599833][ T1] SMP: Total of 8 processors activated.
[ 0.605252][ T1] CPU features: detected: 32-bit EL0 Support
[ 0.611109][ T1] CPU features: detected: Data cache clean to the PoU not required for I/D coherence
[ 0.620461][ T1] CPU features: detected: Common not Private translations
[ 0.627453][ T1] CPU features: detected: CRC32 instructions
[ 0.633311][ T1] CPU features: detected: Data cache clean to Point of Persistence
[ 0.641093][ T1] CPU features: detected: RCpc load-acquire (LDAPR)
[ 0.647560][ T1] CPU features: detected: LSE atomic instructions
[ 0.653854][ T1] CPU features: detected: Privileged Access Never
[ 0.660147][ T1] CPU features: detected: RAS Extension Support
[ 0.666267][ T1] CPU features: detected: Speculative Store Bypassing Safe (SSBS)
[ 0.674012][ T1] CPU: All CPU(s) started at EL2
[ 0.678826][ T1] alternatives: applying system-wide alternatives
[ 0.687342][ T1] devtmpfs: initialized
[ 0.693716][ T1] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.704302][ T1] futex hash table entries: 2048 (order: 5, 131072 bytes, linear)
[ 0.712740][ T1] pinctrl core: initialized pinctrl subsystem
[ 0.718886][ T1] SMBIOS 3.3.0 present.
[ 0.722909][ T1] DMI: phytium D3000M/D3000M, BIOS v2.2.5 01/28/2026
[ 0.730873][ T1] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.737771][ T1] DMA: preallocated 2048 KiB GFP_KERNEL pool for atomic allocations
[ 0.745710][ T1] DMA: preallocated 2048 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[ 0.754344][ T1] DMA: preallocated 2048 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[ 0.763400][ T1] audit: initializing netlink subsys (disabled)
[ 0.769621][ T59] audit: type=2000 audit(0.630:1): state=initialized audit_enabled=0 res=1
[ 0.769752][ T1] thermal_sys: Registered thermal governor 'fair_share'
[ 0.778102][ T1] thermal_sys: Registered thermal governor 'step_wise'
[ 0.784920][ T1] thermal_sys: Registered thermal governor 'user_space'
[ 0.791666][ T1] cpuidle: using governor menu
[ 0.803157][ T1] Detected 8 PCC Subspaces
[ 0.807440][ T1] Registering PCC driver as Mailbox controller
[ 0.813550][ T1] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.821118][ T1] ASID allocator initialised with 65536 entries
[ 0.827250][ T1] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[ 0.834809][ T1] Serial: AMBA PL011 UART driver
[ 0.839888][ T1] Modules: 18608 pages in range for non-PLT usage
[ 0.839890][ T1] Modules: 510128 pages in range for PLT usage
[ 0.848648][ T1] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages
[ 0.862202][ T1] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page
[ 0.869198][ T1] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages
[ 0.876715][ T1] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page
[ 0.883708][ T1] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.891226][ T1] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page
[ 0.898219][ T1] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages
[ 0.905735][ T1] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page
[ 0.913792][ T1] cryptd: max_cpu_qlen set to 1000
[ 0.919657][ T1] ACPI: Added _OSI(Module Device)
[ 0.924564][ T1] ACPI: Added _OSI(Processor Device)
[ 0.929722][ T1] ACPI: Added _OSI(Processor Aggregator Device)
[ 0.937707][ T1] ACPI: 2 ACPI AML tables successfully acquired and loaded
[ 0.945373][ T1] ACPI: EC: EC started
[ 0.949312][ T1] ACPI: EC: interrupt blocked
[ 0.953944][ T1] ACPI: EC: EC_CMD/EC_SC=0x66, EC_DATA=0x62
[ 0.959718][ T1] ACPI: \_SB_.KCS1.EC0_: Boot DSDT EC used to handle transactions
[ 0.967410][ T1] ACPI: Interpreter enabled
[ 0.971782][ T1] ACPI: Using GIC for interrupt routing
[ 0.977350][ T1] ACPI: MCFG table detected, 1 entries
[ 0.982689][ T1] ACPI: IORT: SMMU-v3[26000000] Mapped to Proximity domain 0
[ 0.992234][ T1] Unable to handle kernel paging request at virtual address ffffffffc0800066
[ 1.000886][ T1] Mem abort info:
[ 1.004382][ T1] ESR = 0x0000000096000006
[ 1.008841][ T1] EC = 0x25: DABT (current EL), IL = 32 bits
[ 1.014871][ T1] SET = 0, FnV = 0
[ 1.018631][ T1] EA = 0, S1PTW = 0
[ 1.022477][ T1] FSC = 0x06: level 2 translation fault
[ 1.028071][ T1] Data abort info:
[ 1.031654][ T1] ISV = 0, ISS = 0x00000006, ISS2 = 0x00000000
[ 1.037860][ T1] CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[ 1.043628][ T1] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[ 1.049661][ T1] swapper pgtable: 4k pages, 48-bit VAs, pgdp=00000000e2f13000
[ 1.057092][ T1] [ffffffffc0800066] pgd=00000000e3c90403, p4d=00000000e3c90403, pud=00000000e3c91403, pmd=0000000000000000
[ 1.068458][ T1] Internal error: Oops: 0000000096000006 [#1] SMP
[ 1.074752][ T1] Modules linked in:
[ 1.078513][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.6.0-19-generic #0ok4-KYLINOS
[ 1.086992][ T1] Source Version: Unknown
[ 1.091190][ T1] Hardware name: phytium D3000M/D3000M, BIOS v2.2.5 01/28/2026
[ 1.098619][ T1] pstate: 804000c9 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 1.106311][ T1] pc : logic_inb+0xb4/0x100
[ 1.110688][ T1] lr : advance_transaction+0x38/0x520
[ 1.115938][ T1] sp : ffff8000837ab420
[ 1.119959][ T1] x29: ffff8000837ab420 x28: ffff002023104900 x27: ffff0020223ad500
[ 1.127827][ T1] x26: 0000000000000005 x25: ffff800082684ce0 x24: ffff8000837ab568
[ 1.135696][ T1] x23: 00000000ffff8b52 x22: ffff8000837ab568 x21: 0000000000000000
[ 1.143565][ T1] x20: 0000000000000066 x19: ffff0020223ad500 x18: 0000000000000014
[ 1.151433][ T1] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[ 1.159300][ T1] x14: ffffffffffffffff x13: 0000000000000038 x12: 0101010101010101
[ 1.167166][ T1] x11: ff7f7fff7fff7f7f x10: c9145bb509f550ff x9 : ffff800080975c88
[ 1.175034][ T1] x8 : ffff8000837ab567 x7 : 0000000000000000 x6 : 00000000000000fb
[ 1.182904][ T1] x5 : ffff0020223ad500 x4 : ffff8000837ab567 x3 : 0000000000000000
[ 1.190773][ T1] x2 : 0000000000000001 x1 : 0000000000ffbffe x0 : ffffffffc0800066
[ 1.198640][ T1] Call trace:
[ 1.201787][ T1] logic_inb+0xb4/0x100
[ 1.205811][ T1] advance_transaction+0x38/0x520
[ 1.210710][ T1] acpi_ec_transaction_unlocked+0xe8/0x310
[ 1.216392][ T1] acpi_ec_space_handler+0xf4/0x310
[ 1.221462][ T1] acpi_ev_address_space_dispatch+0x144/0x360
[ 1.227409][ T1] acpi_ex_access_region+0x80/0xf8
[ 1.232392][ T1] acpi_ex_field_datum_io+0x88/0x200
[ 1.237550][ T1] acpi_ex_extract_from_field+0x288/0x2f0
[ 1.243143][ T1] acpi_ex_read_data_from_field+0x98/0x260
[ 1.248826][ T1] acpi_ex_resolve_node_to_value+0x274/0x300
[ 1.254681][ T1] acpi_ex_resolve_to_value+0x60/0xd8
[ 1.259928][ T1] acpi_ds_evaluate_name_path+0xdc/0x150
[ 1.265437][ T1] acpi_ds_exec_end_op+0x34c/0x4c8
[ 1.270420][ T1] acpi_ps_parse_loop+0x100/0x6a0
[ 1.275318][ T1] acpi_ps_parse_aml+0x94/0x3b0
[ 1.280040][ T1] acpi_ps_execute_method+0x12c/0x260
[ 1.285286][ T1] acpi_ns_evaluate+0x1f0/0x2d0
[ 1.290008][ T1] acpi_evaluate_object+0x208/0x3d8
[ 1.295084][ T1] acpi_evaluate_integer+0x60/0x160
[ 1.300156][ T1] acpi_bus_get_status+0x5c/0x140
[ 1.305053][ T1] acpi_add_single_object+0x12c/0x378
[ 1.310300][ T1] acpi_bus_check_add+0x10c/0x2c0
[ 1.315196][ T1] acpi_bus_check_add_1+0x20/0x38
[ 1.320092][ T1] acpi_ns_walk_namespace+0x100/0x230
[ 1.325338][ T1] acpi_walk_namespace+0x124/0x158
[ 1.330322][ T1] acpi_bus_scan+0x1f8/0x220
[ 1.334783][ T1] acpi_scan_init+0xcc/0x2c8
[ 1.339247][ T1] acpi_init+0x8c/0x158
[ 1.343269][ T1] do_one_initcall+0x60/0x348
[ 1.347817][ T1] do_initcalls+0x124/0x240
[ 1.352191][ T1] kernel_init_freeable+0x158/0x2a8
[ 1.357260][ T1] kernel_init+0x2c/0x200
[ 1.361458][ T1] ret_from_fork+0x10/0x20
[ 1.365744][ T1] Code: d65f03c0 929fffe0 f2b81000 8b000280 (39400000)
[ 1.372563][ T1] ---[ end trace 0000000000000000 ]---
[ 1.377894][ T1] Kernel panic - not syncing: Oops: Fatal exception
[ 1.384363][ T1] SMP: stopping secondary CPUs
[ 1.388999][ T1] ---[ end Kernel panic - not syncing: Oops: Fatal exception ]---
P: power on...