+ /*
+ * If the current CPU state is in the range of the AP hotplug thread,
+ * then we need to kick the thread.
+ */
+ if (st->state >= CPUHP_KICK_AP_THREAD) {
+ ret = cpuhp_kick_ap_work(cpu);
+ /*
+ * The AP side has done the error rollback already. Just
+ * return the error code..
+ */
+ if (ret)
+ goto out;
+
+ /*
+ * We might have stopped still in the range of the AP hotplug
+ * thread. Nothing to do anymore.
+ */
+ if (st->state >= CPUHP_KICK_AP_THREAD)
+ goto out;
+ }
+ /*
+ * The AP brought itself down below CPUHP_KICK_AP_THREAD. So we need
+ * to do the further cleanups.
+ */