public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] merge io_apic_xx.c -- fix
@ 2008-08-16 10:07 Yinghai Lu
  2008-08-16 10:07 ` [PATCH 1/5] pci: change msi-x vector to 32bit Yinghai Lu
  2008-08-16 13:35 ` [PATCH 0/5] merge io_apic_xx.c -- fix Ingo Molnar
  0 siblings, 2 replies; 12+ messages in thread
From: Yinghai Lu @ 2008-08-16 10:07 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Eric W. Biederman,
	Andrew Morton
  Cc: linux-kernel, Yinghai Lu

    merge io_apic_xx.c

Thanks

Yinghai Lu


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/5] pci: change msi-x vector to 32bit
  2008-08-16 10:07 [PATCH 0/5] merge io_apic_xx.c -- fix Yinghai Lu
@ 2008-08-16 10:07 ` Yinghai Lu
  2008-08-16 10:07   ` Yinghai Lu
  2008-08-16 13:35 ` [PATCH 0/5] merge io_apic_xx.c -- fix Ingo Molnar
  1 sibling, 1 reply; 12+ messages in thread
From: Yinghai Lu @ 2008-08-16 10:07 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Eric W. Biederman,
	Andrew Morton
  Cc: linux-kernel, Yinghai Lu, Andrew Vasquez

we are using 28bit pci (bus/dev/fn + 12 bits) as irq number, so the
cache for irq number should be 32 bit too.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>

---
 drivers/scsi/qla2xxx/qla_def.h |    2 +-
 include/linux/pci.h            |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/drivers/scsi/qla2xxx/qla_def.h
===================================================================
--- linux-2.6.orig/drivers/scsi/qla2xxx/qla_def.h
+++ linux-2.6/drivers/scsi/qla2xxx/qla_def.h
@@ -2109,7 +2109,7 @@ struct scsi_qla_host;
 
 struct qla_msix_entry {
 	int have_irq;
-	uint16_t msix_vector;
+	uint32_t msix_vector;
 	uint16_t msix_entry;
 };
 
Index: linux-2.6/include/linux/pci.h
===================================================================
--- linux-2.6.orig/include/linux/pci.h
+++ linux-2.6/include/linux/pci.h
@@ -729,7 +729,7 @@ enum pci_dma_burst_strategy {
 };
 
 struct msix_entry {
-	u16 	vector;	/* kernel uses to write allocated vector */
+	u32	vector;	/* kernel uses to write allocated vector */
 	u16	entry;	/* driver uses to specify entry, OS writes */
 };
 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/5] pci: change msi-x vector to 32bit
  2008-08-16 10:07 ` [PATCH 1/5] pci: change msi-x vector to 32bit Yinghai Lu
@ 2008-08-16 10:07   ` Yinghai Lu
  2008-08-16 10:07     ` [PATCH 3/5] x86: irq: interrupt array size should be NR_VECTORS Yinghai Lu
  0 siblings, 1 reply; 12+ messages in thread
From: Yinghai Lu @ 2008-08-16 10:07 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Eric W. Biederman,
	Andrew Morton
  Cc: linux-kernel, Yinghai Lu

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

---
 drivers/pci/intr_remapping.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/pci/intr_remapping.c
