Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

irqchip/riscv-aplic: Do not clear ACPI dependencies on probe failure

aplic_probe() calls acpi_dev_clear_dependencies() unconditionally at the
end, even when the preceding setup (MSI or direct mode) has failed. This is
incorrect because if the device failed to probe, it should not be
considered as active and should not clear dependencies for other devices
waiting on it.

Fix this by returning immediately when the setup fails, skipping the ACPI
dependency cleanup. Also, explicitly return 0 on success instead of relying
on the value of 'rc' to make the success path clear.

Fixes: 5122e380c23b ("irqchip/riscv-aplic: Add ACPI support")
Signed-off-by: Jessica Liu <liu.xuemei1@zte.com.cn>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260310141600411Fu8H8-GXOOgKISU48Tjgx@zte.com.cn

authored by

Jessica Liu and committed by
Thomas Gleixner
620b6ded 1f318b96

+7 -4
+7 -4
drivers/irqchip/irq-riscv-aplic-main.c
··· 372 372 rc = aplic_msi_setup(dev, regs); 373 373 else 374 374 rc = aplic_direct_setup(dev, regs); 375 - if (rc) 375 + 376 + if (rc) { 376 377 dev_err_probe(dev, rc, "failed to setup APLIC in %s mode\n", 377 378 msi_mode ? "MSI" : "direct"); 378 - else 379 - register_syscore(&aplic_syscore); 379 + return rc; 380 + } 381 + 382 + register_syscore(&aplic_syscore); 380 383 381 384 #ifdef CONFIG_ACPI 382 385 if (!acpi_disabled) 383 386 acpi_dev_clear_dependencies(ACPI_COMPANION(dev)); 384 387 #endif 385 388 386 - return rc; 389 + return 0; 387 390 } 388 391 389 392 static const struct of_device_id aplic_match[] = {