Seen in 2.6.32 for OpenSuse. Applies fine to latest Debian 2.6.32. Please consider for stable and longterm tree inclusion.
thanks ----- Forwarded message from Linux Kernel Mailing List <[email protected]> ----- Date: Thu, 21 Oct 2010 22:04:22 GMT From: Linux Kernel Mailing List <[email protected]> To: [email protected] Subject: isdn: hisax: Replace the bogus access to irq stats Gitweb: http://git.kernel.org/linus/40f08a724fcc21285cf3a75aec957aef908605c6 Commit: 40f08a724fcc21285cf3a75aec957aef908605c6 Parent: 154cd387cdf0e5566ce523cbddf92dd2a062dfd6 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed Sep 29 22:16:36 2010 +0200 Committer: Thomas Gleixner <[email protected]> CommitDate: Tue Oct 12 16:39:06 2010 +0200 isdn: hisax: Replace the bogus access to irq stats Abusing irq stats in a driver for counting interrupts is a horrible idea and not safe with shared interrupts. Replace it by a local interrupt counter. Noticed by the attempt to remove the irq stats export. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Ingo Molnar <[email protected]> --- drivers/isdn/hisax/config.c | 18 ++++++++++++++---- drivers/isdn/hisax/hisax.h | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index 6f9afcd..b133378 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -801,6 +801,16 @@ static void closecard(int cardnr) ll_unload(csta); } +static irqreturn_t card_irq(int intno, void *dev_id) +{ + struct IsdnCardState *cs = dev_id; + irqreturn_t ret = cs->irq_func(intno, cs); + + if (ret == IRQ_HANDLED) + cs->irq_cnt++; + return ret; +} + static int init_card(struct IsdnCardState *cs) { int irq_cnt, cnt = 3, ret; @@ -809,10 +819,10 @@ static int init_card(struct IsdnCardState *cs) ret = cs->cardmsg(cs, CARD_INIT, NULL); return(ret); } - irq_cnt = kstat_irqs(cs->irq); + irq_cnt = cs->irq_cnt = 0; printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ], cs->irq, irq_cnt); - if (request_irq(cs->irq, cs->irq_func, cs->irq_flags, "HiSax", cs)) { + if (request_irq(cs->irq, card_irq, cs->irq_flags, "HiSax", cs)) { printk(KERN_WARNING "HiSax: couldn't get interrupt %d\n", cs->irq); return 1; @@ -822,8 +832,8 @@ static int init_card(struct IsdnCardState *cs) /* Timeout 10ms */ msleep(10); printk(KERN_INFO "%s: IRQ %d count %d\n", - CardType[cs->typ], cs->irq, kstat_irqs(cs->irq)); - if (kstat_irqs(cs->irq) == irq_cnt) { + CardType[cs->typ], cs->irq, cs->irq_cnt); + if (cs->irq_cnt == irq_cnt) { printk(KERN_WARNING "%s: IRQ(%d) getting no interrupts during init %d\n", CardType[cs->typ], cs->irq, 4 - cnt); diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index 832a878..32ab392 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -959,6 +959,7 @@ struct IsdnCardState { u_long event; struct work_struct tqueue; struct timer_list dbusytimer; + unsigned int irq_cnt; #ifdef ERROR_STATISTIC int err_crc; int err_tx; -- To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html ----- End forwarded message ----- _______________________________________________ stable mailing list [email protected] http://linux.kernel.org/mailman/listinfo/stable
