clean up mach_reboot_fixups
PATCH 1/1 clean up mach_reboot_fixups
The reboot_fixups stuff seems to be a bit of a mess, specifically the header is in linux/ when its a purely i386-specific piece of code. I'm not sure why it has its config option; its only currently needed for "geode-gx1/cs5530a", so perhaps whatever config option controls that hardware should enable this?
--- arch/i386/kernel/reboot.c | 6 +++++- arch/i386/kernel/reboot_fixups.c | 2 +- include/asm-i386/reboot_fixups.h | 6 ++++++ include/linux/reboot_fixups.h | 10 ---------- 4 files changed, 12 insertions(+), 12 deletions(-)
===================================================================
arch/i386/kernel/reboot.c +5 -1
@@ -17,7 +17,7 @@#include <asm/apic.h> #include <asm/desc.h> #include "mach_reboot.h" -#include <linux/reboot_fixups.h> +#include <asm/reboot_fixups.h> /* * Power off function, if any
@@ -314,6 +314,10 @@ void machine_shutdown(void)#ifdef CONFIG_X86_IO_APIC disable_IO_APIC ();#endif +} + +void __attribute__((weak))mach_reboot_fixups (void ) +{ }void machine_emergency_restart (void )
===================================================================
arch/i386/kernel/reboot_fixups.c +1 -1
@@ -10,7 +10,7 @@#include <asm/delay.h> #include <linux/pci.h> -#include <linux/reboot_fixups.h> +#include <asm/reboot_fixups.h> static void cs5530a_warm_reset (struct pci_dev *dev) {
===================================================================
include/asm-i386/reboot_fixups.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef _LINUX_REBOOT_FIXUPS_H +#define _LINUX_REBOOT_FIXUPS_H + +extern void mach_reboot_fixups (void ); + +#endif /* _LINUX_REBOOT_FIXUPS_H */
===================================================================
include/linux/reboot_fixups.h deleted +0 -10
@@ -1,10 +0,0 @@ -#ifndef _LINUX_REBOOT_FIXUPS_H -#define _LINUX_REBOOT_FIXUPS_H - -#ifdef CONFIG_X86_REBOOTFIXUPS -extern void mach_reboot_fixups (void ); -#else -#define mach_reboot_fixups () ((void)(0)) -#endif - -#endif /* _LINUX_REBOOT_FIXUPS_H */
Quoted 5 lines · Jeremy Fitzhardinge
The
reboot_fixupsstuff seems to be a bit of a mess, specifically the header is in linux/ when its a purely i386-specific piece of code. I'm not sure why it has its config option; its only currently needed for "geode-gx1/cs5530a", so perhaps whatever config option controls that hardware should enable this?
Thanks. Looks good.
-Andi
Geode cs5530a magic (Was: Re: [PATCH] clean up mach_reboot_fixups)
Quoted 10 lines · Andi Kleen
Quoted 6 lines · Jeremy Fitzhardinge
The
reboot_fixupsstuff seems to be a bit of a mess, specifically the header is in linux/ when its a purely i386-specific piece of code. I'm not sure why it has its config option; its only currently needed for "geode-gx1/cs5530a", so perhaps whatever config option controls that hardware should enable this?Thanks. Looks good.
It looks like a cs5530a is a PATA driver in drivers/ata/pata_cs5530.c. Seems to me the cleanest fix is to register a reboot notifier in the driver and have it do the magic rather than have the special mach_reboot_fixups mechanism at all.
Assuming it needs to be done at all...
Alan? Jaya?
J
Re: Geode cs5530a magic (Was: Re: [PATCH] clean up mach_reboot_fixups)
Quoted 12 lines · Jeremy Fitzhardinge
Quoted 10 lines · Andi Kleen
Quoted 6 lines · Jeremy Fitzhardinge
The
reboot_fixupsstuff seems to be a bit of a mess, specifically the header is in linux/ when its a purely i386-specific piece of code. I'm not sure why it has its config option; its only currently needed for "geode-gx1/cs5530a", so perhaps whatever config option controls that hardware should enable this?Thanks. Looks good.
Quoted 8 lines
It looks like a cs5530a is a PATA driver in
drivers/ata/pata_cs5530.c. Seems to me the cleanest fix is to register a reboot notifier in the driver and have it do the magic rather than have the specialmach_reboot_fixupsmechanism at all.Assuming it needs to be done at all...
Alan? Jaya?
I'm guessing rather it is an embedded setup, then a weird pata thing.
If we want to remove crud from this path we should provide a hook like pm_power_off to handle the reboot case.
This is not the kind of thing that a reboot notifier can be used for. as:
a) reboot notifiers don't get called on all paths to machine_emergency_restart.
b) touching those bits looks like they immediately flip the reset line, so trigger the reboot immediately.
Eric