#8301 BLOC 8.2.0 (: Fast suspend/resume cycle causes a libertas crash

Zarro Boogs per Child bugtracker at laptop.org
Mon Sep 8 15:08:31 EDT 2008


#8301: Fast suspend/resume cycle causes a libertas crash
------------------------+---------------------------------------------------
   Reporter:  cjb       |       Owner:  dsaxena                        
       Type:  defect    |      Status:  new                            
   Priority:  blocker   |   Milestone:  8.2.0 (was Update.2)           
  Component:  kernel    |     Version:  not specified                  
 Resolution:            |    Keywords:  blocks-:8.2.0 cjbfor8.2 relnote
Next_action:  diagnose  |    Verified:  0                              
  Blockedby:            |    Blocking:                                 
------------------------+---------------------------------------------------

Comment(by dcbw):

 The current command actually gets removed from the pending command queue
 when it's in-flight, and thus the code in lbs_stop_card() doesn't look
 like it could possibly kill that command too.  Can you try the following
 patch (completely untested, against stable)?

 {{{
 diff --git a/drivers/net/wireless/libertas/cmd.c
 b/drivers/net/wireless/libertas/cmd.c
 index fcf3826..3ea3136 100644
 --- a/drivers/net/wireless/libertas/cmd.c
 +++ b/drivers/net/wireless/libertas/cmd.c
 @@ -1674,6 +1674,7 @@ int lbs_prepare_and_send_command(struct lbs_private
 *priv,
                 might_sleep();
                 wait_event_interruptible(cmdnode->cmdwait_q,
                                          cmdnode->cmdwaitqwoken);
 +lbs_deb_host("PREP_CMD: done waiting for command 0x%X\n", cmd_no);
         }

         spin_lock_irqsave(&priv->driver_lock, flags);
 diff --git a/drivers/net/wireless/libertas/main.c
 b/drivers/net/wireless/libertas/main.c
 index 20af097..b4cdb4b 100644
 --- a/drivers/net/wireless/libertas/main.c
 +++ b/drivers/net/wireless/libertas/main.c
 @@ -1300,11 +1300,24 @@ int lbs_stop_card(struct lbs_private *priv)

         /* Flush pending command nodes */
         spin_lock_irqsave(&priv->driver_lock, flags);
 +lbs_deb_main("%s: clearing pending commands\n", __func__);
         list_for_each_entry(cmdnode, &priv->cmdpendingq, list) {
                 cmdnode->result = -ENOENT;
                 cmdnode->cmdwaitqwoken = 1;
                 wake_up_interruptible(&cmdnode->cmdwait_q);
         }
 +
 +       if (priv->cur_cmd) {
 +               struct cmd_header *cmd;
 +
 +               cmd = priv->cur_cmd->cmdbuf;
 +               lbs_deb_main("%s: clearing in-flight command 0x%X\n",
 __func__, le16_to_cpu(cmd->command));
 +
 +               priv->cur_cmd->result = -ENOENT;
 +               priv->cur_cmd->cmdwaitqwoken = 1;
 +               wake_up_interruptible(&priv->cur_cmd->cmdwait_q);
 +       }
 +lbs_deb_main("%s: done clearing commands\n", __func__);
         spin_unlock_irqrestore(&priv->driver_lock, flags);

         unregister_netdev(dev);
 }}}

-- 
Ticket URL: <http://dev.laptop.org/ticket/8301#comment:38>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list