All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: James Bourne <jbourne@hardrock.org>
Cc: breed@users.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [BUG REPORT 2.6.0] cisco airo_cs scheduling while atomic
Date: Fri, 18 Jul 2003 14:04:14 -0700	[thread overview]
Message-ID: <20030718140414.371cdb55.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0307180656090.19070-100000@cafe.hardrock.org>

James Bourne <jbourne@hardrock.org> wrote:
>
> The Cisco Airo card driver calls schedule while atomic in the function
> issuecommand in drivers/net/wireless/airo.c line 2388.
> 
> 
> Jul 17 15:27:10 localhost kernel: bad: scheduling while atomic!
> Jul 17 15:27:10 localhost kernel: Call Trace:
> Jul 17 15:27:10 localhost kernel:  [<c0119754>] schedule+0x3c4/0x3d0
> Jul 17 15:27:10 localhost kernel:  [<d18cbb51>] sendcommand+0xa1/0xe0 [airo]
> Jul 17 15:27:10 localhost kernel:  [<d18cba80>] issuecommand+0x60/0x90 [airo]
> Jul 17 15:27:10 localhost kernel:  [<d18cc001>] PC4500_accessrid+0x41/0x80 [airo]
> Jul 17 15:27:10 localhost kernel:  [<d18cc0a3>] PC4500_readrid+0x63/0x130 [airo]
> Jul 17 15:27:10 localhost kernel:  [<d18c95d9>] readStatsRid+0x29/0x50 [airo]
> Jul 17 15:27:10 localhost kernel:  [<d18c9c0a>] airo_get_stats+0x2a/0xe0 [airo]

I've been waiting months for someone to test this patch.  Can you please do
so?


diff -puN drivers/net/wireless/airo.c~airo-schedule-fix drivers/net/wireless/airo.c
--- 25/drivers/net/wireless/airo.c~airo-schedule-fix	2003-06-26 17:37:47.000000000 -0700
+++ 25-akpm/drivers/net/wireless/airo.c	2003-06-26 17:37:47.000000000 -0700
@@ -44,6 +44,7 @@
 #include <linux/ioport.h>
 #include <linux/config.h>
 #include <linux/pci.h>
+#include <linux/delay.h>
 #include <asm/uaccess.h>
 
 #ifdef CONFIG_PCI
@@ -2379,20 +2380,26 @@ static u16 setup_card(struct airo_info *
 static u16 issuecommand(struct airo_info *ai, Cmd *pCmd, Resp *pRsp) {
         // Im really paranoid about letting it run forever!
 	int max_tries = 600000;
+	static int max = 0;
+	int count = 0;
 
 	if (sendcommand(ai, pCmd) == (u16)ERROR)
 		return ERROR;
 
 	while (max_tries-- && (IN4500(ai, EVSTAT) & EV_CMD) == 0) {
-		if (!in_interrupt() && (max_tries & 255) == 0)
-			schedule();
+		udelay(1);
+		count++;
 	}
-	if ( max_tries == -1 ) {
+	if (max_tries == -1) {
 		printk( KERN_ERR
 			"airo: Max tries exceeded waiting for command\n" );
                 return ERROR;
 	}
 	completecommand(ai, pRsp);
+	if (count > max) {
+		max = count;
+		printk("%s: max delay = %d usec\n", __FUNCTION__, max);
+	}
 	return SUCCESS;
 }
 

_


  reply	other threads:[~2003-07-18 20:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-18 13:03 [BUG REPORT 2.6.0] cisco airo_cs scheduling while atomic James Bourne
2003-07-18 21:04 ` Andrew Morton [this message]
2003-07-19  2:46   ` James Bourne
2003-07-19  3:00     ` Andrew Morton
2003-07-19  4:36       ` Tom Sightler
2003-07-19 12:17 Daniel Ritz
2003-07-19 12:58 Sven Dowideit
2003-07-21 17:15 ` Georg Nikodym
2003-07-21 19:52   ` Tom Sightler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030718140414.371cdb55.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=breed@users.sourceforge.net \
    --cc=jbourne@hardrock.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.