===================================================================
--- linux-2.6.orig/drivers/pci/intr_remapping.c
+++ linux-2.6/drivers/pci/intr_remapping.c
@@ -99,7 +99,7 @@ static struct irq_2_iommu irq_2_iommuX[N
 
 static struct irq_2_iommu *irq_2_iommu(unsigned int irq)
 {
-	if (irq <= nr_irqs)
+	if (irq < nr_irqs)
 		return &irq_2_iommuX[irq];
 
 	return NULL;

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 3/5] x86: irq: interrupt array size should be NR_VECTORS
  2008-08-16 10:07   ` Yinghai Lu
@ 2008-08-16 10:07     ` Yinghai Lu
  2008-08-16 10:07       ` [PATCH 4/5] x86: unify mask_IO_APIC_irq Yinghai Lu
  0 siblings, 1 reply; 12+ messages in thread
From: Yinghai Lu @ 2008-08-16 10:07 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Eric W. Biederman,
	Andrew Morton
  Cc: linux-kernel, Yinghai Lu

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

---
 drivers/pci/intr_remapping.c |    2 +-
 include/asm-x86/hw_irq.h     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/include/asm-x86/hw_irq.h
===================================================================
--- linux-2.6.orig/include/asm-x86/hw_irq.h
+++ linux-2.6/include/asm-x86/hw_irq.h
@@ -115,7 +115,7 @@ extern asmlinkage void smp_invalidate_in
 #endif
 
 #ifdef CONFIG_X86_32
-extern void (*const interrupt[NR_IRQS])(void);
+extern void (*const interrupt[NR_VECTORS])(void);
 #endif
 
 typedef int vector_irq_t[NR_VECTORS];

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 4/5] x86: unify mask_IO_APIC_irq
  2008-08-16 10:07     ` [PATCH 3/5] x86: irq: interrupt array size should be NR_VECTORS Yinghai Lu
@ 2008-08-16 10:07       ` Yinghai Lu
  2008-08-16 10:07         ` [PATCH 5/5] x86: unify ack_apic_edge Yinghai Lu
  0 siblings, 1 reply; 12+ messages in thread
From: Yinghai Lu @ 2008-08-16 10:07 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Eric W. Biederman,
	Andrew Morton
  Cc: linux-kernel, Yinghai Lu

use MACRO for 32 bit too

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

---
 arch/x86/kernel/io_apic.c |   80 ++++++++++++----------------------------------
 1 file changed, 21 insertions(+), 59 deletions(-)

Index: linux-2.6/arch/x86/kernel/io_apic.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/io_apic.c
+++ linux-2.6/arch/x86/kernel/io_apic.c
@@ -608,18 +608,7 @@ static void __init replace_pin_at_irq(un
 		add_pin_to_irq(irq, newapic, newpin);
 }
 
-#ifdef CONFIG_X86_64
-/*
- * Synchronize the IO-APIC and the CPU by doing
- * a dummy read from the IO-APIC
- */
-static inline void io_apic_sync(unsigned int apic)
-{
-	struct io_apic __iomem *io_apic = io_apic_base(apic);
-	readl(&io_apic->data);
-}
-
-#define __DO_ACTION(R, ACTION, FINAL)					\
+#define __DO_ACTION(R, ACTION_ENABLE, ACTION_DISABLE, FINAL)		\
 									\
 {									\
 	int pin;							\
@@ -634,7 +623,8 @@ static inline void io_apic_sync(unsigned
 			break;						\
 		pin = entry->pin;					\
 		reg = io_apic_read(entry->apic, 0x10 + R + pin*2);	\
-		reg ACTION;						\
+		reg ACTION_DISABLE;					\
+		reg ACTION_ENABLE;					\
 		io_apic_modify(entry->apic, 0x10 + R + pin*2, reg);	\
 		FINAL;							\
 		if (!entry->next)					\
@@ -643,66 +633,38 @@ static inline void io_apic_sync(unsigned
 	}								\
 }
 
-#define DO_ACTION(name,R,ACTION, FINAL)					\
+#define DO_ACTION(name,R, ACTION_ENABLE, ACTION_DISABLE, FINAL)		\
 									\
 	static void name##_IO_APIC_irq (unsigned int irq)		\
-	__DO_ACTION(R, ACTION, FINAL)
-
-/* mask = 1 */
-DO_ACTION(__mask,	0, |= IO_APIC_REDIR_MASKED, io_apic_sync(entry->apic))
+	__DO_ACTION(R, ACTION_ENABLE, ACTION_DISABLE, FINAL)
 
 /* mask = 0 */
-DO_ACTION(__unmask,	0, &= ~IO_APIC_REDIR_MASKED, )
+DO_ACTION(__unmask,	0, |= 0, &= ~IO_APIC_REDIR_MASKED, )
 
-#else
-
-static void __modify_IO_APIC_irq(unsigned int irq, unsigned long enable, unsigned long disable)
+#ifdef CONFIG_X86_64
+/*
+ * Synchronize the IO-APIC and the CPU by doing
+ * a dummy read from the IO-APIC
+ */
+static inline void io_apic_sync(unsigned int apic)
 {
-	struct irq_cfg *cfg;
-	struct irq_pin_list *entry;
-	unsigned int pin, reg;
-
-	cfg = irq_cfg(irq);
-	entry = cfg->irq_2_pin;
-	for (;;) {
-		if (!entry)
-			break;
-		pin = entry->pin;
-		reg = io_apic_read(entry->apic, 0x10 + pin*2);
-		reg &= ~disable;
-		reg |= enable;
-		io_apic_modify(entry->apic, 0x10 + pin*2, reg);
-		if (!entry->next)
-			break;
-		entry = entry->next;
-	}
+	struct io_apic __iomem *io_apic = io_apic_base(apic);
+	readl(&io_apic->data);
 }
 
 /* mask = 1 */
-static void __mask_IO_APIC_irq(unsigned int irq)
-{
-	__modify_IO_APIC_irq(irq, IO_APIC_REDIR_MASKED, 0);
-}
+DO_ACTION(__mask,	0, |= IO_APIC_REDIR_MASKED, &= ~0, io_apic_sync(entry->apic))
 
-/* mask = 0 */
-static void __unmask_IO_APIC_irq(unsigned int irq)
-{
-	__modify_IO_APIC_irq(irq, 0, IO_APIC_REDIR_MASKED);
-}
+#else
+
+/* mask = 1 */
+DO_ACTION(__mask,	0, |= IO_APIC_REDIR_MASKED, &= ~0, )
 
 /* mask = 1, trigger = 0 */
-static void __mask_and_edge_IO_APIC_irq(unsigned int irq)
-{
-	__modify_IO_APIC_irq(irq, IO_APIC_REDIR_MASKED,
-				IO_APIC_REDIR_LEVEL_TRIGGER);
-}
+DO_ACTION(__mask_and_edge, 0, |= IO_APIC_REDIR_MASKED, &= ~IO_APIC_REDIR_LEVEL_TRIGGER, )
 
 /* mask = 0, trigger = 1 */
-static void __unmask_and_level_IO_APIC_irq(unsigned int irq)
-{
-	__modify_IO_APIC_irq(irq, IO_APIC_REDIR_LEVEL_TRIGGER,
-				IO_APIC_REDIR_MASKED);
-}
+DO_ACTION(__unmask_and_level, 0, |= IO_APIC_REDIR_LEVEL_TRIGGER, &= ~IO_APIC_REDIR_MASKED, )
 
 #endif
 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 5/5] x86: unify ack_apic_edge
  2008-08-16 10:07       ` [PATCH 4/5] x86: unify mask_IO_APIC_irq Yinghai Lu
@ 2008-08-16 10:07         ` Yinghai Lu
  0 siblings, 0 replies; 12+ messages in thread
From: Yinghai Lu @ 2008-08-16 10:07 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Eric W. Biederman,
	Andrew Morton
  Cc: linux-kernel, Yinghai Lu

use code in 64 to replace
	move_native_irq(irq, desc);
in 32 bit

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

---
 arch/x86/kernel/io_apic.c |   73 ++++++++++++++++++++++------------------------
 1 file changed, 35 insertions(+), 38 deletions(-)

Index: linux-2.6/arch/x86/kernel/io_apic.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/io_apic.c
+++ linux-2.6/arch/x86/kernel/io_apic.c
@@ -389,7 +389,6 @@ static inline void io_apic_modify(unsign
 	writel(value, &io_apic->data);
 }
 
-#ifdef CONFIG_X86_64
 static bool io_apic_level_ack_pending(unsigned int irq)
 {
 	struct irq_pin_list *entry;
@@ -419,7 +418,6 @@ static bool io_apic_level_ack_pending(un
 
 	return false;
 }
-#endif
 
 union entry_union {
 	struct { u32 w1, w2; };
@@ -2397,9 +2395,16 @@ static void ack_apic_edge(unsigned int i
 	ack_APIC_irq();
 }
 
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86_32
+atomic_t irq_mis_count;
+#endif
+
 static void ack_apic_level(unsigned int irq, struct irq_desc *desc)
 {
+#ifdef CONFIG_X86_32
+	unsigned long v;
+	int i;
+#endif
 	int do_unmask_irq = 0;
 
 	irq_complete_move(irq);
@@ -2411,6 +2416,31 @@ static void ack_apic_level(unsigned int
 	}
 #endif
 
+#ifdef CONFIG_X86_32
+	/*
+	* It appears there is an erratum which affects at least version 0x11
+	* of I/O APIC (that's the 82093AA and cores integrated into various
+	* chipsets).  Under certain conditions a level-triggered interrupt is
+	* erroneously delivered as edge-triggered one but the respective IRR
+	* bit gets set nevertheless.  As a result the I/O unit expects an EOI
+	* message but it will never arrive and further interrupts are blocked
+	* from the source.  The exact reason is so far unknown, but the
+	* phenomenon was observed when two consecutive interrupt requests
+	* from a given source get delivered to the same CPU and the source is
+	* temporarily disabled in between.
+	*
+	* A workaround is to simulate an EOI message manually.  We achieve it
+	* by setting the trigger mode to edge and then to level when the edge
+	* trigger mode gets detected in the TMR of a local APIC for a
+	* level-triggered interrupt.  We mask the source for the time of the
+	* operation to prevent an edge-triggered interrupt escaping meanwhile.
+	* The idea is from Manfred Spraul.  --macro
+	*/
+	i = irq_cfg(irq)->vector;
+
+	v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1));
+#endif
+
 	/*
 	 * We must acknowledge the irq before we move it or the acknowledge will
 	 * not propagate properly.
@@ -2449,41 +2479,8 @@ static void ack_apic_level(unsigned int
 			move_masked_irq(irq, desc);
 		unmask_IO_APIC_irq(irq);
 	}
-}
-#else
-atomic_t irq_mis_count;
-static void ack_apic_level(unsigned int irq, struct irq_desc *desc)
-{
-	unsigned long v;
-	int i;
-
-	irq_complete_move(irq);
-	move_native_irq(irq, desc);
-	/*
-	* It appears there is an erratum which affects at least version 0x11
-	* of I/O APIC (that's the 82093AA and cores integrated into various
-	* chipsets).  Under certain conditions a level-triggered interrupt is
-	* erroneously delivered as edge-triggered one but the respective IRR
-	* bit gets set nevertheless.  As a result the I/O unit expects an EOI
-	* message but it will never arrive and further interrupts are blocked
-	* from the source.  The exact reason is so far unknown, but the
-	* phenomenon was observed when two consecutive interrupt requests
-	* from a given source get delivered to the same CPU and the source is
-	* temporarily disabled in between.
-	*
-	* A workaround is to simulate an EOI message manually.  We achieve it
-	* by setting the trigger mode to edge and then to level when the edge
-	* trigger mode gets detected in the TMR of a local APIC for a
-	* level-triggered interrupt.  We mask the source for the time of the
-	* operation to prevent an edge-triggered interrupt escaping meanwhile.
-	* The idea is from Manfred Spraul.  --macro
-	*/
-	i = irq_cfg(irq)->vector;
-
-	v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1));
-
-	ack_APIC_irq();
 
