Skip to contentSkip to conversation

genirq: fix incorrect proc spurious output

PATCH In review Kenji Kaneshige 3 participants 5 messages Nov 30, 2010 – Dec 1, 2010 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 genirq: fix incorrect proc spurious output

Fix the problem that all the /proc/irq/XX/spurious files shows the IRQ 0 information.

Current irq_spurious_proc_open() passes on NULL as the 3rd argument, which is used as an IRQ number in irq_spurious_proc_show(), to the single_open(). Because of this, all the /proc/irq/XX/spurious file shows IRQ 0 information regardless of the IRQ number.

To fix the problem, irq_spurious_proc_open() must pass on the appropreate data (IRQ number) to single_open().

---
 kernel/irq/proc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/proc.c +1 -1
Index: linux-next-20101125/kernel/irq/proc.c
===================================================================
@@ -214,7 +214,7 @@ static int irq_spurious_proc_show(struct
 
 static int irq_spurious_proc_open(struct inode *inode, struct file *file)
 {
-	return single_open(file, irq_spurious_proc_show, NULL);
+	return single_open(file, irq_spurious_proc_show, PDE(inode)->data);
 }
 
 static const struct file_operations irq_spurious_proc_fops = {
Reviewed-by on v1 1/1
#1 lore raw

2010/11/30 Kenji Kaneshige <[email protected]>:

Quoted 8 lines

Fix the problem that all the /proc/irq/XX/spurious files shows the IRQ 0 information.

Current irq_spurious_proc_open() passes on NULL as the 3rd argument, which is used as an IRQ number in irq_spurious_proc_show(), to the single_open(). Because of this, all the /proc/irq/XX/spurious file shows IRQ 0 information regardless of the IRQ number.

Quoted 4 lines

To fix the problem, irq_spurious_proc_open() must pass on the appropreate data (IRQ number) to single_open().

Looks good.

BTW, it's introduced by a1afb6371bb5341057056194d1168753f6d77242 So should we Cc'ing stable?

Quoted 25 lines

---
 kernel/irq/proc.c |    2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-next-20101125/kernel/irq/proc.c
===================================================================

kernel/irq/proc.c +1 -2
@@ -214,7 +214,7 @@ static int irq_spurious_proc_show(struct
 
  static int irq_spurious_proc_open(struct inode *inode, struct file *file)
  {
-       return single_open(file, irq_spurious_proc_show, NULL);
+       return single_open(file, irq_spurious_proc_show, PDE(inode)->data);
  }
 
  static const struct file_operations irq_spurious_proc_fops = {
 
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

#2 lore raw
Quoted 12 lines · Yong Zhang

2010/11/30 Kenji Kaneshige <[email protected]>:

Quoted 11 lines

Fix the problem that all the /proc/irq/XX/spurious files shows the IRQ 0 information.

Current irq_spurious_proc_open() passes on NULL as the 3rd argument, which is used as an IRQ number in irq_spurious_proc_show(), to the single_open(). Because of this, all the /proc/irq/XX/spurious file shows IRQ 0 information regardless of the IRQ number.

To fix the problem, irq_spurious_proc_open() must pass on the appropreate data (IRQ number) to single_open().

Quoted 8 lines
Quoted 1 line

Looks good.

BTW, it's introduced by a1afb6371bb5341057056194d1168753f6d77242 So should we Cc'ing stable?

Definitely.

Quoted 5 lines
Quoted 5 lines

 static int irq_spurious_proc_open(struct inode *inode, struct file *file) {
-       return single_open(file, irq_spurious_proc_show, NULL);
+       return single_open(file, irq_spurious_proc_show, PDE(inode)->data); }

#3 lore raw

Thank you for reviewing, Yong, Alexey.
I'll resend the patch with cc:ing stable.

Regards,
Kenji Kaneshige

Quoted 31 lines · Alexey Dobriyan
Quoted 12 lines · Yong Zhang

2010/11/30 Kenji Kaneshige<[email protected]>:

Quoted 11 lines

Fix the problem that all the /proc/irq/XX/spurious files shows the IRQ 0 information.

Current irq_spurious_proc_open() passes on NULL as the 3rd argument, which is used as an IRQ number in irq_spurious_proc_show(), to the single_open(). Because of this, all the /proc/irq/XX/spurious file shows IRQ 0 information regardless of the IRQ number.

To fix the problem, irq_spurious_proc_open() must pass on the appropreate data (IRQ number) to single_open().

Quoted 8 lines
Quoted 1 line

Looks good.

BTW, it's introduced by a1afb6371bb5341057056194d1168753f6d77242 So should we Cc'ing stable?

Definitely.

Quoted 5 lines
Quoted 5 lines

static int irq_spurious_proc_open(struct inode *inode, struct file *file) {

kernel/irq/proc.c +1 -1
-       return single_open(file, irq_spurious_proc_show, NULL);
+       return single_open(file, irq_spurious_proc_show, PDE(inode)->data);
  }
#4 lore raw

[tip:irq/urgent] genirq: Fix incorrect proc spurious output

In reply to Kenji Kaneshige
Commit-ID:  25c9170ed64a6551beefe9315882f754e14486f4
Gitweb:     http://git.kernel.org/tip/25c9170ed64a6551beefe9315882f754e14486f4
Author:     Kenji Kaneshige <[email protected]>
AuthorDate: Tue, 30 Nov 2010 17:36:08 +0900
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Wed, 1 Dec 2010 08:44:26 +0100

genirq: Fix incorrect proc spurious output

Since commit a1afb637(switch /proc/irq/*/spurious to seq_file) all /proc/irq/XX/spurious files show the information of irq 0.

Current irq_spurious_proc_open() passes on NULL as the 3rd argument, which is used as an IRQ number in irq_spurious_proc_show(), to the single_open(). Because of this, all the /proc/irq/XX/spurious file shows IRQ 0 information regardless of the IRQ number.

To fix the problem, irq_spurious_proc_open() must pass on the appropreate data (IRQ number) to single_open().

LKML-Reference: <[email protected]>

---
 kernel/irq/proc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/irq/proc.c +1 -1
index 01b1d3a..6c8a2a9 100644
@@ -214,7 +214,7 @@ static int irq_spurious_proc_show(struct seq_file *m, void *v)
 
 static int irq_spurious_proc_open(struct inode *inode, struct file *file)
 {
-	return single_open(file, irq_spurious_proc_show, NULL);
+	return single_open(file, irq_spurious_proc_show, PDE(inode)->data);
 }
 
 static const struct file_operations irq_spurious_proc_fops = {