Re: [RFC PATCH v2 07/35] x86: intel_epb: Don't rely on link order

From: Russell King (Oracle)
Date: Thu Sep 14 2023 - 06:02:22 EST


On Wed, Sep 13, 2023 at 04:37:55PM +0000, James Morse wrote:
> 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 derefernce 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@xxxxxxx>

I think someone knowledgeable from x86 land needs to ack/review this.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!