+#ifdef CONFIG_X86_32
 	if (!(v & (1 << (i & 0x1f)))) {
 		atomic_inc(&irq_mis_count);
 		spin_lock(&ioapic_lock);
@@ -2491,8 +2488,8 @@ static void ack_apic_level(unsigned int
 		__unmask_and_level_IO_APIC_irq(irq);
 		spin_unlock(&ioapic_lock);
 	}
-}
 #endif
+}
 
 static struct irq_chip ioapic_chip __read_mostly = {
 	.name 		= "IO-APIC",

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/5] merge io_apic_xx.c -- fix
  2008-08-16 10:07 [PATCH 0/5] merge io_apic_xx.c -- fix Yinghai Lu
  2008-08-16 10:07 ` [PATCH 1/5] pci: change msi-x vector to 32bit Yinghai Lu
@ 2008-08-16 13:35 ` Ingo Molnar
  2008-08-19 22:21   ` Randy Dunlap
  1 sibling, 1 reply; 12+ messages in thread
From: Ingo Molnar @ 2008-08-16 13:35 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Thomas Gleixner, H. Peter Anvin, Eric W. Biederman, Andrew Morton,
	linux-kernel


* Yinghai Lu <yhlu.kernel@gmail.com> wrote:

>     merge io_apic_xx.c
> 
> Thanks

applied to tip/irq/sparseirq - thanks!

	Ingo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/5] merge io_apic_xx.c -- fix
  2008-08-16 13:35 ` [PATCH 0/5] merge io_apic_xx.c -- fix Ingo Molnar
