2010-02-13 01:43:26

by Jacob Pan

[permalink] [raw]
Subject: [PATCH 5/9] x86/ioapic: improve handling of i8259a irq init

>From ab3ae105e88342a26e4a1d46d6dcdff2fb7970fe Mon Sep 17 00:00:00 2001
From: Alek Du <[email protected]>
Date: Mon, 7 Sep 2009 16:25:45 +0800
Subject: [PATCH 5/9] x86/ioapic: improve handling of i8259a irq init

Since we already track the number of legacy vectors by nr_legacy_irqs, we
can avoid use static vector allocations -- we can use dynamic one.

Signed-off-by: Alek Du <[email protected]>
Signed-off-by: Jacob Pan <[email protected]>
---
arch/x86/kernel/apic/io_apic.c | 23 ++++-------------------
1 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 53243ca..75265ab 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -140,27 +140,10 @@ static struct irq_pin_list *get_one_free_irq_2_pin(int node)

/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */
#ifdef CONFIG_SPARSE_IRQ
-static struct irq_cfg irq_cfgx[] = {
+static struct irq_cfg irq_cfgx[NR_IRQS_LEGACY];
#else
-static struct irq_cfg irq_cfgx[NR_IRQS] = {
+static struct irq_cfg irq_cfgx[NR_IRQS];
#endif
- [0] = { .vector = IRQ0_VECTOR, },
- [1] = { .vector = IRQ1_VECTOR, },
- [2] = { .vector = IRQ2_VECTOR, },
- [3] = { .vector = IRQ3_VECTOR, },
- [4] = { .vector = IRQ4_VECTOR, },
- [5] = { .vector = IRQ5_VECTOR, },
- [6] = { .vector = IRQ6_VECTOR, },
- [7] = { .vector = IRQ7_VECTOR, },
- [8] = { .vector = IRQ8_VECTOR, },
- [9] = { .vector = IRQ9_VECTOR, },
- [10] = { .vector = IRQ10_VECTOR, },
- [11] = { .vector = IRQ11_VECTOR, },
- [12] = { .vector = IRQ12_VECTOR, },
- [13] = { .vector = IRQ13_VECTOR, },
- [14] = { .vector = IRQ14_VECTOR, },
- [15] = { .vector = IRQ15_VECTOR, },
-};

void __init io_apic_disable_legacy(void)
{
@@ -181,6 +164,8 @@ int __init arch_early_irq_init(void)
node= cpu_to_node(boot_cpu_id);

for (i = 0; i < count; i++) {
+ if (i < nr_legacy_irqs)
+ cfg[i].vector = IRQ0_VECTOR + i;
desc = irq_to_desc(i);
desc->chip_data = &cfg[i];
zalloc_cpumask_var_node(&cfg[i].domain, GFP_NOWAIT, node);
--
1.6.5.3


2010-02-20 01:29:06

by Du, Alek

[permalink] [raw]
Subject: [tip:x86/mrst] x86, ioapic: Improve handling of i8259A irq init

Commit-ID: d39f6495f66616b637260405d0b5dc2656bc490e
Gitweb: http://git.kernel.org/tip/d39f6495f66616b637260405d0b5dc2656bc490e
Author: Alek Du <[email protected]>
AuthorDate: Mon, 7 Sep 2009 16:25:45 +0800
Committer: H. Peter Anvin <[email protected]>
CommitDate: Fri, 19 Feb 2010 16:25:17 -0800

x86, ioapic: Improve handling of i8259A irq init

Since we already track the number of legacy vectors by nr_legacy_irqs, we
can avoid use static vector allocations -- we can use dynamic one.

Signed-off-by: Alek Du <[email protected]>
LKML-Reference: <43F901BD926A4E43B106BF17856F07559FB80D01@orsmsx508.amr.corp.intel.com>
Signed-off-by: Jacob Pan <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
---
arch/x86/kernel/apic/io_apic.c | 23 ++++-------------------
1 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 53243ca..75265ab 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -140,27 +140,10 @@ static struct irq_pin_list *get_one_free_irq_2_pin(int node)

/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */
#ifdef CONFIG_SPARSE_IRQ
-static struct irq_cfg irq_cfgx[] = {
+static struct irq_cfg irq_cfgx[NR_IRQS_LEGACY];
#else
-static struct irq_cfg irq_cfgx[NR_IRQS] = {
+static struct irq_cfg irq_cfgx[NR_IRQS];
#endif
- [0] = { .vector = IRQ0_VECTOR, },
- [1] = { .vector = IRQ1_VECTOR, },
- [2] = { .vector = IRQ2_VECTOR, },
- [3] = { .vector = IRQ3_VECTOR, },
- [4] = { .vector = IRQ4_VECTOR, },
- [5] = { .vector = IRQ5_VECTOR, },
- [6] = { .vector = IRQ6_VECTOR, },
- [7] = { .vector = IRQ7_VECTOR, },
- [8] = { .vector = IRQ8_VECTOR, },
- [9] = { .vector = IRQ9_VECTOR, },
- [10] = { .vector = IRQ10_VECTOR, },
- [11] = { .vector = IRQ11_VECTOR, },
- [12] = { .vector = IRQ12_VECTOR, },
- [13] = { .vector = IRQ13_VECTOR, },
- [14] = { .vector = IRQ14_VECTOR, },
- [15] = { .vector = IRQ15_VECTOR, },
-};

void __init io_apic_disable_legacy(void)
{
@@ -181,6 +164,8 @@ int __init arch_early_irq_init(void)
node= cpu_to_node(boot_cpu_id);

for (i = 0; i < count; i++) {
+ if (i < nr_legacy_irqs)
+ cfg[i].vector = IRQ0_VECTOR + i;
desc = irq_to_desc(i);
desc->chip_data = &cfg[i];
zalloc_cpumask_var_node(&cfg[i].domain, GFP_NOWAIT, node);

2010-02-24 02:50:20

by Yinghai Lu

[permalink] [raw]
Subject: [PATCH] x86: fix compiling warning with legacy_pci_xxx


also remove duplicated cfg[i].vector assigning...

Signed-off-by: Yinghai Lu <[email protected]>
---
arch/x86/kernel/apic/io_apic.c | 2 --
arch/x86/kernel/i8259.c | 6 +++---
2 files changed, 3 insertions(+), 5 deletions(-)

Index: linux-2.6/arch/x86/kernel/apic/io_apic.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/apic/io_apic.c
+++ linux-2.6/arch/x86/kernel/apic/io_apic.c
@@ -161,8 +161,6 @@ int __init arch_early_irq_init(void)
node= cpu_to_node(boot_cpu_id);

for (i = 0; i < count; i++) {
- if (i < legacy_pic->nr_legacy_irqs)
- cfg[i].vector = IRQ0_VECTOR + i;
desc = irq_to_desc(i);
desc->chip_data = &cfg[i];
zalloc_cpumask_var_node(&cfg[i].domain, GFP_NOWAIT, node);
Index: linux-2.6/arch/x86/kernel/i8259.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/i8259.c
+++ linux-2.6/arch/x86/kernel/i8259.c
@@ -371,9 +371,9 @@ static void init_8259A(int auto_eoi)
* platforms, such as x86 MID.
*/

-static void __init legacy_pic_noop(void) { };
-static void __init legacy_pic_uint_noop(unsigned int unused) { };
-static void __init legacy_pic_int_noop(int unused) { };
+static void legacy_pic_noop(void) { };
+static void legacy_pic_uint_noop(unsigned int unused) { };
+static void legacy_pic_int_noop(int unused) { };

static struct irq_chip dummy_pic_chip = {
.name = "dummy pic",

2010-02-24 04:18:25

by Yinghai Lu

[permalink] [raw]
Subject: [PATCH] x86: remove left over nr_legacy_irqs



already in legacy_pic

Singed-off-by: Yinghai Lu <[email protected]>

---
arch/x86/include/asm/irq.h | 1 -
arch/x86/kernel/irqinit.c | 7 ++-----
2 files changed, 2 insertions(+), 6 deletions(-)

Index: linux-2.6/arch/x86/include/asm/irq.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/irq.h
+++ linux-2.6/arch/x86/include/asm/irq.h
@@ -48,6 +48,5 @@ extern DECLARE_BITMAP(used_vectors, NR_V
extern int vector_used_by_percpu_irq(unsigned int vector);

extern void init_ISA_irqs(void);
-extern int nr_legacy_irqs;

#endif /* _ASM_X86_IRQ_H */
Index: linux-2.6/arch/x86/kernel/irqinit.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/irqinit.c
+++ linux-2.6/arch/x86/kernel/irqinit.c
@@ -99,9 +99,6 @@ int vector_used_by_percpu_irq(unsigned i
return 0;
}

-/* Number of legacy interrupts */
-int nr_legacy_irqs __read_mostly = NR_IRQS_LEGACY;
-
void __init init_ISA_irqs(void)
{
int i;
@@ -114,7 +111,7 @@ void __init init_ISA_irqs(void)
/*
* 16 old-style INTA-cycle interrupts:
*/
- for (i = 0; i < NR_IRQS_LEGACY; i++) {
+ for (i = 0; i < legacy_pic->nr_legacy_irqs; i++) {
struct irq_desc *desc = irq_to_desc(i);

desc->status = IRQ_DISABLED;
@@ -138,7 +135,7 @@ void __init init_IRQ(void)
* then this vector space can be freed and re-used dynamically as the
* irq's migrate etc.
*/
- for (i = 0; i < nr_legacy_irqs; i++)
+ for (i = 0; i < legacy_pic->nr_legacy_irqs; i++)
per_cpu(vector_irq, 0)[IRQ0_VECTOR + i] = i;

x86_init.irqs.intr_init();

2010-02-24 04:29:08

by Yinghai Lu

[permalink] [raw]
Subject: [PATCH -v2] x86: remove left over nr_legacy_irqs

already in legacy_pic

-v2: there is one in ioapic_.c

Singed-off-by: Yinghai Lu <[email protected]>

---
arch/x86/include/asm/irq.h | 1 -
arch/x86/kernel/apic/io_apic.c | 2 +-
arch/x86/kernel/irqinit.c | 7 ++-----
3 files changed, 3 insertions(+), 7 deletions(-)

Index: linux-2.6/arch/x86/include/asm/irq.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/irq.h
+++ linux-2.6/arch/x86/include/asm/irq.h
@@ -48,6 +48,5 @@ extern DECLARE_BITMAP(used_vectors, NR_V
extern int vector_used_by_percpu_irq(unsigned int vector);

extern void init_ISA_irqs(void);
-extern int nr_legacy_irqs;

#endif /* _ASM_X86_IRQ_H */
Index: linux-2.6/arch/x86/kernel/irqinit.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/irqinit.c
+++ linux-2.6/arch/x86/kernel/irqinit.c
@@ -99,9 +99,6 @@ int vector_used_by_percpu_irq(unsigned i
return 0;
}

-/* Number of legacy interrupts */
-int nr_legacy_irqs __read_mostly = NR_IRQS_LEGACY;
-
void __init init_ISA_irqs(void)
{
int i;
@@ -114,7 +111,7 @@ void __init init_ISA_irqs(void)
/*
* 16 old-style INTA-cycle interrupts:
*/
- for (i = 0; i < NR_IRQS_LEGACY; i++) {
+ for (i = 0; i < legacy_pic->nr_legacy_irqs; i++) {
struct irq_desc *desc = irq_to_desc(i);

desc->status = IRQ_DISABLED;
@@ -138,7 +135,7 @@ void __init init_IRQ(void)
* then this vector space can be freed and re-used dynamically as the
* irq's migrate etc.
*/
- for (i = 0; i < nr_legacy_irqs; i++)
+ for (i = 0; i < legacy_pic->nr_legacy_irqs; i++)
per_cpu(vector_irq, 0)[IRQ0_VECTOR + i] = i;

x86_init.irqs.intr_init();
Index: linux-2.6/arch/x86/kernel/apic/io_apic.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/apic/io_apic.c
+++ linux-2.6/arch/x86/kernel/apic/io_apic.c
@@ -1438,7 +1438,7 @@ static void setup_IO_APIC_irq(int apic_i
* controllers like 8259. Now that IO-APIC can handle this irq, update
* the cfg->domain.
*/
- if (irq < nr_legacy_irqs && cpumask_test_cpu(0, cfg->domain))
+ if (irq < legacy_pic->nr_legacy_irqs && cpumask_test_cpu(0, cfg->domain))
apic->vector_allocation_domain(0, cfg->domain);

if (assign_irq_vector(irq, cfg, apic->target_cpus()))

2010-02-24 08:10:08

by Yinghai Lu

[permalink] [raw]
Subject: [tip:x86/mrst] x86, legacy_irq: Remove left over nr_legacy_irqs

Commit-ID: 0c0cbde569b9ae2b05234669d5188c6f10616a42
Gitweb: http://git.kernel.org/tip/0c0cbde569b9ae2b05234669d5188c6f10616a42
Author: Yinghai Lu <[email protected]>
AuthorDate: Tue, 23 Feb 2010 20:27:48 -0800
Committer: H. Peter Anvin <[email protected]>
CommitDate: Tue, 23 Feb 2010 23:20:15 -0800

x86, legacy_irq: Remove left over nr_legacy_irqs

nr_legacy_irqs and its ilk have moved to legacy_pic.

-v2: there is one in ioapic_.c

Singed-off-by: Yinghai Lu <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
---
arch/x86/include/asm/irq.h | 1 -
arch/x86/kernel/apic/io_apic.c | 2 +-
arch/x86/kernel/irqinit.c | 7 ++-----
3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index 2622927..5458380 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -48,6 +48,5 @@ extern DECLARE_BITMAP(used_vectors, NR_VECTORS);
extern int vector_used_by_percpu_irq(unsigned int vector);

extern void init_ISA_irqs(void);
-extern int nr_legacy_irqs;

#endif /* _ASM_X86_IRQ_H */
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 8c848b5..b9d08f0 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1440,7 +1440,7 @@ static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq
* controllers like 8259. Now that IO-APIC can handle this irq, update
* the cfg->domain.
*/
- if (irq < nr_legacy_irqs && cpumask_test_cpu(0, cfg->domain))
+ if (irq < legacy_pic->nr_legacy_irqs && cpumask_test_cpu(0, cfg->domain))
apic->vector_allocation_domain(0, cfg->domain);

if (assign_irq_vector(irq, cfg, apic->target_cpus()))
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index d2f787b..ef257fc 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -99,9 +99,6 @@ int vector_used_by_percpu_irq(unsigned int vector)
return 0;
}

-/* Number of legacy interrupts */
-int nr_legacy_irqs __read_mostly = NR_IRQS_LEGACY;
-
void __init init_ISA_irqs(void)
{
int i;
@@ -114,7 +111,7 @@ void __init init_ISA_irqs(void)
/*
* 16 old-style INTA-cycle interrupts:
*/
- for (i = 0; i < NR_IRQS_LEGACY; i++) {
+ for (i = 0; i < legacy_pic->nr_legacy_irqs; i++) {
struct irq_desc *desc = irq_to_desc(i);

desc->status = IRQ_DISABLED;
@@ -138,7 +135,7 @@ void __init init_IRQ(void)
* then this vector space can be freed and re-used dynamically as the
* irq's migrate etc.
*/
- for (i = 0; i < nr_legacy_irqs; i++)
+ for (i = 0; i < legacy_pic->nr_legacy_irqs; i++)
per_cpu(vector_irq, 0)[IRQ0_VECTOR + i] = i;

x86_init.irqs.intr_init();

2010-02-24 08:10:28

by Yinghai Lu

[permalink] [raw]
Subject: [tip:x86/mrst] x86, legacy_irq: Remove duplicate vector assigment

Commit-ID: 8cdf5dcab80d5933b048118368caf75df21d2788
Gitweb: http://git.kernel.org/tip/8cdf5dcab80d5933b048118368caf75df21d2788
Author: Yinghai Lu <[email protected]>
AuthorDate: Tue, 23 Feb 2010 18:49:04 -0800
Committer: H. Peter Anvin <[email protected]>
CommitDate: Tue, 23 Feb 2010 23:23:29 -0800

x86, legacy_irq: Remove duplicate vector assigment

Remove duplicated cfg[i].vector assignment.

Signed-off-by: Yinghai Lu <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
---
arch/x86/kernel/apic/io_apic.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index b9d08f0..b758d49 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -161,8 +161,6 @@ int __init arch_early_irq_init(void)
node= cpu_to_node(boot_cpu_id);

for (i = 0; i < count; i++) {
- if (i < legacy_pic->nr_legacy_irqs)
- cfg[i].vector = IRQ0_VECTOR + i;
desc = irq_to_desc(i);
desc->chip_data = &cfg[i];
zalloc_cpumask_var_node(&cfg[i].domain, GFP_NOWAIT, node);

2010-02-24 19:04:31

by Yinghai Lu

[permalink] [raw]
Subject: [tip:x86/mrst] x86, legacy_irq: Remove left over nr_legacy_irqs

Commit-ID: 28c6a0ba30457380b140d9d7a61530eda8969180
Gitweb: http://git.kernel.org/tip/28c6a0ba30457380b140d9d7a61530eda8969180
Author: Yinghai Lu <[email protected]>
AuthorDate: Tue, 23 Feb 2010 20:27:48 -0800
Committer: H. Peter Anvin <[email protected]>
CommitDate: Wed, 24 Feb 2010 11:01:34 -0800

x86, legacy_irq: Remove left over nr_legacy_irqs

nr_legacy_irqs and its ilk have moved to legacy_pic.

-v2: there is one in ioapic_.c

Singed-off-by: Yinghai Lu <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
---
arch/x86/include/asm/irq.h | 1 -
arch/x86/kernel/apic/io_apic.c | 2 +-
arch/x86/kernel/irqinit.c | 7 ++-----
3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index 2622927..5458380 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -48,6 +48,5 @@ extern DECLARE_BITMAP(used_vectors, NR_VECTORS);
extern int vector_used_by_percpu_irq(unsigned int vector);

extern void init_ISA_irqs(void);
-extern int nr_legacy_irqs;

#endif /* _ASM_X86_IRQ_H */
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 8c848b5..b9d08f0 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1440,7 +1440,7 @@ static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq
* controllers like 8259. Now that IO-APIC can handle this irq, update
* the cfg->domain.
*/
- if (irq < nr_legacy_irqs && cpumask_test_cpu(0, cfg->domain))
+ if (irq < legacy_pic->nr_legacy_irqs && cpumask_test_cpu(0, cfg->domain))
apic->vector_allocation_domain(0, cfg->domain);

if (assign_irq_vector(irq, cfg, apic->target_cpus()))
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index d2f787b..ef257fc 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -99,9 +99,6 @@ int vector_used_by_percpu_irq(unsigned int vector)
return 0;
}

-/* Number of legacy interrupts */
-int nr_legacy_irqs __read_mostly = NR_IRQS_LEGACY;
-
void __init init_ISA_irqs(void)
{
int i;
@@ -114,7 +111,7 @@ void __init init_ISA_irqs(void)
/*
* 16 old-style INTA-cycle interrupts:
*/
- for (i = 0; i < NR_IRQS_LEGACY; i++) {
+ for (i = 0; i < legacy_pic->nr_legacy_irqs; i++) {
struct irq_desc *desc = irq_to_desc(i);

desc->status = IRQ_DISABLED;
@@ -138,7 +135,7 @@ void __init init_IRQ(void)
* then this vector space can be freed and re-used dynamically as the
* irq's migrate etc.
*/
- for (i = 0; i < nr_legacy_irqs; i++)
+ for (i = 0; i < legacy_pic->nr_legacy_irqs; i++)
per_cpu(vector_irq, 0)[IRQ0_VECTOR + i] = i;

x86_init.irqs.intr_init();

2010-02-24 19:04:57

by Yinghai Lu

[permalink] [raw]
Subject: [tip:x86/mrst] x86, legacy_irq: Remove duplicate vector assigment

Commit-ID: 9eeeb09edba1e3544526611663472743ca584d36
Gitweb: http://git.kernel.org/tip/9eeeb09edba1e3544526611663472743ca584d36
Author: Yinghai Lu <[email protected]>
AuthorDate: Tue, 23 Feb 2010 18:49:04 -0800
Committer: H. Peter Anvin <[email protected]>
CommitDate: Wed, 24 Feb 2010 11:01:34 -0800

x86, legacy_irq: Remove duplicate vector assigment

Remove duplicated cfg[i].vector assignment.

Signed-off-by: Yinghai Lu <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
---
arch/x86/kernel/apic/io_apic.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index b9d08f0..b758d49 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -161,8 +161,6 @@ int __init arch_early_irq_init(void)
node= cpu_to_node(boot_cpu_id);

for (i = 0; i < count; i++) {
- if (i < legacy_pic->nr_legacy_irqs)
- cfg[i].vector = IRQ0_VECTOR + i;
desc = irq_to_desc(i);
desc->chip_data = &cfg[i];
zalloc_cpumask_var_node(&cfg[i].domain, GFP_NOWAIT, node);

2010-02-24 20:40:52

by Yinghai Lu

[permalink] [raw]
Subject: [PATCH] x86/pci: exclude mrst pci code for other platform



Signed-off-by: Yinghai Lu <[email protected]>

diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile
index ab637f9..131e4da 100644
--- a/arch/x86/pci/Makefile
+++ b/arch/x86/pci/Makefile
@@ -13,7 +13,8 @@ obj-$(CONFIG_X86_VISWS) += visws.o

obj-$(CONFIG_X86_NUMAQ) += numaq_32.o

-obj-y += common.o early.o mrst.o
+obj-y += common.o early.o
+obj-$(CONFIG_X86_MRST) += mrst.o
obj-y += amd_bus.o bus_numa.o

ifeq ($(CONFIG_PCI_DEBUG),y)

2010-02-24 21:03:47

by Jacob Pan

[permalink] [raw]
Subject: RE: [PATCH] x86/pci: exclude mrst pci code for other platform

Our goal is to have a binary compatible kernel runs on Moorestown and PC, can
we keep the Moorestown PCI code for this purpose?

>-----Original Message-----
>From: Yinghai Lu [mailto:[email protected]]
>Sent: Wednesday, February 24, 2010 12:40 PM
>To: [email protected]; [email protected]; [email protected]
>Cc: [email protected]; Du, Alek; Pan, Jacob jun; Siddha, Suresh B;
>Jesse Barnes
>Subject: [PATCH] x86/pci: exclude mrst pci code for other platform
>
>
>
>Signed-off-by: Yinghai Lu <[email protected]>
>
>diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile
>index ab637f9..131e4da 100644
>--- a/arch/x86/pci/Makefile
>+++ b/arch/x86/pci/Makefile
>@@ -13,7 +13,8 @@ obj-$(CONFIG_X86_VISWS) += visws.o
>
> obj-$(CONFIG_X86_NUMAQ) += numaq_32.o
>
>-obj-y += common.o early.o mrst.o
>+obj-y += common.o early.o
>+obj-$(CONFIG_X86_MRST) += mrst.o
> obj-y += amd_bus.o bus_numa.o
>
> ifeq ($(CONFIG_PCI_DEBUG),y)

2010-02-24 21:45:34

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH] x86/pci: exclude mrst pci code for other platform

On 02/24/2010 01:03 PM, Pan, Jacob jun wrote:
> Our goal is to have a binary compatible kernel runs on Moorestown and PC, can
> we keep the Moorestown PCI code for this purpose?

CONFIG_X86_MRST is supposed to reflect the *ability* to run on
Moorestown, not the *requirement* of running on Moorestown. As such,
Yinghai's patch seems correct to me.

If you cannot boot a kernel with CONFIG_X86_MRST=y on PC hardware, that
is a bug which should be fixed.

-hpa

2010-02-24 22:11:20

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH] x86/pci: exclude mrst pci code for other platform

On 02/24/2010 01:44 PM, H. Peter Anvin wrote:
> On 02/24/2010 01:03 PM, Pan, Jacob jun wrote:
>> Our goal is to have a binary compatible kernel runs on Moorestown and PC, can
>> we keep the Moorestown PCI code for this purpose?
>
> CONFIG_X86_MRST is supposed to reflect the *ability* to run on
> Moorestown, not the *requirement* of running on Moorestown. As such,
> Yinghai's patch seems correct to me.
>
> If you cannot boot a kernel with CONFIG_X86_MRST=y on PC hardware, that
> is a bug which should be fixed.

yes, at 64 bit doesn't need that code yet.

that pci_fixed_bar_fixup cause my nehalem-ex box warm reset...

YH

2010-02-24 22:31:51

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH] x86/pci: exclude mrst pci code for other platform

On 02/24/2010 02:10 PM, Yinghai Lu wrote:
> On 02/24/2010 01:44 PM, H. Peter Anvin wrote:
>> On 02/24/2010 01:03 PM, Pan, Jacob jun wrote:
>>> Our goal is to have a binary compatible kernel runs on Moorestown and PC, can
>>> we keep the Moorestown PCI code for this purpose?
>>
>> CONFIG_X86_MRST is supposed to reflect the *ability* to run on
>> Moorestown, not the *requirement* of running on Moorestown. As such,
>> Yinghai's patch seems correct to me.
>>
>> If you cannot boot a kernel with CONFIG_X86_MRST=y on PC hardware, that
>> is a bug which should be fixed.
>
> yes, at 64 bit doesn't need that code yet.
>
> that pci_fixed_bar_fixup cause my nehalem-ex box warm reset...
>

There was a fix for that earlier today, did you pick that up?

-hpa

2010-02-24 22:44:06

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH] x86/pci: exclude mrst pci code for other platform

On 02/24/2010 02:31 PM, H. Peter Anvin wrote:
> On 02/24/2010 02:10 PM, Yinghai Lu wrote:
>> On 02/24/2010 01:44 PM, H. Peter Anvin wrote:
>>> On 02/24/2010 01:03 PM, Pan, Jacob jun wrote:
>>>> Our goal is to have a binary compatible kernel runs on Moorestown and PC, can
>>>> we keep the Moorestown PCI code for this purpose?
>>>
>>> CONFIG_X86_MRST is supposed to reflect the *ability* to run on
>>> Moorestown, not the *requirement* of running on Moorestown. As such,
>>> Yinghai's patch seems correct to me.
>>>
>>> If you cannot boot a kernel with CONFIG_X86_MRST=y on PC hardware, that
>>> is a bug which should be fixed.
>>
>> yes, at 64 bit doesn't need that code yet.
>>
>> that pci_fixed_bar_fixup cause my nehalem-ex box warm reset...
>>
>
> There was a fix for that earlier today, did you pick that up?

seem you rebase tip/x86/mrst, and remove the /* */ for that pci quirks...

Yinghai

2010-02-25 00:41:42

by Jacob Pan

[permalink] [raw]
Subject: [PATCH] x86/mrst: add dependencies for Moorestown

Moorestown platform depends on IOAPIC, specify dependency correctly.

Signed-off-by: Jacob Pan <[email protected]>
---
arch/x86/Kconfig | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0ab2dce..b50788d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -388,8 +388,10 @@ config X86_ELAN

config X86_MRST
bool "Moorestown MID platform"
+ depends on PCI_IOAPIC
depends on X86_32
depends on X86_EXTENDED_PLATFORM
+ depends on X86_IO_APIC
select APB_TIMER
---help---
Moorestown is Intel's Low Power Intel Architecture (LPIA) based Moblin
--
1.5.6.5

2010-02-25 06:04:10

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH] x86/mrst: add dependencies for Moorestown

On 02/24/2010 04:41 PM, Pan, Jacob jun wrote:
> Moorestown platform depends on IOAPIC, specify dependency correctly.
>
> Signed-off-by: Jacob Pan <[email protected]>
> ---
> arch/x86/Kconfig | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 0ab2dce..b50788d 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -388,8 +388,10 @@ config X86_ELAN
>
> config X86_MRST
> bool "Moorestown MID platform"
> + depends on PCI_IOAPIC
> depends on X86_32
> depends on X86_EXTENDED_PLATFORM
> + depends on X86_IO_APIC
> select APB_TIMER
> ---help---
> Moorestown is Intel's Low Power Intel Architecture (LPIA) based Moblin

so mrst is
1) SMP or not?
2) if is not SMP, does it still have MADT?

YH

2010-02-25 22:28:06

by Yinghai Lu

[permalink] [raw]
Subject: [tip:x86/mrst] x86, pci: Exclude Moorestown PCI code if CONFIG_X86_MRST=n

Commit-ID: 722a639fd2cec44501c04ae32af57fd822c5a2d5
Gitweb: http://git.kernel.org/tip/722a639fd2cec44501c04ae32af57fd822c5a2d5
Author: Yinghai Lu <[email protected]>
AuthorDate: Wed, 24 Feb 2010 12:39:37 -0800
Committer: H. Peter Anvin <[email protected]>
CommitDate: Thu, 25 Feb 2010 14:26:43 -0800

x86, pci: Exclude Moorestown PCI code if CONFIG_X86_MRST=n

If we don't have any Moorestown CPU support compiled in, we don't need
the Moorestown PCI support either.

Signed-off-by: Yinghai Lu <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
---
arch/x86/pci/Makefile | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile
index 4753ebc..56caf2a 100644
--- a/arch/x86/pci/Makefile
+++ b/arch/x86/pci/Makefile
@@ -13,7 +13,9 @@ obj-$(CONFIG_X86_VISWS) += visws.o

obj-$(CONFIG_X86_NUMAQ) += numaq_32.o

-obj-y += common.o early.o mrst.o
+obj-$(CONFIG_X86_MRST) += mrst.o
+
+obj-y += common.o early.o
obj-y += amd_bus.o
obj-$(CONFIG_X86_64) += bus_numa.o