Message ID | 20210323141405.55115-1-fazilyildiran@gmail.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Headers | show |
Series | [v2] PM: Kconfig: fix unmet dependency for PM_SLEEP_SMP | expand |
On Tue, Mar 23, 2021 at 3:16 PM Necip Fazil Yildiran <fazilyildiran@gmail.com> wrote: > > When PM_SLEEP_SMP is enabled and HOTPLUG_CPU is disabled, it results in > the following Kbuild warning: > > WARNING: unmet direct dependencies detected for HOTPLUG_CPU > Depends on [n]: SMP [=y] && (PPC_PSERIES [=n] || PPC_PMAC [=n] || PPC_POWERNV [=n] || FSL_SOC_BOOKE [=n]) > Selected by [y]: > - PM_SLEEP_SMP [=y] && SMP [=y] && (ARCH_SUSPEND_POSSIBLE [=n] || ARCH_HIBERNATION_POSSIBLE [=y]) && PM_SLEEP [=y] > > The reason is that PM_SLEEP_SMP selects HOTPLUG_CPU without depending on > or selecting HOTPLUG_CPU's dependencies. > > Let PM_SLEEP_SMP depend on HOTPLUG_CPU's dependencies to avoid Kbuild issues. > > Signed-off-by: Necip Fazil Yildiran <fazilyildiran@gmail.com> > --- > v1->v2: > * Keep selecting HOTPLUG_CPU by PM_SLEEP_SMP as it needs to be selected > automatically, let PM_SLEEP_SMP depend on missing dependencies instead. > --- > kernel/power/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig > index 6bfe3ead10ad..0c4aa403e04a 100644 > --- a/kernel/power/Kconfig > +++ b/kernel/power/Kconfig > @@ -125,6 +125,7 @@ config PM_SLEEP_SMP > depends on SMP > depends on ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE > depends on PM_SLEEP > + depends on PPC_PSERIES || PPC_PMAC || PPC_POWERNV || FSL_SOC_BOOKE This would make it not work on non-PPC, wouldn't it? > select HOTPLUG_CPU > > config PM_SLEEP_SMP_NONZERO_CPU > --
Hi Necip,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.15-rc3 next-20210922]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Necip-Fazil-Yildiran/PM-Kconfig-fix-unmet-dependency-for-PM_SLEEP_SMP/20210929-162901
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a4e6f95a891ac08bd09d62e3e6dae239b150f4c1
config: i386-randconfig-c001-20210929 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dc6e8dfdfe7efecfda318d43a06fae18b40eb498)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/761d2cbd7ffe7612fdc9084465070e008edd48a7
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Necip-Fazil-Yildiran/PM-Kconfig-fix-unmet-dependency-for-PM_SLEEP_SMP/20210929-162901
git checkout 761d2cbd7ffe7612fdc9084465070e008edd48a7
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> arch/x86/power/cpu.c:313:8: error: implicit declaration of function 'freeze_secondary_cpus' [-Werror,-Wimplicit-function-declaration]
ret = freeze_secondary_cpus(0);
^
arch/x86/power/cpu.c:313:8: note: did you mean 'thaw_secondary_cpus'?
include/linux/cpu.h:165:20: note: 'thaw_secondary_cpus' declared here
static inline void thaw_secondary_cpus(void) {}
^
arch/x86/power/cpu.c:288:5: warning: no previous prototype for function 'hibernate_resume_nonboot_cpu_disable' [-Wmissing-prototypes]
int hibernate_resume_nonboot_cpu_disable(void)
^
arch/x86/power/cpu.c:288:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int hibernate_resume_nonboot_cpu_disable(void)
^
static
1 warning and 1 error generated.
vim +/freeze_secondary_cpus +313 arch/x86/power/cpu.c
406f992e4a372da Rafael J. Wysocki 2016-07-14 287
406f992e4a372da Rafael J. Wysocki 2016-07-14 288 int hibernate_resume_nonboot_cpu_disable(void)
406f992e4a372da Rafael J. Wysocki 2016-07-14 289 {
406f992e4a372da Rafael J. Wysocki 2016-07-14 290 void (*play_dead)(void) = smp_ops.play_dead;
406f992e4a372da Rafael J. Wysocki 2016-07-14 291 int ret;
406f992e4a372da Rafael J. Wysocki 2016-07-14 292
406f992e4a372da Rafael J. Wysocki 2016-07-14 293 /*
406f992e4a372da Rafael J. Wysocki 2016-07-14 294 * Ensure that MONITOR/MWAIT will not be used in the "play dead" loop
406f992e4a372da Rafael J. Wysocki 2016-07-14 295 * during hibernate image restoration, because it is likely that the
406f992e4a372da Rafael J. Wysocki 2016-07-14 296 * monitored address will be actually written to at that time and then
406f992e4a372da Rafael J. Wysocki 2016-07-14 297 * the "dead" CPU will attempt to execute instructions again, but the
406f992e4a372da Rafael J. Wysocki 2016-07-14 298 * address in its instruction pointer may not be possible to resolve
406f992e4a372da Rafael J. Wysocki 2016-07-14 299 * any more at that point (the page tables used by it previously may
406f992e4a372da Rafael J. Wysocki 2016-07-14 300 * have been overwritten by hibernate image data).
ec527c318036a65 Jiri Kosina 2019-05-30 301 *
ec527c318036a65 Jiri Kosina 2019-05-30 302 * First, make sure that we wake up all the potentially disabled SMT
ec527c318036a65 Jiri Kosina 2019-05-30 303 * threads which have been initially brought up and then put into
ec527c318036a65 Jiri Kosina 2019-05-30 304 * mwait/cpuidle sleep.
ec527c318036a65 Jiri Kosina 2019-05-30 305 * Those will be put to proper (not interfering with hibernation
ec527c318036a65 Jiri Kosina 2019-05-30 306 * resume) sleep afterwards, and the resumed kernel will decide itself
ec527c318036a65 Jiri Kosina 2019-05-30 307 * what to do with them.
406f992e4a372da Rafael J. Wysocki 2016-07-14 308 */
ec527c318036a65 Jiri Kosina 2019-05-30 309 ret = cpuhp_smt_enable();
ec527c318036a65 Jiri Kosina 2019-05-30 310 if (ret)
ec527c318036a65 Jiri Kosina 2019-05-30 311 return ret;
406f992e4a372da Rafael J. Wysocki 2016-07-14 312 smp_ops.play_dead = resume_play_dead;
565558558985b1d Qais Yousef 2020-04-30 @313 ret = freeze_secondary_cpus(0);
406f992e4a372da Rafael J. Wysocki 2016-07-14 314 smp_ops.play_dead = play_dead;
406f992e4a372da Rafael J. Wysocki 2016-07-14 315 return ret;
406f992e4a372da Rafael J. Wysocki 2016-07-14 316 }
406f992e4a372da Rafael J. Wysocki 2016-07-14 317 #endif
406f992e4a372da Rafael J. Wysocki 2016-07-14 318
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Hi Necip,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.15-rc3 next-20210922]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Necip-Fazil-Yildiran/PM-Kconfig-fix-unmet-dependency-for-PM_SLEEP_SMP/20210929-162901
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a4e6f95a891ac08bd09d62e3e6dae239b150f4c1
config: i386-randconfig-c001-20210929 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/761d2cbd7ffe7612fdc9084465070e008edd48a7
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Necip-Fazil-Yildiran/PM-Kconfig-fix-unmet-dependency-for-PM_SLEEP_SMP/20210929-162901
git checkout 761d2cbd7ffe7612fdc9084465070e008edd48a7
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
arch/x86/power/cpu.c:288:5: warning: no previous prototype for 'hibernate_resume_nonboot_cpu_disable' [-Wmissing-prototypes]
288 | int hibernate_resume_nonboot_cpu_disable(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/power/cpu.c: In function 'hibernate_resume_nonboot_cpu_disable':
>> arch/x86/power/cpu.c:313:8: error: implicit declaration of function 'freeze_secondary_cpus'; did you mean 'thaw_secondary_cpus'? [-Werror=implicit-function-declaration]
313 | ret = freeze_secondary_cpus(0);
| ^~~~~~~~~~~~~~~~~~~~~
| thaw_secondary_cpus
cc1: some warnings being treated as errors
vim +313 arch/x86/power/cpu.c
406f992e4a372d Rafael J. Wysocki 2016-07-14 287
406f992e4a372d Rafael J. Wysocki 2016-07-14 @288 int hibernate_resume_nonboot_cpu_disable(void)
406f992e4a372d Rafael J. Wysocki 2016-07-14 289 {
406f992e4a372d Rafael J. Wysocki 2016-07-14 290 void (*play_dead)(void) = smp_ops.play_dead;
406f992e4a372d Rafael J. Wysocki 2016-07-14 291 int ret;
406f992e4a372d Rafael J. Wysocki 2016-07-14 292
406f992e4a372d Rafael J. Wysocki 2016-07-14 293 /*
406f992e4a372d Rafael J. Wysocki 2016-07-14 294 * Ensure that MONITOR/MWAIT will not be used in the "play dead" loop
406f992e4a372d Rafael J. Wysocki 2016-07-14 295 * during hibernate image restoration, because it is likely that the
406f992e4a372d Rafael J. Wysocki 2016-07-14 296 * monitored address will be actually written to at that time and then
406f992e4a372d Rafael J. Wysocki 2016-07-14 297 * the "dead" CPU will attempt to execute instructions again, but the
406f992e4a372d Rafael J. Wysocki 2016-07-14 298 * address in its instruction pointer may not be possible to resolve
406f992e4a372d Rafael J. Wysocki 2016-07-14 299 * any more at that point (the page tables used by it previously may
406f992e4a372d Rafael J. Wysocki 2016-07-14 300 * have been overwritten by hibernate image data).
ec527c318036a6 Jiri Kosina 2019-05-30 301 *
ec527c318036a6 Jiri Kosina 2019-05-30 302 * First, make sure that we wake up all the potentially disabled SMT
ec527c318036a6 Jiri Kosina 2019-05-30 303 * threads which have been initially brought up and then put into
ec527c318036a6 Jiri Kosina 2019-05-30 304 * mwait/cpuidle sleep.
ec527c318036a6 Jiri Kosina 2019-05-30 305 * Those will be put to proper (not interfering with hibernation
ec527c318036a6 Jiri Kosina 2019-05-30 306 * resume) sleep afterwards, and the resumed kernel will decide itself
ec527c318036a6 Jiri Kosina 2019-05-30 307 * what to do with them.
406f992e4a372d Rafael J. Wysocki 2016-07-14 308 */
ec527c318036a6 Jiri Kosina 2019-05-30 309 ret = cpuhp_smt_enable();
ec527c318036a6 Jiri Kosina 2019-05-30 310 if (ret)
ec527c318036a6 Jiri Kosina 2019-05-30 311 return ret;
406f992e4a372d Rafael J. Wysocki 2016-07-14 312 smp_ops.play_dead = resume_play_dead;
565558558985b1 Qais Yousef 2020-04-30 @313 ret = freeze_secondary_cpus(0);
406f992e4a372d Rafael J. Wysocki 2016-07-14 314 smp_ops.play_dead = play_dead;
406f992e4a372d Rafael J. Wysocki 2016-07-14 315 return ret;
406f992e4a372d Rafael J. Wysocki 2016-07-14 316 }
406f992e4a372d Rafael J. Wysocki 2016-07-14 317 #endif
406f992e4a372d Rafael J. Wysocki 2016-07-14 318
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index 6bfe3ead10ad..0c4aa403e04a 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig @@ -125,6 +125,7 @@ config PM_SLEEP_SMP depends on SMP depends on ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE depends on PM_SLEEP + depends on PPC_PSERIES || PPC_PMAC || PPC_POWERNV || FSL_SOC_BOOKE select HOTPLUG_CPU config PM_SLEEP_SMP_NONZERO_CPU
When PM_SLEEP_SMP is enabled and HOTPLUG_CPU is disabled, it results in the following Kbuild warning: WARNING: unmet direct dependencies detected for HOTPLUG_CPU Depends on [n]: SMP [=y] && (PPC_PSERIES [=n] || PPC_PMAC [=n] || PPC_POWERNV [=n] || FSL_SOC_BOOKE [=n]) Selected by [y]: - PM_SLEEP_SMP [=y] && SMP [=y] && (ARCH_SUSPEND_POSSIBLE [=n] || ARCH_HIBERNATION_POSSIBLE [=y]) && PM_SLEEP [=y] The reason is that PM_SLEEP_SMP selects HOTPLUG_CPU without depending on or selecting HOTPLUG_CPU's dependencies. Let PM_SLEEP_SMP depend on HOTPLUG_CPU's dependencies to avoid Kbuild issues. Signed-off-by: Necip Fazil Yildiran <fazilyildiran@gmail.com> --- v1->v2: * Keep selecting HOTPLUG_CPU by PM_SLEEP_SMP as it needs to be selected automatically, let PM_SLEEP_SMP depend on missing dependencies instead. --- kernel/power/Kconfig | 1 + 1 file changed, 1 insertion(+)