@ 2008-08-19 22:21   ` Randy Dunlap
  2008-08-20  0:24     ` Yinghai Lu
  0 siblings, 1 reply; 12+ messages in thread
From: Randy Dunlap @ 2008-08-19 22:21 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Yinghai Lu, Thomas Gleixner, H. Peter Anvin, Eric W. Biederman,
	Andrew Morton, linux-kernel

On Sat, 16 Aug 2008 15:35:54 +0200 Ingo Molnar wrote:

> 
> * Yinghai Lu <yhlu.kernel@gmail.com> wrote:
> 
> >     merge io_apic_xx.c
> > 
> > Thanks
> 
> applied to tip/irq/sparseirq - thanks!


Are there patches in the io_apic series to fix these warnings in linux-next?? ::


linux-next-20080819/arch/x86/kernel/io_apic_32.c:1539: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
linux-next-20080819/arch/x86/kernel/io_apic_32.c:1540: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64


and

linux-next-20080819/arch/x86/kernel/io_apic_32.c:1539: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
linux-next-20080819/arch/x86/kernel/io_apic_32.c:1540: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'




---
~Randy  [i swear people must not look at warnings]


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/5] merge io_apic_xx.c -- fix
  2008-08-19 22:21   ` Randy Dunlap
@ 2008-08-20  0:24     ` Yinghai Lu
  2008-08-20  0:27       ` Andrew Morton
  0 siblings, 1 reply; 12+ messages in thread
From: Yinghai Lu @ 2008-08-20  0:24 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Eric W. Biederman,
	Andrew Morton, linux-kernel

On Tue, Aug 19, 2008 at 3:21 PM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> On Sat, 16 Aug 2008 15:35:54 +0200 Ingo Molnar wrote:
>
>>
>> * Yinghai Lu <yhlu.kernel@gmail.com> wrote:
>>
>> >     merge io_apic_xx.c
>> >
>> > Thanks
>>
>> applied to tip/irq/sparseirq - thanks!
>
>
> Are there patches in the io_apic series to fix these warnings in linux-next?? ::
>
>
> linux-next-20080819/arch/x86/kernel/io_apic_32.c:1539: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
> linux-next-20080819/arch/x86/kernel/io_apic_32.c:1540: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64
>
>
> and
>
> linux-next-20080819/arch/x86/kernel/io_apic_32.c:1539: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
> linux-next-20080819/arch/x86/kernel/io_apic_32.c:1540: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
>

No

after get io_apic_xx.c merged.

YH

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/5] merge io_apic_xx.c -- fix
  2008-08-20  0:24     ` Yinghai Lu
