All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [BUG REPORT 2.6.0] cisco airo_cs scheduling while atomic
@ 2003-07-19 12:58 Sven Dowideit
  2003-07-21 17:15 ` Georg Nikodym
  0 siblings, 1 reply; 9+ messages in thread
From: Sven Dowideit @ 2003-07-19 12:58 UTC (permalink / raw)
  To: Andrew Morton; +Cc: breed, linux-kernel, Tom Sightler

[-- Attachment #1: Type: text/plain, Size: 6627 bytes --]

hey there,
	I have a longer version of this patch from Tom that i applied to
2.6-test1, that fixes the bad scheduling problem..

I have appended his patch - will this qualify for a sucessful test?

cheers

sven

--------

Message: 19
Date: Fri, 18 Jul 2003 14:04:14 -0700
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

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;
 }
 

_

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

-----------------------------------------------------------------


Tom's patch:

--- airo.c      2003-05-31 09:26:12.000000000 -0400
+++ airo.c.tom  2003-06-19 15:37:07.100811000 -0400
@@ -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
@@ -1762,6 +1763,8 @@
        int i;
        struct airo_info *ai = dev->priv;
 
+       if (down_interruptible(&ai->sem))
+               return -1;
        waitbusy (ai);
        OUT4500(ai,COMMAND,CMD_SOFTRESET);
        set_current_state (TASK_UNINTERRUPTIBLE);
@@ -1771,6 +1774,7 @@
        schedule_timeout (HZ/5);
        if ( setup_card(ai, dev->dev_addr ) != SUCCESS ) {
                printk( KERN_ERR "airo: MAC could not be enabled\n" );
+               up(&ai->sem);
                return -1;
        } else {
                printk( KERN_INFO "airo: MAC enabled %s
%x:%x:%x:%x:%x:%x\n",
@@ -1788,6 +1792,7 @@
        }
        enable_interrupts( ai );
        netif_wake_queue(dev);
+       up(&ai->sem);
        return 0;
 }
 
@@ -1866,6 +1871,7 @@
 
                if ( status & EV_MIC ) {
                        OUT4500( apriv, EVACK, EV_MIC );
+                       if (apriv->flags & FLAG_MIC_CAPABLE)
                        airo_read_mic( apriv );
                }
                if ( status & EV_LINK ) {
@@ -2379,20 +2385,26 @@
 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;
 }
 
@@ -2653,11 +2665,11 @@
        if (down_interruptible(&ai->sem))
                return ERROR;
        if (issuecommand(ai, &cmd, &rsp) != SUCCESS) {
-               txFid = 0;
+               txFid = ERROR;
                goto done;
        }
        if ( (rsp.status & 0xFF00) != 0) {
-               txFid = 0;
+               txFid = ERROR;
                goto done;
        }
        /* wait for the allocate event/indication
@@ -2704,7 +2716,7 @@
 
        len >>= 16;
 
-       if (len < ETH_ALEN * 2) {
+       if (len <= ETH_ALEN * 2) {
                printk( KERN_WARNING "Short packet %d\n", len );
                return ERROR;
        }
@@ -4838,7 +4850,7 @@
        readCapabilityRid(local, &cap_rid);
 
        dwrq->length = sizeof(struct iw_range);
-       memset(range, 0, sizeof(*range));
+       memset(range, 0, sizeof(range));
        range->min_nwid = 0x0000;
        range->max_nwid = 0x0000;
        range->num_channels = 14;



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: [BUG REPORT 2.6.0] cisco airo_cs scheduling while atomic
@ 2003-07-19 12:17 Daniel Ritz
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Ritz @ 2003-07-19 12:17 UTC (permalink / raw)
  To: Tom Sightler, Andrew Morton, linux-kernel; +Cc: Jeff Garzik

> > Well Daniel Ritz has posted a big fix to the driver so I threw mine away. 
> > I'll include it in the next -mm, so please test that.
>
> I've applied Daniel's patch to my 2.6.0-test1-mm1 tree on two of my test
> systems (a PCMCIA and PCI version of the Aironet 350 series) and both
> are working great.  His patches look pretty obviously correct to me and
> are much cleaner than the hacked up patches I've been sending out to
> people to get the card working on recent 2.5.7x kernels.  Just wanted to
> report the success.
>

thanx...nice to hear that it works...

> Later,
> Tom
>

-daniel


^ permalink raw reply	[flat|nested] 9+ messages in thread
* [BUG REPORT 2.6.0] cisco airo_cs scheduling while atomic
@ 2003-07-18 13:03 James Bourne
  2003-07-18 21:04 ` Andrew Morton
  0 siblings, 1 reply; 9+ messages in thread
From: James Bourne @ 2003-07-18 13:03 UTC (permalink / raw)
  To: Benjamin Reed; +Cc: linux-kernel

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]
Jul 17 15:27:10 localhost kernel:  [<c013e194>] check_poison_obj+0x54/0x1d0
Jul 17 15:27:10 localhost kernel:  [<c013e194>] check_poison_obj+0x54/0x1d0
Jul 17 15:27:10 localhost kernel:  [<c013fa94>] kmem_cache_alloc+0x114/0x160
Jul 17 15:27:10 localhost kernel:  [<c01848ce>] proc_alloc_inode+0x1e/0x80
Jul 17 15:27:10 localhost kernel:  [<c01848fd>] proc_alloc_inode+0x4d/0x80
Jul 17 15:27:10 localhost kernel:  [<c016def7>] alloc_inode+0xd7/0x190
Jul 17 15:27:10 localhost kernel:  [<c0184887>] proc_read_inode+0x17/0x40
Jul 17 15:27:10 localhost kernel:  [<c016f941>] wake_up_inode+0x11/0x30
Jul 17 15:27:10 localhost kernel:  [<c01f070a>] vsnprintf+0x21a/0x440
Jul 17 15:27:10 localhost kernel:  [<c0173bd5>] seq_printf+0x45/0x60
Jul 17 15:27:10 localhost kernel:  [<c02846eb>] dev_seq_printf_stats+0xeb/0x100
Jul 17 15:27:10 localhost kernel:  [<c0284726>] dev_seq_show+0x26/0x80
Jul 17 15:27:10 localhost kernel:  [<c0173689>] seq_read+0x1c9/0x300
Jul 17 15:27:10 localhost kernel:  [<c0154bd3>] vfs_read+0xd3/0x140
Jul 17 15:27:10 localhost kernel:  [<c0154e7f>] sys_read+0x3f/0x60
Jul 17 15:27:10 localhost kernel:  [<c01094fb>] syscall_call+0x7/0xb

Regards
James Bourne

-- 
James Bourne                  | Email:            jbourne@hardrock.org          
Unix Systems Administrator    | WWW:           http://www.hardrock.org
Custom Unix Programming       | Linux:  The choice of a GNU generation
----------------------------------------------------------------------
 "All you need's an occasional kick in the philosophy." Frank Herbert  



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

end of thread, other threads:[~2003-07-21 19:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-19 12:58 [BUG REPORT 2.6.0] cisco airo_cs scheduling while atomic Sven Dowideit
2003-07-21 17:15 ` Georg Nikodym
2003-07-21 19:52   ` Tom Sightler
  -- strict thread matches above, loose matches on Subject: below --
2003-07-19 12:17 Daniel Ritz
2003-07-18 13:03 James Bourne
2003-07-18 21:04 ` Andrew Morton
2003-07-19  2:46   ` James Bourne
2003-07-19  3:00     ` Andrew Morton
2003-07-19  4:36       ` Tom Sightler

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.