2006-11-14 07:22:27

by Yanmin Zhang

[permalink] [raw]
Subject: [PATCH] Incorrect MSI interrupt type name

/proc/interrupts shows "<NULL>" for MSI interrupt type name on
my ia64 machine.

Below patch against 2.6.19-rc5-mm1 fixes it.

Signed-off-by: Zhang Yanmin <[email protected]>

---

--- linux-2.6.19-rc5-mm1/arch/ia64/kernel/msi_ia64.c 2006-11-14 14:16:12.000000000 +0800
+++ linux-2.6.19-rc5-mm1_fix/arch/ia64/kernel/msi_ia64.c 2006-11-14 15:08:37.000000000 +0800
@@ -115,7 +115,7 @@ static int ia64_msi_retrigger_irq(unsign
* Generic ops used on most IA64 platforms.
*/
static struct irq_chip ia64_msi_chip = {
- .name = "PCI-MSI",
+ .typename = "PCI-MSI",
.mask = mask_msi_irq,
.unmask = unmask_msi_irq,
.ack = ia64_ack_msi_irq,


2006-11-14 07:43:24

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Incorrect MSI interrupt type name

On Tue, 14 Nov 2006 15:22:57 +0800
"Zhang, Yanmin" <[email protected]> wrote:

> /proc/interrupts shows "<NULL>" for MSI interrupt type name on
> my ia64 machine.
>
> Below patch against 2.6.19-rc5-mm1 fixes it.
>
> Signed-off-by: Zhang Yanmin <[email protected]>
>
> ---
>
> --- linux-2.6.19-rc5-mm1/arch/ia64/kernel/msi_ia64.c 2006-11-14 14:16:12.000000000 +0800
> +++ linux-2.6.19-rc5-mm1_fix/arch/ia64/kernel/msi_ia64.c 2006-11-14 15:08:37.000000000 +0800
> @@ -115,7 +115,7 @@ static int ia64_msi_retrigger_irq(unsign
> * Generic ops used on most IA64 platforms.
> */
> static struct irq_chip ia64_msi_chip = {
> - .name = "PCI-MSI",
> + .typename = "PCI-MSI",
> .mask = mask_msi_irq,
> .unmask = unmask_msi_irq,
> .ack = ia64_ack_msi_irq,

I think the bug is that ia64 is printing ->typename, whereas it should be
printing ->name:


arch/ia64/kernel/iosapic.c | 2 +-
arch/ia64/kernel/irq.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff -puN arch/ia64/kernel/iosapic.c~ia64-irqs-use-name-not-typename arch/ia64/kernel/iosapic.c
--- a/arch/ia64/kernel/iosapic.c~ia64-irqs-use-name-not-typename
+++ a/arch/ia64/kernel/iosapic.c
@@ -664,7 +664,7 @@ register_intr (unsigned int gsi, int vec
printk(KERN_WARNING
"%s: changing vector %d from %s to %s\n",
__FUNCTION__, vector,
- idesc->chip->typename, irq_type->typename);
+ idesc->chip->name, irq_type->name);
idesc->chip = irq_type;
}
return 0;
diff -puN arch/ia64/kernel/irq.c~ia64-irqs-use-name-not-typename arch/ia64/kernel/irq.c
--- a/arch/ia64/kernel/irq.c~ia64-irqs-use-name-not-typename
+++ a/arch/ia64/kernel/irq.c
@@ -76,7 +76,7 @@ int show_interrupts(struct seq_file *p,
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
}
#endif
- seq_printf(p, " %14s", irq_desc[i].chip->typename);
+ seq_printf(p, " %14s", irq_desc[i].chip->name);
seq_printf(p, " %s", action->name);

for (action=action->next; action; action = action->next)
_

2006-11-14 08:23:00

by Yanmin Zhang

[permalink] [raw]
Subject: Re: [PATCH] Incorrect MSI interrupt type name

On Tue, 2006-11-14 at 15:43, Andrew Morton wrote:
> On Tue, 14 Nov 2006 15:22:57 +0800
> "Zhang, Yanmin" <[email protected]> wrote:
>
> > /proc/interrupts shows "<NULL>" for MSI interrupt type name on
> > my ia64 machine.
> >
> > Below patch against 2.6.19-rc5-mm1 fixes it.
> >
> > Signed-off-by: Zhang Yanmin <[email protected]>
> >
> > ---
> >
> > --- linux-2.6.19-rc5-mm1/arch/ia64/kernel/msi_ia64.c 2006-11-14 14:16:12.000000000 +0800
> > +++ linux-2.6.19-rc5-mm1_fix/arch/ia64/kernel/msi_ia64.c 2006-11-14 15:08:37.000000000 +0800
> > @@ -115,7 +115,7 @@ static int ia64_msi_retrigger_irq(unsign
> > * Generic ops used on most IA64 platforms.
> > */
> > static struct irq_chip ia64_msi_chip = {
> > - .name = "PCI-MSI",
> > + .typename = "PCI-MSI",
> > .mask = mask_msi_irq,
> > .unmask = unmask_msi_irq,
> > .ack = ia64_ack_msi_irq,
>
> I think the bug is that ia64 is printing ->typename, whereas it should be
> printing ->name:
A couple of other arch also use typename instead of name when printing.

In addition, function irq_chip_set_defaults will let name=typename if
name is NULL.

Is it more reasonable to delete typename completely?

>
>
> arch/ia64/kernel/iosapic.c | 2 +-
> arch/ia64/kernel/irq.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff -puN arch/ia64/kernel/iosapic.c~ia64-irqs-use-name-not-typename arch/ia64/kernel/iosapic.c
> --- a/arch/ia64/kernel/iosapic.c~ia64-irqs-use-name-not-typename
> +++ a/arch/ia64/kernel/iosapic.c
> @@ -664,7 +664,7 @@ register_intr (unsigned int gsi, int vec
> printk(KERN_WARNING
> "%s: changing vector %d from %s to %s\n",
> __FUNCTION__, vector,
> - idesc->chip->typename, irq_type->typename);
> + idesc->chip->name, irq_type->name);
> idesc->chip = irq_type;
> }
> return 0;
> diff -puN arch/ia64/kernel/irq.c~ia64-irqs-use-name-not-typename arch/ia64/kernel/irq.c
> --- a/arch/ia64/kernel/irq.c~ia64-irqs-use-name-not-typename
> +++ a/arch/ia64/kernel/irq.c
> @@ -76,7 +76,7 @@ int show_interrupts(struct seq_file *p,
> seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
> }
> #endif
> - seq_printf(p, " %14s", irq_desc[i].chip->typename);
> + seq_printf(p, " %14s", irq_desc[i].chip->name);
> seq_printf(p, " %s", action->name);
>
> for (action=action->next; action; action = action->next)
> _

2006-11-14 08:32:33

by Eric W. Biederman

[permalink] [raw]
Subject: Re: [PATCH] Incorrect MSI interrupt type name

Andrew Morton <[email protected]> writes:

> On Tue, 14 Nov 2006 15:22:57 +0800
> "Zhang, Yanmin" <[email protected]> wrote:
>
>> /proc/interrupts shows "<NULL>" for MSI interrupt type name on
>> my ia64 machine.
>>
>> Below patch against 2.6.19-rc5-mm1 fixes it.
>>
>> Signed-off-by: Zhang Yanmin <[email protected]>
>>
>> ---
>>
>> --- linux-2.6.19-rc5-mm1/arch/ia64/kernel/msi_ia64.c 2006-11-14
> 14:16:12.000000000 +0800
>> +++ linux-2.6.19-rc5-mm1_fix/arch/ia64/kernel/msi_ia64.c 2006-11-14
> 15:08:37.000000000 +0800
>> @@ -115,7 +115,7 @@ static int ia64_msi_retrigger_irq(unsign
>> * Generic ops used on most IA64 platforms.
>> */
>> static struct irq_chip ia64_msi_chip = {
>> - .name = "PCI-MSI",
>> + .typename = "PCI-MSI",
>> .mask = mask_msi_irq,
>> .unmask = unmask_msi_irq,
>> .ack = ia64_ack_msi_irq,
>
> I think the bug is that ia64 is printing ->typename, whereas it should be
> printing ->name:

Looks right. The basic issue is that the msi code is fully
genirq converted. While the rest of the ia64 code has yet to
be updated.

But since irq_chip_set_defaults sets name and typename to be
the same I believe this patch is safe.

Eric


> arch/ia64/kernel/iosapic.c | 2 +-
> arch/ia64/kernel/irq.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff -puN arch/ia64/kernel/iosapic.c~ia64-irqs-use-name-not-typename
> arch/ia64/kernel/iosapic.c
> --- a/arch/ia64/kernel/iosapic.c~ia64-irqs-use-name-not-typename
> +++ a/arch/ia64/kernel/iosapic.c
> @@ -664,7 +664,7 @@ register_intr (unsigned int gsi, int vec
> printk(KERN_WARNING
> "%s: changing vector %d from %s to %s\n",
> __FUNCTION__, vector,
> - idesc->chip->typename, irq_type->typename);
> + idesc->chip->name, irq_type->name);
> idesc->chip = irq_type;
> }
> return 0;
> diff -puN arch/ia64/kernel/irq.c~ia64-irqs-use-name-not-typename
> arch/ia64/kernel/irq.c
> --- a/arch/ia64/kernel/irq.c~ia64-irqs-use-name-not-typename
> +++ a/arch/ia64/kernel/irq.c
> @@ -76,7 +76,7 @@ int show_interrupts(struct seq_file *p,
> seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
> }
> #endif
> - seq_printf(p, " %14s", irq_desc[i].chip->typename);
> + seq_printf(p, " %14s", irq_desc[i].chip->name);
> seq_printf(p, " %s", action->name);
>
> for (action=action->next; action; action = action->next)
> _