@ 2008-08-20  0:27       ` Andrew Morton
  2008-08-20  0:32         ` Randy Dunlap
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Morton @ 2008-08-20  0:27 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: randy.dunlap, mingo, tglx, hpa, ebiederm, linux-kernel

On Tue, 19 Aug 2008 17:24:08 -0700
"Yinghai Lu" <yhlu.kernel@gmail.com> wrote:

> On Tue, Aug 19, 2008 at 3:21 PM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> > On Sat, 16 Aug 2008 15:35:54 +0200 Ingo Molnar wrote:
> >
> >>
> >> * Yinghai Lu <yhlu.kernel@gmail.com> wrote:
> >>
> >> >     merge io_apic_xx.c
> >> >
> >> > Thanks
> >>
> >> applied to tip/irq/sparseirq - thanks!
> >
> >
> > Are there patches in the io_apic series to fix these warnings in linux-next?? ::
> >
> >
> > linux-next-20080819/arch/x86/kernel/io_apic_32.c:1539: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
> > linux-next-20080819/arch/x86/kernel/io_apic_32.c:1540: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64
> >
> >
> > and
> >
> > linux-next-20080819/arch/x86/kernel/io_apic_32.c:1539: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
> > linux-next-20080819/arch/x86/kernel/io_apic_32.c:1540: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
> >
> 
> No

