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

powerpc/pseries/hibernation: perform post-suspend fixups later

The pseries hibernate code calls post_mobility_fixup() which is sort
of a dumping ground of fixups that need to run after resuming from
suspend regardless of whether suspend was a hibernation or a
migration. Calling post_mobility_fixup() from
pseries_suspend_enable_irqs() runs this code early in resume with
devices suspended and only one CPU up, while the much more commonly
used migration case runs these fixups in a more typical process
context.

Call post_mobility_fixup() after the suspend core returns a success
status to the hibernate sysfs store method and remove
pseries_suspend_enable_irqs().

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201207215200.1785968-26-nathanl@linux.ibm.com

authored by

Nathan Lynch and committed by
Michael Ellerman
fa53bcdb b8664594

+4 -17
+4 -17
arch/powerpc/platforms/pseries/suspend.c
··· 51 51 } 52 52 53 53 /** 54 - * pseries_suspend_enable_irqs 55 - * 56 - * Post suspend configuration updates 57 - * 58 - **/ 59 - static void pseries_suspend_enable_irqs(void) 60 - { 61 - /* 62 - * Update configuration which can be modified based on device tree 63 - * changes during resume. 64 - */ 65 - post_mobility_fixup(); 66 - } 67 - 68 - /** 69 54 * pseries_suspend_enter - Final phase of hibernation 70 55 * 71 56 * Return value: ··· 112 127 if (!rc) 113 128 rc = pm_suspend(PM_SUSPEND_MEM); 114 129 115 - if (!rc) 130 + if (!rc) { 116 131 rc = count; 132 + post_mobility_fixup(); 133 + } 134 + 117 135 118 136 return rc; 119 137 } ··· 202 214 if ((rc = pseries_suspend_sysfs_register(&suspend_dev))) 203 215 return rc; 204 216 205 - ppc_md.suspend_enable_irqs = pseries_suspend_enable_irqs; 206 217 suspend_set_ops(&pseries_suspend_ops); 207 218 return 0; 208 219 }