tobetter / linux

Linux kernel source tree
Other
68 stars 30 forks source link

Linux 5.17.y `drivers/power/reset/odroid-reboot.c` #31

Closed pyavitz closed 2 years ago

pyavitz commented 3 years ago

There appears to be a fail in the following function concerning the ODROID-COMMON: power:reset: Add odroid support commit.

 CC      drivers/power/reset/odroid-reboot.o
drivers/power/reset/odroid-reboot.c: In function ‘odroid_restart_probe’:
drivers/power/reset/odroid-reboot.c:141:3: error: ‘arm_pm_restart’ undeclared (first use in this function); did you mean ‘alarm_restart’?
  141 |   arm_pm_restart = do_odroid_restart;
      |   ^~~~~~~~~~~~~~
      |   alarm_restart
drivers/power/reset/odroid-reboot.c:141:3: note: each undeclared identifier is reported only once for each function it appears in
make[6]: *** [scripts/Makefile.build:271: drivers/power/reset/odroid-reboot.o] Error 1
make[5]: *** [scripts/Makefile.build:514: drivers/power/reset] Error 2
make[4]: *** [scripts/Makefile.build:514: drivers/power] Error 2
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:1851: drivers] Error 2
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
make[1]: *** [scripts/Makefile.package:83: bindeb-pkg] Error 2
make: *** [Makefile:1569: bindeb-pkg] Error 2

When deselected from the defconfig the build completes fine, of course the boards no longer have the ability to reboot correctly. Just thought you would like to know. Thank you!

tobetter commented 3 years ago

Thanks, temporary fix is uploaded. Let me look into this error again later. :) https://github.com/tobetter/linux/commit/522f011d29ad409124450f51f4cd37c03635504c

pyavitz commented 3 years ago

Thank you very much.

pyavitz commented 2 years ago

Branch 5.17.y is missing the following.

diff -Naur a/arch/arm64/include/asm/system_misc.h b/arch/arm64/include/asm/system_misc.h
--- a/arch/arm64/include/asm/system_misc.h  2022-02-27 17:36:33.000000000 -0500
+++ b/arch/arm64/include/asm/system_misc.h  2022-03-03 13:51:34.031068479 -0500
@@ -32,6 +32,8 @@
 struct mm_struct;
 extern void __show_regs(struct pt_regs *);

+extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
+
 #endif /* __ASSEMBLY__ */

 #endif /* __ASM_SYSTEM_MISC_H */
diff -Naur a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
--- a/arch/arm64/kernel/process.c   2022-02-27 17:36:33.000000000 -0500
+++ b/arch/arm64/kernel/process.c   2022-03-03 13:53:35.651284725 -0500
@@ -68,6 +68,8 @@
 void (*pm_power_off)(void);
 EXPORT_SYMBOL_GPL(pm_power_off);

+void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
+
 #ifdef CONFIG_HOTPLUG_CPU
 void arch_cpu_idle_dead(void)
 {
@@ -138,7 +140,10 @@
        efi_reboot(reboot_mode, NULL);

    /* Now call the architecture specific reboot code. */
-   do_kernel_restart(cmd);
+   if (arm_pm_restart)
+       arm_pm_restart(reboot_mode, cmd);
+   else
+       do_kernel_restart(cmd);

    /*
     * Whoops - the architecture was unable to reboot.