cpufreq: powernv: Fix unsafe notifiers
authorOliver O'Halloran <oohall@gmail.com>
Thu, 6 Feb 2020 06:26:22 +0000 (17:26 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 13 Mar 2020 10:13:11 +0000 (21:13 +1100)
commit966c08de7c2c9bcac13e2cb9e769a39582d5389f
treef0b09544f7574ffa1a0776c7cf7d47e64de1c936
parentd0a72efac89d1c35ac55197895201b7b94c5e6ef
cpufreq: powernv: Fix unsafe notifiers

The PowerNV cpufreq driver registers two notifiers: one to catch
throttle messages from the OCC and one to bump the CPU frequency back
to normal before a reboot. Both require the cpufreq driver to be
registered in order to function since the notifier callbacks use
various cpufreq_*() functions.

Right now we register both notifiers before we've initialised the
driver. This seems to work, but we should head off any protential
problems by registering the notifiers after the driver is initialised.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200206062622.28235-2-oohall@gmail.com
drivers/cpufreq/powernv-cpufreq.c