yes

From: Andrew Morton <akpm@linux-foundation.org>

arch/x86/kernel/io_apic_32.c: In function 'print_local_APIC':
arch/x86/kernel/io_apic_32.c:1539: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
arch/x86/kernel/io_apic_32.c:1540: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'

No need for casting here - we know what type u64 has.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/x86/kernel/io_apic_32.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN arch/x86/kernel/io_apic_32.c~arch-x86-kernel-io_apic_32c-fix-printk-warnings arch/x86/kernel/io_apic_32.c
--- a/arch/x86/kernel/io_apic_32.c~arch-x86-kernel-io_apic_32c-fix-printk-warnings
+++ a/arch/x86/kernel/io_apic_32.c
@@ -1536,8 +1536,8 @@ __apicdebuginit(void) print_local_APIC(v
 	}
 
 	icr = apic_icr_read();
-	printk(KERN_DEBUG "... APIC ICR: %08x\n", icr);
-	printk(KERN_DEBUG "... APIC ICR2: %08x\n", icr >> 32);
+	printk(KERN_DEBUG "... APIC ICR: %08Lx\n", icr);
+	printk(KERN_DEBUG "... APIC ICR2: %08Lx\n", icr >> 32);
 
 	v = apic_read(APIC_LVTT);
 	printk(KERN_DEBUG "... APIC LVTT: %08x\n", v);
_


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/5] merge io_apic_xx.c -- fix
  2008-08-20  0:27       ` Andrew Morton
@ 2008-08-20  0:32         ` Randy Dunlap
  2008-08-20 10:53           ` Ingo Molnar
  0 siblings, 1 reply; 12+ messages in thread
From: Randy Dunlap @ 2008-08-20  0:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Yinghai Lu, mingo, tglx, hpa, ebiederm, linux-kernel

Andrew Morton wrote:
> On Tue, 19 Aug 2008 17:24:08 -0700
> "Yinghai Lu" <yhlu.kernel@gmail.com> wrote:
> 
>> On Tue, Aug 19, 2008 at 3:21 PM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
>>> On Sat, 16 Aug 2008 15:35:54 +0200 Ingo Molnar wrote:
>>>
>>>> * Yinghai Lu <yhlu.kernel@gmail.com> wrote:
>>>>
>>>>>     merge io_apic_xx.c
>>>>>
>>>>> Thanks
>>>> applied to tip/irq/sparseirq - thanks!
>>>
>>> Are there patches in the io_apic series to fix these warnings in linux-next?? ::
>>>
>>>
>>> linux-next-20080819/arch/x86/kernel/io_apic_32.c:1539: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
>>> linux-next-20080819/arch/x86/kernel/io_apic_32.c:1540: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64
>>>
>>>
>>> and
>>>
>>> linux-next-20080819/arch/x86/kernel/io_apic_32.c:1539: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
>>> linux-next-20080819/arch/x86/kernel/io_apic_32.c:1540: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
>>>
>> No
> 
> yes
> 
> From: Andrew Morton <akpm@linux-foundation.org>
> 
> arch/x86/kernel/io_apic_32.c: In function 'print_local_APIC':
> arch/x86/kernel/io_apic_32.c:1539: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
> arch/x86/kernel/io_apic_32.c:1540: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'u64'
> 
> No need for casting here - we know what type u64 has.
> 
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  arch/x86/kernel/io_apic_32.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff -puN arch/x86/kernel/io_apic_32.c~arch-x86-kernel-io_apic_32c-fix-printk-warnings arch/x86/kernel/io_apic_32.c
> --- a/arch/x86/kernel/io_apic_32.c~arch-x86-kernel-io_apic_32c-fix-printk-warnings
> +++ a/arch/x86/kernel/io_apic_32.c
> @@ -1536,8 +1536,8 @@ __apicdebuginit(void) print_local_APIC(v
>  	}
>  
>  	icr = apic_icr_read();
> -	printk(KERN_DEBUG "... APIC ICR: %08x\n", icr);
> -	printk(KERN_DEBUG "... APIC ICR2: %08x\n", icr >> 32);
> +	printk(KERN_DEBUG "... APIC ICR: %08Lx\n", icr);
> +	printk(KERN_DEBUG "... APIC ICR2: %08Lx\n", icr >> 32);
>  
>  	v = apic_read(APIC_LVTT);
>  	printk(KERN_DEBUG "... APIC LVTT: %08x\n", v);
> _


Crud, I had a copy-paste error.  There are also printk format warnings
in io_apic_64.c:

linux-next-20080819/arch/x86/kernel/io_apic_64.c:1284: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'long unsigned int'
linux-next-20080819/arch/x86/kernel/io_apic_64.c:1285: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'long unsigned int


-- 
~Randy
Linux Plumbers Conference, 17-19 September 2008, Portland, Oregon USA
http://linuxplumbersconf.org/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/5] merge io_apic_xx.c -- fix
  2008-08-20  0:32         ` Randy Dunlap
@ 2008-08-20 10:53           ` Ingo Molnar
  0 siblings, 0 replies; 12+ messages in thread
From: Ingo Molnar @ 2008-08-20 10:53 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Andrew Morton, Yinghai Lu, tglx, hpa, ebiederm, linux-kernel


* Randy Dunlap <randy.dunlap@oracle.com> wrote:

> Crud, I had a copy-paste error.  There are also printk format warnings
> in io_apic_64.c:
> 
> linux-next-20080819/arch/x86/kernel/io_apic_64.c:1284: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'long unsigned int'
> linux-next-20080819/arch/x86/kernel/io_apic_64.c:1285: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'long unsigned int

i have the commit below queued up in tip/irq/sparseirq.

	Ingo

-------------->
>From 0a7c144ca555c86b8410f2d6e1c10bf14fd481d1 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Mon, 18 Aug 2008 13:04:26 +0200
Subject: [PATCH] warning: fix arch x86 kernel io_apic c
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

fix warning:

  arch/x86/kernel/io_apic.c: In function ‘print_local_APIC’:
  arch/x86/kernel/io_apic.c:1786: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘u64’
  arch/x86/kernel/io_apic.c:1787: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘u64’

By creating uniform behavior on 32-bit and 64-bit and printing out the ICR
value in two 32-bit words.

Code has changed:

   text	   data	    bss	    dec	    hex	filename
  22901	  19650	  17040	  59591	   e8c7	io_apic.o.before
  22899	  19650	  17040	  59589	   e8c5	io_apic.o.after

Due to the 32-bit cast narrowing the printed out value on 64-bit.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/io_apic.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index f7e8026..34c74cf 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -1774,8 +1774,8 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
 	}
 
 	icr = apic_icr_read();
-	printk(KERN_DEBUG "... APIC ICR: %08x\n", icr);
-	printk(KERN_DEBUG "... APIC ICR2: %08x\n", icr >> 32);
+	printk(KERN_DEBUG "... APIC ICR: %08x\n", (u32)icr);
+	printk(KERN_DEBUG "... APIC ICR2: %08x\n", (u32)(icr >> 32));
 
 	v = apic_read(APIC_LVTT);
 	printk(KERN_DEBUG "... APIC LVTT: %08x\n", v);

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-08-20 10:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-16 10:07 [PATCH 0/5] merge io_apic_xx.c -- fix Yinghai Lu
2008-08-16 10:07 ` [PATCH 1/5] pci: change msi-x vector to 32bit Yinghai Lu
2008-08-16 10:07   ` Yinghai Lu
2008-08-16 10:07     ` [PATCH 3/5] x86: irq: interrupt array size should be NR_VECTORS Yinghai Lu
2008-08-16 10:07       ` [PATCH 4/5] x86: unify mask_IO_APIC_irq Yinghai Lu
2008-08-16 10:07         ` [PATCH 5/5] x86: unify ack_apic_edge Yinghai Lu
2008-08-16 13:35 ` [PATCH 0/5] merge io_apic_xx.c -- fix Ingo Molnar
2008-08-19 22:21   ` Randy Dunlap
2008-08-20  0:24     ` Yinghai Lu
2008-08-20  0:27       ` Andrew Morton
2008-08-20  0:32         ` Randy Dunlap
2008-08-20 10:53           ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox