Thread (86 messages) 86 messages, 6 authors, 2023-11-30

Re: [PATCH RFC 02/22] x86: intel_epb: Don't rely on link order

From: Gavin Shan <hidden>
Date: 2023-11-13 00:04:23
Also in: kvmarm, linux-acpi, linux-arch, linux-doc, linux-pm, linux-riscv, lkml, loongarch

On 11/7/23 20:29, Russell King (Oracle) wrote:
From: James Morse <james.morse@arm.com>

intel_epb_init() is called as a subsys_initcall() to register cpuhp
callbacks. The callbacks make use of get_cpu_device() which will return
NULL unless register_cpu() has been called. register_cpu() is called
from topology_init(), which is also a subsys_initcall().

This is fragile. Moving the register_cpu() to a different
subsys_initcall()  leads to a NULL dereference during boot.

Make intel_epb_init() a late_initcall(), user-space can't provide a
policy before this point anyway.

Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Russell King (Oracle) <redacted>
---
subsys_initcall_sync() would be an option, but moving the register_cpu()
calls into ACPI also means adding a safety net for CPUs that are online
but not described properly by firmware. This lives in subsys_initcall_sync().
---
  arch/x86/kernel/cpu/intel_epb.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Gavin Shan <redacted>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help