* [patch 0/4] i386, x86_64: fix the irqbalance quirk for E7520/E7320/E7525 @ 2006-11-08 1:33 Siddha, Suresh B 2006-11-08 1:36 ` [patch 1/4] add write_pci_config_byte() to direct PCI access routines Siddha, Suresh B 2006-11-08 4:07 ` [patch 0/4] i386, x86_64: fix the irqbalance quirk for E7520/E7320/E7525 Andrew Morton 0 siblings, 2 replies; 12+ messages in thread From: Siddha, Suresh B @ 2006-11-08 1:33 UTC (permalink / raw) To: ak, akpm; +Cc: shaohua.li, linux-kernel, discuss, ashok.raj, suresh.b.siddha Mechanism of selecting physical mode in genapic when cpu hotplug is enabled on x86_64, broke the quirk(quirk_intel_irqbalance()) introduced for working around the transposing interrupt message errata in E7520/E7320/E7525 (revision ID 0x9 and below. errata #23 in http://download.intel.com/design/chipsets/specupdt/30304203.pdf). This errata requires the mode to be in logical flat, so that interrupts can be directed to more than one cpu(and thus use hardware IRQ balancing enabled by BIOS on these platforms). Following four patches fixes this by moving the quirk to early quirk and forcing the x86_64 genapic selection to logical flat on these platforms. Thanks to Shaohua for pointing out the breakage. ^ permalink raw reply [flat|nested] 12+ messages in thread
* [patch 1/4] add write_pci_config_byte() to direct PCI access routines 2006-11-08 1:33 [patch 0/4] i386, x86_64: fix the irqbalance quirk for E7520/E7320/E7525 Siddha, Suresh B @ 2006-11-08 1:36 ` Siddha, Suresh B 2006-11-08 1:40 ` [patch 2/4] introduce the mechanism of disabling cpu hotplug control Siddha, Suresh B 2006-11-08 4:07 ` [patch 0/4] i386, x86_64: fix the irqbalance quirk for E7520/E7320/E7525 Andrew Morton 1 sibling, 1 reply; 12+ messages in thread From: Siddha, Suresh B @ 2006-11-08 1:36 UTC (permalink / raw) To: ak, akpm; +Cc: shaohua.li, linux-kernel, discuss, ashok.raj, suresh.b.siddha Add write_pci_config_byte() to direct PCI access routines Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> --- diff --git a/arch/i386/pci/early.c b/arch/i386/pci/early.c index 713d6c8..42df4b6 100644 --- a/arch/i386/pci/early.c +++ b/arch/i386/pci/early.c @@ -45,6 +45,13 @@ void write_pci_config(u8 bus, u8 slot, u outl(val, 0xcfc); } +void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val) +{ + PDprintk("%x writing to %x: %x\n", slot, offset, val); + outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); + outb(val, 0xcfc); +} + int early_pci_allowed(void) { return (pci_probe & (PCI_PROBE_CONF1|PCI_PROBE_NOEARLY)) == diff --git a/include/asm-x86_64/pci-direct.h b/include/asm-x86_64/pci-direct.h index eba9cb4..6823fa4 100644 --- a/include/asm-x86_64/pci-direct.h +++ b/include/asm-x86_64/pci-direct.h @@ -10,6 +10,7 @@ extern u32 read_pci_config(u8 bus, u8 sl extern u8 read_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset); extern u16 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset); extern void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, u32 val); +extern void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val); extern int early_pci_allowed(void); ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [patch 2/4] introduce the mechanism of disabling cpu hotplug control 2006-11-08 1:36 ` [patch 1/4] add write_pci_config_byte() to direct PCI access routines Siddha, Suresh B @ 2006-11-08 1:40 ` Siddha, Suresh B 2006-11-08 1:43 ` [patch 3/4] x86_64: add genapic_force Siddha, Suresh B 2006-11-08 3:54 ` [patch 2/4] introduce the mechanism of disabling cpu hotplug control Andrew Morton 0 siblings, 2 replies; 12+ messages in thread From: Siddha, Suresh B @ 2006-11-08 1:40 UTC (permalink / raw) To: ak, akpm; +Cc: shaohua.li, linux-kernel, discuss, ashok.raj, suresh.b.siddha Add 'cpu_hotplug_no_control' and when set, the hotplug control file("online") will not be added under /sys/devices/system/cpu/cpuX/ Next patch doing PCI quirks will use this. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> --- diff --git a/arch/i386/kernel/topology.c b/arch/i386/kernel/topology.c index 07d6da3..9b766e7 100644 --- a/arch/i386/kernel/topology.c +++ b/arch/i386/kernel/topology.c @@ -40,14 +40,22 @@ int arch_register_cpu(int num) * restrictions and assumptions in kernel. This basically * doesnt add a control file, one cannot attempt to offline * BSP. + * + * Also certain PCI quirks require to remove this control file + * for all CPU's. */ +#ifdef CONFIG_HOTPLUG_CPU + if (!num || cpu_hotplug_no_control) +#else if (!num) +#endif cpu_devices[num].cpu.no_control = 1; return register_cpu(&cpu_devices[num].cpu, num); } #ifdef CONFIG_HOTPLUG_CPU +int cpu_hotplug_no_control; void arch_unregister_cpu(int num) { return unregister_cpu(&cpu_devices[num].cpu); diff --git a/include/asm-i386/cpu.h b/include/asm-i386/cpu.h index b1bc7b1..3c5da33 100644 --- a/include/asm-i386/cpu.h +++ b/include/asm-i386/cpu.h @@ -13,6 +13,7 @@ struct i386_cpu { extern int arch_register_cpu(int num); #ifdef CONFIG_HOTPLUG_CPU extern void arch_unregister_cpu(int); +extern int cpu_hotplug_no_control; #endif DECLARE_PER_CPU(int, cpu_state); ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [patch 3/4] x86_64: add genapic_force 2006-11-08 1:40 ` [patch 2/4] introduce the mechanism of disabling cpu hotplug control Siddha, Suresh B @ 2006-11-08 1:43 ` Siddha, Suresh B 2006-11-08 1:46 ` [patch 4/4] fix the irqbalance quirk for E7320/E7520/E7525 Siddha, Suresh B 2006-11-08 3:54 ` [patch 2/4] introduce the mechanism of disabling cpu hotplug control Andrew Morton 1 sibling, 1 reply; 12+ messages in thread From: Siddha, Suresh B @ 2006-11-08 1:43 UTC (permalink / raw) To: ak, akpm; +Cc: shaohua.li, linux-kernel, discuss, ashok.raj, suresh.b.siddha Add genapic_force. Used by the next Intel quirks patch. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> --- diff --git a/arch/x86_64/kernel/genapic.c b/arch/x86_64/kernel/genapic.c index 8e78a75..236dc9e 100644 --- a/arch/x86_64/kernel/genapic.c +++ b/arch/x86_64/kernel/genapic.c @@ -33,7 +33,7 @@ extern struct genapic apic_flat; extern struct genapic apic_physflat; struct genapic *genapic = &apic_flat; - +struct genapic *genapic_force; /* * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode. @@ -46,6 +46,14 @@ void __init clustered_apic_check(void) u8 cluster_cnt[NUM_APIC_CLUSTERS]; int max_apic = 0; + /* genapic selection can be forced because of certain quirks and + * in future perhaps user can select this through cmdline + */ + if (genapic_force) { + genapic = genapic_force; + goto print; + } + #if defined(CONFIG_ACPI) /* * Some x86_64 machines use physical APIC mode regardless of how many diff --git a/include/asm-x86_64/genapic.h b/include/asm-x86_64/genapic.h index a0e9a4b..b80f4bb 100644 --- a/include/asm-x86_64/genapic.h +++ b/include/asm-x86_64/genapic.h @@ -30,6 +30,6 @@ struct genapic { }; -extern struct genapic *genapic; +extern struct genapic *genapic, *genapic_force, apic_flat; #endif ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [patch 4/4] fix the irqbalance quirk for E7320/E7520/E7525 2006-11-08 1:43 ` [patch 3/4] x86_64: add genapic_force Siddha, Suresh B @ 2006-11-08 1:46 ` Siddha, Suresh B 0 siblings, 0 replies; 12+ messages in thread From: Siddha, Suresh B @ 2006-11-08 1:46 UTC (permalink / raw) To: ak, akpm; +Cc: shaohua.li, linux-kernel, discuss, ashok.raj, suresh.b.siddha Move the irqbalance quirks for E7320/E7520/E7525(Errata 23 in http://download.intel.com/design/chipsets/specupdt/30304203.pdf) to early quirks. And add a PCI quirk for these platforms to check(which happens very late during the boot) if the APIC routing is indeed set to default flat mode. This fixes the breakage(in x86_64) of this quirk due to cpu hotplug which selects physical mode instead of the logical flat(as needed for this errata workaround). Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> --- diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c index fe799b1..4cdec39 100644 --- a/arch/i386/kernel/acpi/earlyquirk.c +++ b/arch/i386/kernel/acpi/earlyquirk.c @@ -10,6 +10,7 @@ #include <linux/acpi.h> #include <asm/pci-direct.h> #include <asm/acpi.h> #include <asm/apic.h> +#include <asm/irq.h> #ifdef CONFIG_ACPI @@ -43,6 +44,24 @@ #endif return 0; } +static void check_intel(void) +{ + u16 vendor, device; + + vendor = read_pci_config_16(0, 0, 0, PCI_VENDOR_ID); + + if (vendor != PCI_VENDOR_ID_INTEL) + return; + + device = read_pci_config_16(0, 0, 0, PCI_DEVICE_ID); +#ifdef CONFIG_SMP + if (device == PCI_DEVICE_ID_INTEL_E7320_MCH || + device == PCI_DEVICE_ID_INTEL_E7520_MCH || + device == PCI_DEVICE_ID_INTEL_E7525_MCH) + quirk_intel_irqbalance(); +#endif +} + void __init check_acpi_pci(void) { int num, slot, func; @@ -54,6 +73,8 @@ void __init check_acpi_pci(void) if (!early_pci_allowed()) return; + check_intel(); + /* Poor man's PCI discovery */ for (num = 0; num < 32; num++) { for (slot = 0; slot < 32; slot++) { diff --git a/arch/i386/kernel/quirks.c b/arch/i386/kernel/quirks.c index 9f6ab17..fd8c68c 100644 --- a/arch/i386/kernel/quirks.c +++ b/arch/i386/kernel/quirks.c @@ -3,10 +3,28 @@ */ #include <linux/pci.h> #include <linux/irq.h> +#include <asm/pci-direct.h> +#include <asm/genapic.h> +#include <asm/cpu.h> #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI) +static void __devinit verify_quirk_intel_irqbalance(struct pci_dev *dev) +{ +#ifdef CONFIG_X86_64 + if (genapic != &apic_flat) { + printk(KERN_WARNING "APIC mode must be flat on this system\n"); + BUG(); + } +#else + if (genapic != &apic_default) { + printk(KERN_WARNING + "APIC mode must be default(flat) on this system. Use apic=default\n"); + BUG(); + } +#endif +} -static void __devinit quirk_intel_irqbalance(struct pci_dev *dev) +void __init quirk_intel_irqbalance(void) { u8 config, rev; u32 word; @@ -16,18 +34,18 @@ static void __devinit quirk_intel_irqbal * based platforms. * Disable SW irqbalance/affinity on those platforms. */ - pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev); + rev = read_pci_config_byte(0, 0, 0, PCI_CLASS_REVISION); if (rev > 0x9) return; printk(KERN_INFO "Intel E7520/7320/7525 detected."); - /* enable access to config space*/ - pci_read_config_byte(dev, 0xf4, &config); - pci_write_config_byte(dev, 0xf4, config|0x2); + /* enable access to config space */ + config = read_pci_config_byte(0, 0, 0, 0xf4); + write_pci_config_byte(0, 0, 0, 0xf4, config|0x2); /* read xTPR register */ - raw_pci_ops->read(0, 0, 0x40, 0x4c, 2, &word); + word = read_pci_config_16(0, 0, 0x40, 0x4c); if (!(word & (1 << 13))) { printk(KERN_INFO "Disabling irq balancing and affinity\n"); @@ -38,13 +56,24 @@ #endif #ifdef CONFIG_PROC_FS no_irq_affinity = 1; #endif +#ifdef CONFIG_HOTPLUG_CPU + printk(KERN_INFO "Disabling cpu hotplug control\n"); + cpu_hotplug_no_control = 1; +#endif +#ifdef CONFIG_X86_64 + /* force the genapic selection to flat mode so that + * interrupts can be redirected to more than one CPU. + */ + genapic_force = &apic_flat; +#endif } - /* put back the original value for config space*/ + /* put back the original value for config space */ if (!(config & 0x2)) - pci_write_config_byte(dev, 0xf4, config); + write_pci_config_byte(0, 0, 0, 0xf4, config); } -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, quirk_intel_irqbalance); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quirk_intel_irqbalance); -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7520_MCH, quirk_intel_irqbalance); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, verify_quirk_intel_irqbalance); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, verify_quirk_intel_irqbalance); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7520_MCH, verify_quirk_intel_irqbalance); + #endif diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index 4bb8b77..79bc607 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c @@ -52,6 +52,7 @@ #include <asm/tlbflush.h> #include <asm/desc.h> #include <asm/arch_hooks.h> #include <asm/nmi.h> +#include <asm/genapic.h> #include <mach_apic.h> #include <mach_wakecpu.h> @@ -1461,6 +1462,13 @@ #endif cpu_set(cpu, smp_commenced_mask); while (!cpu_isset(cpu, cpu_online_map)) cpu_relax(); + + if (num_online_cpus() > 8 && genapic == &apic_default) { + printk(KERN_WARNING + "Default flat APIC routing can't be used with > 8 cpus\n"); + BUG(); + } + return 0; } diff --git a/arch/x86_64/kernel/early-quirks.c b/arch/x86_64/kernel/early-quirks.c index 2b1245d..a644663 100644 --- a/arch/x86_64/kernel/early-quirks.c +++ b/arch/x86_64/kernel/early-quirks.c @@ -68,6 +68,18 @@ static void ati_bugs(void) } } +static void intel_bugs(void) +{ + u16 device = read_pci_config_16(0, 0, 0, PCI_DEVICE_ID); + +#ifdef CONFIG_SMP + if (device == PCI_DEVICE_ID_INTEL_E7320_MCH || + device == PCI_DEVICE_ID_INTEL_E7520_MCH || + device == PCI_DEVICE_ID_INTEL_E7525_MCH) + quirk_intel_irqbalance(); +#endif +} + struct chipset { u16 vendor; void (*f)(void); @@ -77,6 +89,7 @@ static struct chipset early_qrk[] = { { PCI_VENDOR_ID_NVIDIA, nvidia_bugs }, { PCI_VENDOR_ID_VIA, via_bugs }, { PCI_VENDOR_ID_ATI, ati_bugs }, + { PCI_VENDOR_ID_INTEL, intel_bugs}, {} }; diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index 62c2e74..4c161c2 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c @@ -60,6 +60,7 @@ #include <asm/nmi.h> #include <asm/irq.h> #include <asm/hw_irq.h> #include <asm/numa.h> +#include <asm/genapic.h> /* Number of siblings per CPU package */ int smp_num_siblings = 1; @@ -1167,6 +1168,13 @@ int __cpuinit __cpu_up(unsigned int cpu) while (!cpu_isset(cpu, cpu_online_map)) cpu_relax(); + + if (num_online_cpus() > 8 && genapic == &apic_flat) { + printk(KERN_WARNING + "flat APIC routing can't be used with > 8 cpus\n"); + BUG(); + } + err = 0; return err; diff --git a/include/asm-i386/genapic.h b/include/asm-i386/genapic.h index 8ffbb0f..fd2be59 100644 --- a/include/asm-i386/genapic.h +++ b/include/asm-i386/genapic.h @@ -122,6 +122,6 @@ #define APIC_INIT(aname, aprobe) { \ APICFUNC(phys_pkg_id) \ } -extern struct genapic *genapic; +extern struct genapic *genapic, apic_default; #endif diff --git a/include/asm-i386/irq.h b/include/asm-i386/irq.h index 331726b..c35dc8e 100644 --- a/include/asm-i386/irq.h +++ b/include/asm-i386/irq.h @@ -37,6 +37,8 @@ #ifdef CONFIG_IRQBALANCE extern int irqbalance_disable(char *str); #endif +extern void quirk_intel_irqbalance(void); + #ifdef CONFIG_HOTPLUG_CPU extern void fixup_irqs(cpumask_t map); #endif diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index e72cfcd..3b6a4ec 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h @@ -88,6 +88,7 @@ extern void syscall32_cpu_init(void); extern void setup_node_bootmem(int nodeid, unsigned long start, unsigned long end); extern void early_quirks(void); +extern void quirk_intel_irqbalance(void); extern void check_efer(void); extern int unhandled_signal(struct task_struct *tsk, int sig); ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [patch 2/4] introduce the mechanism of disabling cpu hotplug control 2006-11-08 1:40 ` [patch 2/4] introduce the mechanism of disabling cpu hotplug control Siddha, Suresh B 2006-11-08 1:43 ` [patch 3/4] x86_64: add genapic_force Siddha, Suresh B @ 2006-11-08 3:54 ` Andrew Morton 2006-11-08 4:01 ` Siddha, Suresh B 1 sibling, 1 reply; 12+ messages in thread From: Andrew Morton @ 2006-11-08 3:54 UTC (permalink / raw) To: Siddha, Suresh B; +Cc: ak, shaohua.li, linux-kernel, discuss, ashok.raj On Tue, 7 Nov 2006 17:40:25 -0800 "Siddha, Suresh B" <suresh.b.siddha@intel.com> wrote: > Add 'cpu_hotplug_no_control' and when set, the hotplug control file("online") > will not be added under /sys/devices/system/cpu/cpuX/ > > Next patch doing PCI quirks will use this. > I don't understand what this (ugly) patch has to do with the overall bugfix. We're fixing the APCI initialisation - what does that have to do with presenting cpu-hotplug files in sysfs? > --- > > diff --git a/arch/i386/kernel/topology.c b/arch/i386/kernel/topology.c > index 07d6da3..9b766e7 100644 > --- a/arch/i386/kernel/topology.c > +++ b/arch/i386/kernel/topology.c > @@ -40,14 +40,22 @@ int arch_register_cpu(int num) > * restrictions and assumptions in kernel. This basically > * doesnt add a control file, one cannot attempt to offline > * BSP. > + * > + * Also certain PCI quirks require to remove this control file > + * for all CPU's. > */ > +#ifdef CONFIG_HOTPLUG_CPU > + if (!num || cpu_hotplug_no_control) > +#else > if (!num) > +#endif This ifdef could be removed > cpu_devices[num].cpu.no_control = 1; > > return register_cpu(&cpu_devices[num].cpu, num); > } > > #ifdef CONFIG_HOTPLUG_CPU > +int cpu_hotplug_no_control; > > void arch_unregister_cpu(int num) { > return unregister_cpu(&cpu_devices[num].cpu); > diff --git a/include/asm-i386/cpu.h b/include/asm-i386/cpu.h > index b1bc7b1..3c5da33 100644 > --- a/include/asm-i386/cpu.h > +++ b/include/asm-i386/cpu.h > @@ -13,6 +13,7 @@ struct i386_cpu { > extern int arch_register_cpu(int num); > #ifdef CONFIG_HOTPLUG_CPU > extern void arch_unregister_cpu(int); > +extern int cpu_hotplug_no_control; via: #else #define cpu_hotplug_no_control 1 here. But does this variable _have_ to be a negative like this? The code would be simpler if it had the opposite sense and was called, say, cpu_hotplug_enable_control_file. Are these patches considered 2.6.19 material? They look a bit big, ugly and scary for that. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch 2/4] introduce the mechanism of disabling cpu hotplug control 2006-11-08 3:54 ` [patch 2/4] introduce the mechanism of disabling cpu hotplug control Andrew Morton @ 2006-11-08 4:01 ` Siddha, Suresh B 2006-11-08 4:35 ` Andrew Morton 0 siblings, 1 reply; 12+ messages in thread From: Siddha, Suresh B @ 2006-11-08 4:01 UTC (permalink / raw) To: Andrew Morton Cc: Siddha, Suresh B, ak, shaohua.li, linux-kernel, discuss, ashok.raj On Tue, Nov 07, 2006 at 07:54:30PM -0800, Andrew Morton wrote: > On Tue, 7 Nov 2006 17:40:25 -0800 > "Siddha, Suresh B" <suresh.b.siddha@intel.com> wrote: > > > Add 'cpu_hotplug_no_control' and when set, the hotplug control file("online") > > will not be added under /sys/devices/system/cpu/cpuX/ > > > > Next patch doing PCI quirks will use this. > > > > I don't understand what this (ugly) patch has to do with the overall > bugfix. We're fixing the APCI initialisation - what does that have to do > with presenting cpu-hotplug files in sysfs? This patch is adding a mechanism which will not export the cpu hotplug control file. And the quirk will use this from preventing the users doing cpu hotplug. On these platforms, we need to have atleast 2 cpus online to workaround the errata. In future we can use this mechanism to disable cpu hotplug during bootup. > But does this variable _have_ to be a negative like this? The code would > be simpler if it had the opposite sense and was called, say, > cpu_hotplug_enable_control_file. I wanted to add something like disable_cpu_hotplug.. but suspend code seems to be already using.. Will clean this up. > Are these patches considered 2.6.19 material? They look a bit big, ugly > and scary for that. Though no one reported failures so far, it would be good to get included in 2.6.19. If it is too late and sounds scary, we can consider in -stable after spending sometime in -mm.. thanks, suresh ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch 2/4] introduce the mechanism of disabling cpu hotplug control 2006-11-08 4:01 ` Siddha, Suresh B @ 2006-11-08 4:35 ` Andrew Morton 2006-11-08 5:23 ` Siddha, Suresh B 0 siblings, 1 reply; 12+ messages in thread From: Andrew Morton @ 2006-11-08 4:35 UTC (permalink / raw) To: Siddha, Suresh B; +Cc: ak, shaohua.li, linux-kernel, discuss, ashok.raj On Tue, 7 Nov 2006 20:01:34 -0800 "Siddha, Suresh B" <suresh.b.siddha@intel.com> wrote: > I wanted to add something like disable_cpu_hotplug My point is, `enable_cpu_hotplug' is nicer if (enable_cpu_hotplug) ... if (!enable_cpu_hotplug) ... versus if (disable_cpu_hotplug) ... if (!disable_cpu_hotplug) ... /* My brain hurts */ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch 2/4] introduce the mechanism of disabling cpu hotplug control 2006-11-08 4:35 ` Andrew Morton @ 2006-11-08 5:23 ` Siddha, Suresh B 2006-11-11 0:43 ` [patch] change the 'no_control' field to 'hotpluggable' in the struct cpu Siddha, Suresh B 0 siblings, 1 reply; 12+ messages in thread From: Siddha, Suresh B @ 2006-11-08 5:23 UTC (permalink / raw) To: Andrew Morton Cc: Siddha, Suresh B, ak, shaohua.li, linux-kernel, discuss, ashok.raj On Tue, Nov 07, 2006 at 08:35:04PM -0800, Andrew Morton wrote: > On Tue, 7 Nov 2006 20:01:34 -0800 > "Siddha, Suresh B" <suresh.b.siddha@intel.com> wrote: > > > I wanted to add something like disable_cpu_hotplug > > My point is, `enable_cpu_hotplug' is nicer Yep. I got it and hence my "will clean this up" assurance :) This is all coming from the `no_control' member in cpu structure and I will change that to something like `hotpluggable'. That will make the patch slightly big but def clean. thanks, suresh ^ permalink raw reply [flat|nested] 12+ messages in thread
* [patch] change the 'no_control' field to 'hotpluggable' in the struct cpu 2006-11-08 5:23 ` Siddha, Suresh B @ 2006-11-11 0:43 ` Siddha, Suresh B 0 siblings, 0 replies; 12+ messages in thread From: Siddha, Suresh B @ 2006-11-11 0:43 UTC (permalink / raw) To: akpm; +Cc: linux-kernel, ashok.raj, tony.luck, paulus, ak On Tue, Nov 07, 2006 at 09:23:32PM -0800, Siddha, Suresh B wrote: > On Tue, Nov 07, 2006 at 08:35:04PM -0800, Andrew Morton wrote: > > "Siddha, Suresh B" <suresh.b.siddha@intel.com> wrote: > > > > > I wanted to add something like disable_cpu_hotplug > > > > My point is, `enable_cpu_hotplug' is nicer > > Yep. I got it and hence my "will clean this up" assurance :) > > This is all coming from the `no_control' member in cpu structure and I will > change that to something like `hotpluggable'. That will make the patch slightly > big but def clean. Andrew, Appended the cleanup patch which goes on top of your -mm tree. Please apply. Thanks. --- Change the 'no_control' field in the cpu struct to a more positive and better term 'hotpluggable'. And change(/cleanup) the logic accordingly. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> --- diff --git a/arch/i386/kernel/topology.c b/arch/i386/kernel/topology.c index 844c08f..79cf608 100644 --- a/arch/i386/kernel/topology.c +++ b/arch/i386/kernel/topology.c @@ -44,8 +44,8 @@ int arch_register_cpu(int num) * Also certain PCI quirks require not to enable hotplug control * for all CPU's. */ - if (!num || !enable_cpu_hotplug) - cpu_devices[num].cpu.no_control = 1; + if (num && enable_cpu_hotplug) + cpu_devices[num].cpu.hotpluggable = 1; return register_cpu(&cpu_devices[num].cpu, num); } diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c index 5629b45..687500d 100644 --- a/arch/ia64/kernel/topology.c +++ b/arch/ia64/kernel/topology.c @@ -31,11 +31,11 @@ int arch_register_cpu(int num) { #if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU) /* - * If CPEI cannot be re-targetted, and this is - * CPEI target, then dont create the control file + * If CPEI can be re-targetted or if this is not + * CPEI target, then it is hotpluggable */ - if (!can_cpei_retarget() && is_cpu_cpei_target(num)) - sysfs_cpus[num].cpu.no_control = 1; + if (can_cpei_retarget() || !is_cpu_cpei_target(num)) + sysfs_cpus[num].cpu.hotpluggable = 1; map_cpu_to_node(num, node_cpuid[num].nid); #endif diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index d45a168..bf65a15 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c @@ -240,7 +240,7 @@ static void unregister_cpu_online(unsign struct cpu *c = &per_cpu(cpu_devices, cpu); struct sys_device *s = &c->sysdev; - BUG_ON(c->no_control); + BUG_ON(!c->hotpluggable); #ifndef CONFIG_PPC_ISERIES if (cpu_has_feature(CPU_FTR_SMT)) @@ -360,10 +360,10 @@ static int __init topology_init(void) * CPU. For instance, the boot cpu might never be valid * for hotplugging. */ - if (!ppc_md.cpu_die) - c->no_control = 1; + if (ppc_md.cpu_die) + c->hotpluggable = 1; - if (cpu_online(cpu) || (c->no_control == 0)) { + if (cpu_online(cpu) || c->hotpluggable) { register_cpu(c, cpu); sysdev_create_file(&c->sysdev, &attr_physical_id); diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 4bef76a..d00c67c 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -103,8 +103,8 @@ #endif /* * register_cpu - Setup a driverfs device for a CPU. - * @cpu - Callers can set the cpu->no_control field to 1, to indicate not to - * generate a control file in sysfs for this CPU. + * @cpu - cpu->hotpluggable field set to 1 will generate a control file in + * sysfs for this CPU. * @num - CPU number to use when creating the device. * * Initialize and register the CPU device. @@ -118,7 +118,7 @@ int __devinit register_cpu(struct cpu *c error = sysdev_register(&cpu->sysdev); - if (!error && !cpu->no_control) + if (!error && cpu->hotpluggable) register_cpu_control(cpu); if (!error) cpu_sys_devices[num] = &cpu->sysdev; diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 3fef7d6..a1fd791 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -27,7 +27,7 @@ #include <asm/semaphore.h> struct cpu { int node_id; /* The node which contains the CPU */ - int no_control; /* Should the sysfs control file be created? */ + int hotpluggable; /* creates sysfs control file if hotpluggable */ struct sys_device sysdev; }; ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [patch 0/4] i386, x86_64: fix the irqbalance quirk for E7520/E7320/E7525 2006-11-08 1:33 [patch 0/4] i386, x86_64: fix the irqbalance quirk for E7520/E7320/E7525 Siddha, Suresh B 2006-11-08 1:36 ` [patch 1/4] add write_pci_config_byte() to direct PCI access routines Siddha, Suresh B @ 2006-11-08 4:07 ` Andrew Morton 2006-11-08 4:06 ` Siddha, Suresh B 1 sibling, 1 reply; 12+ messages in thread From: Andrew Morton @ 2006-11-08 4:07 UTC (permalink / raw) To: Siddha, Suresh B; +Cc: ak, shaohua.li, linux-kernel, discuss, ashok.raj On Tue, 7 Nov 2006 17:33:06 -0800 "Siddha, Suresh B" <suresh.b.siddha@intel.com> wrote: > Mechanism of selecting physical mode in genapic when cpu hotplug is enabled > on x86_64, broke the quirk(quirk_intel_irqbalance()) introduced for working > around the transposing interrupt message errata in E7520/E7320/E7525 > (revision ID 0x9 and below. errata #23 in > http://download.intel.com/design/chipsets/specupdt/30304203.pdf). > > This errata requires the mode to be in logical flat, so that interrupts > can be directed to more than one cpu(and thus use hardware IRQ balancing > enabled by BIOS on these platforms). > > Following four patches fixes this by moving the quirk to early quirk > and forcing the x86_64 genapic selection to logical flat on these platforms. > > Thanks to Shaohua for pointing out the breakage. It blew up with the first config I tried (http://userweb.kernel.org/~akpm/config-vmm.txt): arch/i386/kernel/built-in.o: In function `verify_quirk_intel_irqbalance': arch/i386/kernel/quirks.c:19: undefined reference to `genapic' arch/i386/kernel/quirks.c:19: undefined reference to `apic_default' arch/i386/kernel/built-in.o: In function `__cpu_up': arch/i386/kernel/smpboot.c:1487: undefined reference to `genapic' arch/i386/kernel/smpboot.c:1487: undefined reference to `apic_default' The dependencies in the code which you're touching here are really really complex and fragile. One needs to review the change very carefully and test it exhaustively. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch 0/4] i386, x86_64: fix the irqbalance quirk for E7520/E7320/E7525 2006-11-08 4:07 ` [patch 0/4] i386, x86_64: fix the irqbalance quirk for E7520/E7320/E7525 Andrew Morton @ 2006-11-08 4:06 ` Siddha, Suresh B 0 siblings, 0 replies; 12+ messages in thread From: Siddha, Suresh B @ 2006-11-08 4:06 UTC (permalink / raw) To: Andrew Morton Cc: Siddha, Suresh B, ak, shaohua.li, linux-kernel, discuss, ashok.raj On Tue, Nov 07, 2006 at 08:07:02PM -0800, Andrew Morton wrote: > arch/i386/kernel/built-in.o: In function `verify_quirk_intel_irqbalance': > arch/i386/kernel/quirks.c:19: undefined reference to `genapic' > arch/i386/kernel/quirks.c:19: undefined reference to `apic_default' > arch/i386/kernel/built-in.o: In function `__cpu_up': > arch/i386/kernel/smpboot.c:1487: undefined reference to `genapic' > arch/i386/kernel/smpboot.c:1487: undefined reference to `apic_default' > > The dependencies in the code which you're touching here are really really > complex and fragile. One needs to review the change very carefully and > test it exhaustively. oops. I did compile and boot with 6 x86/x86_64 configs.. Seems something is broken in my git test tree. Let me fix and getback to you. thanks, suresh ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-11-11 1:06 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-11-08 1:33 [patch 0/4] i386, x86_64: fix the irqbalance quirk for E7520/E7320/E7525 Siddha, Suresh B 2006-11-08 1:36 ` [patch 1/4] add write_pci_config_byte() to direct PCI access routines Siddha, Suresh B 2006-11-08 1:40 ` [patch 2/4] introduce the mechanism of disabling cpu hotplug control Siddha, Suresh B 2006-11-08 1:43 ` [patch 3/4] x86_64: add genapic_force Siddha, Suresh B 2006-11-08 1:46 ` [patch 4/4] fix the irqbalance quirk for E7320/E7520/E7525 Siddha, Suresh B 2006-11-08 3:54 ` [patch 2/4] introduce the mechanism of disabling cpu hotplug control Andrew Morton 2006-11-08 4:01 ` Siddha, Suresh B 2006-11-08 4:35 ` Andrew Morton 2006-11-08 5:23 ` Siddha, Suresh B 2006-11-11 0:43 ` [patch] change the 'no_control' field to 'hotpluggable' in the struct cpu Siddha, Suresh B 2006-11-08 4:07 ` [patch 0/4] i386, x86_64: fix the irqbalance quirk for E7520/E7320/E7525 Andrew Morton 2006-11-08 4:06 ` Siddha, Suresh B
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox