tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 628e30bc9a3c48a6ab38868cb77fc6497d6ebaa5 commit: c0d9a87efd7845c763e936a5bd9c482c62f8ceb4 [1817/1817] LoongArch: eiointc: fix ext irq route error config: loongarch-randconfig-001-20250110 (https://download.01.org/0day-ci/archive/20250110/202501101806.25f5zC4M-lkp@i...) compiler: loongarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250110/202501101806.25f5zC4M-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202501101806.25f5zC4M-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/irqchip/irq-loongson-eiointc.c: In function 'eiointc_router_init':
drivers/irqchip/irq-loongson-eiointc.c:199:13: warning: unused variable 'cores' [-Wunused-variable]
199 | int cores = (cpu_has_hypervisor ? MAX_CORES_PER_EIO_NODE : CORES_PER_EIO_NODE); | ^~~~~ drivers/irqchip/irq-loongson-eiointc.c: At top level: drivers/irqchip/irq-loongson-eiointc.c:380:12: warning: no previous prototype for 'pch_pic_parse_madt' [-Wmissing-prototypes] 380 | int __init pch_pic_parse_madt(union acpi_subtable_headers *header, | ^~~~~~~~~~~~~~~~~~ drivers/irqchip/irq-loongson-eiointc.c:393:12: warning: no previous prototype for 'pch_msi_parse_madt' [-Wmissing-prototypes] 393 | int __init pch_msi_parse_madt(union acpi_subtable_headers *header, | ^~~~~~~~~~~~~~~~~~ drivers/irqchip/irq-loongson-eiointc.c: In function 'pch_msi_parse_madt': drivers/irqchip/irq-loongson-eiointc.c:401:58: error: 'NODES_PER_FLATMODE_NODE' undeclared (first use in this function) 401 | node = eiointc_priv[nr_pics - 1]->node / NODES_PER_FLATMODE_NODE; | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/irqchip/irq-loongson-eiointc.c:401:58: note: each undeclared identifier is reported only once for each function it appears in drivers/irqchip/irq-loongson-eiointc.c: In function 'eiointc_acpi_init': drivers/irqchip/irq-loongson-eiointc.c:507:45: error: 'NODES_PER_FLATMODE_NODE' undeclared (first use in this function) 507 | node = acpi_eiointc->node / NODES_PER_FLATMODE_NODE; | ^~~~~~~~~~~~~~~~~~~~~~~
vim +/cores +199 drivers/irqchip/irq-loongson-eiointc.c
dd281e1a1a937e Huacai Chen 2022-07-20 192 dd281e1a1a937e Huacai Chen 2022-07-20 193 static int eiointc_router_init(unsigned int cpu) dd281e1a1a937e Huacai Chen 2022-07-20 194 { dd281e1a1a937e Huacai Chen 2022-07-20 195 int i, bit; dd281e1a1a937e Huacai Chen 2022-07-20 196 uint32_t data; dd281e1a1a937e Huacai Chen 2022-07-20 197 uint32_t node = cpu_to_eio_node(cpu); 2e99b73afde188 Bibo Mao 2023-08-11 198 int index = eiointc_index(node); 6379cda0d97b5b liuyun 2023-12-02 @199 int cores = (cpu_has_hypervisor ? MAX_CORES_PER_EIO_NODE : CORES_PER_EIO_NODE); dd281e1a1a937e Huacai Chen 2022-07-20 200 dd281e1a1a937e Huacai Chen 2022-07-20 201 if (index < 0) { dd281e1a1a937e Huacai Chen 2022-07-20 202 pr_err("Error: invalid nodemap!\n"); dd281e1a1a937e Huacai Chen 2022-07-20 203 return -1; dd281e1a1a937e Huacai Chen 2022-07-20 204 } dd281e1a1a937e Huacai Chen 2022-07-20 205 c0d9a87efd7845 wanghongliang 2025-01-07 206 if (!test_bit(node, (&extioi_node_maps)->bits)) { dd281e1a1a937e Huacai Chen 2022-07-20 207 eiointc_enable(); dd281e1a1a937e Huacai Chen 2022-07-20 208 a3f1132c4c6be3 Binbin Zhou 2023-05-05 209 for (i = 0; i < eiointc_priv[0]->vec_count / 32; i++) { dd281e1a1a937e Huacai Chen 2022-07-20 210 data = (((1 << (i * 2 + 1)) << 16) | (1 << (i * 2))); dd281e1a1a937e Huacai Chen 2022-07-20 211 iocsr_write32(data, EIOINTC_REG_NODEMAP + i * 4); dd281e1a1a937e Huacai Chen 2022-07-20 212 } dd281e1a1a937e Huacai Chen 2022-07-20 213 a3f1132c4c6be3 Binbin Zhou 2023-05-05 214 for (i = 0; i < eiointc_priv[0]->vec_count / 32 / 4; i++) { dd281e1a1a937e Huacai Chen 2022-07-20 215 bit = BIT(1 + index); /* Route to IP[1 + index] */ dd281e1a1a937e Huacai Chen 2022-07-20 216 data = bit | (bit << 8) | (bit << 16) | (bit << 24); dd281e1a1a937e Huacai Chen 2022-07-20 217 iocsr_write32(data, EIOINTC_REG_IPMAP + i * 4); dd281e1a1a937e Huacai Chen 2022-07-20 218 } dd281e1a1a937e Huacai Chen 2022-07-20 219 a3f1132c4c6be3 Binbin Zhou 2023-05-05 220 for (i = 0; i < eiointc_priv[0]->vec_count / 4; i++) { dd281e1a1a937e Huacai Chen 2022-07-20 221 /* Route to Node-0 Core-0 */ 5d97cff72f91f4 Bibo Mao 2024-03-13 222 if (eiointc_priv[index]->cpu_encoded) 5d97cff72f91f4 Bibo Mao 2024-03-13 223 bit = cpu_logical_map(0); 5d97cff72f91f4 Bibo Mao 2024-03-13 224 else if (index == 0) 5d97cff72f91f4 Bibo Mao 2024-03-13 225 bit = BIT(cpu_logical_map(0)); dd281e1a1a937e Huacai Chen 2022-07-20 226 else c0d9a87efd7845 wanghongliang 2025-01-07 227 bit = (eiointc_priv[index]->node << 4) | c0d9a87efd7845 wanghongliang 2025-01-07 228 BIT(cpu_logical_map(smp_processor_id()) % c0d9a87efd7845 wanghongliang 2025-01-07 229 CORES_PER_EIO_NODE); dd281e1a1a937e Huacai Chen 2022-07-20 230 dd281e1a1a937e Huacai Chen 2022-07-20 231 data = bit | (bit << 8) | (bit << 16) | (bit << 24); dd281e1a1a937e Huacai Chen 2022-07-20 232 iocsr_write32(data, EIOINTC_REG_ROUTE + i * 4); dd281e1a1a937e Huacai Chen 2022-07-20 233 } dd281e1a1a937e Huacai Chen 2022-07-20 234 a3f1132c4c6be3 Binbin Zhou 2023-05-05 235 for (i = 0; i < eiointc_priv[0]->vec_count / 32; i++) { dd281e1a1a937e Huacai Chen 2022-07-20 236 data = 0xffffffff; dd281e1a1a937e Huacai Chen 2022-07-20 237 iocsr_write32(data, EIOINTC_REG_ENABLE + i * 4); c0d9a87efd7845 wanghongliang 2025-01-07 238 iocsr_write32(0, EIOINTC_REG_BOUNCE + i * 4); dd281e1a1a937e Huacai Chen 2022-07-20 239 } c0d9a87efd7845 wanghongliang 2025-01-07 240 c0d9a87efd7845 wanghongliang 2025-01-07 241 set_bit(node, (&extioi_node_maps)->bits); dd281e1a1a937e Huacai Chen 2022-07-20 242 } dd281e1a1a937e Huacai Chen 2022-07-20 243 dd281e1a1a937e Huacai Chen 2022-07-20 244 return 0; dd281e1a1a937e Huacai Chen 2022-07-20 245 } dd281e1a1a937e Huacai Chen 2022-07-20 246
:::::: The code at line 199 was first introduced by commit :::::: 6379cda0d97b5b38da0c1599b57ab764fb307cc2 LoongArch: Fix virtual machine startup error
:::::: TO: liuyun liuyun@loongson.cn :::::: CC: Hongchen Zhang zhanghongchen@loongson.cn