how to trigger a WARNING()
Marcelo Tosatti
mtosatti at redhat.com
Mon Oct 22 19:29:27 EDT 2007
Hi Holger,
On Wed, Oct 10, 2007 at 11:42:30AM +0200, Holger Schurig wrote:
> $ cd /sys/kernel/debug/libertas_wireless/eth1/subscribed_events
> $ cat beacon_missed
> 60 N/A 1
> $ cat failure_count
> 0 0 0
> $ cat low_snr
> 0 0 0
> $ cat low_rssi
> 0 0 0
> $ cat high_snr
> $ cat high_rssi
> $
>
>
> Note that high_snr/rssi yielded no output.
You need to configure high_snr/rssi first. Check the "subscribed_events"
section of README.
> Also look at your
> dmesg, lot's of warnigs in there:
>
> WARNING: at drivers/net/wireless/libertas/cmdresp.c:857
> libertas_process_rx_command()
> [<f8996161>] libertas_process_rx_command+0x1c9c/0x1d2d
> [libertas]
> [<f898a44d>] libertas_thread+0x0/0x68a [libertas]
> [<f898a87a>] libertas_thread+0x42d/0x68a [libertas]
> [<f898a44d>] libertas_thread+0x0/0x68a [libertas]
Argh, the problem is that nr_cmd_pending is not increased in
libertas_queue_cmd(), which is silly (the burden should not be in the
caller).
Can you please try the following?
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index ce28417..23783b9 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -901,6 +901,10 @@ static int wlan_cmd_mesh_access(wlan_pri
return 0;
}
+/*
+ * Note: NEVER use libertas_queue_cmd() with addtail==0 other than for
+ * the command timer, because it does not account for queued commands.
+ */
void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail)
{
unsigned long flags;
@@ -930,10 +934,11 @@ void libertas_queue_cmd(wlan_adapter * a
spin_lock_irqsave(&adapter->driver_lock, flags);
- if (addtail)
+ if (addtail) {
list_add_tail((struct list_head *)cmdnode,
&adapter->cmdpendingq);
- else
+ adapter->nr_cmd_pending++;
+ } else
list_add((struct list_head *)cmdnode, &adapter->cmdpendingq);
spin_unlock_irqrestore(&adapter->driver_lock, flags);
@@ -1412,7 +1417,6 @@ #define ACTION_NUMLED_TLVTYPE_LEN_FIELDS
cmdnode->cmdwaitqwoken = 0;
libertas_queue_cmd(adapter, cmdnode, 1);
- adapter->nr_cmd_pending++;
wake_up_interruptible(&priv->waitq);
if (wait_option & CMD_OPTION_WAITFORRSP) {
More information about the libertas-dev
mailing list