From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@linux-foundation.org>, ak@suse.de
Cc: linux-kernel@vger.kernel.org, Jeremy Fitzhardinge <jeremy@xensource.com>
Subject: [2.6 patch] remove the config option for the cs5530a_warm_reset() quirk
Date: Sat, 31 Mar 2007 22:55:30 +0200 [thread overview]
Message-ID: <20070331205530.GZ14134@stusta.de> (raw)
In-Reply-To: <20070330010559.2a232d9a.akpm@linux-foundation.org>
On Fri, Mar 30, 2007 at 01:05:59AM -0700, Andrew Morton wrote:
>...
> Changes since 2.6.21-rc5-mm2:
>...
> +x86_64-mm-clean-up-mach_reboot_fixups.patch
>...
> A few x86 updates
>...
OMG - I'll never understand how someone could initially start doing this
hiding of a small fixup behind a config option.
Instead of cleaning up this mess, please replace this patch with the
patch below.
cu
Adrian
<-- snip -->
A config option for hiding one small hardware specific fixup is overkill.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
arch/i386/Kconfig | 18 ----------
arch/i386/kernel/Makefile | 1
arch/i386/kernel/reboot.c | 43 +++++++++++++++++++++++-
arch/i386/kernel/reboot_fixups.c | 55 -------------------------------
include/linux/reboot_fixups.h | 10 -----
5 files changed, 42 insertions(+), 85 deletions(-)
--- linux-2.6.21-rc5-mm3/arch/i386/Kconfig.old 2007-03-31 20:50:28.000000000 +0200
+++ linux-2.6.21-rc5-mm3/arch/i386/Kconfig 2007-03-31 20:50:43.000000000 +0200
@@ -426,24 +426,6 @@
Say Y if you intend to run this kernel on a Dell Inspiron 8000.
Say N otherwise.
-config X86_REBOOTFIXUPS
- bool "Enable X86 board specific fixups for reboot"
- depends on X86
- default n
- ---help---
- This enables chipset and/or board specific fixups to be done
- in order to get reboot to work correctly. This is only needed on
- some combinations of hardware and BIOS. The symptom, for which
- this config is intended, is when reboot ends with a stalled/hung
- system.
-
- Currently, the only fixup is for the Geode GX1/CS5530A/TROM2.1.
- combination.
-
- Say Y if you want to enable the fixup. Currently, it's safe to
- enable this option even if you don't need it.
- Say N otherwise.
-
config MICROCODE
tristate "/dev/cpu/microcode - Intel IA32 CPU microcode support"
select FW_LOADER
--- linux-2.6.21-rc5-mm3/arch/i386/kernel/Makefile.old 2007-03-31 20:51:03.000000000 +0200
+++ linux-2.6.21-rc5-mm3/arch/i386/kernel/Makefile 2007-03-31 20:51:28.000000000 +0200
@@ -23,7 +23,6 @@
obj-$(CONFIG_X86_MPPARSE) += mpparse.o
obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
obj-$(CONFIG_X86_IO_APIC) += io_apic.o
-obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups.o
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
obj-$(CONFIG_X86_NUMAQ) += numaq.o
--- linux-2.6.21-rc5-mm3/arch/i386/kernel/reboot.c.old 2007-03-31 20:52:12.000000000 +0200
+++ linux-2.6.21-rc5-mm3/arch/i386/kernel/reboot.c 2007-03-31 21:20:18.000000000 +0200
@@ -13,11 +13,11 @@
#include <linux/ctype.h>
#include <linux/pm.h>
#include <linux/reboot.h>
+#include <linux/pci.h>
#include <asm/uaccess.h>
#include <asm/apic.h>
#include <asm/desc.h>
#include "mach_reboot.h"
-#include <linux/reboot_fixups.h>
/*
* Power off function, if any
@@ -314,6 +314,47 @@
#endif
}
+static void cs5530a_warm_reset(struct pci_dev *dev)
+{
+ /* writing 1 to the reset control register, 0x44 causes the
+ cs5530a to perform a system warm reset */
+ pci_write_config_byte(dev, 0x44, 0x1);
+ udelay(50); /* shouldn't get here but be safe and spin-a-while */
+ return;
+}
+
+struct device_fixup {
+ unsigned int vendor;
+ unsigned int device;
+ void (*reboot_fixup)(struct pci_dev *);
+};
+
+static struct device_fixup fixups_table[] = {
+{ PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, cs5530a_warm_reset },
+};
+
+/*
+ * we see if any fixup is available for our current hardware. if there
+ * is a fixup, we call it and we expect to never return from it. if we
+ * do return, we keep looking and then eventually fall back to the
+ * standard mach_reboot on return.
+ */
+static void mach_reboot_fixups(void)
+{
+ struct device_fixup *cur;
+ struct pci_dev *dev;
+ int i;
+
+ for (i=0; i < ARRAY_SIZE(fixups_table); i++) {
+ cur = &(fixups_table[i]);
+ dev = pci_get_device(cur->vendor, cur->device, NULL);
+ if (!dev)
+ continue;
+
+ cur->reboot_fixup(dev);
+ }
+}
+
void machine_emergency_restart(void)
{
if (!reboot_thru_bios) {
--- linux-2.6.21-rc5-mm3/include/linux/reboot_fixups.h 2007-03-31 20:45:40.000000000 +0200
+++ /dev/null 2006-09-19 00:45:31.000000000 +0200
@@ -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 */
--- linux-2.6.21-rc5-mm3/arch/i386/kernel/reboot_fixups.c 2007-03-31 20:45:40.000000000 +0200
+++ /dev/null 2006-09-19 00:45:31.000000000 +0200
@@ -1,55 +0,0 @@
-/*
- * linux/arch/i386/kernel/reboot_fixups.c
- *
- * This is a good place to put board specific reboot fixups.
- *
- * List of supported fixups:
- * geode-gx1/cs5530a - Jaya Kumar <jayalk@intworks.biz>
- *
- */
-
-#include <asm/delay.h>
-#include <linux/pci.h>
-#include <linux/reboot_fixups.h>
-
-static void cs5530a_warm_reset(struct pci_dev *dev)
-{
- /* writing 1 to the reset control register, 0x44 causes the
- cs5530a to perform a system warm reset */
- pci_write_config_byte(dev, 0x44, 0x1);
- udelay(50); /* shouldn't get here but be safe and spin-a-while */
- return;
-}
-
-struct device_fixup {
- unsigned int vendor;
- unsigned int device;
- void (*reboot_fixup)(struct pci_dev *);
-};
-
-static struct device_fixup fixups_table[] = {
-{ PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, cs5530a_warm_reset },
-};
-
-/*
- * we see if any fixup is available for our current hardware. if there
- * is a fixup, we call it and we expect to never return from it. if we
- * do return, we keep looking and then eventually fall back to the
- * standard mach_reboot on return.
- */
-void mach_reboot_fixups(void)
-{
- struct device_fixup *cur;
- struct pci_dev *dev;
- int i;
-
- for (i=0; i < ARRAY_SIZE(fixups_table); i++) {
- cur = &(fixups_table[i]);
- dev = pci_get_device(cur->vendor, cur->device, NULL);
- if (!dev)
- continue;
-
- cur->reboot_fixup(dev);
- }
-}
-
next prev parent reply other threads:[~2007-03-31 20:55 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-30 8:05 2.6.21-rc5-mm3 Andrew Morton
2007-03-30 11:00 ` 2.6.21-rc5-mm3 Rafael J. Wysocki
2007-03-30 16:31 ` 2.6.21-rc5-mm3 Michal Piotrowski
2007-03-30 16:55 ` 2.6.21-rc5-mm3 Ingo Molnar
2007-03-30 17:19 ` 2.6.21-rc5-mm3 Michal Piotrowski
2007-03-30 16:38 ` 2.6.21-rc5-mm3 Dmitry Torokhov
2007-03-30 16:59 ` 2.6.21-rc5-mm3 Andrew Morton
2007-03-30 17:23 ` 2.6.21-rc5-mm3 Valdis.Kletnieks
2007-03-30 18:58 ` 2.6.21-rc5-mm3 Johannes Berg
2007-03-31 7:12 ` 2.6.21-rc5-mm3 - no boot, "address not 2M aligned" Helge Hafting
2007-03-31 7:53 ` Andrew Morton
2007-03-31 8:14 ` Eric W. Biederman
2007-04-09 22:09 ` Helge Hafting
2007-04-10 4:48 ` Helge Hafting
2007-04-01 5:29 ` thunder7
2007-04-01 6:15 ` Eric W. Biederman
2007-04-01 6:29 ` Andrew Morton
2007-04-02 7:41 ` Vivek Goyal
2007-04-02 8:43 ` Eric W. Biederman
2007-04-02 9:45 ` Vivek Goyal
2007-04-02 17:26 ` Eric W. Biederman
2007-04-03 4:01 ` Vivek Goyal
2007-04-03 5:23 ` Eric W. Biederman
2007-04-03 10:03 ` Vivek Goyal
2007-04-23 5:12 ` [PATCH 1/2] x86_64: Reflect the relocatability of the kernel in the ELF header Eric W. Biederman
2007-04-23 5:15 ` [PATCH 2/2] x86_64: Remove CONFIG_PHYSICAL_START and CONFIG_RELOCATABLE Eric W. Biederman
2007-04-23 6:07 ` Vivek Goyal
2007-04-23 6:17 ` Eric W. Biederman
2007-04-23 6:25 ` Vivek Goyal
2007-04-24 6:31 ` [PATCH 1/2] x86_64: Reflect the relocatability of the kernel in the ELF header Vivek Goyal
2007-04-24 7:21 ` Eric W. Biederman
2007-04-02 11:17 ` 2.6.21-rc5-mm3 - no boot, "address not 2M aligned" thunder7
2007-04-02 11:36 ` Vivek Goyal
2007-04-02 14:49 ` thunder7
2007-04-02 14:59 ` thunder7
2007-04-03 4:05 ` Vivek Goyal
2007-03-31 8:05 ` 2.6.21-rc5-mm3 - cpuidle, acpi, and C-states Valdis.Kletnieks
2007-03-31 19:25 ` 2.6.21-rc5-mm3: Why was my vioc cleanup patch dropped? Adrian Bunk
2007-03-31 20:48 ` [-mm patch] make drivers/ata/pata_ali.c:ali_tf_load() static Adrian Bunk
2007-04-01 16:21 ` Tejun Heo
2007-03-31 20:55 ` Adrian Bunk [this message]
2007-03-31 21:05 ` [2.6 patch] remove the config option for the cs5530a_warm_reset() quirk Jeremy Fitzhardinge
2007-03-31 21:11 ` Adrian Bunk
2007-03-31 21:17 ` Jeremy Fitzhardinge
2007-03-31 20:55 ` [-mm patch] make drivers/net/qla3xxx.c:PHY_DEVICES[] static Adrian Bunk
2007-04-04 2:34 ` Jeff Garzik
2007-03-31 20:55 ` [-mm patch] make struct proc_fdinfo_file_operations static Adrian Bunk
2007-04-01 16:00 ` 2.6.21-rc5-mm3 Michal Piotrowski
2007-04-01 19:03 ` 2.6.21-rc5-mm3 Andrew Morton
2007-04-01 20:39 ` 2.6.21-rc5-mm3 Rafael J. Wysocki
2007-04-01 20:56 ` 2.6.21-rc5-mm3 Rafael J. Wysocki
2007-04-01 21:59 ` 2.6.21-rc5-mm3 Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070331205530.GZ14134@stusta.de \
--to=bunk@stusta.de \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=jeremy@xensource.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox