From rusty at rustcorp.com.au  Mon Jun  1 08:27:28 2009
From: rusty at rustcorp.com.au (Rusty Russell)
Date: Mon, 1 Jun 2009 21:57:28 +0930
Subject: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit
In-Reply-To: <4A1FFB04.30305@gmail.com>
References: <200905292344.56814.rusty@rustcorp.com.au>
	<4A1FFB04.30305@gmail.com>
Message-ID: <200906012157.29465.rusty@rustcorp.com.au>

On Sat, 30 May 2009 12:41:00 am Eric Dumazet wrote:
> Rusty Russell a ?crit :
> > DaveM points out that there are advantages to doing it generally (it's
> > more likely to be on same CPU than after xmit), and I couldn't find
> > any new starvation issues in simple benchmarking here.
>
> If really no starvations are possible at all, I really wonder why some
> guys added memory accounting to UDP flows. Maybe they dont run "simple
> benchmarks" but real apps ? :)

Well, without any accounting at all you could use quite a lot of memory as 
there are many places packets can be queued.

> For TCP, I agree your patch is a huge benefit, since its paced by remote
> ACKS and window control

I doubt that.  There'll be some cache friendliness, but I'm not sure it'll be 
measurable, let alone "huge".  It's the win to drivers which don't have a 
timely and batching tx free mechanism which I aim for.

> , but an UDP sender will likely be able to saturate
> a link.

I couldn't see any difference in saturation here (with default scheduler and an 
100MBit e1000e).  Two reasons come to mind: firstly, only the hardware queue is 
unregulated: the tx queue is still accounted.  And when you add scheduling to 
the mix, I can't in practice cause starvation of other senders.

Hope that clarifies,
Rusty.


From several at amitz.net  Mon Jun  1 13:00:20 2009
From: several at amitz.net (Bickett)
Date: Mon, 01 Jun 2009 17:00:20 +0000
Subject: Sick Maarriage Contract
Message-ID: <ANOVYR1f848444578rUpa@amitz.net>

A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 353 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libertas-dev/attachments/20090601/952a1ac9/attachment.obj>

From linville at tuxdriver.com  Mon Jun  1 14:34:53 2009
From: linville at tuxdriver.com (John W. Linville)
Date: Mon, 1 Jun 2009 14:34:53 -0400
Subject: [PATCH 3/4 v2] libertas: implement function init/shutdown
	commands for SD8688
In-Reply-To: <1243465413-4997-1-git-send-email-bzhao@marvell.com>
References: <1243465413-4997-1-git-send-email-bzhao@marvell.com>
Message-ID: <20090601183453.GD3386@tuxdriver.com>

On Wed, May 27, 2009 at 04:03:33PM -0700, Bing Zhao wrote:
> SD8688 is a WLAN/Bluetooth combo chip and both functions are supported
> in a single firmware image. FUNC_INIT and FUNC_SHUTDOWN commands are
> implemented to utilize the multiple function feature.
> 
> When SD8688 card is inserted, the firmware image should be downloaded
> only once through either WLAN function (Libertas driver) or Bluetooth
> function (Bluetooth driver).
> 
> This patch adds function init/shutdown for SD8688 WLAN function only.
> 
> Signed-off-by: Bing Zhao <bzhao at marvell.com>

I already merged the 5/19 version.  Could you send a patch rebased
on wireless-testing?

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville at tuxdriver.com			might be all we have.  Be ready.


From bigeasy at linutronix.de  Mon Jun  1 15:41:25 2009
From: bigeasy at linutronix.de (Sebastian Andrzej Siewior)
Date: Mon, 1 Jun 2009 21:41:25 +0200
Subject: [RFC/PATCH] net/libertas: remove GPIO-CS handling in SPI
	interface code
In-Reply-To: <4A223891.8020305@compulab.co.il>
References: <20090527085630.GA10938@www.tglx.de>
	<4A223891.8020305@compulab.co.il>
Message-ID: <20090601194125.GB6653@www.tglx.de>

* Mike Rapoport | 2009-05-31 10:58:09 [+0300]:

>Sebastian Andrzej Siewior wrote:
>> This removes the dependency on GPIO framework and lets the SPI host
>> driver handle the chip select. The SPI host driver is required to keep
>> the CS active for the entire message unless cs_change says otherwise.
>> This patch collects the two/three single SPI transfers into a message.
>> Also the delay in read path in case use_dummy_writes are not used is
>> moved into the SPI host driver.
>> 
>> Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
>
>For PXA270 platform
>Tested-by: Mike Rapoport <mike at compulab.co.il>
That's good to hear. Thanks for that.
Once Andrey is happy with that I would Cc: wireless if there are no
objections.

Sebastian


From patrick.ohly at intel.com  Mon Jun  1 15:47:22 2009
From: patrick.ohly at intel.com (Patrick Ohly)
Date: Mon, 01 Jun 2009 21:47:22 +0200
Subject: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit
In-Reply-To: <200905292344.56814.rusty@rustcorp.com.au>
References: <200905292344.56814.rusty@rustcorp.com.au>
Message-ID: <1243885642.22917.35.camel@pohly-MOBL>

On Fri, 2009-05-29 at 23:44 +0930, Rusty Russell wrote:
> This patch adds skb_orphan to the start of dev_hard_start_xmit(): it
> can be premature in the NETDEV_TX_BUSY case, but that's uncommon.

Would it be possible to make the new skb_orphan() at the start of
dev_hard_start_xmit() conditionally so that it is not executed for
packets that are to be time stamped?

As discussed before
(http://article.gmane.org/gmane.linux.network/121378/), the skb->sk
socket pointer is required for sending back the send time stamp from
inside the device driver. Calling skb_orphan() unconditionally as in
this patch would break the hardware time stamping of outgoing packets.

This should work without much overhead (skb_tx() expands to a lookup of
the skb_shared_info):
if (!skb_tx(skb)->flags)
    skb_orphan(skb);

Instead of looking at the individual skb_shared_tx "hardware" and
"software" bits I'm just checking the whole byte here because it is
shorter and perhaps faster. Semantically the result is the same.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.




From bzhao at marvell.com  Mon Jun  1 21:04:36 2009
From: bzhao at marvell.com (Bing Zhao)
Date: Mon,  1 Jun 2009 18:04:36 -0700
Subject: [PATCH] libertas: improve function init/shutdown handling for SD8688
Message-ID: <1243904676-1881-1-git-send-email-bzhao@marvell.com>

This patch is to incorporate Dan Williams' comments for commit:
"libertas: implement function init/shutdown commands for SD8688"

1. remove fn_init_required and fn_shutdown_required variables from
lbs_private structure. If required, __lbs_cmd() will be called
directly to send function init/shutdown command for SD8688 in
if_sdio_probe() or if_sdio_remove() callback.

2. add global variable "user_rmmod" to distinguish between the module
removal case and the card removal case. This flag will be checked in
if_sdio_remove() against SD8688 card to determine whether or not the
function shutdown command needs to be sent.

3. remove "card" from if_sdio_model structure as it cannot store
card pointers for multiple cards. Besides, it's no longer needed
to store the "card" pointer with changes #1 & #2 above.

Signed-off-by: Bing Zhao <bzhao at marvell.com>
---
 drivers/net/wireless/libertas/dev.h     |    2 -
 drivers/net/wireless/libertas/if_sdio.c |   76 +++++++++++++++++++------------
 drivers/net/wireless/libertas/main.c    |   20 --------
 3 files changed, 47 insertions(+), 51 deletions(-)

diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index 9e11f90..f9ec69e 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -321,8 +321,6 @@ struct lbs_private {
 
 	u32 monitormode;
 	u8 fw_ready;
-	u8 fn_init_required;
-	u8 fn_shutdown_required;
 };
 
 extern struct cmd_confirm_sleep confirm_sleep;
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index a7e3fc1..8cdb88c 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -39,8 +39,24 @@
 #include "decl.h"
 #include "defs.h"
 #include "dev.h"
+#include "cmd.h"
 #include "if_sdio.h"
 
+/* The if_sdio_remove() callback function is called when
+ * user removes this module from kernel space or ejects
+ * the card from the slot. The driver handles these 2 cases
+ * differently for SD8688 combo chip.
+ * If the user is removing the module, the FUNC_SHUTDOWN
+ * command for SD8688 is sent to the firmware.
+ * If the card is removed, there is no need to send this command.
+ *
+ * The variable 'user_rmmod' is used to distinguish these two
+ * scenarios. This flag is initialized as FALSE in case the card
+ * is removed, and will be set to TRUE for module removal when
+ * module_exit function is called.
+ */
+static u8 user_rmmod;
+
 static char *lbs_helper_name = NULL;
 module_param_named(helper_name, lbs_helper_name, charp, 0644);
 
@@ -61,7 +77,6 @@ struct if_sdio_model {
 	int model;
 	const char *helper;
 	const char *firmware;
-	struct if_sdio_card *card;
 };
 
 static struct if_sdio_model if_sdio_models[] = {
@@ -70,21 +85,18 @@ static struct if_sdio_model if_sdio_models[] = {
 		.model = IF_SDIO_MODEL_8385,
 		.helper = "sd8385_helper.bin",
 		.firmware = "sd8385.bin",
-		.card = NULL,
 	},
 	{
 		/* 8686 */
 		.model = IF_SDIO_MODEL_8686,
 		.helper = "sd8686_helper.bin",
 		.firmware = "sd8686.bin",
-		.card = NULL,
 	},
 	{
 		/* 8688 */
 		.model = IF_SDIO_MODEL_8688,
 		.helper = "sd8688_helper.bin",
 		.firmware = "sd8688.bin",
-		.card = NULL,
 	},
 };
 
@@ -927,8 +939,6 @@ static int if_sdio_probe(struct sdio_func *func,
 		goto free;
 	}
 
-	if_sdio_models[i].card = card;
-
 	card->helper = if_sdio_models[i].helper;
 	card->firmware = if_sdio_models[i].firmware;
 
@@ -1014,8 +1024,16 @@ static int if_sdio_probe(struct sdio_func *func,
 	/*
 	 * FUNC_INIT is required for SD8688 WLAN/BT multiple functions
 	 */
-	priv->fn_init_required =
-		(card->model == IF_SDIO_MODEL_8688) ? 1 : 0;
+	if (card->model == IF_SDIO_MODEL_8688) {
+		struct cmd_header cmd;
+
+		memset(&cmd, 0, sizeof(cmd));
+
+		lbs_deb_sdio("send function INIT command\n");
+		if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(cmd),
+				lbs_cmd_copyback, (unsigned long) &cmd))
+			lbs_pr_alert("CMD_FUNC_INIT cmd failed\n");
+	}
 
 	ret = lbs_start_card(priv);
 	if (ret)
@@ -1057,30 +1075,39 @@ static void if_sdio_remove(struct sdio_func *func)
 {
 	struct if_sdio_card *card;
 	struct if_sdio_packet *packet;
-	int ret;
 
 	lbs_deb_enter(LBS_DEB_SDIO);
 
 	card = sdio_get_drvdata(func);
 
-	lbs_stop_card(card->priv);
+	if (user_rmmod && (card->model == IF_SDIO_MODEL_8688)) {
+		/*
+		 * FUNC_SHUTDOWN is required for SD8688 WLAN/BT
+		 * multiple functions
+		 */
+		struct cmd_header cmd;
+
+		memset(&cmd, 0, sizeof(cmd));
+
+		lbs_deb_sdio("send function SHUTDOWN command\n");
+		if (__lbs_cmd(card->priv, CMD_FUNC_SHUTDOWN,
+				&cmd, sizeof(cmd), lbs_cmd_copyback,
+				(unsigned long) &cmd))
+			lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n");
+	}
 
 	card->priv->surpriseremoved = 1;
 
 	lbs_deb_sdio("call remove card\n");
+	lbs_stop_card(card->priv);
 	lbs_remove_card(card->priv);
 
 	flush_workqueue(card->workqueue);
 	destroy_workqueue(card->workqueue);
 
 	sdio_claim_host(func);
-
-	/* Disable interrupts */
-	sdio_writeb(func, 0x00, IF_SDIO_H_INT_MASK, &ret);
-
 	sdio_release_irq(func);
 	sdio_disable_func(func);
-
 	sdio_release_host(func);
 
 	while (card->packets) {
@@ -1116,6 +1143,9 @@ static int __init if_sdio_init_module(void)
 
 	ret = sdio_register_driver(&if_sdio_driver);
 
+	/* Clear the flag in case user removes the card. */
+	user_rmmod = 0;
+
 	lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
 
 	return ret;
@@ -1123,22 +1153,10 @@ static int __init if_sdio_init_module(void)
 
 static void __exit if_sdio_exit_module(void)
 {
-	int i;
-	struct if_sdio_card *card;
-
 	lbs_deb_enter(LBS_DEB_SDIO);
 
-	for (i = 0; i < ARRAY_SIZE(if_sdio_models); i++) {
-		card = if_sdio_models[i].card;
-
-		/*
-		 * FUNC_SHUTDOWN is required for SD8688 WLAN/BT
-		 * multiple functions
-		 */
-		if (card && card->priv)
-			card->priv->fn_shutdown_required =
-				(card->model == IF_SDIO_MODEL_8688) ? 1 : 0;
-	}
+	/* Set the flag as user is removing this module. */
+	user_rmmod = 1;
 
 	sdio_unregister_driver(&if_sdio_driver);
 
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index a58a123..89575e4 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1002,17 +1002,9 @@ static int lbs_setup_firmware(struct lbs_private *priv)
 {
 	int ret = -1;
 	s16 curlevel = 0, minlevel = 0, maxlevel = 0;
-	struct cmd_header cmd;
 
 	lbs_deb_enter(LBS_DEB_FW);
 
-	if (priv->fn_init_required) {
-		memset(&cmd, 0, sizeof(cmd));
-		if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(cmd),
-				lbs_cmd_copyback, (unsigned long) &cmd))
-			lbs_pr_alert("CMD_FUNC_INIT command failed\n");
-	}
-
 	/* Read MAC address from firmware */
 	memset(priv->current_addr, 0xff, ETH_ALEN);
 	ret = lbs_update_hw_spec(priv);
@@ -1200,9 +1192,6 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
 	priv->mesh_open = 0;
 	priv->infra_open = 0;
 
-	priv->fn_init_required = 0;
-	priv->fn_shutdown_required = 0;
-
 	/* Setup the OS Interface to our functions */
  	dev->netdev_ops = &lbs_netdev_ops;
 	dev->watchdog_timeo = 5 * HZ;
@@ -1384,20 +1373,11 @@ void lbs_stop_card(struct lbs_private *priv)
 	struct net_device *dev;
 	struct cmd_ctrl_node *cmdnode;
 	unsigned long flags;
-	struct cmd_header cmd;
 
 	lbs_deb_enter(LBS_DEB_MAIN);
 
 	if (!priv)
 		goto out;
-
-	if (priv->fn_shutdown_required) {
-		memset(&cmd, 0, sizeof(cmd));
-		if (__lbs_cmd(priv, CMD_FUNC_SHUTDOWN, &cmd, sizeof(cmd),
-				lbs_cmd_copyback, (unsigned long) &cmd))
-			lbs_pr_alert("CMD_FUNC_SHUTDOWN command failed\n");
-	}
-
 	dev = priv->dev;
 
 	netif_stop_queue(dev);
-- 
1.5.3.6



From bzhao at marvell.com  Mon Jun  1 20:47:31 2009
From: bzhao at marvell.com (Bing Zhao)
Date: Mon, 1 Jun 2009 17:47:31 -0700
Subject: [PATCH 3/4 v2] libertas: implement function init/shutdown
	commands for SD8688
In-Reply-To: <20090601183453.GD3386@tuxdriver.com>
References: <1243465413-4997-1-git-send-email-bzhao@marvell.com>
	<20090601183453.GD3386@tuxdriver.com>
Message-ID: <477F20668A386D41ADCC57781B1F704301E90675ED@SC-VEXCH1.marvell.com>

Hi John,

The new patch against "master-2009-06-01" has been submitted to the lists:

[PATCH] libertas: improve function init/shutdown handling for SD8688

Thanks,

Bing

> -----Original Message-----
> From: John W. Linville [mailto:linville at tuxdriver.com]
> Sent: Monday, June 01, 2009 11:35 AM
> To: Bing Zhao
> Cc: libertas-dev at lists.infradead.org; linux-wireless at vger.kernel.org
> Subject: Re: [PATCH 3/4 v2] libertas: implement function init/shutdown commands for SD8688
> 
> On Wed, May 27, 2009 at 04:03:33PM -0700, Bing Zhao wrote:
> > SD8688 is a WLAN/Bluetooth combo chip and both functions are supported
> > in a single firmware image. FUNC_INIT and FUNC_SHUTDOWN commands are
> > implemented to utilize the multiple function feature.
> >
> > When SD8688 card is inserted, the firmware image should be downloaded
> > only once through either WLAN function (Libertas driver) or Bluetooth
> > function (Bluetooth driver).
> >
> > This patch adds function init/shutdown for SD8688 WLAN function only.
> >
> > Signed-off-by: Bing Zhao <bzhao at marvell.com>
> 
> I already merged the 5/19 version.  Could you send a patch rebased
> on wireless-testing?
> 
> John
> --
> John W. Linville		Someday the world will need a hero, and you
> linville at tuxdriver.com			might be all we have.  Be ready.


From davem at davemloft.net  Tue Jun  2 03:25:53 2009
From: davem at davemloft.net (David Miller)
Date: Tue, 02 Jun 2009 00:25:53 -0700 (PDT)
Subject: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit
In-Reply-To: <1243885642.22917.35.camel@pohly-MOBL>
References: <200905292344.56814.rusty@rustcorp.com.au>
	<1243885642.22917.35.camel@pohly-MOBL>
Message-ID: <20090602.002553.143476036.davem@davemloft.net>

From: Patrick Ohly <patrick.ohly at intel.com>
Date: Mon, 01 Jun 2009 21:47:22 +0200

> On Fri, 2009-05-29 at 23:44 +0930, Rusty Russell wrote:
>> This patch adds skb_orphan to the start of dev_hard_start_xmit(): it
>> can be premature in the NETDEV_TX_BUSY case, but that's uncommon.
> 
> Would it be possible to make the new skb_orphan() at the start of
> dev_hard_start_xmit() conditionally so that it is not executed for
> packets that are to be time stamped?
> 
> As discussed before
> (http://article.gmane.org/gmane.linux.network/121378/), the skb->sk
> socket pointer is required for sending back the send time stamp from
> inside the device driver. Calling skb_orphan() unconditionally as in
> this patch would break the hardware time stamping of outgoing packets.

Indeed, we need to check that case, at a minimum.

And there are other potentially other problems.  For example, I
wonder how this interacts with the new TX MMAP af_packet support
in net-next-2.6 :-/



From rusty at rustcorp.com.au  Tue Jun  2 10:08:29 2009
From: rusty at rustcorp.com.au (Rusty Russell)
Date: Tue, 2 Jun 2009 23:38:29 +0930
Subject: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit
In-Reply-To: <20090602.002553.143476036.davem@davemloft.net>
References: <200905292344.56814.rusty@rustcorp.com.au>
	<1243885642.22917.35.camel@pohly-MOBL>
	<20090602.002553.143476036.davem@davemloft.net>
Message-ID: <200906022338.30618.rusty@rustcorp.com.au>

On Tue, 2 Jun 2009 04:55:53 pm David Miller wrote:
> From: Patrick Ohly <patrick.ohly at intel.com>
> Date: Mon, 01 Jun 2009 21:47:22 +0200
>
> > On Fri, 2009-05-29 at 23:44 +0930, Rusty Russell wrote:
> >> This patch adds skb_orphan to the start of dev_hard_start_xmit(): it
> >> can be premature in the NETDEV_TX_BUSY case, but that's uncommon.
> >
> > Would it be possible to make the new skb_orphan() at the start of
> > dev_hard_start_xmit() conditionally so that it is not executed for
> > packets that are to be time stamped?
> >
> > As discussed before
> > (http://article.gmane.org/gmane.linux.network/121378/), the skb->sk
> > socket pointer is required for sending back the send time stamp from
> > inside the device driver. Calling skb_orphan() unconditionally as in
> > this patch would break the hardware time stamping of outgoing packets.
>
> Indeed, we need to check that case, at a minimum.
>
> And there are other potentially other problems.  For example, I
> wonder how this interacts with the new TX MMAP af_packet support
> in net-next-2.6 :-/

I think I'll do this in the driver for now, and let's revisit doing it 
generically later?

Thanks,
Rusty.


From andrey at cozybit.com  Tue Jun  2 14:28:39 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Tue, 2 Jun 2009 11:28:39 -0700
Subject: [RFC/PATCH] net/libertas: remove GPIO-CS handling in SPI 
	interface code
In-Reply-To: <20090601194125.GB6653@www.tglx.de>
References: <20090527085630.GA10938@www.tglx.de>
	<4A223891.8020305@compulab.co.il> <20090601194125.GB6653@www.tglx.de>
Message-ID: <45e8e6c40906021128r5384ca91sea1ba5d8d78ae56@mail.gmail.com>

On Mon, Jun 1, 2009 at 12:41 PM, Sebastian Andrzej Siewior
<bigeasy at linutronix.de> wrote:
> * Mike Rapoport | 2009-05-31 10:58:09 [+0300]:
>
>>Sebastian Andrzej Siewior wrote:
>>> This removes the dependency on GPIO framework and lets the SPI host
>>> driver handle the chip select. The SPI host driver is required to keep
>>> the CS active for the entire message unless cs_change says otherwise.
>>> This patch collects the two/three single SPI transfers into a message.
>>> Also the delay in read path in case use_dummy_writes are not used is
>>> moved into the SPI host driver.
>>>
>>> Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
>>
>>For PXA270 platform
>>Tested-by: Mike Rapoport <mike at compulab.co.il>
> That's good to hear. Thanks for that.
> Once Andrey is happy with that I would Cc: wireless if there are no
> objections.

It's working for me with dummy_writes disabled (that is, we use a
fixed delay when reading) but it's not working with dummy_writes
enabled (we clock dummy bytes when reading).

Mike and Sebastian -- have you tested with both dummy_writes enabled
and disabled?  If not, which option did you choose?  Ideally, we will
have both working or, if we get rid of one, it should be
dummy_writes=0 (I'd prefer that we clock in dummy bytes rather than
specifying a fixed delay).

Looks good to me otherwise, thanks!

  -Andrey


From bigeasy at linutronix.de  Tue Jun  2 15:18:36 2009
From: bigeasy at linutronix.de (Sebastian Andrzej Siewior)
Date: Tue, 2 Jun 2009 21:18:36 +0200
Subject: [RFC/PATCH] net/libertas: remove GPIO-CS handling in SPI
	interface code
In-Reply-To: <45e8e6c40906021128r5384ca91sea1ba5d8d78ae56@mail.gmail.com>
References: <20090527085630.GA10938@www.tglx.de>
	<4A223891.8020305@compulab.co.il>
	<20090601194125.GB6653@www.tglx.de>
	<45e8e6c40906021128r5384ca91sea1ba5d8d78ae56@mail.gmail.com>
Message-ID: <20090602191836.GA16547@Chamillionaire.breakpoint.cc>

* Andrey Yurovsky | 2009-06-02 11:28:39 [-0700]:

>It's working for me with dummy_writes disabled (that is, we use a
>fixed delay when reading) but it's not working with dummy_writes
>enabled (we clock dummy bytes when reading).
>
>Mike and Sebastian -- have you tested with both dummy_writes enabled
>and disabled?  If not, which option did you choose?  Ideally, we will
>have both working or, if we get rid of one, it should be
>dummy_writes=0 (I'd prefer that we clock in dummy bytes rather than
>specifying a fixed delay).

I've tested it just with the delay. I can't test the dummy clocks just
yet. If it is not working with dummy clocks than I guess that I do not
sent enough packets or you chip select goes down.
Once my HW is fixed I look into and let you know.

>  -Andrey

Sebastian


From dcbw at redhat.com  Tue Jun  2 16:45:23 2009
From: dcbw at redhat.com (Dan Williams)
Date: Tue, 02 Jun 2009 16:45:23 -0400
Subject: [PATCH] libertas: improve function init/shutdown handling for
	SD8688
In-Reply-To: <1243904676-1881-1-git-send-email-bzhao@marvell.com>
References: <1243904676-1881-1-git-send-email-bzhao@marvell.com>
Message-ID: <1243975523.6070.7.camel@localhost.localdomain>

On Mon, 2009-06-01 at 18:04 -0700, Bing Zhao wrote:
> This patch is to incorporate Dan Williams' comments for commit:
> "libertas: implement function init/shutdown commands for SD8688"
> 
> 1. remove fn_init_required and fn_shutdown_required variables from
> lbs_private structure. If required, __lbs_cmd() will be called
> directly to send function init/shutdown command for SD8688 in
> if_sdio_probe() or if_sdio_remove() callback.
> 
> 2. add global variable "user_rmmod" to distinguish between the module
> removal case and the card removal case. This flag will be checked in
> if_sdio_remove() against SD8688 card to determine whether or not the
> function shutdown command needs to be sent.
> 
> 3. remove "card" from if_sdio_model structure as it cannot store
> card pointers for multiple cards. Besides, it's no longer needed
> to store the "card" pointer with changes #1 & #2 above.
> 
> Signed-off-by: Bing Zhao <bzhao at marvell.com>

Acked-by: Dan Williams <dcbw at redhat.com>

> ---
>  drivers/net/wireless/libertas/dev.h     |    2 -
>  drivers/net/wireless/libertas/if_sdio.c |   76 +++++++++++++++++++------------
>  drivers/net/wireless/libertas/main.c    |   20 --------
>  3 files changed, 47 insertions(+), 51 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
> index 9e11f90..f9ec69e 100644
> --- a/drivers/net/wireless/libertas/dev.h
> +++ b/drivers/net/wireless/libertas/dev.h
> @@ -321,8 +321,6 @@ struct lbs_private {
>  
>  	u32 monitormode;
>  	u8 fw_ready;
> -	u8 fn_init_required;
> -	u8 fn_shutdown_required;
>  };
>  
>  extern struct cmd_confirm_sleep confirm_sleep;
> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
> index a7e3fc1..8cdb88c 100644
> --- a/drivers/net/wireless/libertas/if_sdio.c
> +++ b/drivers/net/wireless/libertas/if_sdio.c
> @@ -39,8 +39,24 @@
>  #include "decl.h"
>  #include "defs.h"
>  #include "dev.h"
> +#include "cmd.h"
>  #include "if_sdio.h"
>  
> +/* The if_sdio_remove() callback function is called when
> + * user removes this module from kernel space or ejects
> + * the card from the slot. The driver handles these 2 cases
> + * differently for SD8688 combo chip.
> + * If the user is removing the module, the FUNC_SHUTDOWN
> + * command for SD8688 is sent to the firmware.
> + * If the card is removed, there is no need to send this command.
> + *
> + * The variable 'user_rmmod' is used to distinguish these two
> + * scenarios. This flag is initialized as FALSE in case the card
> + * is removed, and will be set to TRUE for module removal when
> + * module_exit function is called.
> + */
> +static u8 user_rmmod;
> +
>  static char *lbs_helper_name = NULL;
>  module_param_named(helper_name, lbs_helper_name, charp, 0644);
>  
> @@ -61,7 +77,6 @@ struct if_sdio_model {
>  	int model;
>  	const char *helper;
>  	const char *firmware;
> -	struct if_sdio_card *card;
>  };
>  
>  static struct if_sdio_model if_sdio_models[] = {
> @@ -70,21 +85,18 @@ static struct if_sdio_model if_sdio_models[] = {
>  		.model = IF_SDIO_MODEL_8385,
>  		.helper = "sd8385_helper.bin",
>  		.firmware = "sd8385.bin",
> -		.card = NULL,
>  	},
>  	{
>  		/* 8686 */
>  		.model = IF_SDIO_MODEL_8686,
>  		.helper = "sd8686_helper.bin",
>  		.firmware = "sd8686.bin",
> -		.card = NULL,
>  	},
>  	{
>  		/* 8688 */
>  		.model = IF_SDIO_MODEL_8688,
>  		.helper = "sd8688_helper.bin",
>  		.firmware = "sd8688.bin",
> -		.card = NULL,
>  	},
>  };
>  
> @@ -927,8 +939,6 @@ static int if_sdio_probe(struct sdio_func *func,
>  		goto free;
>  	}
>  
> -	if_sdio_models[i].card = card;
> -
>  	card->helper = if_sdio_models[i].helper;
>  	card->firmware = if_sdio_models[i].firmware;
>  
> @@ -1014,8 +1024,16 @@ static int if_sdio_probe(struct sdio_func *func,
>  	/*
>  	 * FUNC_INIT is required for SD8688 WLAN/BT multiple functions
>  	 */
> -	priv->fn_init_required =
> -		(card->model == IF_SDIO_MODEL_8688) ? 1 : 0;
> +	if (card->model == IF_SDIO_MODEL_8688) {
> +		struct cmd_header cmd;
> +
> +		memset(&cmd, 0, sizeof(cmd));
> +
> +		lbs_deb_sdio("send function INIT command\n");
> +		if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(cmd),
> +				lbs_cmd_copyback, (unsigned long) &cmd))
> +			lbs_pr_alert("CMD_FUNC_INIT cmd failed\n");
> +	}
>  
>  	ret = lbs_start_card(priv);
>  	if (ret)
> @@ -1057,30 +1075,39 @@ static void if_sdio_remove(struct sdio_func *func)
>  {
>  	struct if_sdio_card *card;
>  	struct if_sdio_packet *packet;
> -	int ret;
>  
>  	lbs_deb_enter(LBS_DEB_SDIO);
>  
>  	card = sdio_get_drvdata(func);
>  
> -	lbs_stop_card(card->priv);
> +	if (user_rmmod && (card->model == IF_SDIO_MODEL_8688)) {
> +		/*
> +		 * FUNC_SHUTDOWN is required for SD8688 WLAN/BT
> +		 * multiple functions
> +		 */
> +		struct cmd_header cmd;
> +
> +		memset(&cmd, 0, sizeof(cmd));
> +
> +		lbs_deb_sdio("send function SHUTDOWN command\n");
> +		if (__lbs_cmd(card->priv, CMD_FUNC_SHUTDOWN,
> +				&cmd, sizeof(cmd), lbs_cmd_copyback,
> +				(unsigned long) &cmd))
> +			lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n");
> +	}
>  
>  	card->priv->surpriseremoved = 1;
>  
>  	lbs_deb_sdio("call remove card\n");
> +	lbs_stop_card(card->priv);
>  	lbs_remove_card(card->priv);
>  
>  	flush_workqueue(card->workqueue);
>  	destroy_workqueue(card->workqueue);
>  
>  	sdio_claim_host(func);
> -
> -	/* Disable interrupts */
> -	sdio_writeb(func, 0x00, IF_SDIO_H_INT_MASK, &ret);
> -
>  	sdio_release_irq(func);
>  	sdio_disable_func(func);
> -
>  	sdio_release_host(func);
>  
>  	while (card->packets) {
> @@ -1116,6 +1143,9 @@ static int __init if_sdio_init_module(void)
>  
>  	ret = sdio_register_driver(&if_sdio_driver);
>  
> +	/* Clear the flag in case user removes the card. */
> +	user_rmmod = 0;
> +
>  	lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
>  
>  	return ret;
> @@ -1123,22 +1153,10 @@ static int __init if_sdio_init_module(void)
>  
>  static void __exit if_sdio_exit_module(void)
>  {
> -	int i;
> -	struct if_sdio_card *card;
> -
>  	lbs_deb_enter(LBS_DEB_SDIO);
>  
> -	for (i = 0; i < ARRAY_SIZE(if_sdio_models); i++) {
> -		card = if_sdio_models[i].card;
> -
> -		/*
> -		 * FUNC_SHUTDOWN is required for SD8688 WLAN/BT
> -		 * multiple functions
> -		 */
> -		if (card && card->priv)
> -			card->priv->fn_shutdown_required =
> -				(card->model == IF_SDIO_MODEL_8688) ? 1 : 0;
> -	}
> +	/* Set the flag as user is removing this module. */
> +	user_rmmod = 1;
>  
>  	sdio_unregister_driver(&if_sdio_driver);
>  
> diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
> index a58a123..89575e4 100644
> --- a/drivers/net/wireless/libertas/main.c
> +++ b/drivers/net/wireless/libertas/main.c
> @@ -1002,17 +1002,9 @@ static int lbs_setup_firmware(struct lbs_private *priv)
>  {
>  	int ret = -1;
>  	s16 curlevel = 0, minlevel = 0, maxlevel = 0;
> -	struct cmd_header cmd;
>  
>  	lbs_deb_enter(LBS_DEB_FW);
>  
> -	if (priv->fn_init_required) {
> -		memset(&cmd, 0, sizeof(cmd));
> -		if (__lbs_cmd(priv, CMD_FUNC_INIT, &cmd, sizeof(cmd),
> -				lbs_cmd_copyback, (unsigned long) &cmd))
> -			lbs_pr_alert("CMD_FUNC_INIT command failed\n");
> -	}
> -
>  	/* Read MAC address from firmware */
>  	memset(priv->current_addr, 0xff, ETH_ALEN);
>  	ret = lbs_update_hw_spec(priv);
> @@ -1200,9 +1192,6 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
>  	priv->mesh_open = 0;
>  	priv->infra_open = 0;
>  
> -	priv->fn_init_required = 0;
> -	priv->fn_shutdown_required = 0;
> -
>  	/* Setup the OS Interface to our functions */
>   	dev->netdev_ops = &lbs_netdev_ops;
>  	dev->watchdog_timeo = 5 * HZ;
> @@ -1384,20 +1373,11 @@ void lbs_stop_card(struct lbs_private *priv)
>  	struct net_device *dev;
>  	struct cmd_ctrl_node *cmdnode;
>  	unsigned long flags;
> -	struct cmd_header cmd;
>  
>  	lbs_deb_enter(LBS_DEB_MAIN);
>  
>  	if (!priv)
>  		goto out;
> -
> -	if (priv->fn_shutdown_required) {
> -		memset(&cmd, 0, sizeof(cmd));
> -		if (__lbs_cmd(priv, CMD_FUNC_SHUTDOWN, &cmd, sizeof(cmd),
> -				lbs_cmd_copyback, (unsigned long) &cmd))
> -			lbs_pr_alert("CMD_FUNC_SHUTDOWN command failed\n");
> -	}
> -
>  	dev = priv->dev;
>  
>  	netif_stop_queue(dev);



From davem at davemloft.net  Tue Jun  2 20:14:18 2009
From: davem at davemloft.net (David Miller)
Date: Tue, 02 Jun 2009 17:14:18 -0700 (PDT)
Subject: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit
In-Reply-To: <200906022338.30618.rusty@rustcorp.com.au>
References: <1243885642.22917.35.camel@pohly-MOBL>
	<20090602.002553.143476036.davem@davemloft.net>
	<200906022338.30618.rusty@rustcorp.com.au>
Message-ID: <20090602.171418.186096253.davem@davemloft.net>

From: Rusty Russell <rusty at rustcorp.com.au>
Date: Tue, 2 Jun 2009 23:38:29 +0930

> On Tue, 2 Jun 2009 04:55:53 pm David Miller wrote:
>> From: Patrick Ohly <patrick.ohly at intel.com>
>> Date: Mon, 01 Jun 2009 21:47:22 +0200
>>
>> > On Fri, 2009-05-29 at 23:44 +0930, Rusty Russell wrote:
>> >> This patch adds skb_orphan to the start of dev_hard_start_xmit(): it
>> >> can be premature in the NETDEV_TX_BUSY case, but that's uncommon.
>> >
>> > Would it be possible to make the new skb_orphan() at the start of
>> > dev_hard_start_xmit() conditionally so that it is not executed for
>> > packets that are to be time stamped?
>> >
>> > As discussed before
>> > (http://article.gmane.org/gmane.linux.network/121378/), the skb->sk
>> > socket pointer is required for sending back the send time stamp from
>> > inside the device driver. Calling skb_orphan() unconditionally as in
>> > this patch would break the hardware time stamping of outgoing packets.
>>
>> Indeed, we need to check that case, at a minimum.
>>
>> And there are other potentially other problems.  For example, I
>> wonder how this interacts with the new TX MMAP af_packet support
>> in net-next-2.6 :-/
> 
> I think I'll do this in the driver for now, and let's revisit doing it 
> generically later?

That might be the best course of action for the time being.
This whole area is a rat's nest.


From mike at compulab.co.il  Wed Jun  3 01:47:41 2009
From: mike at compulab.co.il (Mike Rapoport)
Date: Wed, 03 Jun 2009 08:47:41 +0300
Subject: [RFC/PATCH] net/libertas: remove GPIO-CS handling in SPI interface
	code
In-Reply-To: <45e8e6c40906021128r5384ca91sea1ba5d8d78ae56@mail.gmail.com>
References: <20090527085630.GA10938@www.tglx.de>	
	<4A223891.8020305@compulab.co.il>
	<20090601194125.GB6653@www.tglx.de>
	<45e8e6c40906021128r5384ca91sea1ba5d8d78ae56@mail.gmail.com>
Message-ID: <4A260E7D.6000101@compulab.co.il>



Andrey Yurovsky wrote:
> On Mon, Jun 1, 2009 at 12:41 PM, Sebastian Andrzej Siewior
> <bigeasy at linutronix.de> wrote:
>> * Mike Rapoport | 2009-05-31 10:58:09 [+0300]:
>>
>>> Sebastian Andrzej Siewior wrote:
>>>> This removes the dependency on GPIO framework and lets the SPI host
>>>> driver handle the chip select. The SPI host driver is required to keep
>>>> the CS active for the entire message unless cs_change says otherwise.
>>>> This patch collects the two/three single SPI transfers into a message.
>>>> Also the delay in read path in case use_dummy_writes are not used is
>>>> moved into the SPI host driver.
>>>>
>>>> Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
>>> For PXA270 platform
>>> Tested-by: Mike Rapoport <mike at compulab.co.il>
>> That's good to hear. Thanks for that.
>> Once Andrey is happy with that I would Cc: wireless if there are no
>> objections.
> 
> It's working for me with dummy_writes disabled (that is, we use a
> fixed delay when reading) but it's not working with dummy_writes
> enabled (we clock dummy bytes when reading).
> 
> Mike and Sebastian -- have you tested with both dummy_writes enabled
> and disabled?  If not, which option did you choose?  Ideally, we will
> have both working or, if we get rid of one, it should be
> dummy_writes=0 (I'd prefer that we clock in dummy bytes rather than
> specifying a fixed delay).

I've tested with both dummy_writes enabled and disabled. Seems to be Ok in both
cases.

> Looks good to me otherwise, thanks!
> 
>   -Andrey
> 

-- 
Sincerely yours,
Mike.



From andrey at cozybit.com  Wed Jun  3 15:09:05 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Wed, 3 Jun 2009 12:09:05 -0700
Subject: [RFC/PATCH] net/libertas: remove GPIO-CS handling in SPI 
	interface code
In-Reply-To: <4A260E7D.6000101@compulab.co.il>
References: <20090527085630.GA10938@www.tglx.de>
	<4A223891.8020305@compulab.co.il> <20090601194125.GB6653@www.tglx.de>
	<45e8e6c40906021128r5384ca91sea1ba5d8d78ae56@mail.gmail.com>
	<4A260E7D.6000101@compulab.co.il>
Message-ID: <45e8e6c40906031209k7aac810dx7ebb25f3eb8e793@mail.gmail.com>

On Tue, Jun 2, 2009 at 10:47 PM, Mike Rapoport <mike at compulab.co.il> wrote:
>
>
> Andrey Yurovsky wrote:
>> On Mon, Jun 1, 2009 at 12:41 PM, Sebastian Andrzej Siewior
>> <bigeasy at linutronix.de> wrote:
>>> * Mike Rapoport | 2009-05-31 10:58:09 [+0300]:
>>>
>>>> Sebastian Andrzej Siewior wrote:
>>>>> This removes the dependency on GPIO framework and lets the SPI host
>>>>> driver handle the chip select. The SPI host driver is required to keep
>>>>> the CS active for the entire message unless cs_change says otherwise.
>>>>> This patch collects the two/three single SPI transfers into a message.
>>>>> Also the delay in read path in case use_dummy_writes are not used is
>>>>> moved into the SPI host driver.
>>>>>
>>>>> Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
>>>> For PXA270 platform
>>>> Tested-by: Mike Rapoport <mike at compulab.co.il>
>>> That's good to hear. Thanks for that.
>>> Once Andrey is happy with that I would Cc: wireless if there are no
>>> objections.
>>
>> It's working for me with dummy_writes disabled (that is, we use a
>> fixed delay when reading) but it's not working with dummy_writes
>> enabled (we clock dummy bytes when reading).
>>
>> Mike and Sebastian -- have you tested with both dummy_writes enabled
>> and disabled? ?If not, which option did you choose? ?Ideally, we will
>> have both working or, if we get rid of one, it should be
>> dummy_writes=0 (I'd prefer that we clock in dummy bytes rather than
>> specifying a fixed delay).
>
> I've tested with both dummy_writes enabled and disabled. Seems to be Ok in both
> cases.

Thanks Mike.  In that case, it may be an issue with my SPI host
controller (on the Blackfin BF527 SoC) but I've at least been able to
confirm with dummy_writes=0 so that's a great start.  I'll probably be
able to work out the dummy_writes issue in the near future.

Sebastian -- would you like to go ahead and send the patch (rebased if
needed) to wireless-testing?  Please CC Dan Williams as well.  You can
add a "Tested-by: Andrey Yurovsky <andrey at cozybit.com>" (and one for
Mike as well, I suppose?).  I'll update the wireless Wiki about the
Chip Select and dummy_wires after the patch is merged.  Thanks!

  -Andrey

>> Looks good to me otherwise, thanks!
>>
>> ? -Andrey
>>
>
> --
> Sincerely yours,
> Mike.
>
>


From eric.dumazet at gmail.com  Wed Jun  3 17:02:53 2009
From: eric.dumazet at gmail.com (Eric Dumazet)
Date: Wed, 03 Jun 2009 23:02:53 +0200
Subject: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit
In-Reply-To: <200906012157.29465.rusty@rustcorp.com.au>
References: <200905292344.56814.rusty@rustcorp.com.au>
	<4A1FFB04.30305@gmail.com>
	<200906012157.29465.rusty@rustcorp.com.au>
Message-ID: <4A26E4FD.5010405@gmail.com>

Rusty Russell a ?crit :
> On Sat, 30 May 2009 12:41:00 am Eric Dumazet wrote:
>> Rusty Russell a ?crit :
>>> DaveM points out that there are advantages to doing it generally (it's
>>> more likely to be on same CPU than after xmit), and I couldn't find
>>> any new starvation issues in simple benchmarking here.
>> If really no starvations are possible at all, I really wonder why some
>> guys added memory accounting to UDP flows. Maybe they dont run "simple
>> benchmarks" but real apps ? :)
> 
> Well, without any accounting at all you could use quite a lot of memory as 
> there are many places packets can be queued.
> 
>> For TCP, I agree your patch is a huge benefit, since its paced by remote
>> ACKS and window control
> 
> I doubt that.  There'll be some cache friendliness, but I'm not sure it'll be 
> measurable, let alone "huge".  It's the win to drivers which don't have a 
> timely and batching tx free mechanism which I aim for.

At 250.000 packets/second on a Gigabit link, this is huge, I can tell you.
(250.000 incoming packets and 250.000 outgoing packets per second, 700 Mbit/s)

According to this oprofile on CPU0 (dedicated to softirqs on one bnx2 eth adapter)

We can see sock_wfree() being number 2 on the profile, because it touches three cache lines per socket and
transmited packet in TX completion handler.

Also, taking a reference on socket for each xmit packet in flight is very expensive, since it slows
down receiver in __udp4_lib_lookup(). Several cpus are fighting for sk->refcnt cache line.


CPU: Core 2, speed 3000.24 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
samples  cum. samples  %        cum. %     symbol name
21215    21215         11.8847  11.8847    bnx2_poll_work
17239    38454          9.6573  21.5420    sock_wfree      << effect of udp memory accounting >>
14817    53271          8.3005  29.8425    __slab_free
14635    67906          8.1986  38.0411    __udp4_lib_lookup
11425    79331          6.4003  44.4414    __alloc_skb
9710     89041          5.4396  49.8810    __slab_alloc
8095     97136          4.5348  54.4158    __udp4_lib_rcv
7831     104967         4.3869  58.8027    sock_def_write_space
7586     112553         4.2497  63.0524    ip_rcv
7518     120071         4.2116  67.2640    skb_dma_unmap
6711     126782         3.7595  71.0235    netif_receive_skb
6272     133054         3.5136  74.5371    udp_queue_rcv_skb
5262     138316         2.9478  77.4849    skb_release_data
5023     143339         2.8139  80.2988    __kmalloc_track_caller
4070     147409         2.2800  82.5788    kmem_cache_alloc
3216     150625         1.8016  84.3804    ipt_do_table
2576     153201         1.4431  85.8235    skb_queue_tail





From rusty at rustcorp.com.au  Wed Jun  3 23:54:57 2009
From: rusty at rustcorp.com.au (Rusty Russell)
Date: Thu, 4 Jun 2009 13:24:57 +0930
Subject: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit
In-Reply-To: <4A26E4FD.5010405@gmail.com>
References: <200905292344.56814.rusty@rustcorp.com.au>
	<200906012157.29465.rusty@rustcorp.com.au>
	<4A26E4FD.5010405@gmail.com>
Message-ID: <200906041324.59118.rusty@rustcorp.com.au>

On Thu, 4 Jun 2009 06:32:53 am Eric Dumazet wrote:
> Rusty Russell a ?crit :
> > On Sat, 30 May 2009 12:41:00 am Eric Dumazet wrote:
> >> For TCP, I agree your patch is a huge benefit, since its paced by remote
> >> ACKS and window control
> >
> > I doubt that.  There'll be some cache friendliness, but I'm not sure
> > it'll be measurable, let alone "huge".
...
> We can see sock_wfree() being number 2 on the profile, because it touches
> three cache lines per socket and transmited packet in TX completion
> handler.

Interesting, I take it back: got some "after" stats as well?

> Also, taking a reference on socket for each xmit packet in flight is very
> expensive, since it slows down receiver in __udp4_lib_lookup(). Several
> cpus are fighting for sk->refcnt cache line.

Now we have decent dynamic per-cpu, we can finally implement bigrefs.  More 
obvious for device counts than sockets, but perhaps applicable here as well?

Rusty.


From davem at davemloft.net  Thu Jun  4 00:00:54 2009
From: davem at davemloft.net (David Miller)
Date: Wed, 03 Jun 2009 21:00:54 -0700 (PDT)
Subject: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit
In-Reply-To: <200906041324.59118.rusty@rustcorp.com.au>
References: <200906012157.29465.rusty@rustcorp.com.au>
	<4A26E4FD.5010405@gmail.com>
	<200906041324.59118.rusty@rustcorp.com.au>
Message-ID: <20090603.210054.18839960.davem@davemloft.net>

From: Rusty Russell <rusty at rustcorp.com.au>
Date: Thu, 4 Jun 2009 13:24:57 +0930

> On Thu, 4 Jun 2009 06:32:53 am Eric Dumazet wrote:
>> Also, taking a reference on socket for each xmit packet in flight is very
>> expensive, since it slows down receiver in __udp4_lib_lookup(). Several
>> cpus are fighting for sk->refcnt cache line.
> 
> Now we have decent dynamic per-cpu, we can finally implement bigrefs.  More 
> obvious for device counts than sockets, but perhaps applicable here as well?

It might be very beneficial for longer lasting, active, connections, but
for high connection rates it's going to be a lose in my estimation.


From eric.dumazet at gmail.com  Thu Jun  4 00:54:24 2009
From: eric.dumazet at gmail.com (Eric Dumazet)
Date: Thu, 04 Jun 2009 06:54:24 +0200
Subject: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit
In-Reply-To: <20090603.210054.18839960.davem@davemloft.net>
References: <200906012157.29465.rusty@rustcorp.com.au>	<4A26E4FD.5010405@gmail.com>	<200906041324.59118.rusty@rustcorp.com.au>
	<20090603.210054.18839960.davem@davemloft.net>
Message-ID: <4A275380.1050601@gmail.com>

David Miller a ?crit :
> From: Rusty Russell <rusty at rustcorp.com.au>
> Date: Thu, 4 Jun 2009 13:24:57 +0930
> 
>> On Thu, 4 Jun 2009 06:32:53 am Eric Dumazet wrote:
>>> Also, taking a reference on socket for each xmit packet in flight is very
>>> expensive, since it slows down receiver in __udp4_lib_lookup(). Several
>>> cpus are fighting for sk->refcnt cache line.
>> Now we have decent dynamic per-cpu, we can finally implement bigrefs.  More 
>> obvious for device counts than sockets, but perhaps applicable here as well?
> 
> It might be very beneficial for longer lasting, active, connections, but
> for high connection rates it's going to be a lose in my estimation.

Agreed.

We also can avoid the sock_put()/sock_hold() pair for each tx packet,
to only touch sk_wmem_alloc (with appropriate atomic_sub_return() in sock_wfree()
and atomic_dec_test in sk_free

We could initialize sk->sk_wmem_alloc to one instead of 0, so that
sock_wfree() could just synchronize itself with sk_free()

void sk_free(struct sock *sk)
{
	if (atomic_dec_test(&sk->sk_wmem_alloc))
		__sk_free(sk)
}

 static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
 {
-       sock_hold(sk);
        skb->sk = sk;
        skb->destructor = sock_wfree;
        atomic_add(skb->truesize, &sk->sk_wmem_alloc);
 }

 void sock_wfree(struct sk_buff *skb)
 {
        struct sock *sk = skb->sk;
+       int res;

        /* In case it might be waiting for more memory. */
-       atomic_sub(skb->truesize, &sk->sk_wmem_alloc);
+       res = atomic_sub_return(skb->truesize, &sk->sk_wmem_alloc);
        if (!sock_flag(sk, SOCK_USE_WRITE_QUEUE))
                sk->sk_write_space(sk);
-       sock_put(sk);
+       if (res == 0)
+               __sk_free(sk);
 }

Patch will follow after some testing



From davem at davemloft.net  Thu Jun  4 00:56:21 2009
From: davem at davemloft.net (David Miller)
Date: Wed, 03 Jun 2009 21:56:21 -0700 (PDT)
Subject: [PATCH 1/4] net: skb_orphan on dev_hard_start_xmit
In-Reply-To: <4A275380.1050601@gmail.com>
References: <200906041324.59118.rusty@rustcorp.com.au>
	<20090603.210054.18839960.davem@davemloft.net>
	<4A275380.1050601@gmail.com>
Message-ID: <20090603.215621.136203134.davem@davemloft.net>

From: Eric Dumazet <eric.dumazet at gmail.com>
Date: Thu, 04 Jun 2009 06:54:24 +0200

> We also can avoid the sock_put()/sock_hold() pair for each tx packet,
> to only touch sk_wmem_alloc (with appropriate atomic_sub_return() in sock_wfree()
> and atomic_dec_test in sk_free
> 
> We could initialize sk->sk_wmem_alloc to one instead of 0, so that
> sock_wfree() could just synchronize itself with sk_free()

Excellent idea Eric.

> Patch will follow after some testing

I look forward to it :-)


From bigeasy at linutronix.de  Thu Jun  4 05:03:28 2009
From: bigeasy at linutronix.de (Sebastian Andrzej Siewior)
Date: Thu, 4 Jun 2009 11:03:28 +0200
Subject: [RFC/PATCH] net/libertas: remove GPIO-CS handling in SPI
	interface code
In-Reply-To: <45e8e6c40906031209k7aac810dx7ebb25f3eb8e793@mail.gmail.com>
References: <20090527085630.GA10938@www.tglx.de>
	<4A223891.8020305@compulab.co.il>
	<20090601194125.GB6653@www.tglx.de>
	<45e8e6c40906021128r5384ca91sea1ba5d8d78ae56@mail.gmail.com>
	<4A260E7D.6000101@compulab.co.il>
	<45e8e6c40906031209k7aac810dx7ebb25f3eb8e793@mail.gmail.com>
Message-ID: <20090604090328.GA698@Chamillionaire.breakpoint.cc>

* Andrey Yurovsky | 2009-06-03 12:09:05 [-0700]:

>I'll update the wireless Wiki about the
>Chip Select and dummy_wires after the patch is merged.  Thanks!
Please note that it looks like this will go into -next branch and find
its way into .31 while the GPIO version is in .30. So you may want to
keep both versions in your wiki.

>  -Andrey

Sebastian


From bigeasy at linutronix.de  Thu Jun  4 15:47:26 2009
From: bigeasy at linutronix.de (Sebastian Andrzej Siewior)
Date: Thu, 4 Jun 2009 21:47:26 +0200
Subject: [PATCH v2] net/libertas: remove GPIO-CS handling in SPI interface code
Message-ID: <20090604194726.GA22760@www.tglx.de>

This removes the dependency on GPIO framework and lets the SPI host
driver handle the chip select. The SPI host driver is required to keep
the CS active for the entire message unless cs_change says otherwise.
This patch collects the two/three single SPI transfers into a message.
Also the delay in read path in case use_dummy_writes are not used is
moved into the SPI host driver.

Tested-by: Mike Rapoport <mike at compulab.co.il>
Tested-by: Andrey Yurovsky <andrey at cozybit.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
The only change I've made since v1 is that I've replaced
+		reg_trans.delay_usecs = (100 + (delay * 10)) / 1000; 

 with

+		reg_trans.delay_usecs =
+			DIV_ROUND_UP((100 + (delay * 10)), 1000);

The latter should not end up with delay_usecs = 0 if delay is < 90

 drivers/net/wireless/Kconfig           |    2 +-
 drivers/net/wireless/libertas/if_spi.c |   92 +++++++++++++++-----------------
 2 files changed, 45 insertions(+), 49 deletions(-)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index daf4c80..fb7541c 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -153,7 +153,7 @@ config LIBERTAS_SDIO
 
 config LIBERTAS_SPI
 	tristate "Marvell Libertas 8686 SPI 802.11b/g cards"
-	depends on LIBERTAS && SPI && GENERIC_GPIO
+	depends on LIBERTAS && SPI
 	---help---
 	  A driver for Marvell Libertas 8686 SPI devices.
 
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index ea23c5d..f8c2898 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -19,7 +19,6 @@
 
 #include <linux/moduleparam.h>
 #include <linux/firmware.h>
-#include <linux/gpio.h>
 #include <linux/jiffies.h>
 #include <linux/kthread.h>
 #include <linux/list.h>
@@ -51,13 +50,6 @@ struct if_spi_card {
 	u16				card_id;
 	u8				card_rev;
 
-	/* Pin number for our GPIO chip-select. */
-	/* TODO: Once the generic SPI layer has some additional features, we
-	 * should take this out and use the normal chip select here.
-	 * We need support for chip select delays, and not dropping chipselect
-	 * after each word. */
-	int				gpio_cs;
-
 	/* The last time that we initiated an SPU operation */
 	unsigned long			prev_xfer_time;
 
@@ -130,12 +122,10 @@ static void spu_transaction_init(struct if_spi_card *card)
 		 * If not, we have to busy-wait to be on the safe side. */
 		ndelay(400);
 	}
-	gpio_set_value(card->gpio_cs, 0); /* assert CS */
 }
 
 static void spu_transaction_finish(struct if_spi_card *card)
 {
-	gpio_set_value(card->gpio_cs, 1); /* drop CS */
 	card->prev_xfer_time = jiffies;
 }
 
@@ -145,6 +135,13 @@ static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
 {
 	int err = 0;
 	u16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
+	struct spi_message m;
+	struct spi_transfer reg_trans;
+	struct spi_transfer data_trans;
+
+	spi_message_init(&m);
+	memset(&reg_trans, 0, sizeof(reg_trans));
+	memset(&data_trans, 0, sizeof(data_trans));
 
 	/* You must give an even number of bytes to the SPU, even if it
 	 * doesn't care about the last one.  */
@@ -153,13 +150,16 @@ static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
 	spu_transaction_init(card);
 
 	/* write SPU register index */
-	err = spi_write(card->spi, (u8 *)&reg_out, sizeof(u16));
-	if (err)
-		goto out;
+	reg_trans.tx_buf = &reg_out;
+	reg_trans.len = sizeof(reg_out);
 
-	err = spi_write(card->spi, buf, len);
+	data_trans.tx_buf = buf;
+	data_trans.len = len;
 
-out:
+	spi_message_add_tail(&reg_trans, &m);
+	spi_message_add_tail(&data_trans, &m);
+
+	err = spi_sync(card->spi, &m);
 	spu_transaction_finish(card);
 	return err;
 }
@@ -186,10 +186,13 @@ static inline int spu_reg_is_port_reg(u16 reg)
 
 static int spu_read(struct if_spi_card *card, u16 reg, u8 *buf, int len)
 {
-	unsigned int i, delay;
+	unsigned int delay;
 	int err = 0;
-	u16 zero = 0;
 	u16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
+	struct spi_message m;
+	struct spi_transfer reg_trans;
+	struct spi_transfer dummy_trans;
+	struct spi_transfer data_trans;
 
 	/* You must take an even number of bytes from the SPU, even if you
 	 * don't care about the last one.  */
@@ -197,29 +200,34 @@ static int spu_read(struct if_spi_card *card, u16 reg, u8 *buf, int len)
 
 	spu_transaction_init(card);
 
+	spi_message_init(&m);
+	memset(&reg_trans, 0, sizeof(reg_trans));
+	memset(&dummy_trans, 0, sizeof(dummy_trans));
+	memset(&data_trans, 0, sizeof(data_trans));
+
 	/* write SPU register index */
-	err = spi_write(card->spi, (u8 *)&reg_out, sizeof(u16));
-	if (err)
-		goto out;
+	reg_trans.tx_buf = &reg_out;
+	reg_trans.len = sizeof(reg_out);
+	spi_message_add_tail(&reg_trans, &m);
 
 	delay = spu_reg_is_port_reg(reg) ? card->spu_port_delay :
 						card->spu_reg_delay;
 	if (card->use_dummy_writes) {
 		/* Clock in dummy cycles while the SPU fills the FIFO */
-		for (i = 0; i < delay / 16; ++i) {
-			err = spi_write(card->spi, (u8 *)&zero, sizeof(u16));
-			if (err)
-				return err;
-		}
+		dummy_trans.len = delay / 8;
+		spi_message_add_tail(&dummy_trans, &m);
 	} else {
 		/* Busy-wait while the SPU fills the FIFO */
-		ndelay(100 + (delay * 10));
+		reg_trans.delay_usecs =
+			DIV_ROUND_UP((100 + (delay * 10)), 1000);
 	}
 
 	/* read in data */
-	err = spi_read(card->spi, buf, len);
+	data_trans.rx_buf = buf;
+	data_trans.len = len;
+	spi_message_add_tail(&data_trans, &m);
 
-out:
+	err = spi_sync(card->spi, &m);
 	spu_transaction_finish(card);
 	return err;
 }
@@ -1049,7 +1057,6 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 	spi_set_drvdata(spi, card);
 	card->pdata = pdata;
 	card->spi = spi;
-	card->gpio_cs = pdata->gpio_cs;
 	card->prev_xfer_time = jiffies;
 
 	sema_init(&card->spi_ready, 0);
@@ -1058,26 +1065,18 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 	INIT_LIST_HEAD(&card->data_packet_list);
 	spin_lock_init(&card->buffer_lock);
 
-	/* set up GPIO CS line. TODO: use  regular CS line */
-	err = gpio_request(card->gpio_cs, "if_spi_gpio_chip_select");
-	if (err)
-		goto free_card;
-	err = gpio_direction_output(card->gpio_cs, 1);
-	if (err)
-		goto free_gpio;
-
 	/* Initialize the SPI Interface Unit */
 	err = spu_init(card, pdata->use_dummy_writes);
 	if (err)
-		goto free_gpio;
+		goto free_card;
 	err = spu_get_chip_revision(card, &card->card_id, &card->card_rev);
 	if (err)
-		goto free_gpio;
+		goto free_card;
 
 	/* Firmware load */
 	err = spu_read_u32(card, IF_SPI_SCRATCH_4_REG, &scratch);
 	if (err)
-		goto free_gpio;
+		goto free_card;
 	if (scratch == SUCCESSFUL_FW_DOWNLOAD_MAGIC)
 		lbs_deb_spi("Firmware is already loaded for "
 			    "Marvell WLAN 802.11 adapter\n");
@@ -1085,7 +1084,7 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 		err = if_spi_calculate_fw_names(card->card_id,
 				card->helper_fw_name, card->main_fw_name);
 		if (err)
-			goto free_gpio;
+			goto free_card;
 
 		lbs_deb_spi("Initializing FW for Marvell WLAN 802.11 adapter "
 				"(chip_id = 0x%04x, chip_rev = 0x%02x) "
@@ -1096,23 +1095,23 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 				spi->max_speed_hz);
 		err = if_spi_prog_helper_firmware(card);
 		if (err)
-			goto free_gpio;
+			goto free_card;
 		err = if_spi_prog_main_firmware(card);
 		if (err)
-			goto free_gpio;
+			goto free_card;
 		lbs_deb_spi("loaded FW for Marvell WLAN 802.11 adapter\n");
 	}
 
 	err = spu_set_interrupt_mode(card, 0, 1);
 	if (err)
-		goto free_gpio;
+		goto free_card;
 
 	/* Register our card with libertas.
 	 * This will call alloc_etherdev */
 	priv = lbs_add_card(card, &spi->dev);
 	if (!priv) {
 		err = -ENOMEM;
-		goto free_gpio;
+		goto free_card;
 	}
 	card->priv = priv;
 	priv->card = card;
@@ -1157,8 +1156,6 @@ terminate_thread:
 	if_spi_terminate_spi_thread(card);
 remove_card:
 	lbs_remove_card(priv); /* will call free_netdev */
-free_gpio:
-	gpio_free(card->gpio_cs);
 free_card:
 	free_if_spi_card(card);
 out:
@@ -1179,7 +1176,6 @@ static int __devexit libertas_spi_remove(struct spi_device *spi)
 	free_irq(spi->irq, card);
 	if_spi_terminate_spi_thread(card);
 	lbs_remove_card(priv); /* will call free_netdev */
-	gpio_free(card->gpio_cs);
 	if (card->pdata->teardown)
 		card->pdata->teardown(spi);
 	free_if_spi_card(card);
-- 
1.6.0.6



From bigeasy at linutronix.de  Thu Jun  4 15:57:03 2009
From: bigeasy at linutronix.de (Sebastian Andrzej Siewior)
Date: Thu, 4 Jun 2009 21:57:03 +0200
Subject: [PATCH v3] net/libertas: remove GPIO-CS handling in SPI interface code
Message-ID: <20090604195703.GA27495@www.tglx.de>

This removes the dependency on GPIO framework and lets the SPI host
driver handle the chip select. The SPI host driver is required to keep
the CS active for the entire message unless cs_change says otherwise.
This patch collects the two/three single SPI transfers into a message.
Also the delay in read path in case use_dummy_writes are not used is
moved into the SPI host driver.

Tested-by: Mike Rapoport <mike at compulab.co.il>
Tested-by: Andrey Yurovsky <andrey at cozybit.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
v2..v3:
 removed unused gpio_cs from libertas_spi_platform_data 

v1..v2:
+   reg_trans.delay_usecs = (100 + (delay * 10)) / 1000;
 with
+   reg_trans.delay_usecs =
+       DIV_ROUND_UP((100 + (delay * 10)), 1000);
The latter should not end up with delay_usecs = 0 if delay is < 90

 drivers/net/wireless/Kconfig           |    2 +-
 drivers/net/wireless/libertas/if_spi.c |   92 +++++++++++++++-----------------
 include/linux/spi/libertas_spi.h       |    3 -
 3 files changed, 45 insertions(+), 52 deletions(-)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index daf4c80..fb7541c 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -153,7 +153,7 @@ config LIBERTAS_SDIO
 
 config LIBERTAS_SPI
 	tristate "Marvell Libertas 8686 SPI 802.11b/g cards"
-	depends on LIBERTAS && SPI && GENERIC_GPIO
+	depends on LIBERTAS && SPI
 	---help---
 	  A driver for Marvell Libertas 8686 SPI devices.
 
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index ea23c5d..f8c2898 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -19,7 +19,6 @@
 
 #include <linux/moduleparam.h>
 #include <linux/firmware.h>
-#include <linux/gpio.h>
 #include <linux/jiffies.h>
 #include <linux/kthread.h>
 #include <linux/list.h>
@@ -51,13 +50,6 @@ struct if_spi_card {
 	u16				card_id;
 	u8				card_rev;
 
-	/* Pin number for our GPIO chip-select. */
-	/* TODO: Once the generic SPI layer has some additional features, we
-	 * should take this out and use the normal chip select here.
-	 * We need support for chip select delays, and not dropping chipselect
-	 * after each word. */
-	int				gpio_cs;
-
 	/* The last time that we initiated an SPU operation */
 	unsigned long			prev_xfer_time;
 
@@ -130,12 +122,10 @@ static void spu_transaction_init(struct if_spi_card *card)
 		 * If not, we have to busy-wait to be on the safe side. */
 		ndelay(400);
 	}
-	gpio_set_value(card->gpio_cs, 0); /* assert CS */
 }
 
 static void spu_transaction_finish(struct if_spi_card *card)
 {
-	gpio_set_value(card->gpio_cs, 1); /* drop CS */
 	card->prev_xfer_time = jiffies;
 }
 
@@ -145,6 +135,13 @@ static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
 {
 	int err = 0;
 	u16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
+	struct spi_message m;
+	struct spi_transfer reg_trans;
+	struct spi_transfer data_trans;
+
+	spi_message_init(&m);
+	memset(&reg_trans, 0, sizeof(reg_trans));
+	memset(&data_trans, 0, sizeof(data_trans));
 
 	/* You must give an even number of bytes to the SPU, even if it
 	 * doesn't care about the last one.  */
@@ -153,13 +150,16 @@ static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
 	spu_transaction_init(card);
 
 	/* write SPU register index */
-	err = spi_write(card->spi, (u8 *)&reg_out, sizeof(u16));
-	if (err)
-		goto out;
+	reg_trans.tx_buf = &reg_out;
+	reg_trans.len = sizeof(reg_out);
 
-	err = spi_write(card->spi, buf, len);
+	data_trans.tx_buf = buf;
+	data_trans.len = len;
 
-out:
+	spi_message_add_tail(&reg_trans, &m);
+	spi_message_add_tail(&data_trans, &m);
+
+	err = spi_sync(card->spi, &m);
 	spu_transaction_finish(card);
 	return err;
 }
@@ -186,10 +186,13 @@ static inline int spu_reg_is_port_reg(u16 reg)
 
 static int spu_read(struct if_spi_card *card, u16 reg, u8 *buf, int len)
 {
-	unsigned int i, delay;
+	unsigned int delay;
 	int err = 0;
-	u16 zero = 0;
 	u16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
+	struct spi_message m;
+	struct spi_transfer reg_trans;
+	struct spi_transfer dummy_trans;
+	struct spi_transfer data_trans;
 
 	/* You must take an even number of bytes from the SPU, even if you
 	 * don't care about the last one.  */
@@ -197,29 +200,34 @@ static int spu_read(struct if_spi_card *card, u16 reg, u8 *buf, int len)
 
 	spu_transaction_init(card);
 
+	spi_message_init(&m);
+	memset(&reg_trans, 0, sizeof(reg_trans));
+	memset(&dummy_trans, 0, sizeof(dummy_trans));
+	memset(&data_trans, 0, sizeof(data_trans));
+
 	/* write SPU register index */
-	err = spi_write(card->spi, (u8 *)&reg_out, sizeof(u16));
-	if (err)
-		goto out;
+	reg_trans.tx_buf = &reg_out;
+	reg_trans.len = sizeof(reg_out);
+	spi_message_add_tail(&reg_trans, &m);
 
 	delay = spu_reg_is_port_reg(reg) ? card->spu_port_delay :
 						card->spu_reg_delay;
 	if (card->use_dummy_writes) {
 		/* Clock in dummy cycles while the SPU fills the FIFO */
-		for (i = 0; i < delay / 16; ++i) {
-			err = spi_write(card->spi, (u8 *)&zero, sizeof(u16));
-			if (err)
-				return err;
-		}
+		dummy_trans.len = delay / 8;
+		spi_message_add_tail(&dummy_trans, &m);
 	} else {
 		/* Busy-wait while the SPU fills the FIFO */
-		ndelay(100 + (delay * 10));
+		reg_trans.delay_usecs =
+			DIV_ROUND_UP((100 + (delay * 10)), 1000);
 	}
 
 	/* read in data */
-	err = spi_read(card->spi, buf, len);
+	data_trans.rx_buf = buf;
+	data_trans.len = len;
+	spi_message_add_tail(&data_trans, &m);
 
-out:
+	err = spi_sync(card->spi, &m);
 	spu_transaction_finish(card);
 	return err;
 }
@@ -1049,7 +1057,6 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 	spi_set_drvdata(spi, card);
 	card->pdata = pdata;
 	card->spi = spi;
-	card->gpio_cs = pdata->gpio_cs;
 	card->prev_xfer_time = jiffies;
 
 	sema_init(&card->spi_ready, 0);
@@ -1058,26 +1065,18 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 	INIT_LIST_HEAD(&card->data_packet_list);
 	spin_lock_init(&card->buffer_lock);
 
-	/* set up GPIO CS line. TODO: use  regular CS line */
-	err = gpio_request(card->gpio_cs, "if_spi_gpio_chip_select");
-	if (err)
-		goto free_card;
-	err = gpio_direction_output(card->gpio_cs, 1);
-	if (err)
-		goto free_gpio;
-
 	/* Initialize the SPI Interface Unit */
 	err = spu_init(card, pdata->use_dummy_writes);
 	if (err)
-		goto free_gpio;
+		goto free_card;
 	err = spu_get_chip_revision(card, &card->card_id, &card->card_rev);
 	if (err)
-		goto free_gpio;
+		goto free_card;
 
 	/* Firmware load */
 	err = spu_read_u32(card, IF_SPI_SCRATCH_4_REG, &scratch);
 	if (err)
-		goto free_gpio;
+		goto free_card;
 	if (scratch == SUCCESSFUL_FW_DOWNLOAD_MAGIC)
 		lbs_deb_spi("Firmware is already loaded for "
 			    "Marvell WLAN 802.11 adapter\n");
@@ -1085,7 +1084,7 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 		err = if_spi_calculate_fw_names(card->card_id,
 				card->helper_fw_name, card->main_fw_name);
 		if (err)
-			goto free_gpio;
+			goto free_card;
 
 		lbs_deb_spi("Initializing FW for Marvell WLAN 802.11 adapter "
 				"(chip_id = 0x%04x, chip_rev = 0x%02x) "
@@ -1096,23 +1095,23 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 				spi->max_speed_hz);
 		err = if_spi_prog_helper_firmware(card);
 		if (err)
-			goto free_gpio;
+			goto free_card;
 		err = if_spi_prog_main_firmware(card);
 		if (err)
-			goto free_gpio;
+			goto free_card;
 		lbs_deb_spi("loaded FW for Marvell WLAN 802.11 adapter\n");
 	}
 
 	err = spu_set_interrupt_mode(card, 0, 1);
 	if (err)
-		goto free_gpio;
+		goto free_card;
 
 	/* Register our card with libertas.
 	 * This will call alloc_etherdev */
 	priv = lbs_add_card(card, &spi->dev);
 	if (!priv) {
 		err = -ENOMEM;
-		goto free_gpio;
+		goto free_card;
 	}
 	card->priv = priv;
 	priv->card = card;
@@ -1157,8 +1156,6 @@ terminate_thread:
 	if_spi_terminate_spi_thread(card);
 remove_card:
 	lbs_remove_card(priv); /* will call free_netdev */
-free_gpio:
-	gpio_free(card->gpio_cs);
 free_card:
 	free_if_spi_card(card);
 out:
@@ -1179,7 +1176,6 @@ static int __devexit libertas_spi_remove(struct spi_device *spi)
 	free_irq(spi->irq, card);
 	if_spi_terminate_spi_thread(card);
 	lbs_remove_card(priv); /* will call free_netdev */
-	gpio_free(card->gpio_cs);
 	if (card->pdata->teardown)
 		card->pdata->teardown(spi);
 	free_if_spi_card(card);
diff --git a/include/linux/spi/libertas_spi.h b/include/linux/spi/libertas_spi.h
index 79506f5..1b5d538 100644
--- a/include/linux/spi/libertas_spi.h
+++ b/include/linux/spi/libertas_spi.h
@@ -22,9 +22,6 @@ struct libertas_spi_platform_data {
 	 * speed, you may want to use 0 here. */
 	u16 use_dummy_writes;
 
-	/* GPIO number to use as chip select */
-	u16 gpio_cs;
-
 	/* Board specific setup/teardown */
 	int (*setup)(struct spi_device *spi);
 	int (*teardown)(struct spi_device *spi);
-- 
1.6.0.6



From dcbw at redhat.com  Thu Jun  4 16:11:00 2009
From: dcbw at redhat.com (Dan Williams)
Date: Thu, 04 Jun 2009 16:11:00 -0400
Subject: [PATCH v3] net/libertas: remove GPIO-CS handling in SPI
	interface code
In-Reply-To: <20090604195703.GA27495@www.tglx.de>
References: <20090604195703.GA27495@www.tglx.de>
Message-ID: <1244146260.2487.4.camel@localhost.localdomain>

On Thu, 2009-06-04 at 21:57 +0200, Sebastian Andrzej Siewior wrote:
> This removes the dependency on GPIO framework and lets the SPI host
> driver handle the chip select. The SPI host driver is required to keep
> the CS active for the entire message unless cs_change says otherwise.
> This patch collects the two/three single SPI transfers into a message.
> Also the delay in read path in case use_dummy_writes are not used is
> moved into the SPI host driver.
> 
> Tested-by: Mike Rapoport <mike at compulab.co.il>
> Tested-by: Andrey Yurovsky <andrey at cozybit.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>

Yay!  Fewer hardware deps == better :)

Acked-by: Dan Williams <dcbw at redhat.com>

> ---
> v2..v3:
>  removed unused gpio_cs from libertas_spi_platform_data 
> 
> v1..v2:
> +   reg_trans.delay_usecs = (100 + (delay * 10)) / 1000;
>  with
> +   reg_trans.delay_usecs =
> +       DIV_ROUND_UP((100 + (delay * 10)), 1000);
> The latter should not end up with delay_usecs = 0 if delay is < 90
> 
>  drivers/net/wireless/Kconfig           |    2 +-
>  drivers/net/wireless/libertas/if_spi.c |   92 +++++++++++++++-----------------
>  include/linux/spi/libertas_spi.h       |    3 -
>  3 files changed, 45 insertions(+), 52 deletions(-)
> 
> diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
> index daf4c80..fb7541c 100644
> --- a/drivers/net/wireless/Kconfig
> +++ b/drivers/net/wireless/Kconfig
> @@ -153,7 +153,7 @@ config LIBERTAS_SDIO
>  
>  config LIBERTAS_SPI
>  	tristate "Marvell Libertas 8686 SPI 802.11b/g cards"
> -	depends on LIBERTAS && SPI && GENERIC_GPIO
> +	depends on LIBERTAS && SPI
>  	---help---
>  	  A driver for Marvell Libertas 8686 SPI devices.
>  
> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
> index ea23c5d..f8c2898 100644
> --- a/drivers/net/wireless/libertas/if_spi.c
> +++ b/drivers/net/wireless/libertas/if_spi.c
> @@ -19,7 +19,6 @@
>  
>  #include <linux/moduleparam.h>
>  #include <linux/firmware.h>
> -#include <linux/gpio.h>
>  #include <linux/jiffies.h>
>  #include <linux/kthread.h>
>  #include <linux/list.h>
> @@ -51,13 +50,6 @@ struct if_spi_card {
>  	u16				card_id;
>  	u8				card_rev;
>  
> -	/* Pin number for our GPIO chip-select. */
> -	/* TODO: Once the generic SPI layer has some additional features, we
> -	 * should take this out and use the normal chip select here.
> -	 * We need support for chip select delays, and not dropping chipselect
> -	 * after each word. */
> -	int				gpio_cs;
> -
>  	/* The last time that we initiated an SPU operation */
>  	unsigned long			prev_xfer_time;
>  
> @@ -130,12 +122,10 @@ static void spu_transaction_init(struct if_spi_card *card)
>  		 * If not, we have to busy-wait to be on the safe side. */
>  		ndelay(400);
>  	}
> -	gpio_set_value(card->gpio_cs, 0); /* assert CS */
>  }
>  
>  static void spu_transaction_finish(struct if_spi_card *card)
>  {
> -	gpio_set_value(card->gpio_cs, 1); /* drop CS */
>  	card->prev_xfer_time = jiffies;
>  }
>  
> @@ -145,6 +135,13 @@ static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
>  {
>  	int err = 0;
>  	u16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
> +	struct spi_message m;
> +	struct spi_transfer reg_trans;
> +	struct spi_transfer data_trans;
> +
> +	spi_message_init(&m);
> +	memset(&reg_trans, 0, sizeof(reg_trans));
> +	memset(&data_trans, 0, sizeof(data_trans));
>  
>  	/* You must give an even number of bytes to the SPU, even if it
>  	 * doesn't care about the last one.  */
> @@ -153,13 +150,16 @@ static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
>  	spu_transaction_init(card);
>  
>  	/* write SPU register index */
> -	err = spi_write(card->spi, (u8 *)&reg_out, sizeof(u16));
> -	if (err)
> -		goto out;
> +	reg_trans.tx_buf = &reg_out;
> +	reg_trans.len = sizeof(reg_out);
>  
> -	err = spi_write(card->spi, buf, len);
> +	data_trans.tx_buf = buf;
> +	data_trans.len = len;
>  
> -out:
> +	spi_message_add_tail(&reg_trans, &m);
> +	spi_message_add_tail(&data_trans, &m);
> +
> +	err = spi_sync(card->spi, &m);
>  	spu_transaction_finish(card);
>  	return err;
>  }
> @@ -186,10 +186,13 @@ static inline int spu_reg_is_port_reg(u16 reg)
>  
>  static int spu_read(struct if_spi_card *card, u16 reg, u8 *buf, int len)
>  {
> -	unsigned int i, delay;
> +	unsigned int delay;
>  	int err = 0;
> -	u16 zero = 0;
>  	u16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
> +	struct spi_message m;
> +	struct spi_transfer reg_trans;
> +	struct spi_transfer dummy_trans;
> +	struct spi_transfer data_trans;
>  
>  	/* You must take an even number of bytes from the SPU, even if you
>  	 * don't care about the last one.  */
> @@ -197,29 +200,34 @@ static int spu_read(struct if_spi_card *card, u16 reg, u8 *buf, int len)
>  
>  	spu_transaction_init(card);
>  
> +	spi_message_init(&m);
> +	memset(&reg_trans, 0, sizeof(reg_trans));
> +	memset(&dummy_trans, 0, sizeof(dummy_trans));
> +	memset(&data_trans, 0, sizeof(data_trans));
> +
>  	/* write SPU register index */
> -	err = spi_write(card->spi, (u8 *)&reg_out, sizeof(u16));
> -	if (err)
> -		goto out;
> +	reg_trans.tx_buf = &reg_out;
> +	reg_trans.len = sizeof(reg_out);
> +	spi_message_add_tail(&reg_trans, &m);
>  
>  	delay = spu_reg_is_port_reg(reg) ? card->spu_port_delay :
>  						card->spu_reg_delay;
>  	if (card->use_dummy_writes) {
>  		/* Clock in dummy cycles while the SPU fills the FIFO */
> -		for (i = 0; i < delay / 16; ++i) {
> -			err = spi_write(card->spi, (u8 *)&zero, sizeof(u16));
> -			if (err)
> -				return err;
> -		}
> +		dummy_trans.len = delay / 8;
> +		spi_message_add_tail(&dummy_trans, &m);
>  	} else {
>  		/* Busy-wait while the SPU fills the FIFO */
> -		ndelay(100 + (delay * 10));
> +		reg_trans.delay_usecs =
> +			DIV_ROUND_UP((100 + (delay * 10)), 1000);
>  	}
>  
>  	/* read in data */
> -	err = spi_read(card->spi, buf, len);
> +	data_trans.rx_buf = buf;
> +	data_trans.len = len;
> +	spi_message_add_tail(&data_trans, &m);
>  
> -out:
> +	err = spi_sync(card->spi, &m);
>  	spu_transaction_finish(card);
>  	return err;
>  }
> @@ -1049,7 +1057,6 @@ static int __devinit if_spi_probe(struct spi_device *spi)
>  	spi_set_drvdata(spi, card);
>  	card->pdata = pdata;
>  	card->spi = spi;
> -	card->gpio_cs = pdata->gpio_cs;
>  	card->prev_xfer_time = jiffies;
>  
>  	sema_init(&card->spi_ready, 0);
> @@ -1058,26 +1065,18 @@ static int __devinit if_spi_probe(struct spi_device *spi)
>  	INIT_LIST_HEAD(&card->data_packet_list);
>  	spin_lock_init(&card->buffer_lock);
>  
> -	/* set up GPIO CS line. TODO: use  regular CS line */
> -	err = gpio_request(card->gpio_cs, "if_spi_gpio_chip_select");
> -	if (err)
> -		goto free_card;
> -	err = gpio_direction_output(card->gpio_cs, 1);
> -	if (err)
> -		goto free_gpio;
> -
>  	/* Initialize the SPI Interface Unit */
>  	err = spu_init(card, pdata->use_dummy_writes);
>  	if (err)
> -		goto free_gpio;
> +		goto free_card;
>  	err = spu_get_chip_revision(card, &card->card_id, &card->card_rev);
>  	if (err)
> -		goto free_gpio;
> +		goto free_card;
>  
>  	/* Firmware load */
>  	err = spu_read_u32(card, IF_SPI_SCRATCH_4_REG, &scratch);
>  	if (err)
> -		goto free_gpio;
> +		goto free_card;
>  	if (scratch == SUCCESSFUL_FW_DOWNLOAD_MAGIC)
>  		lbs_deb_spi("Firmware is already loaded for "
>  			    "Marvell WLAN 802.11 adapter\n");
> @@ -1085,7 +1084,7 @@ static int __devinit if_spi_probe(struct spi_device *spi)
>  		err = if_spi_calculate_fw_names(card->card_id,
>  				card->helper_fw_name, card->main_fw_name);
>  		if (err)
> -			goto free_gpio;
> +			goto free_card;
>  
>  		lbs_deb_spi("Initializing FW for Marvell WLAN 802.11 adapter "
>  				"(chip_id = 0x%04x, chip_rev = 0x%02x) "
> @@ -1096,23 +1095,23 @@ static int __devinit if_spi_probe(struct spi_device *spi)
>  				spi->max_speed_hz);
>  		err = if_spi_prog_helper_firmware(card);
>  		if (err)
> -			goto free_gpio;
> +			goto free_card;
>  		err = if_spi_prog_main_firmware(card);
>  		if (err)
> -			goto free_gpio;
> +			goto free_card;
>  		lbs_deb_spi("loaded FW for Marvell WLAN 802.11 adapter\n");
>  	}
>  
>  	err = spu_set_interrupt_mode(card, 0, 1);
>  	if (err)
> -		goto free_gpio;
> +		goto free_card;
>  
>  	/* Register our card with libertas.
>  	 * This will call alloc_etherdev */
>  	priv = lbs_add_card(card, &spi->dev);
>  	if (!priv) {
>  		err = -ENOMEM;
> -		goto free_gpio;
> +		goto free_card;
>  	}
>  	card->priv = priv;
>  	priv->card = card;
> @@ -1157,8 +1156,6 @@ terminate_thread:
>  	if_spi_terminate_spi_thread(card);
>  remove_card:
>  	lbs_remove_card(priv); /* will call free_netdev */
> -free_gpio:
> -	gpio_free(card->gpio_cs);
>  free_card:
>  	free_if_spi_card(card);
>  out:
> @@ -1179,7 +1176,6 @@ static int __devexit libertas_spi_remove(struct spi_device *spi)
>  	free_irq(spi->irq, card);
>  	if_spi_terminate_spi_thread(card);
>  	lbs_remove_card(priv); /* will call free_netdev */
> -	gpio_free(card->gpio_cs);
>  	if (card->pdata->teardown)
>  		card->pdata->teardown(spi);
>  	free_if_spi_card(card);
> diff --git a/include/linux/spi/libertas_spi.h b/include/linux/spi/libertas_spi.h
> index 79506f5..1b5d538 100644
> --- a/include/linux/spi/libertas_spi.h
> +++ b/include/linux/spi/libertas_spi.h
> @@ -22,9 +22,6 @@ struct libertas_spi_platform_data {
>  	 * speed, you may want to use 0 here. */
>  	u16 use_dummy_writes;
>  
> -	/* GPIO number to use as chip select */
> -	u16 gpio_cs;
> -
>  	/* Board specific setup/teardown */
>  	int (*setup)(struct spi_device *spi);
>  	int (*teardown)(struct spi_device *spi);



From brian.j.wood at intel.com  Fri Jun  5 15:04:46 2009
From: brian.j.wood at intel.com (Wood, Brian J)
Date: Fri, 5 Jun 2009 12:04:46 -0700
Subject: sd8686 linux system hang when associating to access point
Message-ID: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>

Hello all, 

I have an issue with my development platform that's using Marvell's 88w8686 wifi component. In the past I have been able to use the version 9 firmware when connecting to our corporate wifi testing network. Recently when trying to associate an essid with the wifi network the entire system will hang (like the SDIO controller has crashed). 

I'd like to help debug this issue, but don't know where to start gathering the information needed by the members of the mailing list. I have lbsdebug installed on the target, the kernel source recompiled to have debugging turned on (MMC, Libertas, etc...). My kernel source version is 2.6.29.2 and is from the Moblin v2 project. The development platform is Intel Menlow based (like used in many of the current Netbooks). 

Since the system completely hangs trying to look for kernel oops or messages on the running system in the logfiles/dmesg isn't an option (until a reboot). I've been adding lots of printk's to the drivers files just so I could try and see how this is all unfolding up to the point where it dies. I just discovered the lbsdebug tool this morning and would like to gather the information most helpful to resolve the issue. :-)

I'm excited to help with this, so any advice of what to gather first would be greatly appreciated. 

Thank you, 

Brian Wood
Intel Corporation 
UMG Platform Software Group (UPSG)
brian.j.wood at intel.com
 



From dcbw at redhat.com  Fri Jun  5 15:35:29 2009
From: dcbw at redhat.com (Dan Williams)
Date: Fri, 05 Jun 2009 15:35:29 -0400
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>
Message-ID: <1244230529.15303.7.camel@localhost.localdomain>

On Fri, 2009-06-05 at 12:04 -0700, Wood, Brian J wrote:
> Hello all, 
> 
> I have an issue with my development platform that's using Marvell's 88w8686 wifi component. In the past I have been able to use the version 9 firmware when connecting to our corporate wifi testing network. Recently when trying to associate an essid with the wifi network the entire system will hang (like the SDIO controller has crashed). 
> 
> I'd like to help debug this issue, but don't know where to start gathering the information needed by the members of the mailing list. I have lbsdebug installed on the target, the kernel source recompiled to have debugging turned on (MMC, Libertas, etc...). My kernel source version is 2.6.29.2 and is from the Moblin v2 project. The development platform is Intel Menlow based (like used in many of the current Netbooks). 

You'll first need to figure out if the Moblin kernel still uses a
non-upstream vendor driver.  If so, then you need to contact Marvell or
Intel for help with that driver.  Historically, the Moblin kernels
(2.6.22 and 2.6.24) used a completely different driver than was present
in the upstream kernel, because Intel apparently didn't feel like they
needed to work with the upstream community to enhance the existing one
to meet their needs.  Oh well.

To figure that out, run 'lsmod' when the card is inserted and we'll see
what driver module is there.  If you're actually using the standard
upstream driver, then we get to go on to the following:

1) what SDIO controller are you using?  Is its source upstream in the
kernel?  The *largest* source of issues with the Libertas driver is
crappy SD controllers.  I test the driver mainly on Ricoh laptop SD
controllers, and it works very well there.  The quality of your
controller has a huge impact on how well the driver will work.

2) You may wish to rebuild the libertas modules with debugging enabled.
Set CONFIG_LIBERTAS_DEBUG=y in your kernel config and rebuild.  Then,
modprobe the libertas driver like so:

modprobe libertas.ko libertas_debug=0x5863a7
modprobe libertas_sdio.ko

(see drivers/net/wireless/libertas/defs.h LBS_DEB_* for the debugging
constants)

then try to reproduce the problem.  This will spew out a lot of good
debugging output, which you'll want to capture over a serial port or
something so that when the machine does go south, we can figure out why.

Let me know if you have any questions!

Dan

> Since the system completely hangs trying to look for kernel oops or messages on the running system in the logfiles/dmesg isn't an option (until a reboot). I've been adding lots of printk's to the drivers files just so I could try and see how this is all unfolding up to the point where it dies. I just discovered the lbsdebug tool this morning and would like to gather the information most helpful to resolve the issue. :-)
> 
> I'm excited to help with this, so any advice of what to gather first would be greatly appreciated. 
> 
> Thank you, 
> 
> Brian Wood
> Intel Corporation 
> UMG Platform Software Group (UPSG)
> brian.j.wood at intel.com
>  
> 
> 
> _______________________________________________
> libertas-dev mailing list
> libertas-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev



From airglow at natlapp.com  Sat Jun  6 20:10:42 2009
From: airglow at natlapp.com (airglow)
Date: Sun, 07 Jun 2009 00:10:42 +0000
Subject: Stranded Girrl
Message-ID: <20090607000814_545441beale@natlapp.com>

A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 356 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libertas-dev/attachments/20090607/8776538e/attachment.obj>

From paraphrases at elo.sk  Mon Jun  8 09:52:07 2009
From: paraphrases at elo.sk (Grisanti Secundo)
Date: Mon, 08 Jun 2009 13:52:07 +0000
Subject: Pennsylvania woman used poisonous snakes to hlold police at bay
Message-ID: <499099bc.hmjwHG0WTCdodmv@elo.sk>

A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 356 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libertas-dev/attachments/20090608/bbcbc7c1/attachment.obj>

From brian.j.wood at intel.com  Mon Jun  8 18:02:57 2009
From: brian.j.wood at intel.com (Wood, Brian J)
Date: Mon, 8 Jun 2009 15:02:57 -0700
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <1244230529.15303.7.camel@localhost.localdomain>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>
	<1244230529.15303.7.camel@localhost.localdomain>
Message-ID: <1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>


>-----Original Message-----
>From: Dan Williams [mailto:dcbw at redhat.com]
>Sent: Friday, June 05, 2009 12:35 PM
>To: Wood, Brian J
>Cc: libertas-dev at lists.infradead.org
>Subject: Re: sd8686 linux system hang when associating to access point
>
>On Fri, 2009-06-05 at 12:04 -0700, Wood, Brian J wrote:
>> Hello all,
>>
>> I have an issue with my development platform that's using Marvell's 88w8686 wifi component. In
>the past I have been able to use the version 9 firmware when connecting to our corporate wifi
>testing network. Recently when trying to associate an essid with the wifi network the entire system
>will hang (like the SDIO controller has crashed).
>>
>> I'd like to help debug this issue, but don't know where to start gathering the information needed
>by the members of the mailing list. I have lbsdebug installed on the target, the kernel source
>recompiled to have debugging turned on (MMC, Libertas, etc...). My kernel source version is
>2.6.29.2 and is from the Moblin v2 project. The development platform is Intel Menlow based (like
>used in many of the current Netbooks).
>
>You'll first need to figure out if the Moblin kernel still uses a
>non-upstream vendor driver.  If so, then you need to contact Marvell or
>Intel for help with that driver.  Historically, the Moblin kernels
>(2.6.22 and 2.6.24) used a completely different driver than was present
>in the upstream kernel, because Intel apparently didn't feel like they
>needed to work with the upstream community to enhance the existing one
>to meet their needs.  Oh well.
>
>To figure that out, run 'lsmod' when the card is inserted and we'll see
>what driver module is there.  If you're actually using the standard
>upstream driver, then we get to go on to the following:

Hi Dan, thanks for the help by the way. :)

Yes, I'm using the standard upstream libertas/libertas_sdio driver (just to make sure I pulled down the vanilla 2.6.29.4 kernel and rebuilt with the libertas debugging turned on, so were using a known upstream version. The libertas I'm using is the libertas_sdio for the sd8686.

Here's my lsmod output:
sh-3.2# lsmod
Module                  Size  Used by
libertas_sdio          11616  0
libertas              134196  1 libertas_sdio
lib80211                4848  1 libertas
mmc_block               8552  0
sdhci_pci               6352  0
sdhci                  14392  1 sdhci_pci
mmc_core               41356  3 libertas_sdio,mmc_block,sdhci
pl2303                 14440  1
usbserial              26212  3 pl2303
sh-3.2#

>
>1) what SDIO controller are you using?  Is its source upstream in the
>kernel?  The *largest* source of issues with the Libertas driver is
>crappy SD controllers.  I test the driver mainly on Ricoh laptop SD
>controllers, and it works very well there.  The quality of your
>controller has a huge impact on how well the driver will work.

The development platform I'm using is a Compal Jax10 (Aigo P8860 is another version). Is there a Linux command to find out the SDIO controller its using? I tried using dmidecode and it didn't seem to list a specific HW name for the SD controller. I also tried using lspci, but I don't know if this PCI table info is helpful:

00:1e.0 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
) SDIO Controller #1 (rev 06)
00:1e.1 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
) SDIO Controller #2 (rev 06)


>
>2) You may wish to rebuild the libertas modules with debugging enabled.
>Set CONFIG_LIBERTAS_DEBUG=y in your kernel config and rebuild.  Then,
>modprobe the libertas driver like so:
>
>modprobe libertas.ko libertas_debug=0x5863a7
>modprobe libertas_sdio.ko
>
>(see drivers/net/wireless/libertas/defs.h LBS_DEB_* for the debugging
>constants)
>
>then try to reproduce the problem.  This will spew out a lot of good
>debugging output, which you'll want to capture over a serial port or
>something so that when the machine does go south, we can figure out why.

Here's some output I thought might be helpful:

sh-3.2# dmesg | grep -i libertas
[    9.977267] libertas: 00:1d:19:f0:ca:92, fw 9.70.3p36, cap 0x00000303
[    9.978091] eth0 (libertas_sdio): not using net_device_ops yet
[    9.983572] libertas: PREP_CMD: command 0x00a3 failed: 2
[    9.984501] libertas: PREP_CMD: command 0x00a3 failed: 2
[    9.984646] libertas: eth0: Marvell WLAN 802.11 adapter
sh-3.2#

I saw on a mailing list that the PREP_CMD failure was something to do with the CONFIG_MAC80211_MESH being set, so I tried rebuilding the kernel with this enabled/disabled and still see that message in dmesg. Didn't know if this helps.

Here's the rest of my data:


sh-3.2# echo 8 > /proc/sys/kernel/printk
sh-3.2# echo 5792679 > /sys/module/libertas/parameters/libertas_debug

sh-3.2# ./lbsdebug
0x005863a7: enter,leave,main,wext,scan,assoc,join,host,cmd,fw,thread,sdio

Details:
       enter + 0x00000001 - function entrance
       leave + 0x00000002 - function exit
        main + 0x00000004 - main libertas library code
         net   0x00000008 - interaction with network subsystem
        mesh   0x00000010 - wireless mesh network
        wext + 0x00000020 - interaction with wireless extensions
       ioctl   0x00000040 - misc IOCTLs
        scan + 0x00000080 - scanning for APs
       assoc + 0x00000100 - associating ton an AP
        join + 0x00000200 - joining an IBSS?
         11d   0x00000400 - 802.11d country settings
     debugfs   0x00000800 - interaction with the debugfs subsystem
     ethtool   0x00001000 - interaction with ethtool subsystem
        host + 0x00002000 - communication between host and wlan chip
         cmd + 0x00004000 - command and response processing
          rx   0x00008000 - packet reception
          tx   0x00010000 - packet transmission
         usb   0x00020000 - interaction with USB subsystem
          cs   0x00040000 - interaction with card services subsystem
          fw + 0x00080000 - firmware downloading
      thread + 0x00100000 - main libertas worker thread
         hex   0x00200000 - turn on detailed hex dumps
        sdio + 0x00400000 - interaction with SDIO subsystem
sh-3.2#

sh-3.2# iwconfig eth0
[   66.612880] libertas enter: lbs_get_name()
[   66.613052] libertas leave: lbs_get_name()
[   66.613725] libertas enter: lbs_get_freq()
[   66.613826] libertas wext: freq 241200000
[   66.613937] libertas leave: lbs_get_freq()
[   66.614588] libertas enter: lbs_get_encode()
[   66.614691] libertas wext: flags 0x0, index -1, length 64, wep_tx_keyidx 0
[   66.614790] libertas wext: key: 00:00:00:00:00:00, keylen 64
[   66.614880] libertas wext: return flags 0xa000
[   66.614963] libertas leave: lbs_get_encode()
[   66.615841] libertas enter: lbs_get_essid()
[   66.615928] libertas leave: lbs_get_essid()
[   66.616359] libertas enter: lbs_get_mode()
[   66.616445] libertas leave: lbs_get_mode()
[   66.616544] libertas enter: lbs_get_range()
[   66.616629] libertas enter: copy_active_data_rates()
[   66.616715] libertas leave: copy_active_data_rates()
[   66.616803] libertas wext: IW_MAX_BITRATES 32, num_bitrates 12
[   66.616894] libertas wext: IW_MAX_FREQUENCIES 32, num_frequency 11
[   66.616986] libertas leave: lbs_get_range()
[   66.618195] libertas enter: lbs_get_wap()
[   66.618362] libertas leave: lbs_get_wap()
[   66.618532] libertas enter: lbs_get_rate()
[   66.618694] libertas leave: lbs_get_rate()
[   66.618863] libertas enter: lbs_get_power()
[   66.619050] libertas leave: lbs_get_power()
[   66.620022] liberta[   66.621107] libertas enter: __lbs_cmd()
[   66.621273] liber[   66.626819] libertas thread: sleeping, connect_status 1,0
[   [   66.643861] libertas thread: 3: currenttxskb (null), dnld_sen[   66.6494)
[   66.649574][   66.656430] libertas enter: if_sdio_host_to_card_worker()
[ [   66.660600] libertas enter: if_sdio_interrupt()
[   66.66076[   66.666272] libertas leave: if_sdio_card_to_host(), ret 0
[ [   66.671932] libertas thread: 4: currenttxskb (null), dnld_sen[   66.677602)
[   66.6[   66.683313] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00[   66.0
[   66.694742[   66.700321] libertas enter: if_sdio_host_to_card_worker()
[ [   66.705700] mmc1: req done (CMD52): 0: 00001092 00000000 0000[   66.7114910
[   66.711658eth0      IEEE 802.11b/g  ESSID:""
          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
          Bit Rate:0 kb/s   Tx-Power=15 dBm
          Retry short limit:8   RTS thr=2347 B   Fragment thr=2346 B
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

sh-3.2#

sh-3.2# iwconfig eth0 essid Guest
[  305.621045] libertas enter: lbs_get_wireless_stats()
[  305.621266] libertas leave: lbs_get_wireless_stats()
[  305.621689] libertas enter: lbs_set_essid()
[  305.621866] libertas wext: requested SSID 'Guest'
[  305.622320] libertas enter: lbs_get_association_request()
[  305.622502] libertas leave: lbs_get_association_request()
[  305.622677] libertas leave: lbs_set_essid(), ret 0
[  306.122305] libertas enter: lbs_association_worker()
[  306.122543] libertas assoc: Association Request:
[  306.122549]     flags:     0x00000002
[  306.122553]     SSID:      'Guest'
[  306.122556]     chann:     1
[  306.122560]     band:      0
[  306.122563]     mode:      2
[  306.122566]     BSSID:     00:00:00:00:00:00
[  306.122570]     secinfo:
[  306.122574]     auth_mode: 1
[  306.124280] libertas enter: assoc_helper_associate()
[  306.124484] libertas enter: assoc_helper_essid()
[  306.124669] libertas assoc: SSID 'Guest' requested
[  306.124838] libertas enter: lbs_send_specific_ssid_scan(SSID 'Guest'
[  306.124843] )
[  306.125183] libertas enter: lbs_scan_networks(full_scan 1)
[  306.125356] libertas scan: numchannels 4, bsstype 3
[  306.125529] libertas scan: chan_count 11, scan_channel 0
[  306.125700] libertas scan: scanning 4 of 11 channels
[  306.125868] libertas enter: lbs_do_scan(bsstype 3, chanlist[].chan 1, chan_c)
[  306.126147] libertas enter: __lbs_cmd()
[  306.126310] libertas enter: __lbs_cmd_async()
[  306.126476] libertas enter: lbs_get_cmd_ctrl_node()
[  306.126643] libertas leave: lbs_get_cmd_ctrl_node()
[  306.126810] libertas host: PREP_CMD: command 0x0006
[  306.126976] libertas enter: lbs_queue_cmd()
[  306.127156] libertas host: QUEUE_CMD: [  306.127810] libertas thread: 2: cur0
[  306.592084] mmc1: starting CMD52 arg 00000a00 flags 00000195
[  306.592497] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  306.592720] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
[  306.592729] libertas enter: if_sdio_interrupt()
[  306.593188] mmc1: starting CMD52 arg 10000a00 flags 00000195
[  306.593378] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  306.593562] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
[  306.593748] libertas sdio: interrupt: 0x1
[  306.593912] mmc1: starting CMD52 arg 90000afe flags 00000195
[  306.594117] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  306.594299] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
[  306.594489] libertas enter: if_sdio_card_to_host()
[  306.594658] mmc1: starting CMD52 arg 10006800 flags 00000195
[  306.594845] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  306.595044] mmc1: req done (CMD52): 0: 0000104a 00000000 00000000 00000000
[  306.595233] mmc1: starting CMD52 arg 10006a00 flags 00000195
[  306.595420] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  306.595598] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
[  306.595785] mmc1: starting CMD52 arg 1000400[  306.598899] libertas thread: 0
[  306.6102[  306.615742] libertas thread: 1: currenttxskb (null), dnld_sen[  35
                                                                               0
[  307.081616] mmc1: starting CMD52 arg 00000a00 flags 00000195
[  307.081861] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  307.082162] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
[  307.082383] libertas enter: if_sdio_interrupt()
[  307.082575] mmc1: starting CMD52 arg 10000a00 flags 00000195
[  307.082766] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  307.082948] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
[  307.083160] libertas sdio: interrupt: 0x1
[  307.083327] mmc1: starting CMD52 arg 90000afe flags 00000195
[  307.083511] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  307.083692] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
[  307.083880] libertas enter: if_sdio_card_to_host()
[  307.084068] mmc1: starting CMD52 arg 10006800 flags 00000195
[  307.084254] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  307.084439] mmc1: req done (CMD52): 0: 000010bf 00000000 00000000 00000000
[  307.084625] mmc1: starting CMD52 arg 10006a00 flags 00000195
[  307.084812] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  307.084994] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
[  307.085198] mmc1: starting CMD52 arg 100040[  307.088157] libertas thread: 21
[  307.09948[  307.104808] libertas scan: got SSID IE: 'Guest', len 5
[  30[  307.110688] libertas leave: lbs_queue_cmd()
[  307.110858] l[  307.116137] mmc1: starting CMD52 arg 10000a00 flags 00000195
                                                                               0
[  307.461844] mmc1: starting CMD52 arg 00000a00 flags 00000195
[  307.462288] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  307.462510] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
[  307.462728] libertas enter: if_sdio_interrupt()
[  307.462921] mmc1: starting CMD52 arg 10000a00 flags 00000195
[  307.463131] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  307.463315] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
[  307.463504] libertas sdio: interrupt: 0x1
[  307.463672] mmc1: starting CMD52 arg 90000afe flags 00000195
[  307.463857] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  307.464059] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
[  307.464245] libertas enter: if_sdio_card_to_host()
[  307.464415] mmc1: starting CMD52 arg 10006800 flags 00000195
[  307.464602] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  307.464784] mmc1: req done (CMD52): 0: 0000109c 00000000 00000000 00000000
[  307.464970] mmc1: starting CMD52 arg 10006a00 flags 00000195
[  307.465174] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
[  307.465356] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
[  307.465542] mmc1: starting CMD52 arg 1000400[  307.469629] libertas thread: 1
[  307.4742[  307.479790] libertas scan: process_bss: IE len 106
[  307.47[


At this point the device hangs and the display goes garbled, I'm capturing this output using a USB to serial adapter on the target since it doesn't have a serial port. (I'm assuming I'm dropping some of the messages that I would otherwise being seeing if I had a serial connector setup, I hope this gives us enough information.)

>
>Let me know if you have any questions!
>
>Dan
>
>> Since the system completely hangs trying to look for kernel oops or messages on the running
>system in the logfiles/dmesg isn't an option (until a reboot). I've been adding lots of printk's to
>the drivers files just so I could try and see how this is all unfolding up to the point where it
>dies. I just discovered the lbsdebug tool this morning and would like to gather the information
>most helpful to resolve the issue. :-)
>>
>> I'm excited to help with this, so any advice of what to gather first would be greatly
>appreciated.
>>
>> Thank you,
>>
>> Brian Wood
>> Intel Corporation
>> UMG Platform Software Group (UPSG)
>> brian.j.wood at intel.com
>>
>>
>>
>> _______________________________________________
>> libertas-dev mailing list
>> libertas-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/libertas-dev



From dcbw at redhat.com  Tue Jun  9 11:00:33 2009
From: dcbw at redhat.com (Dan Williams)
Date: Tue, 09 Jun 2009 11:00:33 -0400
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>
	<1244230529.15303.7.camel@localhost.localdomain>
	<1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>
Message-ID: <1244559633.22187.4.camel@localhost.localdomain>

On Mon, 2009-06-08 at 15:02 -0700, Wood, Brian J wrote:
> >-----Original Message-----
> >From: Dan Williams [mailto:dcbw at redhat.com]
> >Sent: Friday, June 05, 2009 12:35 PM
> >To: Wood, Brian J
> >Cc: libertas-dev at lists.infradead.org
> >Subject: Re: sd8686 linux system hang when associating to access point
> >
> >On Fri, 2009-06-05 at 12:04 -0700, Wood, Brian J wrote:
> >> Hello all,
> >>
> >> I have an issue with my development platform that's using Marvell's 88w8686 wifi component. In
> >the past I have been able to use the version 9 firmware when connecting to our corporate wifi
> >testing network. Recently when trying to associate an essid with the wifi network the entire system
> >will hang (like the SDIO controller has crashed).
> >>
> >> I'd like to help debug this issue, but don't know where to start gathering the information needed
> >by the members of the mailing list. I have lbsdebug installed on the target, the kernel source
> >recompiled to have debugging turned on (MMC, Libertas, etc...). My kernel source version is
> >2.6.29.2 and is from the Moblin v2 project. The development platform is Intel Menlow based (like
> >used in many of the current Netbooks).
> >
> >You'll first need to figure out if the Moblin kernel still uses a
> >non-upstream vendor driver.  If so, then you need to contact Marvell or
> >Intel for help with that driver.  Historically, the Moblin kernels
> >(2.6.22 and 2.6.24) used a completely different driver than was present
> >in the upstream kernel, because Intel apparently didn't feel like they
> >needed to work with the upstream community to enhance the existing one
> >to meet their needs.  Oh well.
> >
> >To figure that out, run 'lsmod' when the card is inserted and we'll see
> >what driver module is there.  If you're actually using the standard
> >upstream driver, then we get to go on to the following:
> 
> Hi Dan, thanks for the help by the way. :)
> 
> Yes, I'm using the standard upstream libertas/libertas_sdio driver (just to make sure I pulled down the vanilla 2.6.29.4 kernel and rebuilt with the libertas debugging turned on, so were using a known upstream version. The libertas I'm using is the libertas_sdio for the sd8686.
> 
> Here's my lsmod output:
> sh-3.2# lsmod
> Module                  Size  Used by
> libertas_sdio          11616  0
> libertas              134196  1 libertas_sdio
> lib80211                4848  1 libertas
> mmc_block               8552  0
> sdhci_pci               6352  0
> sdhci                  14392  1 sdhci_pci
> mmc_core               41356  3 libertas_sdio,mmc_block,sdhci
> pl2303                 14440  1
> usbserial              26212  3 pl2303
> sh-3.2#

Yup, looks good.

> >
> >1) what SDIO controller are you using?  Is its source upstream in the
> >kernel?  The *largest* source of issues with the Libertas driver is
> >crappy SD controllers.  I test the driver mainly on Ricoh laptop SD
> >controllers, and it works very well there.  The quality of your
> >controller has a huge impact on how well the driver will work.
> 
> The development platform I'm using is a Compal Jax10 (Aigo P8860 is another version). Is there a Linux command to find out the SDIO controller its using? I tried using dmidecode and it didn't seem to list a specific HW name for the SD controller. I also tried using lspci, but I don't know if this PCI table info is helpful:
> 
> 00:1e.0 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
> ) SDIO Controller #1 (rev 06)
> 00:1e.1 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
> ) SDIO Controller #2 (rev 06)

Ugh.  That driver isn't upstream yet, and last I looked at the patch,
had some serious issues with mergability.  That doesn't say anything
about it's actual *operation*; ie it might work fine or it might not,
but since it's not yet upstream and hasn't passed kernel review, it's
somewhat suspect.

> 
> >
> >2) You may wish to rebuild the libertas modules with debugging enabled.
> >Set CONFIG_LIBERTAS_DEBUG=y in your kernel config and rebuild.  Then,
> >modprobe the libertas driver like so:
> >
> >modprobe libertas.ko libertas_debug=0x5863a7
> >modprobe libertas_sdio.ko
> >
> >(see drivers/net/wireless/libertas/defs.h LBS_DEB_* for the debugging
> >constants)
> >
> >then try to reproduce the problem.  This will spew out a lot of good
> >debugging output, which you'll want to capture over a serial port or
> >something so that when the machine does go south, we can figure out why.
> 
> Here's some output I thought might be helpful:
> 
> sh-3.2# dmesg | grep -i libertas
> [    9.977267] libertas: 00:1d:19:f0:ca:92, fw 9.70.3p36, cap 0x00000303
> [    9.978091] eth0 (libertas_sdio): not using net_device_ops yet
> [    9.983572] libertas: PREP_CMD: command 0x00a3 failed: 2
> [    9.984501] libertas: PREP_CMD: command 0x00a3 failed: 2
> [    9.984646] libertas: eth0: Marvell WLAN 802.11 adapter
> sh-3.2#
> 
> I saw on a mailing list that the PREP_CMD failure was something to do with the CONFIG_MAC80211_MESH being set, so I tried rebuilding the kernel with this enabled/disabled and still see that message in dmesg. Didn't know if this helps.

That failure is expected on non-USB8388 devices, which have the mesh
firmware.  Doesn't have anything to do with CONFIG_MAC80211_MESH
actually, as the 8388 mesh capability is firmware-based.  The command
failures are actually the indicator that a mesh command failed, and thus
mesh isn't supported on this device.  We should probably clean that up,
but it's a low priority.

> Here's the rest of my data:
> 
> 
> sh-3.2# echo 8 > /proc/sys/kernel/printk
> sh-3.2# echo 5792679 > /sys/module/libertas/parameters/libertas_debug
> 
> sh-3.2# ./lbsdebug
> 0x005863a7: enter,leave,main,wext,scan,assoc,join,host,cmd,fw,thread,sdio
> 
> Details:
>        enter + 0x00000001 - function entrance
>        leave + 0x00000002 - function exit
>         main + 0x00000004 - main libertas library code
>          net   0x00000008 - interaction with network subsystem
>         mesh   0x00000010 - wireless mesh network
>         wext + 0x00000020 - interaction with wireless extensions
>        ioctl   0x00000040 - misc IOCTLs
>         scan + 0x00000080 - scanning for APs
>        assoc + 0x00000100 - associating ton an AP
>         join + 0x00000200 - joining an IBSS?
>          11d   0x00000400 - 802.11d country settings
>      debugfs   0x00000800 - interaction with the debugfs subsystem
>      ethtool   0x00001000 - interaction with ethtool subsystem
>         host + 0x00002000 - communication between host and wlan chip
>          cmd + 0x00004000 - command and response processing
>           rx   0x00008000 - packet reception
>           tx   0x00010000 - packet transmission
>          usb   0x00020000 - interaction with USB subsystem
>           cs   0x00040000 - interaction with card services subsystem
>           fw + 0x00080000 - firmware downloading
>       thread + 0x00100000 - main libertas worker thread
>          hex   0x00200000 - turn on detailed hex dumps
>         sdio + 0x00400000 - interaction with SDIO subsystem
> sh-3.2#
> 
> sh-3.2# iwconfig eth0
> [   66.612880] libertas enter: lbs_get_name()
> [   66.613052] libertas leave: lbs_get_name()
> [   66.613725] libertas enter: lbs_get_freq()
> [   66.613826] libertas wext: freq 241200000
> [   66.613937] libertas leave: lbs_get_freq()
> [   66.614588] libertas enter: lbs_get_encode()
> [   66.614691] libertas wext: flags 0x0, index -1, length 64, wep_tx_keyidx 0
> [   66.614790] libertas wext: key: 00:00:00:00:00:00, keylen 64
> [   66.614880] libertas wext: return flags 0xa000
> [   66.614963] libertas leave: lbs_get_encode()
> [   66.615841] libertas enter: lbs_get_essid()
> [   66.615928] libertas leave: lbs_get_essid()
> [   66.616359] libertas enter: lbs_get_mode()
> [   66.616445] libertas leave: lbs_get_mode()
> [   66.616544] libertas enter: lbs_get_range()
> [   66.616629] libertas enter: copy_active_data_rates()
> [   66.616715] libertas leave: copy_active_data_rates()
> [   66.616803] libertas wext: IW_MAX_BITRATES 32, num_bitrates 12
> [   66.616894] libertas wext: IW_MAX_FREQUENCIES 32, num_frequency 11
> [   66.616986] libertas leave: lbs_get_range()
> [   66.618195] libertas enter: lbs_get_wap()
> [   66.618362] libertas leave: lbs_get_wap()
> [   66.618532] libertas enter: lbs_get_rate()
> [   66.618694] libertas leave: lbs_get_rate()
> [   66.618863] libertas enter: lbs_get_power()
> [   66.619050] libertas leave: lbs_get_power()
> [   66.620022] liberta[   66.621107] libertas enter: __lbs_cmd()
> [   66.621273] liber[   66.626819] libertas thread: sleeping, connect_status 1,0
> [   [   66.643861] libertas thread: 3: currenttxskb (null), dnld_sen[   66.6494)
> [   66.649574][   66.656430] libertas enter: if_sdio_host_to_card_worker()
> [ [   66.660600] libertas enter: if_sdio_interrupt()
> [   66.66076[   66.666272] libertas leave: if_sdio_card_to_host(), ret 0
> [ [   66.671932] libertas thread: 4: currenttxskb (null), dnld_sen[   66.677602)
> [   66.6[   66.683313] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00[   66.0
> [   66.694742[   66.700321] libertas enter: if_sdio_host_to_card_worker()
> [ [   66.705700] mmc1: req done (CMD52): 0: 00001092 00000000 0000[   66.7114910
> [   66.711658eth0      IEEE 802.11b/g  ESSID:""
>           Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
>           Bit Rate:0 kb/s   Tx-Power=15 dBm
>           Retry short limit:8   RTS thr=2347 B   Fragment thr=2346 B
>           Encryption key:off
>           Power Management:off
>           Link Quality:0  Signal level:0  Noise level:0
>           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
>           Tx excessive retries:0  Invalid misc:0   Missed beacon:0
> 
> sh-3.2#
> 
> sh-3.2# iwconfig eth0 essid Guest
> [  305.621045] libertas enter: lbs_get_wireless_stats()
> [  305.621266] libertas leave: lbs_get_wireless_stats()
> [  305.621689] libertas enter: lbs_set_essid()
> [  305.621866] libertas wext: requested SSID 'Guest'
> [  305.622320] libertas enter: lbs_get_association_request()
> [  305.622502] libertas leave: lbs_get_association_request()
> [  305.622677] libertas leave: lbs_set_essid(), ret 0
> [  306.122305] libertas enter: lbs_association_worker()
> [  306.122543] libertas assoc: Association Request:
> [  306.122549]     flags:     0x00000002
> [  306.122553]     SSID:      'Guest'
> [  306.122556]     chann:     1
> [  306.122560]     band:      0
> [  306.122563]     mode:      2
> [  306.122566]     BSSID:     00:00:00:00:00:00
> [  306.122570]     secinfo:
> [  306.122574]     auth_mode: 1
> [  306.124280] libertas enter: assoc_helper_associate()
> [  306.124484] libertas enter: assoc_helper_essid()
> [  306.124669] libertas assoc: SSID 'Guest' requested
> [  306.124838] libertas enter: lbs_send_specific_ssid_scan(SSID 'Guest'
> [  306.124843] )
> [  306.125183] libertas enter: lbs_scan_networks(full_scan 1)
> [  306.125356] libertas scan: numchannels 4, bsstype 3
> [  306.125529] libertas scan: chan_count 11, scan_channel 0
> [  306.125700] libertas scan: scanning 4 of 11 channels
> [  306.125868] libertas enter: lbs_do_scan(bsstype 3, chanlist[].chan 1, chan_c)
> [  306.126147] libertas enter: __lbs_cmd()
> [  306.126310] libertas enter: __lbs_cmd_async()
> [  306.126476] libertas enter: lbs_get_cmd_ctrl_node()
> [  306.126643] libertas leave: lbs_get_cmd_ctrl_node()
> [  306.126810] libertas host: PREP_CMD: command 0x0006
> [  306.126976] libertas enter: lbs_queue_cmd()
> [  306.127156] libertas host: QUEUE_CMD: [  306.127810] libertas thread: 2: cur0
> [  306.592084] mmc1: starting CMD52 arg 00000a00 flags 00000195
> [  306.592497] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  306.592720] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
> [  306.592729] libertas enter: if_sdio_interrupt()
> [  306.593188] mmc1: starting CMD52 arg 10000a00 flags 00000195
> [  306.593378] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  306.593562] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
> [  306.593748] libertas sdio: interrupt: 0x1
> [  306.593912] mmc1: starting CMD52 arg 90000afe flags 00000195
> [  306.594117] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  306.594299] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
> [  306.594489] libertas enter: if_sdio_card_to_host()
> [  306.594658] mmc1: starting CMD52 arg 10006800 flags 00000195
> [  306.594845] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  306.595044] mmc1: req done (CMD52): 0: 0000104a 00000000 00000000 00000000
> [  306.595233] mmc1: starting CMD52 arg 10006a00 flags 00000195
> [  306.595420] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  306.595598] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
> [  306.595785] mmc1: starting CMD52 arg 1000400[  306.598899] libertas thread: 0
> [  306.6102[  306.615742] libertas thread: 1: currenttxskb (null), dnld_sen[  35
>                                                                                0
> [  307.081616] mmc1: starting CMD52 arg 00000a00 flags 00000195
> [  307.081861] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  307.082162] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
> [  307.082383] libertas enter: if_sdio_interrupt()
> [  307.082575] mmc1: starting CMD52 arg 10000a00 flags 00000195
> [  307.082766] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  307.082948] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
> [  307.083160] libertas sdio: interrupt: 0x1
> [  307.083327] mmc1: starting CMD52 arg 90000afe flags 00000195
> [  307.083511] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  307.083692] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
> [  307.083880] libertas enter: if_sdio_card_to_host()
> [  307.084068] mmc1: starting CMD52 arg 10006800 flags 00000195
> [  307.084254] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  307.084439] mmc1: req done (CMD52): 0: 000010bf 00000000 00000000 00000000
> [  307.084625] mmc1: starting CMD52 arg 10006a00 flags 00000195
> [  307.084812] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  307.084994] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
> [  307.085198] mmc1: starting CMD52 arg 100040[  307.088157] libertas thread: 21
> [  307.09948[  307.104808] libertas scan: got SSID IE: 'Guest', len 5
> [  30[  307.110688] libertas leave: lbs_queue_cmd()
> [  307.110858] l[  307.116137] mmc1: starting CMD52 arg 10000a00 flags 00000195
>                                                                                0
> [  307.461844] mmc1: starting CMD52 arg 00000a00 flags 00000195
> [  307.462288] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  307.462510] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
> [  307.462728] libertas enter: if_sdio_interrupt()
> [  307.462921] mmc1: starting CMD52 arg 10000a00 flags 00000195
> [  307.463131] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  307.463315] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
> [  307.463504] libertas sdio: interrupt: 0x1
> [  307.463672] mmc1: starting CMD52 arg 90000afe flags 00000195
> [  307.463857] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  307.464059] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
> [  307.464245] libertas enter: if_sdio_card_to_host()
> [  307.464415] mmc1: starting CMD52 arg 10006800 flags 00000195
> [  307.464602] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  307.464784] mmc1: req done (CMD52): 0: 0000109c 00000000 00000000 00000000
> [  307.464970] mmc1: starting CMD52 arg 10006a00 flags 00000195
> [  307.465174] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
> [  307.465356] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
> [  307.465542] mmc1: starting CMD52 arg 1000400[  307.469629] libertas thread: 1
> [  307.4742[  307.479790] libertas scan: process_bss: IE len 106
> [  307.47[
> 
> 
> At this point the device hangs and the display goes garbled, I'm capturing this output using a USB to serial adapter on the target since it doesn't have a serial port. (I'm assuming I'm dropping some of the messages that I would otherwise being seeing if I had a serial connector setup, I hope this gives us enough information.)

Hmm, yeah, that's probably not where it left off, but that's likely the
best you can do for now.  Does a normal scan (iwlist eth0 scan) make
things hang?   Or is it just association?

Dan

> >
> >Let me know if you have any questions!
> >
> >Dan
> >
> >> Since the system completely hangs trying to look for kernel oops or messages on the running
> >system in the logfiles/dmesg isn't an option (until a reboot). I've been adding lots of printk's to
> >the drivers files just so I could try and see how this is all unfolding up to the point where it
> >dies. I just discovered the lbsdebug tool this morning and would like to gather the information
> >most helpful to resolve the issue. :-)
> >>
> >> I'm excited to help with this, so any advice of what to gather first would be greatly
> >appreciated.
> >>
> >> Thank you,
> >>
> >> Brian Wood
> >> Intel Corporation
> >> UMG Platform Software Group (UPSG)
> >> brian.j.wood at intel.com
> >>
> >>
> >>
> >> _______________________________________________
> >> libertas-dev mailing list
> >> libertas-dev at lists.infradead.org
> >> http://lists.infradead.org/mailman/listinfo/libertas-dev
> 
> 
> _______________________________________________
> libertas-dev mailing list
> libertas-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev



From brian.j.wood at intel.com  Tue Jun  9 11:59:04 2009
From: brian.j.wood at intel.com (Wood, Brian J)
Date: Tue, 9 Jun 2009 08:59:04 -0700
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <1244559633.22187.4.camel@localhost.localdomain>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>
	<1244230529.15303.7.camel@localhost.localdomain>
	<1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>
	<1244559633.22187.4.camel@localhost.localdomain>
Message-ID: <1BEA8649F0C00540AB2811D7922ECB6C32775FF5@orsmsx507.amr.corp.intel.com>

>-----Original Message-----
>From: Dan Williams [mailto:dcbw at redhat.com]
>Sent: Tuesday, June 09, 2009 8:01 AM
>To: Wood, Brian J
>Cc: libertas-dev at lists.infradead.org
>Subject: RE: sd8686 linux system hang when associating to access point
>
>On Mon, 2009-06-08 at 15:02 -0700, Wood, Brian J wrote:
>> >-----Original Message-----
>> >From: Dan Williams [mailto:dcbw at redhat.com]
>> >Sent: Friday, June 05, 2009 12:35 PM
>> >To: Wood, Brian J
>> >Cc: libertas-dev at lists.infradead.org
>> >Subject: Re: sd8686 linux system hang when associating to access point
>> >
>> >On Fri, 2009-06-05 at 12:04 -0700, Wood, Brian J wrote:
>> >> Hello all,
>> >>
>> >> I have an issue with my development platform that's using Marvell's 88w8686 wifi component. In
>> >the past I have been able to use the version 9 firmware when connecting to our corporate wifi
>> >testing network. Recently when trying to associate an essid with the wifi network the entire
>system
>> >will hang (like the SDIO controller has crashed).
>> >>
>> >> I'd like to help debug this issue, but don't know where to start gathering the information
>needed
>> >by the members of the mailing list. I have lbsdebug installed on the target, the kernel source
>> >recompiled to have debugging turned on (MMC, Libertas, etc...). My kernel source version is
>> >2.6.29.2 and is from the Moblin v2 project. The development platform is Intel Menlow based (like
>> >used in many of the current Netbooks).
>> >
>> >You'll first need to figure out if the Moblin kernel still uses a
>> >non-upstream vendor driver.  If so, then you need to contact Marvell or
>> >Intel for help with that driver.  Historically, the Moblin kernels
>> >(2.6.22 and 2.6.24) used a completely different driver than was present
>> >in the upstream kernel, because Intel apparently didn't feel like they
>> >needed to work with the upstream community to enhance the existing one
>> >to meet their needs.  Oh well.
>> >
>> >To figure that out, run 'lsmod' when the card is inserted and we'll see
>> >what driver module is there.  If you're actually using the standard
>> >upstream driver, then we get to go on to the following:
>>
>> Hi Dan, thanks for the help by the way. :)
>>
>> Yes, I'm using the standard upstream libertas/libertas_sdio driver (just to make sure I pulled
>down the vanilla 2.6.29.4 kernel and rebuilt with the libertas debugging turned on, so were using a
>known upstream version. The libertas I'm using is the libertas_sdio for the sd8686.
>>
>> Here's my lsmod output:
>> sh-3.2# lsmod
>> Module                  Size  Used by
>> libertas_sdio          11616  0
>> libertas              134196  1 libertas_sdio
>> lib80211                4848  1 libertas
>> mmc_block               8552  0
>> sdhci_pci               6352  0
>> sdhci                  14392  1 sdhci_pci
>> mmc_core               41356  3 libertas_sdio,mmc_block,sdhci
>> pl2303                 14440  1
>> usbserial              26212  3 pl2303
>> sh-3.2#
>
>Yup, looks good.
>
>> >
>> >1) what SDIO controller are you using?  Is its source upstream in the
>> >kernel?  The *largest* source of issues with the Libertas driver is
>> >crappy SD controllers.  I test the driver mainly on Ricoh laptop SD
>> >controllers, and it works very well there.  The quality of your
>> >controller has a huge impact on how well the driver will work.
>>
>> The development platform I'm using is a Compal Jax10 (Aigo P8860 is another version). Is there a
>Linux command to find out the SDIO controller its using? I tried using dmidecode and it didn't seem
>to list a specific HW name for the SD controller. I also tried using lspci, but I don't know if
>this PCI table info is helpful:
>>
>> 00:1e.0 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
>> ) SDIO Controller #1 (rev 06)
>> 00:1e.1 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
>> ) SDIO Controller #2 (rev 06)
>
>Ugh.  That driver isn't upstream yet, and last I looked at the patch,
>had some serious issues with mergability.  That doesn't say anything
>about it's actual *operation*; ie it might work fine or it might not,
>but since it's not yet upstream and hasn't passed kernel review, it's
>somewhat suspect.
>
>>
>> >
>> >2) You may wish to rebuild the libertas modules with debugging enabled.
>> >Set CONFIG_LIBERTAS_DEBUG=y in your kernel config and rebuild.  Then,
>> >modprobe the libertas driver like so:
>> >
>> >modprobe libertas.ko libertas_debug=0x5863a7
>> >modprobe libertas_sdio.ko
>> >
>> >(see drivers/net/wireless/libertas/defs.h LBS_DEB_* for the debugging
>> >constants)
>> >
>> >then try to reproduce the problem.  This will spew out a lot of good
>> >debugging output, which you'll want to capture over a serial port or
>> >something so that when the machine does go south, we can figure out why.
>>
>> Here's some output I thought might be helpful:
>>
>> sh-3.2# dmesg | grep -i libertas
>> [    9.977267] libertas: 00:1d:19:f0:ca:92, fw 9.70.3p36, cap 0x00000303
>> [    9.978091] eth0 (libertas_sdio): not using net_device_ops yet
>> [    9.983572] libertas: PREP_CMD: command 0x00a3 failed: 2
>> [    9.984501] libertas: PREP_CMD: command 0x00a3 failed: 2
>> [    9.984646] libertas: eth0: Marvell WLAN 802.11 adapter
>> sh-3.2#
>>
>> I saw on a mailing list that the PREP_CMD failure was something to do with the
>CONFIG_MAC80211_MESH being set, so I tried rebuilding the kernel with this enabled/disabled and
>still see that message in dmesg. Didn't know if this helps.
>
>That failure is expected on non-USB8388 devices, which have the mesh
>firmware.  Doesn't have anything to do with CONFIG_MAC80211_MESH
>actually, as the 8388 mesh capability is firmware-based.  The command
>failures are actually the indicator that a mesh command failed, and thus
>mesh isn't supported on this device.  We should probably clean that up,
>but it's a low priority.
>
>> Here's the rest of my data:
>>
>>
>> sh-3.2# echo 8 > /proc/sys/kernel/printk
>> sh-3.2# echo 5792679 > /sys/module/libertas/parameters/libertas_debug
>>
>> sh-3.2# ./lbsdebug
>> 0x005863a7: enter,leave,main,wext,scan,assoc,join,host,cmd,fw,thread,sdio
>>
>> Details:
>>        enter + 0x00000001 - function entrance
>>        leave + 0x00000002 - function exit
>>         main + 0x00000004 - main libertas library code
>>          net   0x00000008 - interaction with network subsystem
>>         mesh   0x00000010 - wireless mesh network
>>         wext + 0x00000020 - interaction with wireless extensions
>>        ioctl   0x00000040 - misc IOCTLs
>>         scan + 0x00000080 - scanning for APs
>>        assoc + 0x00000100 - associating ton an AP
>>         join + 0x00000200 - joining an IBSS?
>>          11d   0x00000400 - 802.11d country settings
>>      debugfs   0x00000800 - interaction with the debugfs subsystem
>>      ethtool   0x00001000 - interaction with ethtool subsystem
>>         host + 0x00002000 - communication between host and wlan chip
>>          cmd + 0x00004000 - command and response processing
>>           rx   0x00008000 - packet reception
>>           tx   0x00010000 - packet transmission
>>          usb   0x00020000 - interaction with USB subsystem
>>           cs   0x00040000 - interaction with card services subsystem
>>           fw + 0x00080000 - firmware downloading
>>       thread + 0x00100000 - main libertas worker thread
>>          hex   0x00200000 - turn on detailed hex dumps
>>         sdio + 0x00400000 - interaction with SDIO subsystem
>> sh-3.2#
>>
>> sh-3.2# iwconfig eth0
>> [   66.612880] libertas enter: lbs_get_name()
>> [   66.613052] libertas leave: lbs_get_name()
>> [   66.613725] libertas enter: lbs_get_freq()
>> [   66.613826] libertas wext: freq 241200000
>> [   66.613937] libertas leave: lbs_get_freq()
>> [   66.614588] libertas enter: lbs_get_encode()
>> [   66.614691] libertas wext: flags 0x0, index -1, length 64, wep_tx_keyidx 0
>> [   66.614790] libertas wext: key: 00:00:00:00:00:00, keylen 64
>> [   66.614880] libertas wext: return flags 0xa000
>> [   66.614963] libertas leave: lbs_get_encode()
>> [   66.615841] libertas enter: lbs_get_essid()
>> [   66.615928] libertas leave: lbs_get_essid()
>> [   66.616359] libertas enter: lbs_get_mode()
>> [   66.616445] libertas leave: lbs_get_mode()
>> [   66.616544] libertas enter: lbs_get_range()
>> [   66.616629] libertas enter: copy_active_data_rates()
>> [   66.616715] libertas leave: copy_active_data_rates()
>> [   66.616803] libertas wext: IW_MAX_BITRATES 32, num_bitrates 12
>> [   66.616894] libertas wext: IW_MAX_FREQUENCIES 32, num_frequency 11
>> [   66.616986] libertas leave: lbs_get_range()
>> [   66.618195] libertas enter: lbs_get_wap()
>> [   66.618362] libertas leave: lbs_get_wap()
>> [   66.618532] libertas enter: lbs_get_rate()
>> [   66.618694] libertas leave: lbs_get_rate()
>> [   66.618863] libertas enter: lbs_get_power()
>> [   66.619050] libertas leave: lbs_get_power()
>> [   66.620022] liberta[   66.621107] libertas enter: __lbs_cmd()
>> [   66.621273] liber[   66.626819] libertas thread: sleeping, connect_status 1,0
>> [   [   66.643861] libertas thread: 3: currenttxskb (null), dnld_sen[   66.6494)
>> [   66.649574][   66.656430] libertas enter: if_sdio_host_to_card_worker()
>> [ [   66.660600] libertas enter: if_sdio_interrupt()
>> [   66.66076[   66.666272] libertas leave: if_sdio_card_to_host(), ret 0
>> [ [   66.671932] libertas thread: 4: currenttxskb (null), dnld_sen[   66.677602)
>> [   66.6[   66.683313] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00[   66.0
>> [   66.694742[   66.700321] libertas enter: if_sdio_host_to_card_worker()
>> [ [   66.705700] mmc1: req done (CMD52): 0: 00001092 00000000 0000[   66.7114910
>> [   66.711658eth0      IEEE 802.11b/g  ESSID:""
>>           Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
>>           Bit Rate:0 kb/s   Tx-Power=15 dBm
>>           Retry short limit:8   RTS thr=2347 B   Fragment thr=2346 B
>>           Encryption key:off
>>           Power Management:off
>>           Link Quality:0  Signal level:0  Noise level:0
>>           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
>>           Tx excessive retries:0  Invalid misc:0   Missed beacon:0
>>
>> sh-3.2#
>>
>> sh-3.2# iwconfig eth0 essid Guest
>> [  305.621045] libertas enter: lbs_get_wireless_stats()
>> [  305.621266] libertas leave: lbs_get_wireless_stats()
>> [  305.621689] libertas enter: lbs_set_essid()
>> [  305.621866] libertas wext: requested SSID 'Guest'
>> [  305.622320] libertas enter: lbs_get_association_request()
>> [  305.622502] libertas leave: lbs_get_association_request()
>> [  305.622677] libertas leave: lbs_set_essid(), ret 0
>> [  306.122305] libertas enter: lbs_association_worker()
>> [  306.122543] libertas assoc: Association Request:
>> [  306.122549]     flags:     0x00000002
>> [  306.122553]     SSID:      'Guest'
>> [  306.122556]     chann:     1
>> [  306.122560]     band:      0
>> [  306.122563]     mode:      2
>> [  306.122566]     BSSID:     00:00:00:00:00:00
>> [  306.122570]     secinfo:
>> [  306.122574]     auth_mode: 1
>> [  306.124280] libertas enter: assoc_helper_associate()
>> [  306.124484] libertas enter: assoc_helper_essid()
>> [  306.124669] libertas assoc: SSID 'Guest' requested
>> [  306.124838] libertas enter: lbs_send_specific_ssid_scan(SSID 'Guest'
>> [  306.124843] )
>> [  306.125183] libertas enter: lbs_scan_networks(full_scan 1)
>> [  306.125356] libertas scan: numchannels 4, bsstype 3
>> [  306.125529] libertas scan: chan_count 11, scan_channel 0
>> [  306.125700] libertas scan: scanning 4 of 11 channels
>> [  306.125868] libertas enter: lbs_do_scan(bsstype 3, chanlist[].chan 1, chan_c)
>> [  306.126147] libertas enter: __lbs_cmd()
>> [  306.126310] libertas enter: __lbs_cmd_async()
>> [  306.126476] libertas enter: lbs_get_cmd_ctrl_node()
>> [  306.126643] libertas leave: lbs_get_cmd_ctrl_node()
>> [  306.126810] libertas host: PREP_CMD: command 0x0006
>> [  306.126976] libertas enter: lbs_queue_cmd()
>> [  306.127156] libertas host: QUEUE_CMD: [  306.127810] libertas thread: 2: cur0
>> [  306.592084] mmc1: starting CMD52 arg 00000a00 flags 00000195
>> [  306.592497] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  306.592720] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>> [  306.592729] libertas enter: if_sdio_interrupt()
>> [  306.593188] mmc1: starting CMD52 arg 10000a00 flags 00000195
>> [  306.593378] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  306.593562] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>> [  306.593748] libertas sdio: interrupt: 0x1
>> [  306.593912] mmc1: starting CMD52 arg 90000afe flags 00000195
>> [  306.594117] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  306.594299] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>> [  306.594489] libertas enter: if_sdio_card_to_host()
>> [  306.594658] mmc1: starting CMD52 arg 10006800 flags 00000195
>> [  306.594845] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  306.595044] mmc1: req done (CMD52): 0: 0000104a 00000000 00000000 00000000
>> [  306.595233] mmc1: starting CMD52 arg 10006a00 flags 00000195
>> [  306.595420] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  306.595598] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>> [  306.595785] mmc1: starting CMD52 arg 1000400[  306.598899] libertas thread: 0
>> [  306.6102[  306.615742] libertas thread: 1: currenttxskb (null), dnld_sen[  35
>>                                                                                0
>> [  307.081616] mmc1: starting CMD52 arg 00000a00 flags 00000195
>> [  307.081861] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  307.082162] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>> [  307.082383] libertas enter: if_sdio_interrupt()
>> [  307.082575] mmc1: starting CMD52 arg 10000a00 flags 00000195
>> [  307.082766] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  307.082948] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>> [  307.083160] libertas sdio: interrupt: 0x1
>> [  307.083327] mmc1: starting CMD52 arg 90000afe flags 00000195
>> [  307.083511] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  307.083692] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>> [  307.083880] libertas enter: if_sdio_card_to_host()
>> [  307.084068] mmc1: starting CMD52 arg 10006800 flags 00000195
>> [  307.084254] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  307.084439] mmc1: req done (CMD52): 0: 000010bf 00000000 00000000 00000000
>> [  307.084625] mmc1: starting CMD52 arg 10006a00 flags 00000195
>> [  307.084812] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  307.084994] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>> [  307.085198] mmc1: starting CMD52 arg 100040[  307.088157] libertas thread: 21
>> [  307.09948[  307.104808] libertas scan: got SSID IE: 'Guest', len 5
>> [  30[  307.110688] libertas leave: lbs_queue_cmd()
>> [  307.110858] l[  307.116137] mmc1: starting CMD52 arg 10000a00 flags 00000195
>>                                                                                0
>> [  307.461844] mmc1: starting CMD52 arg 00000a00 flags 00000195
>> [  307.462288] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  307.462510] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>> [  307.462728] libertas enter: if_sdio_interrupt()
>> [  307.462921] mmc1: starting CMD52 arg 10000a00 flags 00000195
>> [  307.463131] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  307.463315] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>> [  307.463504] libertas sdio: interrupt: 0x1
>> [  307.463672] mmc1: starting CMD52 arg 90000afe flags 00000195
>> [  307.463857] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  307.464059] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>> [  307.464245] libertas enter: if_sdio_card_to_host()
>> [  307.464415] mmc1: starting CMD52 arg 10006800 flags 00000195
>> [  307.464602] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  307.464784] mmc1: req done (CMD52): 0: 0000109c 00000000 00000000 00000000
>> [  307.464970] mmc1: starting CMD52 arg 10006a00 flags 00000195
>> [  307.465174] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>> [  307.465356] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>> [  307.465542] mmc1: starting CMD52 arg 1000400[  307.469629] libertas thread: 1
>> [  307.4742[  307.479790] libertas scan: process_bss: IE len 106
>> [  307.47[
>>
>>
>> At this point the device hangs and the display goes garbled, I'm capturing this output using a
>USB to serial adapter on the target since it doesn't have a serial port. (I'm assuming I'm dropping
>some of the messages that I would otherwise being seeing if I had a serial connector setup, I hope
>this gives us enough information.)
>
>Hmm, yeah, that's probably not where it left off, but that's likely the
>best you can do for now.  Does a normal scan (iwlist eth0 scan) make
>things hang?   Or is it just association?
>
>Dan

A regular scan will work ok (no hang), its just when I try and associate with an accesspoint. I'm going to try a suggestion from Philip about the align_sdio function about aligning with multiples of 4 bytes. I saw in the if_sdio.c file a mention about the 4 byte padding for certain controllers, but it looks like in the functions if_sdio_host_to_card() and if_sdio_card_to_host() they're being padded with the "+4" and "-4" to the card->buffer and chunk respectively, this must be something similar?

Brian

>
>> >
>> >Let me know if you have any questions!
>> >
>> >Dan
>> >
>> >> Since the system completely hangs trying to look for kernel oops or messages on the running
>> >system in the logfiles/dmesg isn't an option (until a reboot). I've been adding lots of printk's
>to
>> >the drivers files just so I could try and see how this is all unfolding up to the point where it
>> >dies. I just discovered the lbsdebug tool this morning and would like to gather the information
>> >most helpful to resolve the issue. :-)
>> >>
>> >> I'm excited to help with this, so any advice of what to gather first would be greatly
>> >appreciated.
>> >>
>> >> Thank you,
>> >>
>> >> Brian Wood
>> >> Intel Corporation
>> >> UMG Platform Software Group (UPSG)
>> >> brian.j.wood at intel.com
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> libertas-dev mailing list
>> >> libertas-dev at lists.infradead.org
>> >> http://lists.infradead.org/mailman/listinfo/libertas-dev
>>
>>
>> _______________________________________________
>> libertas-dev mailing list
>> libertas-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/libertas-dev



From brian.j.wood at intel.com  Tue Jun  9 12:13:08 2009
From: brian.j.wood at intel.com (Wood, Brian J)
Date: Tue, 9 Jun 2009 09:13:08 -0700
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <597915.56872.qm@web59207.mail.re1.yahoo.com>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>
	<1244230529.15303.7.camel@localhost.localdomain>
	<1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>
	<597915.56872.qm@web59207.mail.re1.yahoo.com>
Message-ID: <1BEA8649F0C00540AB2811D7922ECB6C32776026@orsmsx507.amr.corp.intel.com>

>-----Original Message-----
>From: Philip Rakity [mailto:prakity at yahoo.com]
>Sent: Monday, June 08, 2009 9:09 PM
>To: Wood, Brian J
>Subject: Re: sd8686 linux system hang when associating to access point
>
>
>
>Brian,
>
>in core.c there is an align_sdio function that aligns requests to multiples of 4 bytes. (2.6.29)
>For fun set the alignment to 64 bytes and see what happens.  eg add 63, divide by 64 and multiple
>64.

Hi Philip,

Is it the "mmc_align_data_size()" function found in the drivers/mmc/core/core.c file? I'm going to try your suggestion of replacing:

sz = ((sz +3)/4)*4;

with

sz = ((sz + 63)/64)*64;


could this also be accomplished in the in the functions found in if_sdio.c for if_sdio_host_to_card() and if_sdio_card_to_host() by changing the "+4" and "-4" to "+64" and "-64"?


Brian


>
>Philip
>
>
>
>----- Original Message ----
>From: "Wood, Brian J" <brian.j.wood at intel.com>
>To: "libertas-dev at lists.infradead.org" <libertas-dev at lists.infradead.org>
>Sent: Monday, June 8, 2009 3:02:57 PM
>Subject: RE: sd8686 linux system hang when associating to access point
>
>
>>-----Original Message-----
>>From: Dan Williams [mailto:dcbw at redhat.com]
>>Sent: Friday, June 05, 2009 12:35 PM
>>To: Wood, Brian J
>>Cc: libertas-dev at lists.infradead.org
>>Subject: Re: sd8686 linux system hang when associating to access point
>>
>>On Fri, 2009-06-05 at 12:04 -0700, Wood, Brian J wrote:
>>> Hello all,
>>>
>>> I have an issue with my development platform that's using Marvell's 88w8686 wifi component. In
>>the past I have been able to use the version 9 firmware when connecting to our corporate wifi
>>testing network. Recently when trying to associate an essid with the wifi network the entire
>system
>>will hang (like the SDIO controller has crashed).
>>>
>>> I'd like to help debug this issue, but don't know where to start gathering the information
>needed
>>by the members of the mailing list. I have lbsdebug installed on the target, the kernel source
>>recompiled to have debugging turned on (MMC, Libertas, etc...). My kernel source version is
>>2.6.29.2 and is from the Moblin v2 project. The development platform is Intel Menlow based (like
>>used in many of the current Netbooks).
>>
>>You'll first need to figure out if the Moblin kernel still uses a
>>non-upstream vendor driver.  If so, then you need to contact Marvell or
>>Intel for help with that driver.  Historically, the Moblin kernels
>>(2.6.22 and 2.6.24) used a completely different driver than was present
>>in the upstream kernel, because Intel apparently didn't feel like they
>>needed to work with the upstream community to enhance the existing one
>>to meet their needs.  Oh well.
>>
>>To figure that out, run 'lsmod' when the card is inserted and we'll see
>>what driver module is there.  If you're actually using the standard
>>upstream driver, then we get to go on to the following:
>
>Hi Dan, thanks for the help by the way. :)
>
>Yes, I'm using the standard upstream libertas/libertas_sdio driver (just to make sure I pulled down
>the vanilla 2.6.29.4 kernel and rebuilt with the libertas debugging turned on, so were using a
>known upstream version. The libertas I'm using is the libertas_sdio for the sd8686.
>
>Here's my lsmod output:
>sh-3.2# lsmod
>Module                  Size  Used by
>libertas_sdio          11616  0
>libertas              134196  1 libertas_sdio
>lib80211                4848  1 libertas
>mmc_block               8552  0
>sdhci_pci               6352  0
>sdhci                  14392  1 sdhci_pci
>mmc_core               41356  3 libertas_sdio,mmc_block,sdhci
>pl2303                 14440  1
>usbserial              26212  3 pl2303
>sh-3.2#
>
>>
>>1) what SDIO controller are you using?  Is its source upstream in the
>>kernel?  The *largest* source of issues with the Libertas driver is
>>crappy SD controllers.  I test the driver mainly on Ricoh laptop SD
>>controllers, and it works very well there.  The quality of your
>>controller has a huge impact on how well the driver will work.
>
>The development platform I'm using is a Compal Jax10 (Aigo P8860 is another version). Is there a
>Linux command to find out the SDIO controller its using? I tried using dmidecode and it didn't seem
>to list a specific HW name for the SD controller. I also tried using lspci, but I don't know if
>this PCI table info is helpful:
>
>00:1e.0 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
>) SDIO Controller #1 (rev 06)
>00:1e.1 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
>) SDIO Controller #2 (rev 06)
>
>
>>
>>2) You may wish to rebuild the libertas modules with debugging enabled.
>>Set CONFIG_LIBERTAS_DEBUG=y in your kernel config and rebuild.  Then,
>>modprobe the libertas driver like so:
>>
>>modprobe libertas.ko libertas_debug=0x5863a7
>>modprobe libertas_sdio.ko
>>
>>(see drivers/net/wireless/libertas/defs.h LBS_DEB_* for the debugging
>>constants)
>>
>>then try to reproduce the problem.  This will spew out a lot of good
>>debugging output, which you'll want to capture over a serial port or
>>something so that when the machine does go south, we can figure out why.
>
>Here's some output I thought might be helpful:
>
>sh-3.2# dmesg | grep -i libertas
>[    9.977267] libertas: 00:1d:19:f0:ca:92, fw 9.70.3p36, cap 0x00000303
>[    9.978091] eth0 (libertas_sdio): not using net_device_ops yet
>[    9.983572] libertas: PREP_CMD: command 0x00a3 failed: 2
>[    9.984501] libertas: PREP_CMD: command 0x00a3 failed: 2
>[    9.984646] libertas: eth0: Marvell WLAN 802.11 adapter
>sh-3.2#
>
>I saw on a mailing list that the PREP_CMD failure was something to do with the CONFIG_MAC80211_MESH
>being set, so I tried rebuilding the kernel with this enabled/disabled and still see that message
>in dmesg. Didn't know if this helps.
>
>Here's the rest of my data:
>
>
>sh-3.2# echo 8 > /proc/sys/kernel/printk
>sh-3.2# echo 5792679 > /sys/module/libertas/parameters/libertas_debug
>
>sh-3.2# ./lbsdebug
>0x005863a7: enter,leave,main,wext,scan,assoc,join,host,cmd,fw,thread,sdio
>
>Details:
>       enter + 0x00000001 - function entrance
>       leave + 0x00000002 - function exit
>        main + 0x00000004 - main libertas library code
>         net   0x00000008 - interaction with network subsystem
>        mesh   0x00000010 - wireless mesh network
>        wext + 0x00000020 - interaction with wireless extensions
>       ioctl   0x00000040 - misc IOCTLs
>        scan + 0x00000080 - scanning for APs
>       assoc + 0x00000100 - associating ton an AP
>        join + 0x00000200 - joining an IBSS?
>         11d   0x00000400 - 802.11d country settings
>     debugfs   0x00000800 - interaction with the debugfs subsystem
>     ethtool   0x00001000 - interaction with ethtool subsystem
>        host + 0x00002000 - communication between host and wlan chip
>         cmd + 0x00004000 - command and response processing
>          rx   0x00008000 - packet reception
>          tx   0x00010000 - packet transmission
>         usb   0x00020000 - interaction with USB subsystem
>          cs   0x00040000 - interaction with card services subsystem
>          fw + 0x00080000 - firmware downloading
>      thread + 0x00100000 - main libertas worker thread
>         hex   0x00200000 - turn on detailed hex dumps
>        sdio + 0x00400000 - interaction with SDIO subsystem
>sh-3.2#
>
>sh-3.2# iwconfig eth0
>[   66.612880] libertas enter: lbs_get_name()
>[   66.613052] libertas leave: lbs_get_name()
>[   66.613725] libertas enter: lbs_get_freq()
>[   66.613826] libertas wext: freq 241200000
>[   66.613937] libertas leave: lbs_get_freq()
>[   66.614588] libertas enter: lbs_get_encode()
>[   66.614691] libertas wext: flags 0x0, index -1, length 64, wep_tx_keyidx 0
>[   66.614790] libertas wext: key: 00:00:00:00:00:00, keylen 64
>[   66.614880] libertas wext: return flags 0xa000
>[   66.614963] libertas leave: lbs_get_encode()
>[   66.615841] libertas enter: lbs_get_essid()
>[   66.615928] libertas leave: lbs_get_essid()
>[   66.616359] libertas enter: lbs_get_mode()
>[   66.616445] libertas leave: lbs_get_mode()
>[   66.616544] libertas enter: lbs_get_range()
>[   66.616629] libertas enter: copy_active_data_rates()
>[   66.616715] libertas leave: copy_active_data_rates()
>[   66.616803] libertas wext: IW_MAX_BITRATES 32, num_bitrates 12
>[   66.616894] libertas wext: IW_MAX_FREQUENCIES 32, num_frequency 11
>[   66.616986] libertas leave: lbs_get_range()
>[   66.618195] libertas enter: lbs_get_wap()
>[   66.618362] libertas leave: lbs_get_wap()
>[   66.618532] libertas enter: lbs_get_rate()
>[   66.618694] libertas leave: lbs_get_rate()
>[   66.618863] libertas enter: lbs_get_power()
>[   66.619050] libertas leave: lbs_get_power()
>[   66.620022] liberta[   66.621107] libertas enter: __lbs_cmd()
>[   66.621273] liber[   66.626819] libertas thread: sleeping, connect_status 1,0
>[   [   66.643861] libertas thread: 3: currenttxskb (null), dnld_sen[   66.6494)
>[   66.649574][   66.656430] libertas enter: if_sdio_host_to_card_worker()
>[ [   66.660600] libertas enter: if_sdio_interrupt()
>[   66.66076[   66.666272] libertas leave: if_sdio_card_to_host(), ret 0
>[ [   66.671932] libertas thread: 4: currenttxskb (null), dnld_sen[   66.677602)
>[   66.6[   66.683313] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00[   66.0
>[   66.694742[   66.700321] libertas enter: if_sdio_host_to_card_worker()
>[ [   66.705700] mmc1: req done (CMD52): 0: 00001092 00000000 0000[   66.7114910
>[   66.711658eth0      IEEE 802.11b/g  ESSID:""
>          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
>          Bit Rate:0 kb/s   Tx-Power=15 dBm
>          Retry short limit:8   RTS thr=2347 B   Fragment thr=2346 B
>          Encryption key:off
>          Power Management:off
>          Link Quality:0  Signal level:0  Noise level:0
>          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
>          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
>
>sh-3.2#
>
>sh-3.2# iwconfig eth0 essid Guest
>[  305.621045] libertas enter: lbs_get_wireless_stats()
>[  305.621266] libertas leave: lbs_get_wireless_stats()
>[  305.621689] libertas enter: lbs_set_essid()
>[  305.621866] libertas wext: requested SSID 'Guest'
>[  305.622320] libertas enter: lbs_get_association_request()
>[  305.622502] libertas leave: lbs_get_association_request()
>[  305.622677] libertas leave: lbs_set_essid(), ret 0
>[  306.122305] libertas enter: lbs_association_worker()
>[  306.122543] libertas assoc: Association Request:
>[  306.122549]     flags:     0x00000002
>[  306.122553]     SSID:      'Guest'
>[  306.122556]     chann:     1
>[  306.122560]     band:      0
>[  306.122563]     mode:      2
>[  306.122566]     BSSID:     00:00:00:00:00:00
>[  306.122570]     secinfo:
>[  306.122574]     auth_mode: 1
>[  306.124280] libertas enter: assoc_helper_associate()
>[  306.124484] libertas enter: assoc_helper_essid()
>[  306.124669] libertas assoc: SSID 'Guest' requested
>[  306.124838] libertas enter: lbs_send_specific_ssid_scan(SSID 'Guest'
>[  306.124843] )
>[  306.125183] libertas enter: lbs_scan_networks(full_scan 1)
>[  306.125356] libertas scan: numchannels 4, bsstype 3
>[  306.125529] libertas scan: chan_count 11, scan_channel 0
>[  306.125700] libertas scan: scanning 4 of 11 channels
>[  306.125868] libertas enter: lbs_do_scan(bsstype 3, chanlist[].chan 1, chan_c)
>[  306.126147] libertas enter: __lbs_cmd()
>[  306.126310] libertas enter: __lbs_cmd_async()
>[  306.126476] libertas enter: lbs_get_cmd_ctrl_node()
>[  306.126643] libertas leave: lbs_get_cmd_ctrl_node()
>[  306.126810] libertas host: PREP_CMD: command 0x0006
>[  306.126976] libertas enter: lbs_queue_cmd()
>[  306.127156] libertas host: QUEUE_CMD: [  306.127810] libertas thread: 2: cur0
>[  306.592084] mmc1: starting CMD52 arg 00000a00 flags 00000195
>[  306.592497] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  306.592720] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>[  306.592729] libertas enter: if_sdio_interrupt()
>[  306.593188] mmc1: starting CMD52 arg 10000a00 flags 00000195
>[  306.593378] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  306.593562] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>[  306.593748] libertas sdio: interrupt: 0x1
>[  306.593912] mmc1: starting CMD52 arg 90000afe flags 00000195
>[  306.594117] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  306.594299] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>[  306.594489] libertas enter: if_sdio_card_to_host()
>[  306.594658] mmc1: starting CMD52 arg 10006800 flags 00000195
>[  306.594845] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  306.595044] mmc1: req done (CMD52): 0: 0000104a 00000000 00000000 00000000
>[  306.595233] mmc1: starting CMD52 arg 10006a00 flags 00000195
>[  306.595420] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  306.595598] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>[  306.595785] mmc1: starting CMD52 arg 1000400[  306.598899] libertas thread: 0
>[  306.6102[  306.615742] libertas thread: 1: currenttxskb (null), dnld_sen[  35
>                                                                               0
>[  307.081616] mmc1: starting CMD52 arg 00000a00 flags 00000195
>[  307.081861] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  307.082162] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>[  307.082383] libertas enter: if_sdio_interrupt()
>[  307.082575] mmc1: starting CMD52 arg 10000a00 flags 00000195
>[  307.082766] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  307.082948] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>[  307.083160] libertas sdio: interrupt: 0x1
>[  307.083327] mmc1: starting CMD52 arg 90000afe flags 00000195
>[  307.083511] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  307.083692] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>[  307.083880] libertas enter: if_sdio_card_to_host()
>[  307.084068] mmc1: starting CMD52 arg 10006800 flags 00000195
>[  307.084254] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  307.084439] mmc1: req done (CMD52): 0: 000010bf 00000000 00000000 00000000
>[  307.084625] mmc1: starting CMD52 arg 10006a00 flags 00000195
>[  307.084812] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  307.084994] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>[  307.085198] mmc1: starting CMD52 arg 100040[  307.088157] libertas thread: 21
>[  307.09948[  307.104808] libertas scan: got SSID IE: 'Guest', len 5
>[  30[  307.110688] libertas leave: lbs_queue_cmd()
>[  307.110858] l[  307.116137] mmc1: starting CMD52 arg 10000a00 flags 00000195
>                                                                               0
>[  307.461844] mmc1: starting CMD52 arg 00000a00 flags 00000195
>[  307.462288] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  307.462510] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>[  307.462728] libertas enter: if_sdio_interrupt()
>[  307.462921] mmc1: starting CMD52 arg 10000a00 flags 00000195
>[  307.463131] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  307.463315] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>[  307.463504] libertas sdio: interrupt: 0x1
>[  307.463672] mmc1: starting CMD52 arg 90000afe flags 00000195
>[  307.463857] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  307.464059] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>[  307.464245] libertas enter: if_sdio_card_to_host()
>[  307.464415] mmc1: starting CMD52 arg 10006800 flags 00000195
>[  307.464602] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  307.464784] mmc1: req done (CMD52): 0: 0000109c 00000000 00000000 00000000
>[  307.464970] mmc1: starting CMD52 arg 10006a00 flags 00000195
>[  307.465174] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>[  307.465356] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>[  307.465542] mmc1: starting CMD52 arg 1000400[  307.469629] libertas thread: 1
>[  307.4742[  307.479790] libertas scan: process_bss: IE len 106
>[  307.47[
>
>
>At this point the device hangs and the display goes garbled, I'm capturing this output using a USB
>to serial adapter on the target since it doesn't have a serial port. (I'm assuming I'm dropping
>some of the messages that I would otherwise being seeing if I had a serial connector setup, I hope
>this gives us enough information.)
>
>>
>>Let me know if you have any questions!
>>
>>Dan
>>
>>> Since the system completely hangs trying to look for kernel oops or messages on the running
>>system in the logfiles/dmesg isn't an option (until a reboot). I've been adding lots of printk's
>to
>>the drivers files just so I could try and see how this is all unfolding up to the point where it
>>dies. I just discovered the lbsdebug tool this morning and would like to gather the information
>>most helpful to resolve the issue. :-)
>>>
>>> I'm excited to help with this, so any advice of what to gather first would be greatly
>>appreciated.
>>>
>>> Thank you,
>>>
>>> Brian Wood
>>> Intel Corporation
>>> UMG Platform Software Group (UPSG)
>>> brian.j.wood at intel.com
>>>
>>>
>>>
>>> _______________________________________________
>>> libertas-dev mailing list
>>> libertas-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/libertas-dev
>
>
>_______________________________________________
>libertas-dev mailing list
>libertas-dev at lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/libertas-dev
>
>
>
>


From brian.j.wood at intel.com  Tue Jun  9 12:21:13 2009
From: brian.j.wood at intel.com (Wood, Brian J)
Date: Tue, 9 Jun 2009 09:21:13 -0700
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <1BEA8649F0C00540AB2811D7922ECB6C32776026@orsmsx507.amr.corp.intel.com>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>
	<1244230529.15303.7.camel@localhost.localdomain>
	<1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>
	<597915.56872.qm@web59207.mail.re1.yahoo.com>
	<1BEA8649F0C00540AB2811D7922ECB6C32776026@orsmsx507.amr.corp.intel.com>
Message-ID: <1BEA8649F0C00540AB2811D7922ECB6C3277603F@orsmsx507.amr.corp.intel.com>


>-----Original Message-----
>From: libertas-dev-bounces at lists.infradead.org [mailto:libertas-dev-bounces at lists.infradead.org] On
>Behalf Of Wood, Brian J
>Sent: Tuesday, June 09, 2009 9:13 AM
>To: Philip Rakity
>Cc: libertas-dev at lists.infradead.org
>Subject: RE: sd8686 linux system hang when associating to access point
>
>>-----Original Message-----
>>From: Philip Rakity [mailto:prakity at yahoo.com]
>>Sent: Monday, June 08, 2009 9:09 PM
>>To: Wood, Brian J
>>Subject: Re: sd8686 linux system hang when associating to access point
>>
>>
>>
>>Brian,
>>
>>in core.c there is an align_sdio function that aligns requests to multiples of 4 bytes. (2.6.29)
>>For fun set the alignment to 64 bytes and see what happens.  eg add 63, divide by 64 and multiple
>>64.
>
>Hi Philip,
>
>Is it the "mmc_align_data_size()" function found in the drivers/mmc/core/core.c file? I'm going to
>try your suggestion of replacing:
>
>sz = ((sz +3)/4)*4;
>
>with
>
>sz = ((sz + 63)/64)*64;
>
>
>could this also be accomplished in the in the functions found in if_sdio.c for
>if_sdio_host_to_card() and if_sdio_card_to_host() by changing the "+4" and "-4" to "+64" and "-64"?

Scratch that, that would only change the sz after looking at how its passing it down the stack, I'll change it in the mmc_align_data_size() and retest.

Brian


>
>
>Brian
>
>
>>
>>Philip
>>
>>
>>
>>----- Original Message ----
>>From: "Wood, Brian J" <brian.j.wood at intel.com>
>>To: "libertas-dev at lists.infradead.org" <libertas-dev at lists.infradead.org>
>>Sent: Monday, June 8, 2009 3:02:57 PM
>>Subject: RE: sd8686 linux system hang when associating to access point
>>
>>
>>>-----Original Message-----
>>>From: Dan Williams [mailto:dcbw at redhat.com]
>>>Sent: Friday, June 05, 2009 12:35 PM
>>>To: Wood, Brian J
>>>Cc: libertas-dev at lists.infradead.org
>>>Subject: Re: sd8686 linux system hang when associating to access point
>>>
>>>On Fri, 2009-06-05 at 12:04 -0700, Wood, Brian J wrote:
>>>> Hello all,
>>>>
>>>> I have an issue with my development platform that's using Marvell's 88w8686 wifi component. In
>>>the past I have been able to use the version 9 firmware when connecting to our corporate wifi
>>>testing network. Recently when trying to associate an essid with the wifi network the entire
>>system
>>>will hang (like the SDIO controller has crashed).
>>>>
>>>> I'd like to help debug this issue, but don't know where to start gathering the information
>>needed
>>>by the members of the mailing list. I have lbsdebug installed on the target, the kernel source
>>>recompiled to have debugging turned on (MMC, Libertas, etc...). My kernel source version is
>>>2.6.29.2 and is from the Moblin v2 project. The development platform is Intel Menlow based (like
>>>used in many of the current Netbooks).
>>>
>>>You'll first need to figure out if the Moblin kernel still uses a
>>>non-upstream vendor driver.  If so, then you need to contact Marvell or
>>>Intel for help with that driver.  Historically, the Moblin kernels
>>>(2.6.22 and 2.6.24) used a completely different driver than was present
>>>in the upstream kernel, because Intel apparently didn't feel like they
>>>needed to work with the upstream community to enhance the existing one
>>>to meet their needs.  Oh well.
>>>
>>>To figure that out, run 'lsmod' when the card is inserted and we'll see
>>>what driver module is there.  If you're actually using the standard
>>>upstream driver, then we get to go on to the following:
>>
>>Hi Dan, thanks for the help by the way. :)
>>
>>Yes, I'm using the standard upstream libertas/libertas_sdio driver (just to make sure I pulled
>down
>>the vanilla 2.6.29.4 kernel and rebuilt with the libertas debugging turned on, so were using a
>>known upstream version. The libertas I'm using is the libertas_sdio for the sd8686.
>>
>>Here's my lsmod output:
>>sh-3.2# lsmod
>>Module                  Size  Used by
>>libertas_sdio          11616  0
>>libertas              134196  1 libertas_sdio
>>lib80211                4848  1 libertas
>>mmc_block               8552  0
>>sdhci_pci               6352  0
>>sdhci                  14392  1 sdhci_pci
>>mmc_core               41356  3 libertas_sdio,mmc_block,sdhci
>>pl2303                 14440  1
>>usbserial              26212  3 pl2303
>>sh-3.2#
>>
>>>
>>>1) what SDIO controller are you using?  Is its source upstream in the
>>>kernel?  The *largest* source of issues with the Libertas driver is
>>>crappy SD controllers.  I test the driver mainly on Ricoh laptop SD
>>>controllers, and it works very well there.  The quality of your
>>>controller has a huge impact on how well the driver will work.
>>
>>The development platform I'm using is a Compal Jax10 (Aigo P8860 is another version). Is there a
>>Linux command to find out the SDIO controller its using? I tried using dmidecode and it didn't
>seem
>>to list a specific HW name for the SD controller. I also tried using lspci, but I don't know if
>>this PCI table info is helpful:
>>
>>00:1e.0 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
>>) SDIO Controller #1 (rev 06)
>>00:1e.1 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
>>) SDIO Controller #2 (rev 06)
>>
>>
>>>
>>>2) You may wish to rebuild the libertas modules with debugging enabled.
>>>Set CONFIG_LIBERTAS_DEBUG=y in your kernel config and rebuild.  Then,
>>>modprobe the libertas driver like so:
>>>
>>>modprobe libertas.ko libertas_debug=0x5863a7
>>>modprobe libertas_sdio.ko
>>>
>>>(see drivers/net/wireless/libertas/defs.h LBS_DEB_* for the debugging
>>>constants)
>>>
>>>then try to reproduce the problem.  This will spew out a lot of good
>>>debugging output, which you'll want to capture over a serial port or
>>>something so that when the machine does go south, we can figure out why.
>>
>>Here's some output I thought might be helpful:
>>
>>sh-3.2# dmesg | grep -i libertas
>>[    9.977267] libertas: 00:1d:19:f0:ca:92, fw 9.70.3p36, cap 0x00000303
>>[    9.978091] eth0 (libertas_sdio): not using net_device_ops yet
>>[    9.983572] libertas: PREP_CMD: command 0x00a3 failed: 2
>>[    9.984501] libertas: PREP_CMD: command 0x00a3 failed: 2
>>[    9.984646] libertas: eth0: Marvell WLAN 802.11 adapter
>>sh-3.2#
>>
>>I saw on a mailing list that the PREP_CMD failure was something to do with the
>CONFIG_MAC80211_MESH
>>being set, so I tried rebuilding the kernel with this enabled/disabled and still see that message
>>in dmesg. Didn't know if this helps.
>>
>>Here's the rest of my data:
>>
>>
>>sh-3.2# echo 8 > /proc/sys/kernel/printk
>>sh-3.2# echo 5792679 > /sys/module/libertas/parameters/libertas_debug
>>
>>sh-3.2# ./lbsdebug
>>0x005863a7: enter,leave,main,wext,scan,assoc,join,host,cmd,fw,thread,sdio
>>
>>Details:
>>       enter + 0x00000001 - function entrance
>>       leave + 0x00000002 - function exit
>>        main + 0x00000004 - main libertas library code
>>         net   0x00000008 - interaction with network subsystem
>>        mesh   0x00000010 - wireless mesh network
>>        wext + 0x00000020 - interaction with wireless extensions
>>       ioctl   0x00000040 - misc IOCTLs
>>        scan + 0x00000080 - scanning for APs
>>       assoc + 0x00000100 - associating ton an AP
>>        join + 0x00000200 - joining an IBSS?
>>         11d   0x00000400 - 802.11d country settings
>>     debugfs   0x00000800 - interaction with the debugfs subsystem
>>     ethtool   0x00001000 - interaction with ethtool subsystem
>>        host + 0x00002000 - communication between host and wlan chip
>>         cmd + 0x00004000 - command and response processing
>>          rx   0x00008000 - packet reception
>>          tx   0x00010000 - packet transmission
>>         usb   0x00020000 - interaction with USB subsystem
>>          cs   0x00040000 - interaction with card services subsystem
>>          fw + 0x00080000 - firmware downloading
>>      thread + 0x00100000 - main libertas worker thread
>>         hex   0x00200000 - turn on detailed hex dumps
>>        sdio + 0x00400000 - interaction with SDIO subsystem
>>sh-3.2#
>>
>>sh-3.2# iwconfig eth0
>>[   66.612880] libertas enter: lbs_get_name()
>>[   66.613052] libertas leave: lbs_get_name()
>>[   66.613725] libertas enter: lbs_get_freq()
>>[   66.613826] libertas wext: freq 241200000
>>[   66.613937] libertas leave: lbs_get_freq()
>>[   66.614588] libertas enter: lbs_get_encode()
>>[   66.614691] libertas wext: flags 0x0, index -1, length 64, wep_tx_keyidx 0
>>[   66.614790] libertas wext: key: 00:00:00:00:00:00, keylen 64
>>[   66.614880] libertas wext: return flags 0xa000
>>[   66.614963] libertas leave: lbs_get_encode()
>>[   66.615841] libertas enter: lbs_get_essid()
>>[   66.615928] libertas leave: lbs_get_essid()
>>[   66.616359] libertas enter: lbs_get_mode()
>>[   66.616445] libertas leave: lbs_get_mode()
>>[   66.616544] libertas enter: lbs_get_range()
>>[   66.616629] libertas enter: copy_active_data_rates()
>>[   66.616715] libertas leave: copy_active_data_rates()
>>[   66.616803] libertas wext: IW_MAX_BITRATES 32, num_bitrates 12
>>[   66.616894] libertas wext: IW_MAX_FREQUENCIES 32, num_frequency 11
>>[   66.616986] libertas leave: lbs_get_range()
>>[   66.618195] libertas enter: lbs_get_wap()
>>[   66.618362] libertas leave: lbs_get_wap()
>>[   66.618532] libertas enter: lbs_get_rate()
>>[   66.618694] libertas leave: lbs_get_rate()
>>[   66.618863] libertas enter: lbs_get_power()
>>[   66.619050] libertas leave: lbs_get_power()
>>[   66.620022] liberta[   66.621107] libertas enter: __lbs_cmd()
>>[   66.621273] liber[   66.626819] libertas thread: sleeping, connect_status 1,0
>>[   [   66.643861] libertas thread: 3: currenttxskb (null), dnld_sen[   66.6494)
>>[   66.649574][   66.656430] libertas enter: if_sdio_host_to_card_worker()
>>[ [   66.660600] libertas enter: if_sdio_interrupt()
>>[   66.66076[   66.666272] libertas leave: if_sdio_card_to_host(), ret 0
>>[ [   66.671932] libertas thread: 4: currenttxskb (null), dnld_sen[   66.677602)
>>[   66.6[   66.683313] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00[   66.0
>>[   66.694742[   66.700321] libertas enter: if_sdio_host_to_card_worker()
>>[ [   66.705700] mmc1: req done (CMD52): 0: 00001092 00000000 0000[   66.7114910
>>[   66.711658eth0      IEEE 802.11b/g  ESSID:""
>>          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
>>          Bit Rate:0 kb/s   Tx-Power=15 dBm
>>          Retry short limit:8   RTS thr=2347 B   Fragment thr=2346 B
>>          Encryption key:off
>>          Power Management:off
>>          Link Quality:0  Signal level:0  Noise level:0
>>          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
>>          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
>>
>>sh-3.2#
>>
>>sh-3.2# iwconfig eth0 essid Guest
>>[  305.621045] libertas enter: lbs_get_wireless_stats()
>>[  305.621266] libertas leave: lbs_get_wireless_stats()
>>[  305.621689] libertas enter: lbs_set_essid()
>>[  305.621866] libertas wext: requested SSID 'Guest'
>>[  305.622320] libertas enter: lbs_get_association_request()
>>[  305.622502] libertas leave: lbs_get_association_request()
>>[  305.622677] libertas leave: lbs_set_essid(), ret 0
>>[  306.122305] libertas enter: lbs_association_worker()
>>[  306.122543] libertas assoc: Association Request:
>>[  306.122549]     flags:     0x00000002
>>[  306.122553]     SSID:      'Guest'
>>[  306.122556]     chann:     1
>>[  306.122560]     band:      0
>>[  306.122563]     mode:      2
>>[  306.122566]     BSSID:     00:00:00:00:00:00
>>[  306.122570]     secinfo:
>>[  306.122574]     auth_mode: 1
>>[  306.124280] libertas enter: assoc_helper_associate()
>>[  306.124484] libertas enter: assoc_helper_essid()
>>[  306.124669] libertas assoc: SSID 'Guest' requested
>>[  306.124838] libertas enter: lbs_send_specific_ssid_scan(SSID 'Guest'
>>[  306.124843] )
>>[  306.125183] libertas enter: lbs_scan_networks(full_scan 1)
>>[  306.125356] libertas scan: numchannels 4, bsstype 3
>>[  306.125529] libertas scan: chan_count 11, scan_channel 0
>>[  306.125700] libertas scan: scanning 4 of 11 channels
>>[  306.125868] libertas enter: lbs_do_scan(bsstype 3, chanlist[].chan 1, chan_c)
>>[  306.126147] libertas enter: __lbs_cmd()
>>[  306.126310] libertas enter: __lbs_cmd_async()
>>[  306.126476] libertas enter: lbs_get_cmd_ctrl_node()
>>[  306.126643] libertas leave: lbs_get_cmd_ctrl_node()
>>[  306.126810] libertas host: PREP_CMD: command 0x0006
>>[  306.126976] libertas enter: lbs_queue_cmd()
>>[  306.127156] libertas host: QUEUE_CMD: [  306.127810] libertas thread: 2: cur0
>>[  306.592084] mmc1: starting CMD52 arg 00000a00 flags 00000195
>>[  306.592497] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  306.592720] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>>[  306.592729] libertas enter: if_sdio_interrupt()
>>[  306.593188] mmc1: starting CMD52 arg 10000a00 flags 00000195
>>[  306.593378] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  306.593562] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>>[  306.593748] libertas sdio: interrupt: 0x1
>>[  306.593912] mmc1: starting CMD52 arg 90000afe flags 00000195
>>[  306.594117] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  306.594299] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>>[  306.594489] libertas enter: if_sdio_card_to_host()
>>[  306.594658] mmc1: starting CMD52 arg 10006800 flags 00000195
>>[  306.594845] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  306.595044] mmc1: req done (CMD52): 0: 0000104a 00000000 00000000 00000000
>>[  306.595233] mmc1: starting CMD52 arg 10006a00 flags 00000195
>>[  306.595420] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  306.595598] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>>[  306.595785] mmc1: starting CMD52 arg 1000400[  306.598899] libertas thread: 0
>>[  306.6102[  306.615742] libertas thread: 1: currenttxskb (null), dnld_sen[  35
>>                                                                               0
>>[  307.081616] mmc1: starting CMD52 arg 00000a00 flags 00000195
>>[  307.081861] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  307.082162] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>>[  307.082383] libertas enter: if_sdio_interrupt()
>>[  307.082575] mmc1: starting CMD52 arg 10000a00 flags 00000195
>>[  307.082766] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  307.082948] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>>[  307.083160] libertas sdio: interrupt: 0x1
>>[  307.083327] mmc1: starting CMD52 arg 90000afe flags 00000195
>>[  307.083511] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  307.083692] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>>[  307.083880] libertas enter: if_sdio_card_to_host()
>>[  307.084068] mmc1: starting CMD52 arg 10006800 flags 00000195
>>[  307.084254] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  307.084439] mmc1: req done (CMD52): 0: 000010bf 00000000 00000000 00000000
>>[  307.084625] mmc1: starting CMD52 arg 10006a00 flags 00000195
>>[  307.084812] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  307.084994] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>>[  307.085198] mmc1: starting CMD52 arg 100040[  307.088157] libertas thread: 21
>>[  307.09948[  307.104808] libertas scan: got SSID IE: 'Guest', len 5
>>[  30[  307.110688] libertas leave: lbs_queue_cmd()
>>[  307.110858] l[  307.116137] mmc1: starting CMD52 arg 10000a00 flags 00000195
>>                                                                               0
>>[  307.461844] mmc1: starting CMD52 arg 00000a00 flags 00000195
>>[  307.462288] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  307.462510] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>>[  307.462728] libertas enter: if_sdio_interrupt()
>>[  307.462921] mmc1: starting CMD52 arg 10000a00 flags 00000195
>>[  307.463131] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  307.463315] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>>[  307.463504] libertas sdio: interrupt: 0x1
>>[  307.463672] mmc1: starting CMD52 arg 90000afe flags 00000195
>>[  307.463857] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  307.464059] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>>[  307.464245] libertas enter: if_sdio_card_to_host()
>>[  307.464415] mmc1: starting CMD52 arg 10006800 flags 00000195
>>[  307.464602] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  307.464784] mmc1: req done (CMD52): 0: 0000109c 00000000 00000000 00000000
>>[  307.464970] mmc1: starting CMD52 arg 10006a00 flags 00000195
>>[  307.465174] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>[  307.465356] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>>[  307.465542] mmc1: starting CMD52 arg 1000400[  307.469629] libertas thread: 1
>>[  307.4742[  307.479790] libertas scan: process_bss: IE len 106
>>[  307.47[
>>
>>
>>At this point the device hangs and the display goes garbled, I'm capturing this output using a USB
>>to serial adapter on the target since it doesn't have a serial port. (I'm assuming I'm dropping
>>some of the messages that I would otherwise being seeing if I had a serial connector setup, I hope
>>this gives us enough information.)
>>
>>>
>>>Let me know if you have any questions!
>>>
>>>Dan
>>>
>>>> Since the system completely hangs trying to look for kernel oops or messages on the running
>>>system in the logfiles/dmesg isn't an option (until a reboot). I've been adding lots of printk's
>>to
>>>the drivers files just so I could try and see how this is all unfolding up to the point where it
>>>dies. I just discovered the lbsdebug tool this morning and would like to gather the information
>>>most helpful to resolve the issue. :-)
>>>>
>>>> I'm excited to help with this, so any advice of what to gather first would be greatly
>>>appreciated.
>>>>
>>>> Thank you,
>>>>
>>>> Brian Wood
>>>> Intel Corporation
>>>> UMG Platform Software Group (UPSG)
>>>> brian.j.wood at intel.com
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> libertas-dev mailing list
>>>> libertas-dev at lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/libertas-dev
>>
>>
>>_______________________________________________
>>libertas-dev mailing list
>>libertas-dev at lists.infradead.org
>>http://lists.infradead.org/mailman/listinfo/libertas-dev
>>
>>
>>
>>
>
>_______________________________________________
>libertas-dev mailing list
>libertas-dev at lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/libertas-dev


From dario at eecs.harvard.edu  Tue Jun  9 12:28:20 2009
From: dario at eecs.harvard.edu (Dario Vlah)
Date: Tue, 9 Jun 2009 12:28:20 -0400 (EDT)
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <1BEA8649F0C00540AB2811D7922ECB6C3277603F@orsmsx507.amr.corp.intel.com>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>
	<1244230529.15303.7.camel@localhost.localdomain>
	<1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>
	<597915.56872.qm@web59207.mail.re1.yahoo.com>
	<1BEA8649F0C00540AB2811D7922ECB6C32776026@orsmsx507.amr.corp.intel.com>
	<1BEA8649F0C00540AB2811D7922ECB6C3277603F@orsmsx507.amr.corp.intel.com>
Message-ID: <20090609122333.N87890@bowser.eecs.harvard.edu>

I got the wireless-testing driver to work on JAX10 after I applied the 
patch that James Cameron posted a while ago on this mailing list. 
(attached).  Before that it was crashing as you describe; IIRC there was 
some memory corruption due to calling GET_LOG in the wrong context.

--dario


On Tue, 9 Jun 2009, Wood, Brian J wrote:

>
>> -----Original Message-----
>> From: libertas-dev-bounces at lists.infradead.org [mailto:libertas-dev-bounces at lists.infradead.org] On
>> Behalf Of Wood, Brian J
>> Sent: Tuesday, June 09, 2009 9:13 AM
>> To: Philip Rakity
>> Cc: libertas-dev at lists.infradead.org
>> Subject: RE: sd8686 linux system hang when associating to access point
>>
>>> -----Original Message-----
>>> From: Philip Rakity [mailto:prakity at yahoo.com]
>>> Sent: Monday, June 08, 2009 9:09 PM
>>> To: Wood, Brian J
>>> Subject: Re: sd8686 linux system hang when associating to access point
>>>
>>>
>>>
>>> Brian,
>>>
>>> in core.c there is an align_sdio function that aligns requests to multiples of 4 bytes. (2.6.29)
>>> For fun set the alignment to 64 bytes and see what happens.  eg add 63, divide by 64 and multiple
>>> 64.
>>
>> Hi Philip,
>>
>> Is it the "mmc_align_data_size()" function found in the drivers/mmc/core/core.c file? I'm going to
>> try your suggestion of replacing:
>>
>> sz = ((sz +3)/4)*4;
>>
>> with
>>
>> sz = ((sz + 63)/64)*64;
>>
>>
>> could this also be accomplished in the in the functions found in if_sdio.c for
>> if_sdio_host_to_card() and if_sdio_card_to_host() by changing the "+4" and "-4" to "+64" and "-64"?
>
> Scratch that, that would only change the sz after looking at how its passing it down the stack, I'll change it in the mmc_align_data_size() and retest.
>
> Brian
>
>
>>
>>
>> Brian
>>
>>
>>>
>>> Philip
>>>
>>>
>>>
>>> ----- Original Message ----
>>> From: "Wood, Brian J" <brian.j.wood at intel.com>
>>> To: "libertas-dev at lists.infradead.org" <libertas-dev at lists.infradead.org>
>>> Sent: Monday, June 8, 2009 3:02:57 PM
>>> Subject: RE: sd8686 linux system hang when associating to access point
>>>
>>>
>>>> -----Original Message-----
>>>> From: Dan Williams [mailto:dcbw at redhat.com]
>>>> Sent: Friday, June 05, 2009 12:35 PM
>>>> To: Wood, Brian J
>>>> Cc: libertas-dev at lists.infradead.org
>>>> Subject: Re: sd8686 linux system hang when associating to access point
>>>>
>>>> On Fri, 2009-06-05 at 12:04 -0700, Wood, Brian J wrote:
>>>>> Hello all,
>>>>>
>>>>> I have an issue with my development platform that's using Marvell's 88w8686 wifi component. In
>>>> the past I have been able to use the version 9 firmware when connecting to our corporate wifi
>>>> testing network. Recently when trying to associate an essid with the wifi network the entire
>>> system
>>>> will hang (like the SDIO controller has crashed).
>>>>>
>>>>> I'd like to help debug this issue, but don't know where to start gathering the information
>>> needed
>>>> by the members of the mailing list. I have lbsdebug installed on the target, the kernel source
>>>> recompiled to have debugging turned on (MMC, Libertas, etc...). My kernel source version is
>>>> 2.6.29.2 and is from the Moblin v2 project. The development platform is Intel Menlow based (like
>>>> used in many of the current Netbooks).
>>>>
>>>> You'll first need to figure out if the Moblin kernel still uses a
>>>> non-upstream vendor driver.  If so, then you need to contact Marvell or
>>>> Intel for help with that driver.  Historically, the Moblin kernels
>>>> (2.6.22 and 2.6.24) used a completely different driver than was present
>>>> in the upstream kernel, because Intel apparently didn't feel like they
>>>> needed to work with the upstream community to enhance the existing one
>>>> to meet their needs.  Oh well.
>>>>
>>>> To figure that out, run 'lsmod' when the card is inserted and we'll see
>>>> what driver module is there.  If you're actually using the standard
>>>> upstream driver, then we get to go on to the following:
>>>
>>> Hi Dan, thanks for the help by the way. :)
>>>
>>> Yes, I'm using the standard upstream libertas/libertas_sdio driver (just to make sure I pulled
>> down
>>> the vanilla 2.6.29.4 kernel and rebuilt with the libertas debugging turned on, so were using a
>>> known upstream version. The libertas I'm using is the libertas_sdio for the sd8686.
>>>
>>> Here's my lsmod output:
>>> sh-3.2# lsmod
>>> Module                  Size  Used by
>>> libertas_sdio          11616  0
>>> libertas              134196  1 libertas_sdio
>>> lib80211                4848  1 libertas
>>> mmc_block               8552  0
>>> sdhci_pci               6352  0
>>> sdhci                  14392  1 sdhci_pci
>>> mmc_core               41356  3 libertas_sdio,mmc_block,sdhci
>>> pl2303                 14440  1
>>> usbserial              26212  3 pl2303
>>> sh-3.2#
>>>
>>>>
>>>> 1) what SDIO controller are you using?  Is its source upstream in the
>>>> kernel?  The *largest* source of issues with the Libertas driver is
>>>> crappy SD controllers.  I test the driver mainly on Ricoh laptop SD
>>>> controllers, and it works very well there.  The quality of your
>>>> controller has a huge impact on how well the driver will work.
>>>
>>> The development platform I'm using is a Compal Jax10 (Aigo P8860 is another version). Is there a
>>> Linux command to find out the SDIO controller its using? I tried using dmidecode and it didn't
>> seem
>>> to list a specific HW name for the SD controller. I also tried using lspci, but I don't know if
>>> this PCI table info is helpful:
>>>
>>> 00:1e.0 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
>>> ) SDIO Controller #1 (rev 06)
>>> 00:1e.1 SD Host controller: Intel Corporation System Controller Hub (SCH Poulsbo
>>> ) SDIO Controller #2 (rev 06)
>>>
>>>
>>>>
>>>> 2) You may wish to rebuild the libertas modules with debugging enabled.
>>>> Set CONFIG_LIBERTAS_DEBUG=y in your kernel config and rebuild.  Then,
>>>> modprobe the libertas driver like so:
>>>>
>>>> modprobe libertas.ko libertas_debug=0x5863a7
>>>> modprobe libertas_sdio.ko
>>>>
>>>> (see drivers/net/wireless/libertas/defs.h LBS_DEB_* for the debugging
>>>> constants)
>>>>
>>>> then try to reproduce the problem.  This will spew out a lot of good
>>>> debugging output, which you'll want to capture over a serial port or
>>>> something so that when the machine does go south, we can figure out why.
>>>
>>> Here's some output I thought might be helpful:
>>>
>>> sh-3.2# dmesg | grep -i libertas
>>> [    9.977267] libertas: 00:1d:19:f0:ca:92, fw 9.70.3p36, cap 0x00000303
>>> [    9.978091] eth0 (libertas_sdio): not using net_device_ops yet
>>> [    9.983572] libertas: PREP_CMD: command 0x00a3 failed: 2
>>> [    9.984501] libertas: PREP_CMD: command 0x00a3 failed: 2
>>> [    9.984646] libertas: eth0: Marvell WLAN 802.11 adapter
>>> sh-3.2#
>>>
>>> I saw on a mailing list that the PREP_CMD failure was something to do with the
>> CONFIG_MAC80211_MESH
>>> being set, so I tried rebuilding the kernel with this enabled/disabled and still see that message
>>> in dmesg. Didn't know if this helps.
>>>
>>> Here's the rest of my data:
>>>
>>>
>>> sh-3.2# echo 8 > /proc/sys/kernel/printk
>>> sh-3.2# echo 5792679 > /sys/module/libertas/parameters/libertas_debug
>>>
>>> sh-3.2# ./lbsdebug
>>> 0x005863a7: enter,leave,main,wext,scan,assoc,join,host,cmd,fw,thread,sdio
>>>
>>> Details:
>>>       enter + 0x00000001 - function entrance
>>>       leave + 0x00000002 - function exit
>>>        main + 0x00000004 - main libertas library code
>>>         net   0x00000008 - interaction with network subsystem
>>>        mesh   0x00000010 - wireless mesh network
>>>        wext + 0x00000020 - interaction with wireless extensions
>>>       ioctl   0x00000040 - misc IOCTLs
>>>        scan + 0x00000080 - scanning for APs
>>>       assoc + 0x00000100 - associating ton an AP
>>>        join + 0x00000200 - joining an IBSS?
>>>         11d   0x00000400 - 802.11d country settings
>>>     debugfs   0x00000800 - interaction with the debugfs subsystem
>>>     ethtool   0x00001000 - interaction with ethtool subsystem
>>>        host + 0x00002000 - communication between host and wlan chip
>>>         cmd + 0x00004000 - command and response processing
>>>          rx   0x00008000 - packet reception
>>>          tx   0x00010000 - packet transmission
>>>         usb   0x00020000 - interaction with USB subsystem
>>>          cs   0x00040000 - interaction with card services subsystem
>>>          fw + 0x00080000 - firmware downloading
>>>      thread + 0x00100000 - main libertas worker thread
>>>         hex   0x00200000 - turn on detailed hex dumps
>>>        sdio + 0x00400000 - interaction with SDIO subsystem
>>> sh-3.2#
>>>
>>> sh-3.2# iwconfig eth0
>>> [   66.612880] libertas enter: lbs_get_name()
>>> [   66.613052] libertas leave: lbs_get_name()
>>> [   66.613725] libertas enter: lbs_get_freq()
>>> [   66.613826] libertas wext: freq 241200000
>>> [   66.613937] libertas leave: lbs_get_freq()
>>> [   66.614588] libertas enter: lbs_get_encode()
>>> [   66.614691] libertas wext: flags 0x0, index -1, length 64, wep_tx_keyidx 0
>>> [   66.614790] libertas wext: key: 00:00:00:00:00:00, keylen 64
>>> [   66.614880] libertas wext: return flags 0xa000
>>> [   66.614963] libertas leave: lbs_get_encode()
>>> [   66.615841] libertas enter: lbs_get_essid()
>>> [   66.615928] libertas leave: lbs_get_essid()
>>> [   66.616359] libertas enter: lbs_get_mode()
>>> [   66.616445] libertas leave: lbs_get_mode()
>>> [   66.616544] libertas enter: lbs_get_range()
>>> [   66.616629] libertas enter: copy_active_data_rates()
>>> [   66.616715] libertas leave: copy_active_data_rates()
>>> [   66.616803] libertas wext: IW_MAX_BITRATES 32, num_bitrates 12
>>> [   66.616894] libertas wext: IW_MAX_FREQUENCIES 32, num_frequency 11
>>> [   66.616986] libertas leave: lbs_get_range()
>>> [   66.618195] libertas enter: lbs_get_wap()
>>> [   66.618362] libertas leave: lbs_get_wap()
>>> [   66.618532] libertas enter: lbs_get_rate()
>>> [   66.618694] libertas leave: lbs_get_rate()
>>> [   66.618863] libertas enter: lbs_get_power()
>>> [   66.619050] libertas leave: lbs_get_power()
>>> [   66.620022] liberta[   66.621107] libertas enter: __lbs_cmd()
>>> [   66.621273] liber[   66.626819] libertas thread: sleeping, connect_status 1,0
>>> [   [   66.643861] libertas thread: 3: currenttxskb (null), dnld_sen[   66.6494)
>>> [   66.649574][   66.656430] libertas enter: if_sdio_host_to_card_worker()
>>> [ [   66.660600] libertas enter: if_sdio_interrupt()
>>> [   66.66076[   66.666272] libertas leave: if_sdio_card_to_host(), ret 0
>>> [ [   66.671932] libertas thread: 4: currenttxskb (null), dnld_sen[   66.677602)
>>> [   66.6[   66.683313] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00[   66.0
>>> [   66.694742[   66.700321] libertas enter: if_sdio_host_to_card_worker()
>>> [ [   66.705700] mmc1: req done (CMD52): 0: 00001092 00000000 0000[   66.7114910
>>> [   66.711658eth0      IEEE 802.11b/g  ESSID:""
>>>          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
>>>          Bit Rate:0 kb/s   Tx-Power=15 dBm
>>>          Retry short limit:8   RTS thr=2347 B   Fragment thr=2346 B
>>>          Encryption key:off
>>>          Power Management:off
>>>          Link Quality:0  Signal level:0  Noise level:0
>>>          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
>>>          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
>>>
>>> sh-3.2#
>>>
>>> sh-3.2# iwconfig eth0 essid Guest
>>> [  305.621045] libertas enter: lbs_get_wireless_stats()
>>> [  305.621266] libertas leave: lbs_get_wireless_stats()
>>> [  305.621689] libertas enter: lbs_set_essid()
>>> [  305.621866] libertas wext: requested SSID 'Guest'
>>> [  305.622320] libertas enter: lbs_get_association_request()
>>> [  305.622502] libertas leave: lbs_get_association_request()
>>> [  305.622677] libertas leave: lbs_set_essid(), ret 0
>>> [  306.122305] libertas enter: lbs_association_worker()
>>> [  306.122543] libertas assoc: Association Request:
>>> [  306.122549]     flags:     0x00000002
>>> [  306.122553]     SSID:      'Guest'
>>> [  306.122556]     chann:     1
>>> [  306.122560]     band:      0
>>> [  306.122563]     mode:      2
>>> [  306.122566]     BSSID:     00:00:00:00:00:00
>>> [  306.122570]     secinfo:
>>> [  306.122574]     auth_mode: 1
>>> [  306.124280] libertas enter: assoc_helper_associate()
>>> [  306.124484] libertas enter: assoc_helper_essid()
>>> [  306.124669] libertas assoc: SSID 'Guest' requested
>>> [  306.124838] libertas enter: lbs_send_specific_ssid_scan(SSID 'Guest'
>>> [  306.124843] )
>>> [  306.125183] libertas enter: lbs_scan_networks(full_scan 1)
>>> [  306.125356] libertas scan: numchannels 4, bsstype 3
>>> [  306.125529] libertas scan: chan_count 11, scan_channel 0
>>> [  306.125700] libertas scan: scanning 4 of 11 channels
>>> [  306.125868] libertas enter: lbs_do_scan(bsstype 3, chanlist[].chan 1, chan_c)
>>> [  306.126147] libertas enter: __lbs_cmd()
>>> [  306.126310] libertas enter: __lbs_cmd_async()
>>> [  306.126476] libertas enter: lbs_get_cmd_ctrl_node()
>>> [  306.126643] libertas leave: lbs_get_cmd_ctrl_node()
>>> [  306.126810] libertas host: PREP_CMD: command 0x0006
>>> [  306.126976] libertas enter: lbs_queue_cmd()
>>> [  306.127156] libertas host: QUEUE_CMD: [  306.127810] libertas thread: 2: cur0
>>> [  306.592084] mmc1: starting CMD52 arg 00000a00 flags 00000195
>>> [  306.592497] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  306.592720] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>>> [  306.592729] libertas enter: if_sdio_interrupt()
>>> [  306.593188] mmc1: starting CMD52 arg 10000a00 flags 00000195
>>> [  306.593378] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  306.593562] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>>> [  306.593748] libertas sdio: interrupt: 0x1
>>> [  306.593912] mmc1: starting CMD52 arg 90000afe flags 00000195
>>> [  306.594117] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  306.594299] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>>> [  306.594489] libertas enter: if_sdio_card_to_host()
>>> [  306.594658] mmc1: starting CMD52 arg 10006800 flags 00000195
>>> [  306.594845] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  306.595044] mmc1: req done (CMD52): 0: 0000104a 00000000 00000000 00000000
>>> [  306.595233] mmc1: starting CMD52 arg 10006a00 flags 00000195
>>> [  306.595420] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  306.595598] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>>> [  306.595785] mmc1: starting CMD52 arg 1000400[  306.598899] libertas thread: 0
>>> [  306.6102[  306.615742] libertas thread: 1: currenttxskb (null), dnld_sen[  35
>>>                                                                               0
>>> [  307.081616] mmc1: starting CMD52 arg 00000a00 flags 00000195
>>> [  307.081861] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  307.082162] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>>> [  307.082383] libertas enter: if_sdio_interrupt()
>>> [  307.082575] mmc1: starting CMD52 arg 10000a00 flags 00000195
>>> [  307.082766] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  307.082948] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>>> [  307.083160] libertas sdio: interrupt: 0x1
>>> [  307.083327] mmc1: starting CMD52 arg 90000afe flags 00000195
>>> [  307.083511] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  307.083692] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>>> [  307.083880] libertas enter: if_sdio_card_to_host()
>>> [  307.084068] mmc1: starting CMD52 arg 10006800 flags 00000195
>>> [  307.084254] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  307.084439] mmc1: req done (CMD52): 0: 000010bf 00000000 00000000 00000000
>>> [  307.084625] mmc1: starting CMD52 arg 10006a00 flags 00000195
>>> [  307.084812] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  307.084994] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>>> [  307.085198] mmc1: starting CMD52 arg 100040[  307.088157] libertas thread: 21
>>> [  307.09948[  307.104808] libertas scan: got SSID IE: 'Guest', len 5
>>> [  30[  307.110688] libertas leave: lbs_queue_cmd()
>>> [  307.110858] l[  307.116137] mmc1: starting CMD52 arg 10000a00 flags 00000195
>>>                                                                               0
>>> [  307.461844] mmc1: starting CMD52 arg 00000a00 flags 00000195
>>> [  307.462288] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  307.462510] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
>>> [  307.462728] libertas enter: if_sdio_interrupt()
>>> [  307.462921] mmc1: starting CMD52 arg 10000a00 flags 00000195
>>> [  307.463131] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  307.463315] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>>> [  307.463504] libertas sdio: interrupt: 0x1
>>> [  307.463672] mmc1: starting CMD52 arg 90000afe flags 00000195
>>> [  307.463857] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  307.464059] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
>>> [  307.464245] libertas enter: if_sdio_card_to_host()
>>> [  307.464415] mmc1: starting CMD52 arg 10006800 flags 00000195
>>> [  307.464602] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  307.464784] mmc1: req done (CMD52): 0: 0000109c 00000000 00000000 00000000
>>> [  307.464970] mmc1: starting CMD52 arg 10006a00 flags 00000195
>>> [  307.465174] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
>>> [  307.465356] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
>>> [  307.465542] mmc1: starting CMD52 arg 1000400[  307.469629] libertas thread: 1
>>> [  307.4742[  307.479790] libertas scan: process_bss: IE len 106
>>> [  307.47[
>>>
>>>
>>> At this point the device hangs and the display goes garbled, I'm capturing this output using a USB
>>> to serial adapter on the target since it doesn't have a serial port. (I'm assuming I'm dropping
>>> some of the messages that I would otherwise being seeing if I had a serial connector setup, I hope
>>> this gives us enough information.)
>>>
>>>>
>>>> Let me know if you have any questions!
>>>>
>>>> Dan
>>>>
>>>>> Since the system completely hangs trying to look for kernel oops or messages on the running
>>>> system in the logfiles/dmesg isn't an option (until a reboot). I've been adding lots of printk's
>>> to
>>>> the drivers files just so I could try and see how this is all unfolding up to the point where it
>>>> dies. I just discovered the lbsdebug tool this morning and would like to gather the information
>>>> most helpful to resolve the issue. :-)
>>>>>
>>>>> I'm excited to help with this, so any advice of what to gather first would be greatly
>>>> appreciated.
>>>>>
>>>>> Thank you,
>>>>>
>>>>> Brian Wood
>>>>> Intel Corporation
>>>>> UMG Platform Software Group (UPSG)
>>>>> brian.j.wood at intel.com
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> libertas-dev mailing list
>>>>> libertas-dev at lists.infradead.org
>>>>> http://lists.infradead.org/mailman/listinfo/libertas-dev
>>>
>>>
>>> _______________________________________________
>>> libertas-dev mailing list
>>> libertas-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/libertas-dev
>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> libertas-dev mailing list
>> libertas-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/libertas-dev
>
> _______________________________________________
> libertas-dev mailing list
> libertas-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev
>
-------------- next part --------------
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 639dd02..0950e1f 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1336,7 +1336,7 @@ void lbs_set_mac_control(struct lbs_private *priv)
  *  @param cmd_action	command action: GET or SET
  *  @param wait_option	wait option: wait response or not
  *  @param cmd_oid	cmd oid: treated as sub command
- *  @param pdata_buf	A pointer to informaion buffer
+ *  @param pdata_buf	A pointer to information buffer
  *  @return 		0 or -1
  */
 int lbs_prepare_and_send_command(struct lbs_private *priv,
@@ -1478,6 +1478,13 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
 		ret = lbs_cmd_fwt_access(cmdptr, cmd_action, pdata_buf);
 		break;
 
+	case CMD_802_11_GET_LOG:
+		cmdptr->command = cpu_to_le16(CMD_802_11_GET_LOG);
+		cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_get_log) +
+					    S_DS_GEN);
+		ret = 0;
+		break;
+
 	case CMD_GET_TSF:
 		cmdptr->command = cpu_to_le16(CMD_GET_TSF);
 		cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_get_tsf) +
@@ -1487,6 +1494,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
 	case CMD_802_11_BEACON_CTRL:
 		ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action);
 		break;
+
 	default:
 		lbs_pr_err("PREP_CMD: unknown command 0x%04x\n", cmd_no);
 		ret = -1;
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index bcf2a97..c2f99e6 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -189,7 +189,21 @@ static int lbs_ret_802_11_bcn_ctrl(struct lbs_private * priv,
 		priv->beacon_period = le16_to_cpu(bcn_ctrl->beacon_period);
 	}
 
+	lbs_deb_leave(LBS_DEB_CMD);
+	return 0;
+}
+
+static int lbs_ret_802_11_get_log(struct lbs_private * priv,
+					struct cmd_ds_command *resp)
+{
+	struct cmd_ds_802_11_get_log *log = &resp->params.log;
+
 	lbs_deb_enter(LBS_DEB_CMD);
+	priv->wstats.discard.retries = get_unaligned_le32(&log->retry);
+	priv->wstats.discard.code = get_unaligned_le32(&log->wepundecryptable);
+	priv->wstats.discard.misc = get_unaligned_le32(&log->ackfailure);
+	lbs_deb_leave(LBS_DEB_CMD);
+
 	return 0;
 }
 
@@ -273,7 +287,9 @@ static inline int handle_cmd_response(struct lbs_private *priv,
 	case CMD_RET(CMD_802_11_BEACON_CTRL):
 		ret = lbs_ret_802_11_bcn_ctrl(priv, resp);
 		break;
-
+	case CMD_RET(CMD_802_11_GET_LOG):
+		ret = lbs_ret_802_11_get_log(priv, resp);
+		break;
 	default:
 		lbs_pr_err("CMD_RESP: unknown cmd response 0x%04x\n",
 			   le16_to_cpu(resp->command));
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h
index a899aeb..483a1d0 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -744,6 +744,7 @@ struct cmd_ds_command {
 
 	/* command Body */
 	union {
+		struct cmd_ds_802_11_get_log log;
 		struct cmd_ds_802_11_ps_mode psmode;
 		struct cmd_ds_802_11_associate associate;
 		struct cmd_ds_802_11_authenticate auth;
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index c6102e0..217249b 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -788,7 +788,6 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
 	int stats_valid = 0;
 	u8 rssi;
 	u32 tx_retries;
-	struct cmd_ds_802_11_get_log log;
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
@@ -804,12 +803,11 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
 	    CAL_RSSI(priv->SNR[TYPE_BEACON][TYPE_NOAVG],
 	     priv->NF[TYPE_BEACON][TYPE_NOAVG]);
 
-	if (priv->NF[TYPE_BEACON][TYPE_NOAVG] == 0) {
+	if (priv->NF[TYPE_BEACON][TYPE_NOAVG] == 0)
 		priv->wstats.qual.noise = MRVDRV_NF_DEFAULT_SCAN_VALUE;
-	} else {
+	else
 		priv->wstats.qual.noise =
 		    CAL_NF(priv->NF[TYPE_BEACON][TYPE_NOAVG]);
-	}
 
 	lbs_deb_wext("signal level %#x\n", priv->wstats.qual.level);
 	lbs_deb_wext("noise %#x\n", priv->wstats.qual.noise);
@@ -830,13 +828,11 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
 	quality = rssi_qual;
 
 	/* Quality by TX errors */
-	priv->wstats.discard.retries = priv->stats.tx_errors;
+	/* Previously this line was here, but the value was overwritten
+	 * a few lines later.
+	 * priv->wstats.discard.retries = priv->stats.tx_errors; */
 
-	memset(&log, 0, sizeof(log));
-	log.hdr.size = cpu_to_le16(sizeof(log));
-	lbs_cmd_with_response(priv, CMD_802_11_GET_LOG, &log);
-
-	tx_retries = le32_to_cpu(log.retry);
+	tx_retries = priv->wstats.discard.retries;
 
 	if (tx_retries > 75)
 		tx_qual = (90 - tx_retries) * POOR / 15;
@@ -846,10 +842,10 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
 		tx_qual = (70 - tx_retries) * (GOOD - FAIR) / 5 + FAIR;
 	else if (tx_retries > 50)
 		tx_qual = (65 - tx_retries) * (VERY_GOOD - GOOD) /
-		    15 + GOOD;
+			15 + GOOD;
 	else
 		tx_qual = (50 - tx_retries) *
-		    (PERFECT - VERY_GOOD) / 50 + VERY_GOOD;
+			(PERFECT - VERY_GOOD) / 50 + VERY_GOOD;
 	quality = min(quality, tx_qual);
 
 	priv->wstats.discard.code = le32_to_cpu(log.wepundecryptable);
@@ -864,6 +860,9 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
 	/* update stats asynchronously for future calls */
 	lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0,
 					0, 0, NULL);
+
+	lbs_prepare_and_send_command(priv, CMD_802_11_GET_LOG, 0,
+				     0, 0, NULL);
 out:
 	if (!stats_valid) {
 		priv->wstats.miss.beacon = 0;

From jic23 at cam.ac.uk  Tue Jun  9 14:30:55 2009
From: jic23 at cam.ac.uk (Jonathan Cameron)
Date: Tue, 09 Jun 2009 18:30:55 +0000
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <20090609122333.N87890@bowser.eecs.harvard.edu>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>	<1244230529.15303.7.camel@localhost.localdomain>	<1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>	<597915.56872.qm@web59207.mail.re1.yahoo.com>	<1BEA8649F0C00540AB2811D7922ECB6C32776026@orsmsx507.amr.corp.intel.com>	<1BEA8649F0C00540AB2811D7922ECB6C3277603F@orsmsx507.amr.corp.intel.com>
	<20090609122333.N87890@bowser.eecs.harvard.edu>
Message-ID: <4A2EAA5F.50304@cam.ac.uk>

Dario Vlah wrote:
> I got the wireless-testing driver to work on JAX10 after I applied the
> patch that James Cameron posted a while ago on this mailing list.
> (attached).  Before that it was crashing as you describe; IIRC there was
> some memory corruption due to calling GET_LOG in the wrong context.
> 
> --dario
> 
> 
Oops, that one is still sat in my patches to clean up list. 

I didn't think that a GET_LOG call occurred in association but if you
hit it whilst trying to associate, my guess is something has changed
in wireless tools.

The patch in question was meant to address some issues when getting
signal strength readings but I never really considered what else might
trigger it.

---
Jonathan Cameron





From brian.j.wood at intel.com  Tue Jun  9 14:36:42 2009
From: brian.j.wood at intel.com (Wood, Brian J)
Date: Tue, 9 Jun 2009 11:36:42 -0700
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <4A2EAA5F.50304@cam.ac.uk>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>
	<1244230529.15303.7.camel@localhost.localdomain>
	<1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>
	<597915.56872.qm@web59207.mail.re1.yahoo.com>
	<1BEA8649F0C00540AB2811D7922ECB6C32776026@orsmsx507.amr.corp.intel.com>
	<1BEA8649F0C00540AB2811D7922ECB6C3277603F@orsmsx507.amr.corp.intel.com>
	<20090609122333.N87890@bowser.eecs.harvard.edu>
	<4A2EAA5F.50304@cam.ac.uk>
Message-ID: <1BEA8649F0C00540AB2811D7922ECB6C327761C3@orsmsx507.amr.corp.intel.com>


>-----Original Message-----
>From: Jonathan Cameron [mailto:jic23 at cam.ac.uk]
>Sent: Tuesday, June 09, 2009 11:31 AM
>To: Dario Vlah
>Cc: Wood, Brian J; Philip Rakity; libertas-dev at lists.infradead.org
>Subject: Re: sd8686 linux system hang when associating to access point
>
>Dario Vlah wrote:
>> I got the wireless-testing driver to work on JAX10 after I applied the
>> patch that James Cameron posted a while ago on this mailing list.
>> (attached).  Before that it was crashing as you describe; IIRC there was
>> some memory corruption due to calling GET_LOG in the wrong context.
>>
>> --dario
>>
>>
>Oops, that one is still sat in my patches to clean up list.
>
>I didn't think that a GET_LOG call occurred in association but if you
>hit it whilst trying to associate, my guess is something has changed
>in wireless tools.
>
>The patch in question was meant to address some issues when getting
>signal strength readings but I never really considered what else might
>trigger it.

I just applied the patch to the 2.6.29.4 kernel and its complaining when I recompile that wext.c still has two calls to the "log" structure present (must have been inserted after your branch): 

priv->wstats.discard.code = le32_to_cpu(log.wepundecryptable);
priv->wstats.discard.misc = le32_to_cpu(log.ackfailure);

Do you happen to know what I can change these to? 

Thank you, Brian.


>
>---
>Jonathan Cameron
>
>



From brian.j.wood at intel.com  Tue Jun  9 16:26:25 2009
From: brian.j.wood at intel.com (Wood, Brian J)
Date: Tue, 9 Jun 2009 13:26:25 -0700
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <4A2EACAE.3060207@cam.ac.uk>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>
	<1244230529.15303.7.camel@localhost.localdomain>
	<1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>
	<597915.56872.qm@web59207.mail.re1.yahoo.com>
	<1BEA8649F0C00540AB2811D7922ECB6C32776026@orsmsx507.amr.corp.intel.com>
	<1BEA8649F0C00540AB2811D7922ECB6C3277603F@orsmsx507.amr.corp.intel.com>
	<20090609122333.N87890@bowser.eecs.harvard.edu>
	<4A2EAA5F.50304@cam.ac.uk>
	<1BEA8649F0C00540AB2811D7922ECB6C327761C3@orsmsx507.amr.corp.intel.com>
	<4A2EACAE.3060207@cam.ac.uk>
Message-ID: <1BEA8649F0C00540AB2811D7922ECB6C327762A0@orsmsx507.amr.corp.intel.com>

>-----Original Message-----
>From: Jonathan Cameron [mailto:jic23 at cam.ac.uk]
>Sent: Tuesday, June 09, 2009 11:41 AM
>To: Wood, Brian J
>Subject: Re: sd8686 linux system hang when associating to access point
>
>Wood, Brian J wrote:
>>> -----Original Message-----
>>> From: Jonathan Cameron [mailto:jic23 at cam.ac.uk]
>>> Sent: Tuesday, June 09, 2009 11:31 AM
>>> To: Dario Vlah
>>> Cc: Wood, Brian J; Philip Rakity; libertas-dev at lists.infradead.org
>>> Subject: Re: sd8686 linux system hang when associating to access point
>>>
>>> Dario Vlah wrote:
>>>> I got the wireless-testing driver to work on JAX10 after I applied the
>>>> patch that James Cameron posted a while ago on this mailing list.
>>>> (attached).  Before that it was crashing as you describe; IIRC there was
>>>> some memory corruption due to calling GET_LOG in the wrong context.
>>>>
>>>> --dario
>>>>
>>>>
>>> Oops, that one is still sat in my patches to clean up list.
>>>
>>> I didn't think that a GET_LOG call occurred in association but if you
>>> hit it whilst trying to associate, my guess is something has changed
>>> in wireless tools.
>>>
>>> The patch in question was meant to address some issues when getting
>>> signal strength readings but I never really considered what else might
>>> trigger it.
>>
>> I just applied the patch to the 2.6.29.4 kernel and its complaining when I recompile that wext.c
>still has two calls to the "log" structure present (must have been inserted after your branch):
>>
>> priv->wstats.discard.code = le32_to_cpu(log.wepundecryptable);
>> priv->wstats.discard.misc = le32_to_cpu(log.ackfailure);
>>
>> Do you happen to know what I can change these to?
>>
>> Thank you, Brian.
>As a quick sanity check to see if this is your problem, set them to  0 (claim no errors ;)
>
>We can clean up what they should actually be as and when resubmitting that patch.


Hi Jonathan, 

I set those calls to 0 (and had to set some more inside cmdresp.c), recompiled the kernel and tested...still hangs on association to an accesspoint. 

I also tried to Philip's suggestion of replacing:
sz = ((sz +3)/4)*4;
with:
sz = ((sz + 63)/64)*64;
inside the function mmc_align_data_size() inside the core.c file...same hang during the association. 

>
>Jonathan


From mlitwack at employees.org  Tue Jun  9 23:04:10 2009
From: mlitwack at employees.org (Mark Litwack)
Date: Tue, 9 Jun 2009 23:04:10 -0400
Subject: Marvell 8686 in SDIO over SPI mode?
Message-ID: <20090609230410.642d0478@piper>

Can anyone confirm if the Marvell 8686 works in SDIO over
SPI mode?

If so, what version of the helper and firmware worked for
you?

Thanks,

-mark


From liber+tas at ml.breakpoint.cc  Wed Jun 10 03:57:31 2009
From: liber+tas at ml.breakpoint.cc (Sebastian Andrzej Siewior)
Date: Wed, 10 Jun 2009 09:57:31 +0200
Subject: Marvell 8686 in SDIO over SPI mode?
In-Reply-To: <20090609230410.642d0478@piper>
References: <20090609230410.642d0478@piper>
Message-ID: <20090610075731.GA26981@Chamillionaire.breakpoint.cc>

* Mark Litwack | 2009-06-09 23:04:10 [-0400]:

>Can anyone confirm if the Marvell 8686 works in SDIO over
>SPI mode?
>
>If so, what version of the helper and firmware worked for
>you?

Starting with v2.6.30 just released there is SPI support. The link [0]
contains some informations and a pointer to a firmware.

[0] http://linuxwireless.org/en/users/Drivers/libertas
>Thanks,
>
>-mark

Sebastian


From daniel at caiaq.de  Wed Jun 10 05:16:26 2009
From: daniel at caiaq.de (Daniel Mack)
Date: Wed, 10 Jun 2009 11:16:26 +0200
Subject: Marvell 8686 in SDIO over SPI mode?
In-Reply-To: <20090609230410.642d0478@piper>
References: <20090609230410.642d0478@piper>
Message-ID: <20090610091626.GL26688@buzzloop.caiaq.de>

On Tue, Jun 09, 2009 at 11:04:10PM -0400, Mark Litwack wrote:
> Can anyone confirm if the Marvell 8686 works in SDIO over
> SPI mode?

Not quite sure what you mean here. SPI and SDIO are totally different
hardware protocols, and even though the chip is available in both
variants, I can't say what "SDIO over SPI mode" should refer to?

We're using the Wi2Wi chipset connected to a PXA's MMC port via SDIO,
with no SPI in the game.

Daniel



From jic23 at cam.ac.uk  Wed Jun 10 07:19:22 2009
From: jic23 at cam.ac.uk (Jonathan Cameron)
Date: Wed, 10 Jun 2009 11:19:22 +0000
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <1BEA8649F0C00540AB2811D7922ECB6C327762A0@orsmsx507.amr.corp.intel.com>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>	<1244230529.15303.7.camel@localhost.localdomain>	<1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>	<597915.56872.qm@web59207.mail.re1.yahoo.com>	<1BEA8649F0C00540AB2811D7922ECB6C32776026@orsmsx507.amr.corp.intel.com>	<1BEA8649F0C00540AB2811D7922ECB6C3277603F@orsmsx507.amr.corp.intel.com>	<20090609122333.N87890@bowser.eecs.harvard.edu>	<4A2EAA5F.50304@cam.ac.uk>	<1BEA8649F0C00540AB2811D7922ECB6C327761C3@orsmsx507.amr.corp.intel.com>	<4A2EACAE.3060207@cam.ac.uk>
	<1BEA8649F0C00540AB2811D7922ECB6C327762A0@orsmsx507.amr.corp.intel.com>
Message-ID: <4A2F96BA.6020401@cam.ac.uk>

Wood, Brian J wrote:
>> -----Original Message-----
>> From: Jonathan Cameron [mailto:jic23 at cam.ac.uk]
>> Sent: Tuesday, June 09, 2009 11:41 AM
>> To: Wood, Brian J
>> Subject: Re: sd8686 linux system hang when associating to access point
>>
>> Wood, Brian J wrote:
>>>> -----Original Message-----
>>>> From: Jonathan Cameron [mailto:jic23 at cam.ac.uk]
>>>> Sent: Tuesday, June 09, 2009 11:31 AM
>>>> To: Dario Vlah
>>>> Cc: Wood, Brian J; Philip Rakity; libertas-dev at lists.infradead.org
>>>> Subject: Re: sd8686 linux system hang when associating to access point
>>>>
>>>> Dario Vlah wrote:
>>>>> I got the wireless-testing driver to work on JAX10 after I applied the
>>>>> patch that James Cameron posted a while ago on this mailing list.
>>>>> (attached).  Before that it was crashing as you describe; IIRC there was
>>>>> some memory corruption due to calling GET_LOG in the wrong context.
>>>>>
>>>>> --dario
>>>>>
>>>>>
>>>> Oops, that one is still sat in my patches to clean up list.
>>>>
>>>> I didn't think that a GET_LOG call occurred in association but if you
>>>> hit it whilst trying to associate, my guess is something has changed
>>>> in wireless tools.
>>>>
>>>> The patch in question was meant to address some issues when getting
>>>> signal strength readings but I never really considered what else might
>>>> trigger it.
>>> I just applied the patch to the 2.6.29.4 kernel and its complaining when I recompile that wext.c
>> still has two calls to the "log" structure present (must have been inserted after your branch):
>>> priv->wstats.discard.code = le32_to_cpu(log.wepundecryptable);
>>> priv->wstats.discard.misc = le32_to_cpu(log.ackfailure);
>>>
>>> Do you happen to know what I can change these to?
>>>
>>> Thank you, Brian.
>> As a quick sanity check to see if this is your problem, set them to  0 (claim no errors ;)
>>
>> We can clean up what they should actually be as and when resubmitting that patch.
> 
> 
> Hi Jonathan, 
> 
> I set those calls to 0 (and had to set some more inside cmdresp.c), recompiled the kernel and tested...still hangs on association to an accesspoint. 
 
> I also tried to Philip's suggestion of replacing:
> sz = ((sz +3)/4)*4;
> with:
> sz = ((sz + 63)/64)*64;
> inside the function mmc_align_data_size() inside the core.c file...same hang during the association. 
Sorry, I've no idea what else could be going on.

We did have a problem at one point with the driver hanging if we attempted to associate with a non existent
essid, but I've just verified that no longer happens.

I guess you are going to be adding a lot of debug info to try and isolate where exactly it is dying.

Jonathan


From mlitwack at employees.org  Wed Jun 10 09:19:43 2009
From: mlitwack at employees.org (Mark Litwack)
Date: Wed, 10 Jun 2009 09:19:43 -0400
Subject: Marvell 8686 in SDIO over SPI mode?
In-Reply-To: <20090610091626.GL26688@buzzloop.caiaq.de>
References: <20090609230410.642d0478@piper>
	<20090610091626.GL26688@buzzloop.caiaq.de>
Message-ID: <20090610091943.707ca290@piper>

On Wed, 10 Jun 2009 11:16:26 +0200
Daniel Mack <daniel at caiaq.de> wrote:
> On Tue, Jun 09, 2009 at 11:04:10PM -0400, Mark Litwack
> wrote:
> > Can anyone confirm if the Marvell 8686 works in SDIO
> > over SPI mode?
> 
> Not quite sure what you mean here. SPI and SDIO are
> totally different hardware protocols, and even though the
> chip is available in both variants, I can't say what
> "SDIO over SPI mode" should refer to?


I'm referring to the SDIO Simplified Spec 2.00, section 2.2.1:

  2.2 SDIO Card modes

  There are 3 signaling modes defined for SD memory cards that
  also apply to SDIO Card:

  2.2.1 SPI (Card mandatory support)

  The SPI bus topology is defined in section 3.5.2 and the
  protocol is defined in sections 3.6.2 and 7 of the SD
  Physical Specification Version 2.00. In this mode pin 8,
  which is undefined for memory, is used as the interrupt
  pin. All other pins and signaling protocols are identical to
  the SD Physical Specification.

  2.2.2 1-bit SD Data Transfer Mode (Card Mandatory Support)
  ...

  2.2.3 4-bit SD Data Transfer Mode (Mandatory for High-Speed
        Cards, Optional for Low-Speed)
  ...

There are numerous other sections in the spec that describe
SPI.  The SD Card Physical Spec 2.00 has chapter 7 dedicated
to this mode of operation.

Here's the pinout:

  http://www.interfacebus.com/Secure_Digital_IO_Card_Pinout.html

In short, it's using a connection from an SPI master (DI,
DO, CLK, CS, plus an added IRQ) to access SDIO functions.
But it's not completely transparent from regular SDIO
because there are a few differences in packet format.  The
mmc_spi driver seems to handle the differences in the SPI
layer.


Specific to the Marvell 8686, there is a pin (SDIO_SPI_SEL)
which selects SDIO or GSPI mode.  I already have GSPI mode
working.

I'm trying to get SDIO/SPI mode to work as per the SDIO
spec.  It should work since this mode is mandatory.

The 8686 module is recognized properly and the
libertas/if_sdio driver proceeds to set up the module via
mmc_spi.  But once the helper is loaded, the helper only
requests 16 bytes to be loaded at a time (as appears in
IF_SDIO_RD_BASE+0 and IF_SDIO_RD_BASE+1).  I don't think 16
is right.  In the end the main firmware fails to boot.

I've verified the exchange with the module with a logic
analyzer, so I don't think it's a controller issue.

So before I get into a deep debugging exchange, I was asking
if I have the right firmware.  Given that there is different
firmware for GSPI, I would not be a surprised if I needed
something different for SDIO/SPI versus regular SDIO.

Thanks,

-mark


From brian.j.wood at intel.com  Wed Jun 10 14:08:40 2009
From: brian.j.wood at intel.com (Wood, Brian J)
Date: Wed, 10 Jun 2009 11:08:40 -0700
Subject: sd8686 linux system hang when associating to access point
In-Reply-To: <4A2F96BA.6020401@cam.ac.uk>
References: <1BEA8649F0C00540AB2811D7922ECB6C326FA968@orsmsx507.amr.corp.intel.com>
	<1244230529.15303.7.camel@localhost.localdomain>
	<1BEA8649F0C00540AB2811D7922ECB6C32775D33@orsmsx507.amr.corp.intel.com>
	<597915.56872.qm@web59207.mail.re1.yahoo.com>
	<1BEA8649F0C00540AB2811D7922ECB6C32776026@orsmsx507.amr.corp.intel.com>
	<1BEA8649F0C00540AB2811D7922ECB6C3277603F@orsmsx507.amr.corp.intel.com>
	<20090609122333.N87890@bowser.eecs.harvard.edu>	<4A2EAA5F.50304@cam.ac.uk>
	<1BEA8649F0C00540AB2811D7922ECB6C327761C3@orsmsx507.amr.corp.intel.com>
	<4A2EACAE.3060207@cam.ac.uk>
	<1BEA8649F0C00540AB2811D7922ECB6C327762A0@orsmsx507.amr.corp.intel.com>
	<4A2F96BA.6020401@cam.ac.uk>
Message-ID: <1BEA8649F0C00540AB2811D7922ECB6C3277679D@orsmsx507.amr.corp.intel.com>

Hi Jonathan (all),

I changed my rsyslog.conf file to get the output of the kern.* printk's to a logfile that should help with pinpointing the issue (hopefully). I've also turned on the mmc debugging in the kernel so it might help with the controller portions? Also, I used the suggested "5792679" setting as the "libertas_debug" module parameter file to get this output.

This log capture is from the point where I issue the command:

        $iwconfig eth0 essid "Guest"

Until the system hangs.


Jun 10 06:45:23 localhost kernel: [  521.751098] libertas enter: lbs_get_wireless_stats()
Jun 10 06:45:23 localhost kernel: [  521.751235] libertas leave: lbs_get_wireless_stats()
Jun 10 06:45:23 localhost kernel: [  521.751557] libertas enter: lbs_set_essid()
Jun 10 06:45:23 localhost kernel: [  521.751650] libertas wext: requested SSID 'Guest'
Jun 10 06:45:23 localhost kernel: [  521.751760] libertas enter: lbs_get_association_request()
Jun 10 06:45:23 localhost kernel: [  521.751871] libertas leave: lbs_get_association_request()
Jun 10 06:45:23 localhost kernel: [  521.751963] libertas leave: lbs_set_essid(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.251312] libertas enter: lbs_association_worker()
Jun 10 06:45:24 localhost kernel: [  522.251470] libertas assoc: Association Request:
Jun 10 06:45:24 localhost kernel: [  522.251476]     flags:     0x00000002
Jun 10 06:45:24 localhost kernel: [  522.251480]     SSID:      'Guest'
Jun 10 06:45:24 localhost kernel: [  522.251484]     chann:     1
Jun 10 06:45:24 localhost kernel: [  522.251487]     band:      0
Jun 10 06:45:24 localhost kernel: [  522.251490]     mode:      2
Jun 10 06:45:24 localhost kernel: [  522.251494]     BSSID:     00:00:00:00:00:00
Jun 10 06:45:24 localhost kernel: [  522.251498]     secinfo:
Jun 10 06:45:24 localhost kernel: [  522.251501]     auth_mode: 1
Jun 10 06:45:24 localhost kernel: [  522.253120] libertas enter: assoc_helper_associate()
Jun 10 06:45:24 localhost kernel: [  522.253323] libertas enter: assoc_helper_essid()
Jun 10 06:45:24 localhost kernel: [  522.253510] libertas assoc: SSID 'Guest' requested
Jun 10 06:45:24 localhost kernel: [  522.253678] libertas enter: lbs_send_specific_ssid_scan(SSID 'Guest'
Jun 10 06:45:24 localhost kernel: [  522.253684] )
Jun 10 06:45:24 localhost kernel: [  522.254026] libertas enter: lbs_scan_networks(full_scan 1)
Jun 10 06:45:24 localhost kernel: [  522.254198] libertas scan: numchannels 4, bsstype 3
Jun 10 06:45:24 localhost kernel: [  522.258553] libertas scan: chan_count 11, scan_channel 0
Jun 10 06:45:24 localhost kernel: [  522.258735] libertas scan: scanning 4 of 11 channels
Jun 10 06:45:24 localhost kernel: [  522.258904] libertas enter: lbs_do_scan(bsstype 3, chanlist[].chan 1, chan_count 4)
Jun 10 06:45:24 localhost kernel: [  522.259975] libertas enter: __lbs_cmd()
Jun 10 06:45:24 localhost kernel: [  522.260168] libertas enter: __lbs_cmd_async()
Jun 10 06:45:24 localhost kernel: [  522.260334] libertas enter: lbs_get_cmd_ctrl_node()
Jun 10 06:45:24 localhost kernel: [  522.260502] libertas leave: lbs_get_cmd_ctrl_node()
Jun 10 06:45:24 localhost kernel: [  522.260671] libertas host: PREP_CMD: command 0x0006
Jun 10 06:45:24 localhost kernel: [  522.260838] libertas enter: lbs_queue_cmd()
Jun 10 06:45:24 localhost kernel: [  522.261021] libertas host: QUEUE_CMD: inserted command 0x0006 into cmdpendingq
Jun 10 06:45:24 localhost kernel: [  522.261282] libertas leave: lbs_queue_cmd()
Jun 10 06:45:24 localhost kernel: [  522.261452] libertas leave: __lbs_cmd_async(), ret dd4c40f0
Jun 10 06:45:24 localhost kernel: [  522.263816] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:24 localhost kernel: [  522.263997] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:24 localhost kernel: [  522.264195] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:24 localhost kernel: [  522.264371] libertas enter: lbs_execute_next_command()
Jun 10 06:45:24 localhost kernel: [  522.264540] libertas host: EXEC_NEXT_CMD: sending command 0x0006
Jun 10 06:45:24 localhost kernel: [  522.264711] libertas enter: lbs_submit_command()
Jun 10 06:45:24 localhost kernel: [  522.264878] libertas cmd: DNLD_CMD: command 0x0006, seq 67, size 72
Jun 10 06:45:24 localhost kernel: [  522.265069] libertas enter: if_sdio_host_to_card(type 1, bytes 72)
Jun 10 06:45:24 localhost kernel: [  522.265253] libertas leave: if_sdio_host_to_card(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.265422] libertas leave: lbs_submit_command()
Jun 10 06:45:24 localhost kernel: [  522.265587] libertas leave: lbs_execute_next_command()
Jun 10 06:45:24 localhost kernel: [  522.265756] libertas thread: 1: currenttxskb (null), dnld_sent 2
Jun 10 06:45:24 localhost kernel: [  522.265929] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:24 localhost kernel: [  522.269428] libertas enter: if_sdio_host_to_card_worker()
Jun 10 06:45:24 localhost kernel: [  522.269614] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.269810] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.269997] mmc1: req done (CMD52): 0: 00001008 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.271242] mmc1: starting CMD53 arg 9200004c flags 000001b5
Jun 10 06:45:24 localhost kernel: [  522.271421] mmc1:     blksz 76 blocks 1 flags 00000100 tsac 1000 ms nsac 0
Jun 10 06:45:24 localhost kernel: [  522.271626] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000003
Jun 10 06:45:24 localhost kernel: [  522.271810] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000100
Jun 10 06:45:24 localhost kernel: [  522.272000] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.272196] mmc1:     76 bytes transferred: 0
Jun 10 06:45:24 localhost kernel: [  522.273921] libertas leave: if_sdio_host_to_card_worker()
Jun 10 06:45:24 localhost kernel: [  522.274147] mmc1: starting CMD52 arg 00000a00 flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.274337] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.274519] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.274704] libertas enter: if_sdio_interrupt()
Jun 10 06:45:24 localhost kernel: [  522.274873] mmc1: starting CMD52 arg 10000a00 flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.275076] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.275258] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.275443] libertas sdio: interrupt: 0x2
Jun 10 06:45:24 localhost kernel: [  522.275608] mmc1: starting CMD52 arg 90000afd flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.275794] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.275974] mmc1: req done (CMD52): 0: 000010fd 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.276179] libertas enter: lbs_host_to_card_done()
Jun 10 06:45:24 localhost kernel: [  522.276345] libertas leave: lbs_host_to_card_done()
Jun 10 06:45:24 localhost kernel: [  522.276514] libertas leave: if_sdio_interrupt(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.731904] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000100
Jun 10 06:45:24 localhost kernel: [  522.732227] mmc1: starting CMD52 arg 00000a00 flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.732623] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.732844] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.733121] libertas enter: if_sdio_interrupt()
Jun 10 06:45:24 localhost kernel: [  522.733320] mmc1: starting CMD52 arg 10000a00 flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.733514] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.733697] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.733884] libertas sdio: interrupt: 0x1
Jun 10 06:45:24 localhost kernel: [  522.734068] mmc1: starting CMD52 arg 90000afe flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.734255] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.734435] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.734623] libertas enter: if_sdio_card_to_host()
Jun 10 06:45:24 localhost kernel: [  522.734792] mmc1: starting CMD52 arg 10006800 flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.734976] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.735175] mmc1: req done (CMD52): 0: 000010bd 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.735362] mmc1: starting CMD52 arg 10006a00 flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.735548] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.735728] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.735915] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.736117] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.736300] mmc1: req done (CMD52): 0: 0000100a 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.736490] mmc1: starting CMD53 arg 1a000002 flags 000001b5
Jun 10 06:45:24 localhost kernel: [  522.736662] mmc1:     blksz 256 blocks 2 flags 00000200 tsac 1000 ms nsac 0
Jun 10 06:45:24 localhost kernel: [  522.736858] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.737059] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000002
Jun 10 06:45:24 localhost kernel: [  522.737242] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.737416] mmc1:     512 bytes transferred: 0
Jun 10 06:45:24 localhost kernel: [  522.737591] libertas sdio: packet of type 1 and size 445 bytes
Jun 10 06:45:24 localhost kernel: [  522.737765] libertas enter: if_sdio_handle_cmd()
Jun 10 06:45:24 localhost kernel: [  522.737933] libertas enter: lbs_notify_command_response()
Jun 10 06:45:24 localhost kernel: [  522.738040] libertas leave: lbs_notify_command_response()
Jun 10 06:45:24 localhost kernel: [  522.738326] libertas leave: if_sdio_handle_cmd(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.738496] libertas leave: if_sdio_card_to_host(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.738665] libertas leave: if_sdio_interrupt(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.744037] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:24 localhost kernel: [  522.744218] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:24 localhost kernel: [  522.744389] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:24 localhost kernel: [  522.744563] libertas enter: lbs_process_command_response()
Jun 10 06:45:24 localhost kernel: [  522.744737] libertas cmd: CMD_RESP: response 0x8006, seq 67, size 441
Jun 10 06:45:24 localhost kernel: [  522.744915] libertas enter: lbs_ret_80211_scan()
Jun 10 06:45:24 localhost kernel: [  522.745126] libertas scan: SCAN_RESP: bssdescriptsize 402
Jun 10 06:45:24 localhost kernel: [  522.745296] libertas scan: SCAN_RESP: scan results 3
Jun 10 06:45:24 localhost kernel: [  522.745462] libertas enter: lbs_process_bss()
Jun 10 06:45:24 localhost kernel: [  522.745628] libertas scan: process_bss: BSSID 00:12:d9:3c:bb:83
Jun 10 06:45:24 localhost kernel: [  522.745800] libertas scan: process_bss: RSSI 68
Jun 10 06:45:24 localhost kernel: [  522.745966] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:24 localhost kernel: [  522.746150] libertas scan: process_bss: IE len 100
Jun 10 06:45:24 localhost kernel: [  522.746321] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:24 localhost kernel: [  522.746489] libertas scan: got RATES IE
Jun 10 06:45:24 localhost kernel: [  522.746652] libertas scan: got DS IE, channel 1
Jun 10 06:45:24 localhost kernel: [  522.746815] libertas scan: got COUNTRY IE
Jun 10 06:45:24 localhost kernel: [  522.746979] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:24 localhost kernel: [  522.747159] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:24 localhost kernel: [  522.747327] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:24 localhost kernel: [  522.747496] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:24 localhost kernel: [  522.747666] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:24 localhost kernel: [  522.747838] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:24 localhost kernel: [  522.748024] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:24 localhost kernel: [  522.748196] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.748365] libertas scan: SCAN_RESP: BSSID 00:12:d9:3c:bb:83
Jun 10 06:45:24 localhost kernel: [  522.748536] libertas enter: lbs_process_bss()
Jun 10 06:45:24 localhost kernel: [  522.748701] libertas scan: process_bss: BSSID 00:24:14:86:4d:d3
Jun 10 06:45:24 localhost kernel: [  522.748871] libertas scan: process_bss: RSSI 78
Jun 10 06:45:24 localhost kernel: [  522.749050] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:24 localhost kernel: [  522.749220] libertas scan: process_bss: IE len 133
Jun 10 06:45:24 localhost kernel: [  522.749432] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:24 localhost kernel: [  522.749601] libertas scan: got RATES IE
Jun 10 06:45:24 localhost kernel: [  522.749765] libertas scan: got DS IE, channel 1
Jun 10 06:45:24 localhost kernel: [  522.749930] libertas scan: got COUNTRY IE
Jun 10 06:45:24 localhost kernel: [  522.750112] libertas scan: got IE 0x000b, len 5
Jun 10 06:45:24 localhost kernel: [  522.750278] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:24 localhost kernel: [  522.750442] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:24 localhost kernel: [  522.750610] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:24 localhost kernel: [  522.750779] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:24 localhost kernel: [  522.750952] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:24 localhost kernel: [  522.751140] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:24 localhost kernel: [  522.751313] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:24 localhost kernel: [  522.751486] libertas scan: got generic IE: 00:50:f2:02, len 24
Jun 10 06:45:24 localhost kernel: [  522.751659] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.751827] libertas scan: SCAN_RESP: BSSID 00:24:14:86:4d:d3
Jun 10 06:45:24 localhost kernel: [  522.751998] libertas enter: lbs_process_bss()
Jun 10 06:45:24 localhost kernel: [  522.752177] libertas scan: process_bss: BSSID 00:24:14:86:49:53
Jun 10 06:45:24 localhost kernel: [  522.752347] libertas scan: process_bss: RSSI 82
Jun 10 06:45:24 localhost kernel: [  522.752512] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:24 localhost kernel: [  522.752682] libertas scan: process_bss: IE len 106
Jun 10 06:45:24 localhost kernel: [  522.752852] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:24 localhost kernel: [  522.753032] libertas scan: got RATES IE
Jun 10 06:45:24 localhost kernel: [  522.753194] libertas scan: got DS IE, channel 1
Jun 10 06:45:24 localhost kernel: [  522.753361] libertas scan: got IE 0x0005, len 4
Jun 10 06:45:24 localhost kernel: [  522.753525] libertas scan: got COUNTRY IE
Jun 10 06:45:24 localhost kernel: [  522.753689] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:24 localhost kernel: [  522.753855] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:24 localhost kernel: [  522.754035] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:24 localhost kernel: [  522.754203] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:24 localhost kernel: [  522.754375] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:24 localhost kernel: [  522.754545] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:24 localhost kernel: [  522.754718] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:24 localhost kernel: [  522.754926] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.755112] libertas scan: SCAN_RESP: BSSID 00:24:14:86:49:53
Jun 10 06:45:24 localhost kernel: [  522.755284] libertas leave: lbs_ret_80211_scan(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.755460] libertas leave: lbs_process_command_response(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.755634] libertas enter: lbs_execute_next_command()
Jun 10 06:45:24 localhost kernel: [  522.755800] libertas leave: lbs_execute_next_command()
Jun 10 06:45:24 localhost kernel: [  522.755969] libertas thread: 1: currenttxskb (null), dnld_sent 0
Jun 10 06:45:24 localhost kernel: [  522.756154] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:24 localhost kernel: [  522.758384] libertas enter: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:24 localhost kernel: [  522.758559] libertas leave: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:24 localhost kernel: [  522.758727] libertas leave: __lbs_cmd(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.758894] libertas leave: lbs_do_scan(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.759085] libertas scan: scanning 4 of 7 channels
Jun 10 06:45:24 localhost kernel: [  522.759255] libertas enter: lbs_do_scan(bsstype 3, chanlist[].chan 5, chan_count 4)
Jun 10 06:45:24 localhost kernel: [  522.761424] libertas enter: __lbs_cmd()
Jun 10 06:45:24 localhost kernel: [  522.761591] libertas enter: __lbs_cmd_async()
Jun 10 06:45:24 localhost kernel: [  522.761755] libertas enter: lbs_get_cmd_ctrl_node()
Jun 10 06:45:24 localhost kernel: [  522.761922] libertas leave: lbs_get_cmd_ctrl_node()
Jun 10 06:45:24 localhost kernel: [  522.762114] libertas host: PREP_CMD: command 0x0006
Jun 10 06:45:24 localhost kernel: [  522.762282] libertas enter: lbs_queue_cmd()
Jun 10 06:45:24 localhost kernel: [  522.762448] libertas host: QUEUE_CMD: inserted command 0x0006 into cmdpendingq
Jun 10 06:45:24 localhost kernel: [  522.762707] libertas leave: lbs_queue_cmd()
Jun 10 06:45:24 localhost kernel: [  522.762877] libertas leave: __lbs_cmd_async(), ret dd4c4118
Jun 10 06:45:24 localhost kernel: [  522.763335] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:24 localhost kernel: [  522.763510] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:24 localhost kernel: [  522.763682] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:24 localhost kernel: [  522.763856] libertas enter: lbs_execute_next_command()
Jun 10 06:45:24 localhost kernel: [  522.764050] libertas host: EXEC_NEXT_CMD: sending command 0x0006
Jun 10 06:45:24 localhost kernel: [  522.764221] libertas enter: lbs_submit_command()
Jun 10 06:45:24 localhost kernel: [  522.764387] libertas cmd: DNLD_CMD: command 0x0006, seq 68, size 72
Jun 10 06:45:24 localhost kernel: [  522.764562] libertas enter: if_sdio_host_to_card(type 1, bytes 72)
Jun 10 06:45:24 localhost kernel: [  522.764743] libertas leave: if_sdio_host_to_card(), ret 0
Jun 10 06:45:24 localhost kernel: [  522.764914] libertas leave: lbs_submit_command()
Jun 10 06:45:24 localhost kernel: [  522.765095] libertas leave: lbs_execute_next_command()
Jun 10 06:45:24 localhost kernel: [  522.765263] libertas thread: 1: currenttxskb (null), dnld_sent 2
Jun 10 06:45:24 localhost kernel: [  522.765436] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:24 localhost kernel: [  522.766039] libertas enter: if_sdio_host_to_card_worker()
Jun 10 06:45:24 localhost kernel: [  522.766253] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.766445] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.766629] mmc1: req done (CMD52): 0: 00001008 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.766819] mmc1: starting CMD53 arg 9200004c flags 000001b5
Jun 10 06:45:24 localhost kernel: [  522.766992] mmc1:     blksz 76 blocks 1 flags 00000100 tsac 1000 ms nsac 0
Jun 10 06:45:24 localhost kernel: [  522.767211] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.767392] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000102
Jun 10 06:45:24 localhost kernel: [  522.767579] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.767757] mmc1:     76 bytes transferred: 0
Jun 10 06:45:24 localhost kernel: [  522.768283] libertas leave: if_sdio_host_to_card_worker()
Jun 10 06:45:24 localhost kernel: [  522.768466] mmc1: starting CMD52 arg 00000a00 flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.768654] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.768835] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.769045] libertas enter: if_sdio_interrupt()
Jun 10 06:45:24 localhost kernel: [  522.769215] mmc1: starting CMD52 arg 10000a00 flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.769401] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.769584] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.769769] libertas sdio: interrupt: 0x2
Jun 10 06:45:24 localhost kernel: [  522.769934] mmc1: starting CMD52 arg 90000afd flags 00000195
Jun 10 06:45:24 localhost kernel: [  522.770137] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:24 localhost kernel: [  522.770318] mmc1: req done (CMD52): 0: 000010fd 00000000 00000000 00000000
Jun 10 06:45:24 localhost kernel: [  522.770503] libertas enter: lbs_host_to_card_done()
Jun 10 06:45:24 localhost kernel: [  522.770670] libertas leave: lbs_host_to_card_done()
Jun 10 06:45:24 localhost kernel: [  522.770837] libertas leave: if_sdio_interrupt(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.221478] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000100
Jun 10 06:45:25 localhost kernel: [  523.221796] mmc1: starting CMD52 arg 00000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.222272] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.222494] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.222709] libertas enter: if_sdio_interrupt()
Jun 10 06:45:25 localhost kernel: [  523.222902] mmc1: starting CMD52 arg 10000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.223110] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.223293] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.223481] libertas sdio: interrupt: 0x1
Jun 10 06:45:25 localhost kernel: [  523.223648] mmc1: starting CMD52 arg 90000afe flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.223831] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.224032] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.224217] libertas enter: if_sdio_card_to_host()
Jun 10 06:45:25 localhost kernel: [  523.224387] mmc1: starting CMD52 arg 10006800 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.224574] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.224757] mmc1: req done (CMD52): 0: 000010d9 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.224944] mmc1: starting CMD52 arg 10006a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.225148] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.225329] mmc1: req done (CMD52): 0: 00001003 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.225515] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.225700] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.225881] mmc1: req done (CMD52): 0: 0000100a 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.226092] mmc1: starting CMD53 arg 1a000004 flags 000001b5
Jun 10 06:45:25 localhost kernel: [  523.226268] mmc1:     blksz 256 blocks 4 flags 00000200 tsac 1000 ms nsac 0
Jun 10 06:45:25 localhost kernel: [  523.226464] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.226649] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000002
Jun 10 06:45:25 localhost kernel: [  523.226829] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.227021] mmc1:     1024 bytes transferred: 0
Jun 10 06:45:25 localhost kernel: [  523.227197] libertas sdio: packet of type 1 and size 985 bytes
Jun 10 06:45:25 localhost kernel: [  523.227370] libertas enter: if_sdio_handle_cmd()
Jun 10 06:45:25 localhost kernel: [  523.227541] libertas enter: lbs_notify_command_response()
Jun 10 06:45:25 localhost kernel: [  523.227715] libertas leave: lbs_notify_command_response()
Jun 10 06:45:25 localhost kernel: [  523.227882] libertas leave: if_sdio_handle_cmd(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.228069] libertas leave: if_sdio_card_to_host(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.228242] libertas leave: if_sdio_interrupt(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.229660] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:25 localhost kernel: [  523.229840] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.230038] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.230211] libertas enter: lbs_process_command_response()
Jun 10 06:45:25 localhost kernel: [  523.230534] libertas cmd: CMD_RESP: response 0x8006, seq 68, size 981
Jun 10 06:45:25 localhost kernel: [  523.230715] libertas enter: lbs_ret_80211_scan()
Jun 10 06:45:25 localhost kernel: [  523.230882] libertas scan: SCAN_RESP: bssdescriptsize 910
Jun 10 06:45:25 localhost kernel: [  523.231077] libertas scan: SCAN_RESP: scan results 7
Jun 10 06:45:25 localhost kernel: [  523.231246] libertas enter: lbs_process_bss()
Jun 10 06:45:25 localhost kernel: [  523.231411] libertas scan: process_bss: BSSID 00:24:14:86:37:43
Jun 10 06:45:25 localhost kernel: [  523.231583] libertas scan: process_bss: RSSI 68
Jun 10 06:45:25 localhost kernel: [  523.231750] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:25 localhost kernel: [  523.231919] libertas scan: process_bss: IE len 133
Jun 10 06:45:25 localhost kernel: [  523.232105] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:25 localhost kernel: [  523.232273] libertas scan: got RATES IE
Jun 10 06:45:25 localhost kernel: [  523.232435] libertas scan: got DS IE, channel 6
Jun 10 06:45:25 localhost kernel: [  523.232600] libertas scan: got COUNTRY IE
Jun 10 06:45:25 localhost kernel: [  523.232779] libertas scan: got IE 0x000b, len 5
Jun 10 06:45:25 localhost kernel: [  523.232942] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:25 localhost kernel: [  523.233123] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:25 localhost kernel: [  523.233289] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:25 localhost kernel: [  523.233458] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:25 localhost kernel: [  523.233630] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:25 localhost kernel: [  523.233801] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:25 localhost kernel: [  523.233971] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:25 localhost kernel: [  523.234197] libertas scan: got generic IE: 00:50:f2:02, len 24
Jun 10 06:45:25 localhost kernel: [  523.234371] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.234539] libertas scan: SCAN_RESP: BSSID 00:24:14:86:37:43
Jun 10 06:45:25 localhost kernel: [  523.234712] libertas enter: lbs_process_bss()
Jun 10 06:45:25 localhost kernel: [  523.234876] libertas scan: process_bss: BSSID 00:12:d9:3c:be:23
Jun 10 06:45:25 localhost kernel: [  523.235065] libertas scan: process_bss: RSSI 78
Jun 10 06:45:25 localhost kernel: [  523.235230] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:25 localhost kernel: [  523.235400] libertas scan: process_bss: IE len 100
Jun 10 06:45:25 localhost kernel: [  523.235567] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:25 localhost kernel: [  523.235734] libertas scan: got RATES IE
Jun 10 06:45:25 localhost kernel: [  523.235895] libertas scan: got DS IE, channel 6
Jun 10 06:45:25 localhost kernel: [  523.236075] libertas scan: got COUNTRY IE
Jun 10 06:45:25 localhost kernel: [  523.236238] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:25 localhost kernel: [  523.236403] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:25 localhost kernel: [  523.236569] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:25 localhost kernel: [  523.236738] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:25 localhost kernel: [  523.236910] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:25 localhost kernel: [  523.237096] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:25 localhost kernel: [  523.237268] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:25 localhost kernel: [  523.237440] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.237608] libertas scan: SCAN_RESP: BSSID 00:12:d9:3c:be:23
Jun 10 06:45:25 localhost kernel: [  523.237779] libertas enter: lbs_process_bss()
Jun 10 06:45:25 localhost kernel: [  523.237943] libertas scan: process_bss: BSSID 00:12:d9:42:37:d3
Jun 10 06:45:25 localhost kernel: [  523.238129] libertas scan: process_bss: RSSI 86
Jun 10 06:45:25 localhost kernel: [  523.238293] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:25 localhost kernel: [  523.238460] libertas scan: process_bss: IE len 106
Jun 10 06:45:25 localhost kernel: [  523.238627] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:25 localhost kernel: [  523.238794] libertas scan: got RATES IE
Jun 10 06:45:25 localhost kernel: [  523.238955] libertas scan: got DS IE, channel 6
Jun 10 06:45:25 localhost kernel: [  523.239136] libertas scan: got IE 0x0005, len 4
Jun 10 06:45:25 localhost kernel: [  523.239300] libertas scan: got COUNTRY IE
Jun 10 06:45:25 localhost kernel: [  523.239464] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:25 localhost kernel: [  523.239664] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:25 localhost kernel: [  523.239831] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:25 localhost kernel: [  523.239999] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:25 localhost kernel: [  523.240188] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:25 localhost kernel: [  523.240360] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:25 localhost kernel: [  523.240534] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:25 localhost kernel: [  523.240706] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.240874] libertas scan: SCAN_RESP: BSSID 00:12:d9:42:37:d3
Jun 10 06:45:25 localhost kernel: [  523.241059] libertas enter: lbs_process_bss()
Jun 10 06:45:25 localhost kernel: [  523.241223] libertas scan: process_bss: BSSID 00:11:bb:ef:87:33
Jun 10 06:45:25 localhost kernel: [  523.241392] libertas scan: process_bss: RSSI 83
Jun 10 06:45:25 localhost kernel: [  523.241557] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:25 localhost kernel: [  523.241727] libertas scan: process_bss: IE len 106
Jun 10 06:45:25 localhost kernel: [  523.241894] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:25 localhost kernel: [  523.242077] libertas scan: got RATES IE
Jun 10 06:45:25 localhost kernel: [  523.242240] libertas scan: got DS IE, channel 6
Jun 10 06:45:25 localhost kernel: [  523.242407] libertas scan: got IE 0x0005, len 4
Jun 10 06:45:25 localhost kernel: [  523.242570] libertas scan: got COUNTRY IE
Jun 10 06:45:25 localhost kernel: [  523.242734] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:25 localhost kernel: [  523.242900] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:25 localhost kernel: [  523.243081] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:25 localhost kernel: [  523.243247] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:25 localhost kernel: [  523.243420] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:25 localhost kernel: [  523.243591] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:25 localhost kernel: [  523.243763] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:25 localhost kernel: [  523.243934] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.244116] libertas scan: SCAN_RESP: BSSID 00:11:bb:ef:87:33
Jun 10 06:45:25 localhost kernel: [  523.244287] libertas enter: lbs_process_bss()
Jun 10 06:45:25 localhost kernel: [  523.244450] libertas scan: process_bss: BSSID 00:12:d9:3c:b7:63
Jun 10 06:45:25 localhost kernel: [  523.244621] libertas scan: process_bss: RSSI 89
Jun 10 06:45:25 localhost kernel: [  523.244786] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:25 localhost kernel: [  523.244953] libertas scan: process_bss: IE len 106
Jun 10 06:45:25 localhost kernel: [  523.245172] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:25 localhost kernel: [  523.245339] libertas scan: got RATES IE
Jun 10 06:45:25 localhost kernel: [  523.245502] libertas scan: got DS IE, channel 6
Jun 10 06:45:25 localhost kernel: [  523.245667] libertas scan: got IE 0x0005, len 4
Jun 10 06:45:25 localhost kernel: [  523.245832] libertas scan: got COUNTRY IE
Jun 10 06:45:25 localhost kernel: [  523.245995] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:25 localhost kernel: [  523.246178] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:25 localhost kernel: [  523.246346] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:25 localhost kernel: [  523.248183] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:25 localhost kernel: [  523.248354] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:25 localhost kernel: [  523.248528] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:25 localhost kernel: [  523.248700] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:25 localhost kernel: [  523.248871] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.249053] libertas scan: SCAN_RESP: BSSID 00:12:d9:3c:b7:63
Jun 10 06:45:25 localhost kernel: [  523.249225] libertas enter: lbs_process_bss()
Jun 10 06:45:25 localhost kernel: [  523.249388] libertas scan: process_bss: BSSID 00:12:d9:42:38:43
Jun 10 06:45:25 localhost kernel: [  523.249562] libertas scan: process_bss: RSSI 78
Jun 10 06:45:25 localhost kernel: [  523.249727] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:25 localhost kernel: [  523.249894] libertas scan: process_bss: IE len 106
Jun 10 06:45:25 localhost kernel: [  523.250075] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:25 localhost kernel: [  523.250242] libertas scan: got RATES IE
Jun 10 06:45:25 localhost kernel: [  523.250404] libertas scan: got DS IE, channel 6
Jun 10 06:45:25 localhost kernel: [  523.250569] libertas scan: got IE 0x0005, len 4
Jun 10 06:45:25 localhost kernel: [  523.250733] libertas scan: got COUNTRY IE
Jun 10 06:45:25 localhost kernel: [  523.250930] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:25 localhost kernel: [  523.251114] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:25 localhost kernel: [  523.251281] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:25 localhost kernel: [  523.251449] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:25 localhost kernel: [  523.251621] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:25 localhost kernel: [  523.251791] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:25 localhost kernel: [  523.251963] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:25 localhost kernel: [  523.252149] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.252317] libertas scan: SCAN_RESP: BSSID 00:12:d9:42:38:43
Jun 10 06:45:25 localhost kernel: [  523.252489] libertas enter: lbs_process_bss()
Jun 10 06:45:25 localhost kernel: [  523.252655] libertas scan: process_bss: BSSID 00:12:d9:3c:b3:63
Jun 10 06:45:25 localhost kernel: [  523.252826] libertas scan: process_bss: RSSI 89
Jun 10 06:45:25 localhost kernel: [  523.252990] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:25 localhost kernel: [  523.253173] libertas scan: process_bss: IE len 106
Jun 10 06:45:25 localhost kernel: [  523.253341] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:25 localhost kernel: [  523.253506] libertas scan: got RATES IE
Jun 10 06:45:25 localhost kernel: [  523.253668] libertas scan: got DS IE, channel 6
Jun 10 06:45:25 localhost kernel: [  523.253834] libertas scan: got IE 0x0005, len 4
Jun 10 06:45:25 localhost kernel: [  523.253997] libertas scan: got COUNTRY IE
Jun 10 06:45:25 localhost kernel: [  523.254173] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:25 localhost kernel: [  523.254339] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:25 localhost kernel: [  523.254506] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:25 localhost kernel: [  523.254674] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:25 localhost kernel: [  523.254848] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:25 localhost kernel: [  523.255036] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:25 localhost kernel: [  523.255206] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:25 localhost kernel: [  523.255377] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.255546] libertas scan: SCAN_RESP: BSSID 00:12:d9:3c:b3:63
Jun 10 06:45:25 localhost kernel: [  523.255716] libertas leave: lbs_ret_80211_scan(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.255895] libertas leave: lbs_process_command_response(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.256085] libertas enter: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.256255] libertas leave: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.256423] libertas thread: 1: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.256631] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:25 localhost kernel: [  523.260817] libertas enter: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:25 localhost kernel: [  523.260993] libertas leave: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:25 localhost kernel: [  523.261187] libertas leave: __lbs_cmd(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.261354] libertas leave: lbs_do_scan(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.261521] libertas scan: scanning 3 of 3 channels
Jun 10 06:45:25 localhost kernel: [  523.261689] libertas enter: lbs_do_scan(bsstype 3, chanlist[].chan 9, chan_count 3)
Jun 10 06:45:25 localhost kernel: [  523.262218] libertas enter: __lbs_cmd()
Jun 10 06:45:25 localhost kernel: [  523.262385] libertas enter: __lbs_cmd_async()
Jun 10 06:45:25 localhost kernel: [  523.262552] libertas enter: lbs_get_cmd_ctrl_node()
Jun 10 06:45:25 localhost kernel: [  523.262718] libertas leave: lbs_get_cmd_ctrl_node()
Jun 10 06:45:25 localhost kernel: [  523.262885] libertas host: PREP_CMD: command 0x0006
Jun 10 06:45:25 localhost kernel: [  523.263077] libertas enter: lbs_queue_cmd()
Jun 10 06:45:25 localhost kernel: [  523.263243] libertas host: QUEUE_CMD: inserted command 0x0006 into cmdpendingq
Jun 10 06:45:25 localhost kernel: [  523.263500] libertas leave: lbs_queue_cmd()
Jun 10 06:45:25 localhost kernel: [  523.263668] libertas leave: __lbs_cmd_async(), ret dd4c4140
Jun 10 06:45:25 localhost kernel: [  523.264178] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:25 localhost kernel: [  523.264355] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.264525] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.264696] libertas enter: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.264865] libertas host: EXEC_NEXT_CMD: sending command 0x0006
Jun 10 06:45:25 localhost kernel: [  523.265059] libertas enter: lbs_submit_command()
Jun 10 06:45:25 localhost kernel: [  523.265228] libertas cmd: DNLD_CMD: command 0x0006, seq 69, size 65
Jun 10 06:45:25 localhost kernel: [  523.265405] libertas enter: if_sdio_host_to_card(type 1, bytes 65)
Jun 10 06:45:25 localhost kernel: [  523.265586] libertas leave: if_sdio_host_to_card(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.265756] libertas leave: lbs_submit_command()
Jun 10 06:45:25 localhost kernel: [  523.265922] libertas leave: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.266107] libertas thread: 1: currenttxskb (null), dnld_sent 2
Jun 10 06:45:25 localhost kernel: [  523.266283] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:25 localhost kernel: [  523.266860] libertas enter: if_sdio_host_to_card_worker()
Jun 10 06:45:25 localhost kernel: [  523.267130] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.267322] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.267505] mmc1: req done (CMD52): 0: 00001008 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.267735] mmc1: starting CMD53 arg 92000048 flags 000001b5
Jun 10 06:45:25 localhost kernel: [  523.267909] mmc1:     blksz 72 blocks 1 flags 00000100 tsac 1000 ms nsac 0
Jun 10 06:45:25 localhost kernel: [  523.268127] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.268310] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000102
Jun 10 06:45:25 localhost kernel: [  523.268498] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.268674] mmc1:     72 bytes transferred: 0
Jun 10 06:45:25 localhost kernel: [  523.269175] libertas leave: if_sdio_host_to_card_worker()
Jun 10 06:45:25 localhost kernel: [  523.269355] mmc1: starting CMD52 arg 00000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.269541] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.269722] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.269907] libertas enter: if_sdio_interrupt()
Jun 10 06:45:25 localhost kernel: [  523.270096] mmc1: starting CMD52 arg 10000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.270284] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.270464] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.270648] libertas sdio: interrupt: 0x2
Jun 10 06:45:25 localhost kernel: [  523.270813] mmc1: starting CMD52 arg 90000afd flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.270998] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.271199] mmc1: req done (CMD52): 0: 000010fd 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.271385] libertas enter: lbs_host_to_card_done()
Jun 10 06:45:25 localhost kernel: [  523.271552] libertas leave: lbs_host_to_card_done()
Jun 10 06:45:25 localhost kernel: [  523.271720] libertas leave: if_sdio_interrupt(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.613048] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000100
Jun 10 06:45:25 localhost kernel: [  523.613359] mmc1: starting CMD52 arg 00000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.613729] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.613949] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.614226] libertas enter: if_sdio_interrupt()
Jun 10 06:45:25 localhost kernel: [  523.614423] mmc1: starting CMD52 arg 10000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.614614] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.614797] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.614984] libertas sdio: interrupt: 0x1
Jun 10 06:45:25 localhost kernel: [  523.615170] mmc1: starting CMD52 arg 90000afe flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.615356] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.615536] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.615722] libertas enter: if_sdio_card_to_host()
Jun 10 06:45:25 localhost kernel: [  523.615893] mmc1: starting CMD52 arg 10006800 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.616096] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.616296] mmc1: req done (CMD52): 0: 00001029 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.616484] mmc1: starting CMD52 arg 10006a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.616670] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.616850] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.617056] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.617243] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.617423] mmc1: req done (CMD52): 0: 0000100a 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.617613] mmc1: starting CMD53 arg 1a000003 flags 000001b5
Jun 10 06:45:25 localhost kernel: [  523.617786] mmc1:     blksz 256 blocks 3 flags 00000200 tsac 1000 ms nsac 0
Jun 10 06:45:25 localhost kernel: [  523.617981] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.618183] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000002
Jun 10 06:45:25 localhost kernel: [  523.618365] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.618539] mmc1:     768 bytes transferred: 0
Jun 10 06:45:25 localhost kernel: [  523.618715] libertas sdio: packet of type 1 and size 553 bytes
Jun 10 06:45:25 localhost kernel: [  523.618886] libertas enter: if_sdio_handle_cmd()
Jun 10 06:45:25 localhost kernel: [  523.619071] libertas enter: lbs_notify_command_response()
Jun 10 06:45:25 localhost kernel: [  523.619246] libertas leave: lbs_notify_command_response()
Jun 10 06:45:25 localhost kernel: [  523.619450] libertas leave: if_sdio_handle_cmd(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.619620] libertas leave: if_sdio_card_to_host(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.619789] libertas leave: if_sdio_interrupt(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.621210] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:25 localhost kernel: [  523.621389] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.621563] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.621736] libertas enter: lbs_process_command_response()
Jun 10 06:45:25 localhost kernel: [  523.621909] libertas cmd: CMD_RESP: response 0x8006, seq 69, size 549
Jun 10 06:45:25 localhost kernel: [  523.622110] libertas enter: lbs_ret_80211_scan()
Jun 10 06:45:25 localhost kernel: [  523.622281] libertas scan: SCAN_RESP: bssdescriptsize 502
Jun 10 06:45:25 localhost kernel: [  523.622448] libertas scan: SCAN_RESP: scan results 4
Jun 10 06:45:25 localhost kernel: [  523.622616] libertas enter: lbs_process_bss()
Jun 10 06:45:25 localhost kernel: [  523.622781] libertas scan: process_bss: BSSID 00:24:14:86:41:b3
Jun 10 06:45:25 localhost kernel: [  523.622954] libertas scan: process_bss: RSSI 50
Jun 10 06:45:25 localhost kernel: [  523.623135] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:25 localhost kernel: [  523.623305] libertas scan: process_bss: IE len 100
Jun 10 06:45:25 localhost kernel: [  523.623476] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:25 localhost kernel: [  523.623644] libertas scan: got RATES IE
Jun 10 06:45:25 localhost kernel: [  523.623806] libertas scan: got DS IE, channel 11
Jun 10 06:45:25 localhost kernel: [  523.623974] libertas scan: got COUNTRY IE
Jun 10 06:45:25 localhost kernel: [  523.624152] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:25 localhost kernel: [  523.624318] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:25 localhost kernel: [  523.624484] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:25 localhost kernel: [  523.624651] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:25 localhost kernel: [  523.624864] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:25 localhost kernel: [  523.625056] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:25 localhost kernel: [  523.625228] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:25 localhost kernel: [  523.625400] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.625570] libertas scan: SCAN_RESP: BSSID 00:24:14:86:41:b3
Jun 10 06:45:25 localhost kernel: [  523.625741] libertas enter: lbs_process_bss()
Jun 10 06:45:25 localhost kernel: [  523.625908] libertas scan: process_bss: BSSID 00:24:14:86:48:13
Jun 10 06:45:25 localhost kernel: [  523.626093] libertas scan: process_bss: RSSI 80
Jun 10 06:45:25 localhost kernel: [  523.626258] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:25 localhost kernel: [  523.626427] libertas scan: process_bss: IE len 106
Jun 10 06:45:25 localhost kernel: [  523.626595] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:25 localhost kernel: [  523.626762] libertas scan: got RATES IE
Jun 10 06:45:25 localhost kernel: [  523.626923] libertas scan: got DS IE, channel 11
Jun 10 06:45:25 localhost kernel: [  523.627103] libertas scan: got IE 0x0005, len 4
Jun 10 06:45:25 localhost kernel: [  523.627268] libertas scan: got COUNTRY IE
Jun 10 06:45:25 localhost kernel: [  523.627430] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:25 localhost kernel: [  523.627597] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:25 localhost kernel: [  523.627764] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:25 localhost kernel: [  523.627931] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:25 localhost kernel: [  523.629777] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:25 localhost kernel: [  523.629949] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:25 localhost kernel: [  523.630137] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:25 localhost kernel: [  523.630307] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.630510] libertas scan: SCAN_RESP: BSSID 00:24:14:86:48:13
Jun 10 06:45:25 localhost kernel: [  523.630682] libertas enter: lbs_process_bss()
Jun 10 06:45:25 localhost kernel: [  523.630847] libertas scan: process_bss: BSSID 00:24:14:86:4e:63
Jun 10 06:45:25 localhost kernel: [  523.631036] libertas scan: process_bss: RSSI 80
Jun 10 06:45:25 localhost kernel: [  523.631201] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:25 localhost kernel: [  523.631371] libertas scan: process_bss: IE len 106
Jun 10 06:45:25 localhost kernel: [  523.631537] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:25 localhost kernel: [  523.631705] libertas scan: got RATES IE
Jun 10 06:45:25 localhost kernel: [  523.631867] libertas scan: got DS IE, channel 11
Jun 10 06:45:25 localhost kernel: [  523.632048] libertas scan: got IE 0x0005, len 4
Jun 10 06:45:25 localhost kernel: [  523.632214] libertas scan: got COUNTRY IE
Jun 10 06:45:25 localhost kernel: [  523.632378] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:25 localhost kernel: [  523.632544] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:25 localhost kernel: [  523.632709] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:25 localhost kernel: [  523.632877] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:25 localhost kernel: [  523.633064] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:25 localhost kernel: [  523.633234] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:25 localhost kernel: [  523.633406] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:25 localhost kernel: [  523.633575] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.633743] libertas scan: SCAN_RESP: BSSID 00:24:14:86:4e:63
Jun 10 06:45:25 localhost kernel: [  523.633913] libertas enter: lbs_process_bss()
Jun 10 06:45:25 localhost kernel: [  523.634091] libertas scan: process_bss: BSSID 00:12:d9:3c:ca:93
Jun 10 06:45:25 localhost kernel: [  523.634264] libertas scan: process_bss: RSSI 85
Jun 10 06:45:25 localhost kernel: [  523.634430] libertas scan: process_bss: capabilities 0x0421
Jun 10 06:45:25 localhost kernel: [  523.634597] libertas scan: process_bss: IE len 106
Jun 10 06:45:25 localhost kernel: [  523.634766] libertas scan: got SSID IE: 'Guest', len 5
Jun 10 06:45:25 localhost kernel: [  523.634933] libertas scan: got RATES IE
Jun 10 06:45:25 localhost kernel: [  523.635109] libertas scan: got DS IE, channel 11
Jun 10 06:45:25 localhost kernel: [  523.635276] libertas scan: got IE 0x0005, len 4
Jun 10 06:45:25 localhost kernel: [  523.635440] libertas scan: got COUNTRY IE
Jun 10 06:45:25 localhost kernel: [  523.635605] libertas scan: got IE 0x002a, len 1
Jun 10 06:45:25 localhost kernel: [  523.635770] libertas scan: got IE 0x0085, len 30
Jun 10 06:45:25 localhost kernel: [  523.635937] libertas scan: got IE 0x0096, len 6
Jun 10 06:45:25 localhost kernel: [  523.636154] libertas scan: got generic IE: 00:40:96:01, len 6
Jun 10 06:45:25 localhost kernel: [  523.636327] libertas scan: got generic IE: 00:40:96:03, len 5
Jun 10 06:45:25 localhost kernel: [  523.636496] libertas scan: got generic IE: 00:40:96:0b, len 5
Jun 10 06:45:25 localhost kernel: [  523.636668] libertas scan: got generic IE: 00:40:96:14, len 5
Jun 10 06:45:25 localhost kernel: [  523.636839] libertas leave: lbs_process_bss(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.637024] libertas scan: SCAN_RESP: BSSID 00:12:d9:3c:ca:93
Jun 10 06:45:25 localhost kernel: [  523.637195] libertas leave: lbs_ret_80211_scan(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.637371] libertas leave: lbs_process_command_response(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.637546] libertas enter: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.637715] libertas leave: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.637884] libertas thread: 1: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.638074] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:25 localhost kernel: [  523.640763] libertas enter: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:25 localhost kernel: [  523.640939] libertas leave: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:25 localhost kernel: [  523.641133] libertas leave: __lbs_cmd(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.641300] libertas leave: lbs_do_scan(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.641916] libertas enter: lbs_get_scan()
Jun 10 06:45:25 localhost kernel: [  523.642170] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.642348] libertas leave: lbs_translate_scan(), start dd414089
Jun 10 06:45:25 localhost kernel: [  523.642518] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.642686] libertas leave: lbs_translate_scan(), start dd414112
Jun 10 06:45:25 localhost kernel: [  523.642857] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.643050] libertas leave: lbs_translate_scan(), start dd41419b
Jun 10 06:45:25 localhost kernel: [  523.643224] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.643391] libertas leave: lbs_translate_scan(), start dd414224
Jun 10 06:45:25 localhost kernel: [  523.643563] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.643731] libertas leave: lbs_translate_scan(), start dd4142ad
Jun 10 06:45:25 localhost kernel: [  523.643903] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.644089] libertas leave: lbs_translate_scan(), start dd414336
Jun 10 06:45:25 localhost kernel: [  523.644263] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.644430] libertas leave: lbs_translate_scan(), start dd4143bf
Jun 10 06:45:25 localhost kernel: [  523.644602] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.644770] libertas leave: lbs_translate_scan(), start dd414448
Jun 10 06:45:25 localhost kernel: [  523.644939] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.645120] libertas leave: lbs_translate_scan(), start dd4144d1
Jun 10 06:45:25 localhost kernel: [  523.645292] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.645459] libertas leave: lbs_translate_scan(), start dd41455a
Jun 10 06:45:25 localhost kernel: [  523.645631] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.645798] libertas leave: lbs_translate_scan(), start dd4145e3
Jun 10 06:45:25 localhost kernel: [  523.645967] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.646150] libertas leave: lbs_translate_scan(), start dd41466c
Jun 10 06:45:25 localhost kernel: [  523.646321] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.646490] libertas leave: lbs_translate_scan(), start dd4146f5
Jun 10 06:45:25 localhost kernel: [  523.646661] libertas enter: lbs_translate_scan()
Jun 10 06:45:25 localhost kernel: [  523.646830] libertas leave: lbs_translate_scan(), start dd41477e
Jun 10 06:45:25 localhost kernel: [  523.647001] libertas leave: lbs_get_scan(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.682362] libertas scan: scan table:
Jun 10 06:45:25 localhost kernel: [  523.682550] libertas scan: 00: BSSID 00:12:d9:3c:bb:83, RSSI 68, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.682733] libertas scan: 01: BSSID 00:24:14:86:4d:d3, RSSI 78, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.682910] libertas scan: 02: BSSID 00:24:14:86:49:53, RSSI 82, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.683118] libertas scan: 03: BSSID 00:24:14:86:37:43, RSSI 68, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.683298] libertas scan: 04: BSSID 00:12:d9:3c:be:23, RSSI 78, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.683477] libertas scan: 05: BSSID 00:12:d9:42:37:d3, RSSI 86, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.683656] libertas scan: 06: BSSID 00:11:bb:ef:87:33, RSSI 83, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.683833] libertas scan: 07: BSSID 00:12:d9:3c:b7:63, RSSI 89, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.684028] libertas scan: 08: BSSID 00:12:d9:42:38:43, RSSI 78, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.684209] libertas scan: 09: BSSID 00:12:d9:3c:b3:63, RSSI 89, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.684387] libertas scan: 10: BSSID 00:24:14:86:41:b3, RSSI 50, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.684566] libertas scan: 11: BSSID 00:24:14:86:48:13, RSSI 80, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.684743] libertas scan: 12: BSSID 00:24:14:86:4e:63, RSSI 80, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.684921] libertas scan: 13: BSSID 00:12:d9:3c:ca:93, RSSI 85, SSID 'Guest'
Jun 10 06:45:25 localhost kernel: [  523.685113] libertas leave: lbs_scan_networks(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.685283] libertas leave: lbs_send_specific_ssid_scan(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.685455] libertas enter: lbs_find_ssid_in_list()
Jun 10 06:45:25 localhost kernel: [  523.686293] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.686467] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.686689] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.686860] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.687055] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.687221] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.687391] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.687558] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.687730] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.687897] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.688085] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.688254] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.688426] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.688592] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.688763] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.688932] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.689122] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.689291] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.689461] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.689627] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.689798] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.689966] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.690150] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.690317] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.690488] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.690656] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.690829] libertas enter: is_network_compatible()
Jun 10 06:45:25 localhost kernel: [  523.690998] libertas leave: is_network_compatible(), matched: 1
Jun 10 06:45:25 localhost kernel: [  523.691186] libertas leave: lbs_find_ssid_in_list(), found_bss dd5bdea8
Jun 10 06:45:25 localhost kernel: [  523.691360] libertas enter: lbs_associate()
Jun 10 06:45:25 localhost kernel: [  523.691525] libertas enter: lbs_prepare_and_send_command()
Jun 10 06:45:25 localhost kernel: [  523.691694] libertas enter: lbs_get_cmd_ctrl_node()
Jun 10 06:45:25 localhost kernel: [  523.691861] libertas leave: lbs_get_cmd_ctrl_node()
Jun 10 06:45:25 localhost kernel: [  523.692044] libertas host: PREP_CMD: command 0x0011
Jun 10 06:45:25 localhost kernel: [  523.692213] libertas enter: lbs_cmd_80211_authenticate()
Jun 10 06:45:25 localhost kernel: [  523.692422] libertas join: AUTH_CMD: BSSID 00:24:14:86:41:b3, auth 0x0
Jun 10 06:45:25 localhost kernel: [  523.692598] libertas leave: lbs_cmd_80211_authenticate(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.692771] libertas enter: lbs_queue_cmd()
Jun 10 06:45:25 localhost kernel: [  523.692936] libertas host: QUEUE_CMD: inserted command 0x0011 into cmdpendingq
Jun 10 06:45:25 localhost kernel: [  523.693212] libertas leave: lbs_queue_cmd()
Jun 10 06:45:25 localhost kernel: [  523.693380] libertas host: PREP_CMD: wait for response
Jun 10 06:45:25 localhost kernel: [  523.706489] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:25 localhost kernel: [  523.706677] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.706852] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.707054] libertas enter: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.707224] libertas host: EXEC_NEXT_CMD: sending command 0x0011
Jun 10 06:45:25 localhost kernel: [  523.707397] libertas enter: lbs_submit_command()
Jun 10 06:45:25 localhost kernel: [  523.707565] libertas cmd: DNLD_CMD: command 0x0011, seq 70, size 25
Jun 10 06:45:25 localhost kernel: [  523.707740] libertas enter: if_sdio_host_to_card(type 1, bytes 25)
Jun 10 06:45:25 localhost kernel: [  523.707923] libertas leave: if_sdio_host_to_card(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.708111] libertas leave: lbs_submit_command()
Jun 10 06:45:25 localhost kernel: [  523.708279] libertas leave: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.708448] libertas thread: 1: currenttxskb (null), dnld_sent 2
Jun 10 06:45:25 localhost kernel: [  523.708624] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:25 localhost kernel: [  523.709323] libertas enter: if_sdio_host_to_card_worker()
Jun 10 06:45:25 localhost kernel: [  523.709505] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.709698] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.709884] mmc1: req done (CMD52): 0: 00001008 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.710253] mmc1: starting CMD53 arg 92000020 flags 000001b5
Jun 10 06:45:25 localhost kernel: [  523.710428] mmc1:     blksz 32 blocks 1 flags 00000100 tsac 1000 ms nsac 0
Jun 10 06:45:25 localhost kernel: [  523.710627] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.710807] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000102
Jun 10 06:45:25 localhost kernel: [  523.710997] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.711195] mmc1:     32 bytes transferred: 0
Jun 10 06:45:25 localhost kernel: [  523.711599] libertas leave: if_sdio_host_to_card_worker()
Jun 10 06:45:25 localhost kernel: [  523.711781] mmc1: starting CMD52 arg 00000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.711969] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.712174] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.712361] libertas enter: if_sdio_interrupt()
Jun 10 06:45:25 localhost kernel: [  523.712529] mmc1: starting CMD52 arg 10000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.712714] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.712898] mmc1: req done (CMD52): 0: 00001003 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.713102] libertas sdio: interrupt: 0x3
Jun 10 06:45:25 localhost kernel: [  523.713269] mmc1: starting CMD52 arg 90000afc flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.713453] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.713635] mmc1: req done (CMD52): 0: 000010fc 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.713818] libertas enter: lbs_host_to_card_done()
Jun 10 06:45:25 localhost kernel: [  523.713987] libertas leave: lbs_host_to_card_done()
Jun 10 06:45:25 localhost kernel: [  523.715854] libertas enter: if_sdio_card_to_host()
Jun 10 06:45:25 localhost kernel: [  523.716044] mmc1: starting CMD52 arg 10006800 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.716230] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.716413] mmc1: req done (CMD52): 0: 0000101d 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.716602] mmc1: starting CMD52 arg 10006a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.716788] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.716970] mmc1: req done (CMD52): 0: 00001000 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.717176] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.717362] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.717546] mmc1: req done (CMD52): 0: 0000100a 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.717733] mmc1: starting CMD53 arg 12000020 flags 000001b5
Jun 10 06:45:25 localhost kernel: [  523.717907] mmc1:     blksz 32 blocks 1 flags 00000200 tsac 1000 ms nsac 0
Jun 10 06:45:25 localhost kernel: [  523.718119] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.718301] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000002
Jun 10 06:45:25 localhost kernel: [  523.718483] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.718659] mmc1:     32 bytes transferred: 0
Jun 10 06:45:25 localhost kernel: [  523.718833] libertas sdio: packet of type 1 and size 29 bytes
Jun 10 06:45:25 localhost kernel: [  523.719023] libertas enter: if_sdio_handle_cmd()
Jun 10 06:45:25 localhost kernel: [  523.719188] libertas enter: lbs_notify_command_response()
Jun 10 06:45:25 localhost kernel: [  523.719359] libertas leave: lbs_notify_command_response()
Jun 10 06:45:25 localhost kernel: [  523.719528] libertas leave: if_sdio_handle_cmd(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.719697] libertas leave: if_sdio_card_to_host(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.719866] libertas leave: if_sdio_interrupt(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.721233] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:25 localhost kernel: [  523.721410] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.721581] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.721754] libertas enter: lbs_process_command_response()
Jun 10 06:45:25 localhost kernel: [  523.721924] libertas cmd: CMD_RESP: response 0x8011, seq 70, size 25
Jun 10 06:45:25 localhost kernel: [  523.722124] libertas enter: handle_cmd_response()
Jun 10 06:45:25 localhost kernel: [  523.722290] libertas leave: handle_cmd_response()
Jun 10 06:45:25 localhost kernel: [  523.722460] libertas enter: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:25 localhost kernel: [  523.722632] libertas leave: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:25 localhost kernel: [  523.722801] libertas leave: lbs_process_command_response(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.722973] libertas enter: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.723157] libertas leave: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.723325] libertas thread: 1: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.723500] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:25 localhost kernel: [  523.724137] libertas leave: lbs_prepare_and_send_command(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.724315] libertas enter: lbs_set_radio()
Jun 10 06:45:25 localhost kernel: [  523.724481] libertas cmd: RADIO_CONTROL: radio ON, preamble 2
Jun 10 06:45:25 localhost kernel: [  523.724651] libertas enter: __lbs_cmd()
Jun 10 06:45:25 localhost kernel: [  523.724813] libertas enter: __lbs_cmd_async()
Jun 10 06:45:25 localhost kernel: [  523.724978] libertas enter: lbs_get_cmd_ctrl_node()
Jun 10 06:45:25 localhost kernel: [  523.725168] libertas leave: lbs_get_cmd_ctrl_node()
Jun 10 06:45:25 localhost kernel: [  523.725336] libertas host: PREP_CMD: command 0x001c
Jun 10 06:45:25 localhost kernel: [  523.725503] libertas enter: lbs_queue_cmd()
Jun 10 06:45:25 localhost kernel: [  523.725667] libertas host: QUEUE_CMD: inserted command 0x001c into cmdpendingq
Jun 10 06:45:25 localhost kernel: [  523.725925] libertas leave: lbs_queue_cmd()
Jun 10 06:45:25 localhost kernel: [  523.726153] libertas leave: __lbs_cmd_async(), ret dd4c4000
Jun 10 06:45:25 localhost kernel: [  523.726686] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:25 localhost kernel: [  523.726863] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.727062] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.727231] libertas enter: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.727400] libertas host: EXEC_NEXT_CMD: sending command 0x001c
Jun 10 06:45:25 localhost kernel: [  523.727571] libertas enter: lbs_submit_command()
Jun 10 06:45:25 localhost kernel: [  523.727741] libertas cmd: DNLD_CMD: command 0x001c, seq 71, size 12
Jun 10 06:45:25 localhost kernel: [  523.727915] libertas enter: if_sdio_host_to_card(type 1, bytes 12)
Jun 10 06:45:25 localhost kernel: [  523.728107] libertas leave: if_sdio_host_to_card(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.728278] libertas leave: lbs_submit_command()
Jun 10 06:45:25 localhost kernel: [  523.728443] libertas leave: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.728612] libertas thread: 1: currenttxskb (null), dnld_sent 2
Jun 10 06:45:25 localhost kernel: [  523.728786] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:25 localhost kernel: [  523.729391] libertas enter: if_sdio_host_to_card_worker()
Jun 10 06:45:25 localhost kernel: [  523.729567] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.729752] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.729936] mmc1: req done (CMD52): 0: 00001008 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.730291] mmc1: starting CMD53 arg 92000010 flags 000001b5
Jun 10 06:45:25 localhost kernel: [  523.730466] mmc1:     blksz 16 blocks 1 flags 00000100 tsac 1000 ms nsac 0
Jun 10 06:45:25 localhost kernel: [  523.730660] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000003
Jun 10 06:45:25 localhost kernel: [  523.730844] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.731045] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000100
Jun 10 06:45:25 localhost kernel: [  523.731227] mmc1:     16 bytes transferred: 0
Jun 10 06:45:25 localhost kernel: [  523.731659] libertas leave: if_sdio_host_to_card_worker()
Jun 10 06:45:25 localhost kernel: [  523.731838] mmc1: starting CMD52 arg 00000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.732048] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.732231] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.732416] libertas enter: if_sdio_interrupt()
Jun 10 06:45:25 localhost kernel: [  523.732584] mmc1: starting CMD52 arg 10000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.732770] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.732950] mmc1: req done (CMD52): 0: 00001003 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.733155] libertas sdio: interrupt: 0x3
Jun 10 06:45:25 localhost kernel: [  523.733322] mmc1: starting CMD52 arg 90000afc flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.733508] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.733688] mmc1: req done (CMD52): 0: 000010fc 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.733871] libertas enter: lbs_host_to_card_done()
Jun 10 06:45:25 localhost kernel: [  523.734057] libertas leave: lbs_host_to_card_done()
Jun 10 06:45:25 localhost kernel: [  523.734224] libertas enter: if_sdio_card_to_host()
Jun 10 06:45:25 localhost kernel: [  523.734394] mmc1: starting CMD52 arg 10006800 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.734580] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.734762] mmc1: req done (CMD52): 0: 00001010 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.734945] mmc1: starting CMD52 arg 10006a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.735150] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.735332] mmc1: req done (CMD52): 0: 00001000 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.735519] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.735706] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.735886] mmc1: req done (CMD52): 0: 0000100a 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.736092] mmc1: starting CMD53 arg 12000010 flags 000001b5
Jun 10 06:45:25 localhost kernel: [  523.736269] mmc1:     blksz 16 blocks 1 flags 00000200 tsac 1000 ms nsac 0
Jun 10 06:45:25 localhost kernel: [  523.736463] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000003
Jun 10 06:45:25 localhost kernel: [  523.736645] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.736822] mmc1:     16 bytes transferred: 0
Jun 10 06:45:25 localhost kernel: [  523.736995] libertas sdio: packet of type 1 and size 16 bytes
Jun 10 06:45:25 localhost kernel: [  523.737182] libertas enter: if_sdio_handle_cmd()
Jun 10 06:45:25 localhost kernel: [  523.737348] libertas enter: lbs_notify_command_response()
Jun 10 06:45:25 localhost kernel: [  523.737519] libertas leave: lbs_notify_command_response()
Jun 10 06:45:25 localhost kernel: [  523.737733] libertas leave: if_sdio_handle_cmd(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.737902] libertas leave: if_sdio_card_to_host(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.738090] libertas leave: if_sdio_interrupt(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.739355] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:25 localhost kernel: [  523.739532] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.739702] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.739874] libertas enter: lbs_process_command_response()
Jun 10 06:45:25 localhost kernel: [  523.740219] libertas cmd: CMD_RESP: response 0x801c, seq 71, size 12
Jun 10 06:45:25 localhost kernel: [  523.740403] libertas leave: lbs_process_command_response(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.740575] libertas enter: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.740744] libertas leave: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.740912] libertas thread: 1: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.741108] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:25 localhost kernel: [  523.741652] libertas enter: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:25 localhost kernel: [  523.741827] libertas leave: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:25 localhost kernel: [  523.741995] libertas leave: __lbs_cmd(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.742185] libertas leave: lbs_set_radio(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.742352] libertas enter: lbs_prepare_and_send_command()
Jun 10 06:45:25 localhost kernel: [  523.742519] libertas enter: lbs_get_cmd_ctrl_node()
Jun 10 06:45:25 localhost kernel: [  523.742684] libertas leave: lbs_get_cmd_ctrl_node()
Jun 10 06:45:25 localhost kernel: [  523.742849] libertas host: PREP_CMD: command 0x0050
Jun 10 06:45:25 localhost kernel: [  523.743069] libertas enter: lbs_cmd_80211_associate()
Jun 10 06:45:25 localhost kernel: [  523.743244] libertas join: TX data rate 0x00
Jun 10 06:45:25 localhost kernel: [  523.743408] libertas assoc: ASSOC_CMD: num rates 8
Jun 10 06:45:25 localhost kernel: [  523.743578] libertas assoc: ASSOC_CMD: capability 0x0421
Jun 10 06:45:25 localhost kernel: [  523.743746] libertas leave: lbs_cmd_80211_associate(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.743917] libertas enter: lbs_queue_cmd()
Jun 10 06:45:25 localhost kernel: [  523.744116] libertas host: QUEUE_CMD: inserted command 0x0050 into cmdpendingq
Jun 10 06:45:25 localhost kernel: [  523.744373] libertas leave: lbs_queue_cmd()
Jun 10 06:45:25 localhost kernel: [  523.744540] libertas host: PREP_CMD: wait for response
Jun 10 06:45:25 localhost kernel: [  523.745268] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:25 localhost kernel: [  523.745444] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.745615] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:25 localhost kernel: [  523.745787] libertas enter: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.745955] libertas host: EXEC_NEXT_CMD: sending command 0x0050
Jun 10 06:45:25 localhost kernel: [  523.746152] libertas enter: lbs_submit_command()
Jun 10 06:45:25 localhost kernel: [  523.746319] libertas cmd: DNLD_CMD: command 0x0050, seq 72, size 57
Jun 10 06:45:25 localhost kernel: [  523.746494] libertas enter: if_sdio_host_to_card(type 1, bytes 57)
Jun 10 06:45:25 localhost kernel: [  523.746669] libertas leave: if_sdio_host_to_card(), ret 0
Jun 10 06:45:25 localhost kernel: [  523.746838] libertas leave: lbs_submit_command()
Jun 10 06:45:25 localhost kernel: [  523.747020] libertas leave: lbs_execute_next_command()
Jun 10 06:45:25 localhost kernel: [  523.747188] libertas thread: 1: currenttxskb (null), dnld_sent 2
Jun 10 06:45:25 localhost kernel: [  523.747359] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:25 localhost kernel: [  523.747974] libertas enter: if_sdio_host_to_card_worker()
Jun 10 06:45:25 localhost kernel: [  523.748234] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.748424] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.748647] mmc1: req done (CMD52): 0: 00001008 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.748838] mmc1: starting CMD53 arg 92000040 flags 000001b5
Jun 10 06:45:25 localhost kernel: [  523.749035] mmc1:     blksz 64 blocks 1 flags 00000100 tsac 1000 ms nsac 0
Jun 10 06:45:25 localhost kernel: [  523.749231] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.749397] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000102
Jun 10 06:45:25 localhost kernel: [  523.749569] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.749731] mmc1:     64 bytes transferred: 0
Jun 10 06:45:25 localhost kernel: [  523.750245] libertas leave: if_sdio_host_to_card_worker()
Jun 10 06:45:25 localhost kernel: [  523.750413] mmc1: starting CMD52 arg 00000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.750587] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.750755] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.750926] libertas enter: if_sdio_interrupt()
Jun 10 06:45:25 localhost kernel: [  523.751104] mmc1: starting CMD52 arg 10000a00 flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.751277] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.751444] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.751615] libertas sdio: interrupt: 0x2
Jun 10 06:45:25 localhost kernel: [  523.751769] mmc1: starting CMD52 arg 90000afd flags 00000195
Jun 10 06:45:25 localhost kernel: [  523.751939] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:25 localhost kernel: [  523.752125] mmc1: req done (CMD52): 0: 000010fd 00000000 00000000 00000000
Jun 10 06:45:25 localhost kernel: [  523.752298] libertas enter: lbs_host_to_card_done()
Jun 10 06:45:25 localhost kernel: [  523.752453] libertas leave: lbs_host_to_card_done()
Jun 10 06:45:25 localhost kernel: [  523.752607] libertas leave: if_sdio_interrupt(), ret 0
Jun 10 06:45:26 localhost kernel: [  524.286913] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000100
Jun 10 06:45:26 localhost kernel: [  524.287198] mmc1: starting CMD52 arg 00000a00 flags 00000195
Jun 10 06:45:26 localhost kernel: [  524.287396] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:26 localhost kernel: [  524.287572] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
Jun 10 06:45:26 localhost kernel: [  524.287750] libertas enter: if_sdio_interrupt()
Jun 10 06:45:26 localhost kernel: [  524.289450] mmc1: starting CMD52 arg 10000a00 flags 00000195
Jun 10 06:45:26 localhost kernel: [  524.289643] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:26 localhost kernel: [  524.289812] mmc1: req done (CMD52): 0: 00001001 00000000 00000000 00000000
Jun 10 06:45:26 localhost kernel: [  524.289988] libertas sdio: interrupt: 0x1
Jun 10 06:45:26 localhost kernel: [  524.290161] mmc1: starting CMD52 arg 90000afe flags 00000195
Jun 10 06:45:26 localhost kernel: [  524.290335] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:26 localhost kernel: [  524.290502] mmc1: req done (CMD52): 0: 000010fe 00000000 00000000 00000000
Jun 10 06:45:26 localhost kernel: [  524.290676] libertas enter: if_sdio_card_to_host()
Jun 10 06:45:26 localhost kernel: [  524.290833] mmc1: starting CMD52 arg 10006800 flags 00000195
Jun 10 06:45:26 localhost kernel: [  524.291024] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:26 localhost kernel: [  524.291198] mmc1: req done (CMD52): 0: 00001012 00000000 00000000 00000000
Jun 10 06:45:26 localhost kernel: [  524.291372] mmc1: starting CMD52 arg 10006a00 flags 00000195
Jun 10 06:45:26 localhost kernel: [  524.291545] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:26 localhost kernel: [  524.291711] mmc1: req done (CMD52): 0: 00001000 00000000 00000000 00000000
Jun 10 06:45:26 localhost kernel: [  524.291883] mmc1: starting CMD52 arg 10004000 flags 00000195
Jun 10 06:45:26 localhost kernel: [  524.292074] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
Jun 10 06:45:26 localhost kernel: [  524.292242] mmc1: req done (CMD52): 0: 0000100a 00000000 00000000 00000000
Jun 10 06:45:26 localhost kernel: [  524.292420] mmc1: starting CMD53 arg 12000014 flags 000001b5
Jun 10 06:45:26 localhost kernel: [  524.292580] mmc1:     blksz 20 blocks 1 flags 00000200 tsac 1000 ms nsac 0
Jun 10 06:45:26 localhost kernel: [  524.292762] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000003
Jun 10 06:45:26 localhost kernel: [  524.292930] mmc1: req done (CMD53): 0: 00002000 00000000 00000000 00000000
Jun 10 06:45:26 localhost kernel: [  524.293110] mmc1:     20 bytes transferred: 0
Jun 10 06:45:26 localhost kernel: [  524.293274] libertas sdio: packet of type 1 and size 18 bytes
Jun 10 06:45:26 localhost kernel: [  524.293432] libertas enter: if_sdio_handle_cmd()
Jun 10 06:45:26 localhost kernel: [  524.293587] libertas enter: lbs_notify_command_response()
Jun 10 06:45:26 localhost kernel: [  524.293747] libertas leave: lbs_notify_command_response()
Jun 10 06:45:26 localhost kernel: [  524.293904] libertas leave: if_sdio_handle_cmd(), ret 0
Jun 10 06:45:26 localhost kernel: [  524.294076] libertas leave: if_sdio_card_to_host(), ret 0
Jun 10 06:45:26 localhost kernel: [  524.294233] libertas leave: if_sdio_interrupt(), ret 0
Jun 10 06:45:26 localhost kernel: [  524.295601] libertas thread: 2: currenttxskb (null), dnld_send 0
Jun 10 06:45:26 localhost kernel: [  524.295772] libertas thread: 3: currenttxskb (null), dnld_sent 0
Jun 10 06:45:26 localhost kernel: [  524.295932] libertas thread: 4: currenttxskb (null), dnld_sent 0
Jun 10 06:45:26 localhost kernel: [  524.296117] libertas enter: lbs_process_command_response()
Jun 10 06:45:26 localhost kernel: [  524.296425] libertas cmd: CMD_RESP: response 0x8012, seq 72, size 14
Jun 10 06:45:26 localhost kernel: [  524.296591] libertas enter: handle_cmd_response()
Jun 10 06:45:26 localhost kernel: [  524.296745] libertas enter: lbs_ret_80211_associate()
Jun 10 06:45:26 localhost kernel: [  524.296901] libertas assoc: ASSOC_RESP: internal timer expired while waiting for the AP
Jun 10 06:45:26 localhost kernel: [  524.297166] libertas leave: lbs_ret_80211_associate(), ret -1
Jun 10 06:45:26 localhost kernel: [  524.297324] libertas leave: handle_cmd_response()
Jun 10 06:45:26 localhost kernel: [  524.297483] libertas enter: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:26 localhost kernel: [  524.297642] libertas leave: __lbs_cleanup_and_insert_cmd()
Jun 10 06:45:26 localhost kernel: [  524.297800] libertas leave: lbs_process_command_response(), ret -1
Jun 10 06:45:26 localhost kernel: [  524.297961] libertas enter: lbs_execute_next_command()
Jun 10 06:45:26 localhost kernel: [  524.298132] libertas leave: lbs_execute_next_command()
Jun 10 06:45:26 localhost kernel: [  524.298289] libertas thread: 1: currenttxskb (null), dnld_sent 0
Jun 10 06:45:26 localhost kernel: [  524.298449] libertas thread: sleeping, connect_status 1, psmode 0, psstate 0
Jun 10 06:45:26 localhost kernel: [  524.299041] libertas leave: lbs_prepare_and_send_command(), ret 0
Jun 10 06:45:26 localhost kernel: [  524.299205] libertas leave: lbs_associate(), ret 0
Jun 10 06:45:26 localhost kernel: [  524.299359] libertas leave: assoc_helper_essid(), ret 0
Jun 10 06:45:26 localhost kernel: [  524.299516] libertas leave: assoc_helper_associate(), ret 0
Jun 10 06:45:26 localhost kernel: [  524.299674] libertas assoc: ASSOC: association unsuccessful, not connected
Jun 10 06:45:26 localhost kernel: [  524.299837] libertas assoc: ASSOC: reconfiguration attempt unsuccessful: -1
Jun 10 06:45:26 localhost kernel: [  524.300001] libertas leave: lbs_association_worker()

Brian Wood
Intel Corporation
UMG Platform Software Group (UPSG)
brian.j.wood at intel.com



From andrey at cozybit.com  Thu Jun 11 19:23:45 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Thu, 11 Jun 2009 16:23:45 -0700
Subject: [PATCH] libertas: Fix IEEE PS mode in GSPI driver
Message-ID: <1244762625-29618-1-git-send-email-andrey@cozybit.com>

The card firmware does not set the Command Download Ready interrupt bit when
IEEE PS mode is enabled, preventing the driver from sending commands (such as
the command to exit IEEE PS mode) since there is no indication that the card is
ready to accept commands.  

This patch changes the driver to use the TX Download Ready bit, which is 
normally set along with Command Download Ready and does get set in IEEE PS 
mode.  It also moves the card event interrupt acknowledgement to the
interrupt handler and acknowledges all interrupts that we handle as well.

Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
Signed-off-by: Javier Cardona <javier at cozybit.com>
---
 drivers/net/wireless/libertas/if_spi.c |   48 ++++++++++++++++++--------------
 1 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index f8c2898..c32c08d 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -820,10 +820,6 @@ static void if_spi_e2h(struct if_spi_card *card)
 	if (err)
 		goto out;
 
-	/* re-enable the card event interrupt */
-	spu_write_u16(card, IF_SPI_HOST_INT_STATUS_REG,
-			~IF_SPI_HICU_CARD_EVENT);
-
 	/* generate a card interrupt */
 	spu_write_u16(card, IF_SPI_CARD_INT_CAUSE_REG, IF_SPI_CIC_HOST_EVENT);
 
@@ -867,23 +863,23 @@ static int lbs_spi_thread(void *data)
 			goto err;
 		}
 
-		if (hiStatus & IF_SPI_HIST_CMD_UPLOAD_RDY)
+		if (hiStatus & IF_SPI_HIST_CMD_UPLOAD_RDY) {
+			spu_write_u16(card, IF_SPI_HOST_INT_STATUS_REG,
+					~(IF_SPI_HIST_CMD_UPLOAD_RDY));
 			err = if_spi_c2h_cmd(card);
 			if (err)
 				goto err;
-		if (hiStatus & IF_SPI_HIST_RX_UPLOAD_RDY)
+		}
+		if (hiStatus & IF_SPI_HIST_RX_UPLOAD_RDY) {
+			spu_write_u16(card, IF_SPI_HOST_INT_STATUS_REG,
+					~(IF_SPI_HIST_RX_UPLOAD_RDY));
 			err = if_spi_c2h_data(card);
 			if (err)
 				goto err;
-		if (hiStatus & IF_SPI_HIST_CMD_DOWNLOAD_RDY) {
-			/* This means two things. First of all,
-			 * if there was a previous command sent, the card has
-			 * successfully received it.
-			 * Secondly, it is now ready to download another
-			 * command.
-			 */
-			lbs_host_to_card_done(card->priv);
+		}
 
+		if (hiStatus & IF_SPI_HIST_TX_DOWNLOAD_RDY ||
+		    hiStatus & IF_SPI_HIST_CMD_DOWNLOAD_RDY) {
 			/* Do we have any command packets from the host to
 			 * send? */
 			packet = NULL;
@@ -895,10 +891,12 @@ static int lbs_spi_thread(void *data)
 			}
 			spin_unlock_irqrestore(&card->buffer_lock, flags);
 
-			if (packet)
-				if_spi_h2c(card, packet, MVMS_CMD);
-		}
-		if (hiStatus & IF_SPI_HIST_TX_DOWNLOAD_RDY) {
+			if (packet) {
+				spu_write_u16(card, IF_SPI_HOST_INT_STATUS_REG,
+					~(IF_SPI_HIST_CMD_DOWNLOAD_RDY));
+				if_spi_h2c(card, packet, MVMS_CMD);
+			}
+
 			/* Do we have any data packets from the host to
 			 * send? */
 			packet = NULL;
@@ -910,12 +908,20 @@ static int lbs_spi_thread(void *data)
 			}
 			spin_unlock_irqrestore(&card->buffer_lock, flags);
 
-			if (packet)
+			if (packet) {
+				spu_write_u16(card, IF_SPI_HOST_INT_STATUS_REG,
+						~(IF_SPI_HIST_TX_DOWNLOAD_RDY));
 				if_spi_h2c(card, packet, MVMS_DAT);
+			}
+
+			lbs_host_to_card_done(card->priv);
 		}
-		if (hiStatus & IF_SPI_HIST_CARD_EVENT)
-			if_spi_e2h(card);
 
+		if (hiStatus & IF_SPI_HIST_CARD_EVENT) {
+			spu_write_u16(card, IF_SPI_HOST_INT_STATUS_REG,
+					~(IF_SPI_HIST_CARD_EVENT));
+			if_spi_e2h(card);
+		}
 err:
 		if (err)
 			lbs_pr_err("%s: got error %d\n", __func__, err);
-- 
1.5.6.3



From bigeasy at linutronix.de  Fri Jun 12 05:47:10 2009
From: bigeasy at linutronix.de (Sebastian Andrzej Siewior)
Date: Fri, 12 Jun 2009 11:47:10 +0200
Subject: [PATCH] net/libertas: don't recursive spin lock in if_spi_e2h()
Message-ID: <20090612094710.GA28098@www.tglx.de>

|BUG: spinlock recursion on CPU#0, lbs_spi_thread/1030
| lock: dee9a1bc, .magic: dead4ead, .owner: lbs_spi_thread/1030, .owner_cpu: 0
|Call Trace:
|[deec3eb0] [c0007220] show_stack+0x4c/0x15c (unreliable)
|[deec3ef0] [c0187720] spin_bug+0x9c/0xb0
|[deec3f10] [c0187890] _raw_spin_lock+0x54/0x148
|[deec3f40] [c02d260c] _spin_lock_irqsave+0x2c/0x44
|[deec3f60] [e8671800] lbs_queue_event+0x7c/0x130 [libertas]
|[deec3f80] [e8725f04] lbs_spi_thread+0x538/0x58c [libertas_spi]
|[deec3fe0] [c004f270] kthread+0x4c/0x88
|[deec3ff0] [c000f33c] kernel_thread+0x4c/0x68

if_spi_e2h() is grabbing ->driver_lock just while calling
lbs_queue_event() which is grabbing the same lock.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
 drivers/net/wireless/libertas/if_spi.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index f8c2898..b3be25b 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -827,10 +827,7 @@ static void if_spi_e2h(struct if_spi_card *card)
 	/* generate a card interrupt */
 	spu_write_u16(card, IF_SPI_CARD_INT_CAUSE_REG, IF_SPI_CIC_HOST_EVENT);
 
-	spin_lock_irqsave(&priv->driver_lock, flags);
 	lbs_queue_event(priv, cause & 0xff);
-	spin_unlock_irqrestore(&priv->driver_lock, flags);
-
 out:
 	if (err)
 		lbs_pr_err("%s: error %d\n", __func__, err);
-- 
1.6.0.6



From profits at combustions.com  Fri Jun 12 10:13:31 2009
From: profits at combustions.com (Hann Teeples)
Date: Fri, 12 Jun 2009 14:13:31 +0000
Subject: Kiss, cook, dance ofr Guinness World Records Day
Message-ID: <4A3261BD_2483483@combustions.com>

Hii, my photo attached
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arrows.png
Type: image/png
Size: 12743 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libertas-dev/attachments/20090612/b068e399/attachment.png>

From 4-hoff at yahoo.com  Fri Jun 12 13:13:20 2009
From: 4-hoff at yahoo.com (House J Dorothea)
Date: 12 Jun 2009 13:13:20 -0400
Subject: D entists Listing in the USA
Message-ID: <HUBBLE2J1OwOSzZBSG80000123f@hubble.interflex.net>

Just Released: Listing of Dentists  in the US

**> 164,702 |>entists with City, State, Zip
**> 158,604 Postal Addresses
**> 163,283 Tel Nos
**> 77,564 Fax Numbers
**> 45,098 Emails

Until June 12th we have lowered the price to $291 - a $100 savings!

Please reply by email to Farmer at emedicalindex.com for more details

for stopping this email in future send us an email here delrem at emedicalindex.com




From dongas86 at gmail.com  Fri Jun 12 14:36:47 2009
From: dongas86 at gmail.com (Dongas)
Date: Sat, 13 Jun 2009 02:36:47 +0800
Subject: Libetas can not reload modules
Message-ID: <60ce8d250906121136g363ce5bfra0358ca90a89ea63@mail.gmail.com>

Dear ALL,

The issue i encounterred is that libertas modules can not be reloaed.
(It works well when i first insmod them)
I want to rmmod them and do the re-insmod, but the error message is
shown as follows:
# insmod libertas_sdio.ko
libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
??
libertas: failed to load helper firmware
libertas leave: if_sdio_prog_helper(), ret -110

After digging in the code, i found that the libertas driver will check
IF_SDIO_IO_RDY and IF_SDIO_DL_RDY bit in IF_SDIO_STATUS register for
the firmware downloading(CMD53 write) operation.
However, the SDIO status read back of mine card indicated that the
card IF_SDIO_DL_RDY bit was alway not set during the module reload
operation.Then the timeout happened with '-ETIMEDOUT' returned.

Is there any body know why?

BTW, i saw some code in if_sdio_prog_firmware funtion as follows.
---------------------------------------------------------------------------------------------------
	if (scratch == IF_SDIO_FIRMWARE_OK) {
		lbs_deb_sdio("firmware already loaded\n");
		goto success;
	}
-----------------------------------------------------------------------------------------------------
It seems the driver doesn't need to re-load the firmware if the
firmware is already loaded, right?
In my case, during the first insmod of libertas modules, the driver
works well and i can assume the firmware is already loaded.
But when i reload modules, why the driver still needs to do firmware
reloading rather than skip it as above code said?

(My card is based on Marvell 8686 chipset and kernel is 2.6.29)

Thanks

Regards
Dongas


From bigeasy at linutronix.de  Fri Jun 12 15:37:31 2009
From: bigeasy at linutronix.de (Sebastian Andrzej Siewior)
Date: Fri, 12 Jun 2009 21:37:31 +0200
Subject: [PATCH v2] net/libertas: don't recursive spin lock in if_spi_e2h()
In-Reply-To: <20090612094710.GA28098@www.tglx.de>
References: <20090612094710.GA28098@www.tglx.de>
Message-ID: <20090612193731.GA21528@Chamillionaire.breakpoint.cc>

|BUG: spinlock recursion on CPU#0, lbs_spi_thread/1030
| lock: dee9a1bc, .magic: dead4ead, .owner: lbs_spi_thread/1030, .owner_cpu: 0
|Call Trace:
|[deec3eb0] [c0007220] show_stack+0x4c/0x15c (unreliable)
|[deec3ef0] [c0187720] spin_bug+0x9c/0xb0
|[deec3f10] [c0187890] _raw_spin_lock+0x54/0x148
|[deec3f40] [c02d260c] _spin_lock_irqsave+0x2c/0x44
|[deec3f60] [e8671800] lbs_queue_event+0x7c/0x130 [libertas]
|[deec3f80] [e8725f04] lbs_spi_thread+0x538/0x58c [libertas_spi]
|[deec3fe0] [c004f270] kthread+0x4c/0x88
|[deec3ff0] [c000f33c] kernel_thread+0x4c/0x68

if_spi_e2h() is grabbing ->driver_lock just while calling
lbs_queue_event() which is grabbing the same lock.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
v1..v2: remove flags

 drivers/net/wireless/libertas/if_spi.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index f8c2898..583162c 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -812,7 +812,6 @@ out:
 static void if_spi_e2h(struct if_spi_card *card)
 {
 	int err = 0;
-	unsigned long flags;
 	u32 cause;
 	struct lbs_private *priv = card->priv;
 
@@ -827,10 +826,7 @@ static void if_spi_e2h(struct if_spi_card *card)
 	/* generate a card interrupt */
 	spu_write_u16(card, IF_SPI_CARD_INT_CAUSE_REG, IF_SPI_CIC_HOST_EVENT);
 
-	spin_lock_irqsave(&priv->driver_lock, flags);
 	lbs_queue_event(priv, cause & 0xff);
-	spin_unlock_irqrestore(&priv->driver_lock, flags);
-
 out:
 	if (err)
 		lbs_pr_err("%s: error %d\n", __func__, err);
-- 
1.6.0.6



From andrey at cozybit.com  Fri Jun 12 15:45:36 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Fri, 12 Jun 2009 12:45:36 -0700
Subject: [PATCH v2] libertas: fix IEEE PS mode in GSPI driver
In-Reply-To: <1244762625-29618-1-git-send-email-andrey@cozybit.com>
References: <1244762625-29618-1-git-send-email-andrey@cozybit.com>
Message-ID: <1244835936-17188-1-git-send-email-andrey@cozybit.com>

The card firmware does not set the Command Download Ready interrupt bit
when IEEE PS mode is enabled, preventing the driver from sending
commands (such as the command to exit IEEE PS mode) since there is no
indication that the card is ready to accept commands.

This patch works around the problem by using the the TX Download Ready
bit in place of the Command Download Ready Bit while in IEEE PS mode.
TX Download Ready is set in IEEE PS mode.

Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
Signed-off-by: Javier Cardona <javier at cozybit.com>
---
 drivers/net/wireless/libertas/if_spi.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index f8c2898..dc2a1f6 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -875,7 +875,12 @@ static int lbs_spi_thread(void *data)
 			err = if_spi_c2h_data(card);
 			if (err)
 				goto err;
-		if (hiStatus & IF_SPI_HIST_CMD_DOWNLOAD_RDY) {
+
+		/* workaround: in PS mode, the card does not set the Command
+		 * Download Ready bit, but it sets TX Download Ready. */
+		if (hiStatus & IF_SPI_HIST_CMD_DOWNLOAD_RDY ||
+		   (card->priv->psstate != PS_STATE_FULL_POWER &&
+		    (hiStatus & IF_SPI_HIST_TX_DOWNLOAD_RDY))) {
 			/* This means two things. First of all,
 			 * if there was a previous command sent, the card has
 			 * successfully received it.
-- 
1.5.6.3



From jic23 at cam.ac.uk  Fri Jun 12 15:50:14 2009
From: jic23 at cam.ac.uk (Jonathan Cameron)
Date: Fri, 12 Jun 2009 19:50:14 +0000
Subject: Libetas can not reload modules
In-Reply-To: <60ce8d250906121136g363ce5bfra0358ca90a89ea63@mail.gmail.com>
References: <60ce8d250906121136g363ce5bfra0358ca90a89ea63@mail.gmail.com>
Message-ID: <4A32B176.4000305@cam.ac.uk>

Dongas wrote:
> Dear ALL,
> 
> The issue i encounterred is that libertas modules can not be reloaed.
> (It works well when i first insmod them)
> I want to rmmod them and do the re-insmod, but the error message is
> shown as follows:
> # insmod libertas_sdio.ko
> libertas_sdio: Libertas SDIO driver
> libertas_sdio: Copyright Pierre Ossman
> ??
> libertas: failed to load helper firmware
> libertas leave: if_sdio_prog_helper(), ret -110
> 
> After digging in the code, i found that the libertas driver will check
> IF_SDIO_IO_RDY and IF_SDIO_DL_RDY bit in IF_SDIO_STATUS register for
> the firmware downloading(CMD53 write) operation.
> However, the SDIO status read back of mine card indicated that the
> card IF_SDIO_DL_RDY bit was alway not set during the module reload
> operation.Then the timeout happened with '-ETIMEDOUT' returned.
> 
> Is there any body know why?
This turns up on the mailing list from time to time.
I think the firmware still still doesn't play ball.  
> BTW, i saw some code in if_sdio_prog_firmware funtion as follows.
> ---------------------------------------------------------------------------------------------------
> 	if (scratch == IF_SDIO_FIRMWARE_OK) {
> 		lbs_deb_sdio("firmware already loaded\n");
> 		goto success;
> 	}
> -----------------------------------------------------------------------------------------------------
Someone else may correct me on this, but I think that will only be true
immediately after driver load.  From then on there is no easy
way of finding out what state the card is in.
> It seems the driver doesn't need to re-load the firmware if the
> firmware is already loaded, right?
> In my case, during the first insmod of libertas modules, the driver
> works well and i can assume the firmware is already loaded.
> But when i reload modules, why the driver still needs to do firmware
> reloading rather than skip it as above code said?
> 
> (My card is based on Marvell 8686 chipset and kernel is 2.6.29)
> 
> Thanks
> 
> Regards
> Dongas
> 
> _______________________________________________
> libertas-dev mailing list
> libertas-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev
> 



From dongas86 at gmail.com  Sun Jun 14 00:44:38 2009
From: dongas86 at gmail.com (Dongas)
Date: Sun, 14 Jun 2009 12:44:38 +0800
Subject: Libetas can not reload modules
In-Reply-To: <4A32B176.4000305@cam.ac.uk>
References: <60ce8d250906121136g363ce5bfra0358ca90a89ea63@mail.gmail.com>
	<4A32B176.4000305@cam.ac.uk>
Message-ID: <60ce8d250906132144y203c6daawea2f8b254bb89166@mail.gmail.com>

2009/6/13 Jonathan Cameron <jic23 at cam.ac.uk>:
> Dongas wrote:
>> Dear ALL,
>>
>> The issue i encounterred is that libertas modules can not be reloaed.
>> (It works well when i first insmod them)
>> I want to rmmod them and do the re-insmod, but the error message is
>> shown as follows:
>> # insmod libertas_sdio.ko
>> libertas_sdio: Libertas SDIO driver
>> libertas_sdio: Copyright Pierre Ossman
>> ??
>> libertas: failed to load helper firmware
>> libertas leave: if_sdio_prog_helper(), ret -110
>>
>> After digging in the code, i found that the libertas driver will check
>> IF_SDIO_IO_RDY and IF_SDIO_DL_RDY bit in IF_SDIO_STATUS register for
>> the firmware downloading(CMD53 write) operation.
>> However, the SDIO status read back of mine card indicated that the
>> card IF_SDIO_DL_RDY bit was alway not set during the module reload
>> operation.Then the timeout happened with '-ETIMEDOUT' returned.
>>
>> Is there any body know why?
> This turns up on the mailing list from time to time.
> I think the firmware still still doesn't play ball.

Jonathan , thanks for your reply.
(I havn't searched out many related mails failed by this issue in the maillist.)
Could you please clarify a bit more?

Why the firmware still still doesn't play ball?
Is there any way to fix this issue?

>> BTW, i saw some code in if_sdio_prog_firmware funtion as follows.
>> ---------------------------------------------------------------------------------------------------
>> ? ? ? if (scratch == IF_SDIO_FIRMWARE_OK) {
>> ? ? ? ? ? ? ? lbs_deb_sdio("firmware already loaded\n");
>> ? ? ? ? ? ? ? goto success;
>> ? ? ? }
>> -----------------------------------------------------------------------------------------------------
> Someone else may correct me on this, but I think that will only be true
> immediately after driver load. ?From then on there is no easy
> way of finding out what state the card is in.
>> It seems the driver doesn't need to re-load the firmware if the
>> firmware is already loaded, right?
>> In my case, during the first insmod of libertas modules, the driver
>> works well and i can assume the firmware is already loaded.
>> But when i reload modules, why the driver still needs to do firmware
>> reloading rather than skip it as above code said?
>>
>> (My card is based on Marvell 8686 chipset and kernel is 2.6.29)
>>
>> Thanks
>>
>> Regards
>> Dongas
>>
>> _______________________________________________
>> libertas-dev mailing list
>> libertas-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/libertas-dev
>>
>
>


From lijinlei1 at 163.com  Sun Jun 14 00:58:39 2009
From: lijinlei1 at 163.com (lijinlei1)
Date: Sun, 14 Jun 2009 12:58:39 +0800
Subject: Libetas can not reload modules
References: <60ce8d250906121136g363ce5bfra0358ca90a89ea63@mail.gmail.com><4A32B176.4000305@cam.ac.uk>
	<60ce8d250906132144y203c6daawea2f8b254bb89166@mail.gmail.com>
Message-ID: <E14EEE7BCF0340BDB0C3BAA22013A6A7@irex.local>

I have the same problem, waiting for follow-ups.

----- Original Message ----- 
From: "Dongas" <dongas86 at gmail.com>
To: "Jonathan Cameron" <jic23 at cam.ac.uk>
Cc: <libertas-dev at lists.infradead.org>
Sent: Sunday, June 14, 2009 12:44 PM
Subject: Re: Libetas can not reload modules


2009/6/13 Jonathan Cameron <jic23 at cam.ac.uk>:
> Dongas wrote:
>> Dear ALL,
>>
>> The issue i encounterred is that libertas modules can not be reloaed.
>> (It works well when i first insmod them)
>> I want to rmmod them and do the re-insmod, but the error message is
>> shown as follows:
>> # insmod libertas_sdio.ko
>> libertas_sdio: Libertas SDIO driver
>> libertas_sdio: Copyright Pierre Ossman
>> ??
>> libertas: failed to load helper firmware
>> libertas leave: if_sdio_prog_helper(), ret -110
>>
>> After digging in the code, i found that the libertas driver will check
>> IF_SDIO_IO_RDY and IF_SDIO_DL_RDY bit in IF_SDIO_STATUS register for
>> the firmware downloading(CMD53 write) operation.
>> However, the SDIO status read back of mine card indicated that the
>> card IF_SDIO_DL_RDY bit was alway not set during the module reload
>> operation.Then the timeout happened with '-ETIMEDOUT' returned.
>>
>> Is there any body know why?
> This turns up on the mailing list from time to time.
> I think the firmware still still doesn't play ball.

Jonathan , thanks for your reply.
(I havn't searched out many related mails failed by this issue in the maillist.)
Could you please clarify a bit more?

Why the firmware still still doesn't play ball?
Is there any way to fix this issue?

>> BTW, i saw some code in if_sdio_prog_firmware funtion as follows.
>> ---------------------------------------------------------------------------------------------------
>> if (scratch == IF_SDIO_FIRMWARE_OK) {
>> lbs_deb_sdio("firmware already loaded\n");
>> goto success;
>> }
>> -----------------------------------------------------------------------------------------------------
> Someone else may correct me on this, but I think that will only be true
> immediately after driver load. From then on there is no easy
> way of finding out what state the card is in.
>> It seems the driver doesn't need to re-load the firmware if the
>> firmware is already loaded, right?
>> In my case, during the first insmod of libertas modules, the driver
>> works well and i can assume the firmware is already loaded.
>> But when i reload modules, why the driver still needs to do firmware
>> reloading rather than skip it as above code said?
>>
>> (My card is based on Marvell 8686 chipset and kernel is 2.6.29)
>>
>> Thanks
>>
>> Regards
>> Dongas
>>
>> _______________________________________________
>> libertas-dev mailing list
>> libertas-dev at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/libertas-dev
>>
>
>

_______________________________________________
libertas-dev mailing list
libertas-dev at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/libertas-dev

From jic23 at cam.ac.uk  Mon Jun 15 07:39:35 2009
From: jic23 at cam.ac.uk (Jonathan Cameron)
Date: Mon, 15 Jun 2009 11:39:35 +0000
Subject: Libetas can not reload modules
In-Reply-To: <E14EEE7BCF0340BDB0C3BAA22013A6A7@irex.local>
References: <60ce8d250906121136g363ce5bfra0358ca90a89ea63@mail.gmail.com><4A32B176.4000305@cam.ac.uk>
	<60ce8d250906132144y203c6daawea2f8b254bb89166@mail.gmail.com>
	<E14EEE7BCF0340BDB0C3BAA22013A6A7@irex.local>
Message-ID: <4A3632F7.20003@cam.ac.uk>

lijinlei1 wrote:
> I have the same problem, waiting for follow-ups.
> 
> ----- Original Message ----- 
> From: "Dongas" <dongas86 at gmail.com>
> To: "Jonathan Cameron" <jic23 at cam.ac.uk>
> Cc: <libertas-dev at lists.infradead.org>
> Sent: Sunday, June 14, 2009 12:44 PM
> Subject: Re: Libetas can not reload modules
> 
> 
> 2009/6/13 Jonathan Cameron <jic23 at cam.ac.uk>:
>> Dongas wrote:
>>> Dear ALL,
>>>
>>> The issue i encounterred is that libertas modules can not be reloaed.
>>> (It works well when i first insmod them)
>>> I want to rmmod them and do the re-insmod, but the error message is
>>> shown as follows:
>>> # insmod libertas_sdio.ko
>>> libertas_sdio: Libertas SDIO driver
>>> libertas_sdio: Copyright Pierre Ossman
>>> ??
>>> libertas: failed to load helper firmware
>>> libertas leave: if_sdio_prog_helper(), ret -110
>>>
>>> After digging in the code, i found that the libertas driver will check
>>> IF_SDIO_IO_RDY and IF_SDIO_DL_RDY bit in IF_SDIO_STATUS register for
>>> the firmware downloading(CMD53 write) operation.
>>> However, the SDIO status read back of mine card indicated that the
>>> card IF_SDIO_DL_RDY bit was alway not set during the module reload
>>> operation.Then the timeout happened with '-ETIMEDOUT' returned.
>>>
>>> Is there any body know why?
>> This turns up on the mailing list from time to time.
>> I think the firmware still still doesn't play ball.
> 
> Jonathan , thanks for your reply.
> (I havn't searched out many related mails failed by this issue in the maillist.)
> Could you please clarify a bit more?

I think the last discussion about this was the one following on from...

http://lists.infradead.org/pipermail/libertas-dev/2008-September/001928.html
 
> Why the firmware still still doesn't play ball?
Don't know. Unfortunately I wasn't in a position to run Marvell's driver and find
out whether their reset code actually works, but we never managed to replicate it
using the in kernel code.
> Is there any way to fix this issue?
We never really managed to isolate the cause I'm afraid.

Jonathan

> 
>>> BTW, i saw some code in if_sdio_prog_firmware funtion as follows.
>>> ---------------------------------------------------------------------------------------------------
>>> if (scratch == IF_SDIO_FIRMWARE_OK) {
>>> lbs_deb_sdio("firmware already loaded\n");
>>> goto success;
>>> }
>>> -----------------------------------------------------------------------------------------------------
>> Someone else may correct me on this, but I think that will only be true
>> immediately after driver load. From then on there is no easy
>> way of finding out what state the card is in.
>>> It seems the driver doesn't need to re-load the firmware if the
>>> firmware is already loaded, right?
>>> In my case, during the first insmod of libertas modules, the driver
>>> works well and i can assume the firmware is already loaded.
>>> But when i reload modules, why the driver still needs to do firmware
>>> reloading rather than skip it as above code said?
>>>
>>> (My card is based on Marvell 8686 chipset and kernel is 2.6.29)
>>>
>>> Thanks
>>>
>>> Regards
>>> Dongas
>>>
>>> _______________________________________________
>>> libertas-dev mailing list
>>> libertas-dev at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/libertas-dev
>>>
>>
> 
> _______________________________________________
> libertas-dev mailing list
> libertas-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev



From dongas86 at gmail.com  Mon Jun 15 13:03:25 2009
From: dongas86 at gmail.com (Dongas)
Date: Tue, 16 Jun 2009 01:03:25 +0800
Subject: Libetas can not reload modules
In-Reply-To: <4A3632F7.20003@cam.ac.uk>
References: <60ce8d250906121136g363ce5bfra0358ca90a89ea63@mail.gmail.com>
	<4A32B176.4000305@cam.ac.uk>
	<60ce8d250906132144y203c6daawea2f8b254bb89166@mail.gmail.com>
	<E14EEE7BCF0340BDB0C3BAA22013A6A7@irex.local>
	<4A3632F7.20003@cam.ac.uk>
Message-ID: <60ce8d250906151003g10ef1e56r38f2d43ba468cff3@mail.gmail.com>

2009/6/15 Jonathan Cameron <jic23 at cam.ac.uk>:
>> 2009/6/13 Jonathan Cameron <jic23 at cam.ac.uk>:
>>> Dongas wrote:
>>>> Dear ALL,
>>>>
>>>> The issue i encounterred is that libertas modules can not be reloaed.
>>>> (It works well when i first insmod them)
>>>> I want to rmmod them and do the re-insmod, but the error message is
>>>> shown as follows:
>>>> # insmod libertas_sdio.ko
>>>> libertas_sdio: Libertas SDIO driver
>>>> libertas_sdio: Copyright Pierre Ossman
>>>> ??
>>>> libertas: failed to load helper firmware
>>>> libertas leave: if_sdio_prog_helper(), ret -110
>>>>
>>>> After digging in the code, i found that the libertas driver will check
>>>> IF_SDIO_IO_RDY and IF_SDIO_DL_RDY bit in IF_SDIO_STATUS register for
>>>> the firmware downloading(CMD53 write) operation.
>>>> However, the SDIO status read back of mine card indicated that the
>>>> card IF_SDIO_DL_RDY bit was alway not set during the module reload
>>>> operation.Then the timeout happened with '-ETIMEDOUT' returned.
>>>>
>>>> Is there any body know why?
>>> This turns up on the mailing list from time to time.
>>> I think the firmware still still doesn't play ball.
>>
>> Jonathan , thanks for your reply.
>> (I havn't searched out many related mails failed by this issue in the maillist.)
>> Could you please clarify a bit more?
>
> I think the last discussion about this was the one following on from...
>
> http://lists.infradead.org/pipermail/libertas-dev/2008-September/001928.html
>
>> Why the firmware still still doesn't play ball?
> Don't know. Unfortunately I wasn't in a position to run Marvell's driver and find
> out whether their reset code actually works, but we never managed to replicate it
> using the in kernel code.
>> Is there any way to fix this issue?
> We never really managed to isolate the cause I'm afraid.
>

I also tried two methods in the thread you mentioned, a)
enable/disable function and b) CMD_802_11_RESET command, but they
didn't work as you experienced.

From andrey at cozybit.com  Mon Jun 15 16:01:51 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Mon, 15 Jun 2009 13:01:51 -0700
Subject: [PATCH] libertas: Fix re-enabling IEEE PS with WPA/WPA2
Message-ID: <1245096111-20884-1-git-send-email-andrey@cozybit.com>

With IEEE PS enabled, the driver will temporarily take the device out of
PS mode to issue commands and then re-enable PS once the commands have
completed.  With WPA or WPA2 security, the driver fails to re-enable PS
mode because of a check for key lengths that are always zero.

This patch removes the key lengths check (the local copy of the keys is
not maintained) and fixes IEEE PS mode with WPA or WPA2 security.
Tested on GSPI and SDIO interfaces with V9 firmware.

Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
---
 drivers/net/wireless/libertas/cmd.c |   29 +++++++----------------------
 1 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 01db705..5825396 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1782,32 +1782,17 @@ int lbs_execute_next_command(struct lbs_private *priv)
 		lbs_deb_host("EXEC_NEXT_CMD: sending command 0x%04x\n",
 			    le16_to_cpu(cmd->command));
 		lbs_submit_command(priv, cmdnode);
-	} else {
+	} else if ((priv->psmode != LBS802_11POWERMODECAM) &&
+		   (priv->psstate == PS_STATE_FULL_POWER) &&
+		   ((priv->connect_status == LBS_CONNECTED) ||
+		   (priv->mesh_connect_status == LBS_CONNECTED))) {
 		/*
 		 * check if in power save mode, if yes, put the device back
 		 * to PS mode
 		 */
-		if ((priv->psmode != LBS802_11POWERMODECAM) &&
-		    (priv->psstate == PS_STATE_FULL_POWER) &&
-		    ((priv->connect_status == LBS_CONNECTED) ||
-		    (priv->mesh_connect_status == LBS_CONNECTED))) {
-			if (priv->secinfo.WPAenabled ||
-			    priv->secinfo.WPA2enabled) {
-				/* check for valid WPA group keys */
-				if (priv->wpa_mcast_key.len ||
-				    priv->wpa_unicast_key.len) {
-					lbs_deb_host(
-					       "EXEC_NEXT_CMD: WPA enabled and GTK_SET"
-					       " go back to PS_SLEEP");
-					lbs_ps_sleep(priv, 0);
-				}
-			} else {
-				lbs_deb_host(
-				       "EXEC_NEXT_CMD: cmdpendingq empty, "
-				       "go back to PS_SLEEP");
-				lbs_ps_sleep(priv, 0);
-			}
-		}
+		lbs_deb_host("EXEC_NEXT_CMD: cmdpendingq empty, "
+				"go back to PS_SLEEP");
+		lbs_ps_sleep(priv, 0);
 	}
 
 	ret = 0;
-- 
1.5.6.3



From andrey at cozybit.com  Mon Jun 15 18:29:20 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Mon, 15 Jun 2009 15:29:20 -0700
Subject: [PATCH] libertas: Fix interface driver unload with PS mode
Message-ID: <1245104960-2199-1-git-send-email-andrey@cozybit.com>

When IEEE PS mode is enabled, lbs_remove_card needs to exit PS mode
before returning.  It will then set surpriseremoved=1, which blocks any
further attempts to issue commands.  In the SDIO, SPI, and USB drivers,
lbs_remove_card is called with surpriseremoved already set, which makes
it impossible to exit PS mode.  As a result, reloading the driver while
PS mode is enabled does not work.

This patch removes the setting of surpriseremoved in the interface
drivers and corrects the order in which lbs_stop_card and
lbs_remove_card are called.  Tested on SPI with V9 firmware.

Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
---
 drivers/net/wireless/libertas/if_sdio.c |    2 --
 drivers/net/wireless/libertas/if_spi.c  |    4 ++--
 drivers/net/wireless/libertas/if_usb.c  |    1 -
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 8cdb88c..6bb95ce 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -1096,8 +1096,6 @@ static void if_sdio_remove(struct sdio_func *func)
 			lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n");
 	}
 
-	card->priv->surpriseremoved = 1;
-
 	lbs_deb_sdio("call remove card\n");
 	lbs_stop_card(card->priv);
 	lbs_remove_card(card->priv);
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 923ed58..757352c 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -1171,12 +1171,12 @@ static int __devexit libertas_spi_remove(struct spi_device *spi)
 
 	lbs_deb_spi("libertas_spi_remove\n");
 	lbs_deb_enter(LBS_DEB_SPI);
-	priv->surpriseremoved = 1;
 
 	lbs_stop_card(priv);
+	lbs_remove_card(priv); /* will call free_netdev */
+
 	free_irq(spi->irq, card);
 	if_spi_terminate_spi_thread(card);
-	lbs_remove_card(priv); /* will call free_netdev */
 	if (card->pdata->teardown)
 		card->pdata->teardown(spi);
 	free_if_spi_card(card);
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index ea3dc03..7e03f0e 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -357,7 +357,6 @@ static void if_usb_disconnect(struct usb_interface *intf)
 	cardp->surprise_removed = 1;
 
 	if (priv) {
-		priv->surpriseremoved = 1;
 		lbs_stop_card(priv);
 		lbs_remove_card(priv);
 	}
-- 
1.5.6.3



From endowing at ffkinc.com  Mon Jun 15 19:55:32 2009
From: endowing at ffkinc.com (Chihuahua)
Date: Mon, 15 Jun 2009 22:55:32 -0100 (PDT)
Subject: 3 Ways to Gyet Your Woman in the Mood For Psasionate sex
Message-ID: <7f0c58d118729abf350a20090615224654@ffkinc.com>

Baseball Manager Throws AA iHssy Fit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpg
Size: 31972 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libertas-dev/attachments/20090615/d01a0064/attachment-0001.jpg>

From dongas86 at gmail.com  Tue Jun 16 10:54:26 2009
From: dongas86 at gmail.com (Dongas)
Date: Tue, 16 Jun 2009 22:54:26 +0800
Subject: transmit timed out when downloading files
Message-ID: <60ce8d250906160754m2312d387kf37052b9aa25afdc@mail.gmail.com>

Dear ALL,

I'm facing a urgent issue that 'transmit timed out' issue frequently
happened when i downloaded files with WiFi function.
The WiFi modules i used is based on Marvell 8686 chipset and the
dirver is libertas in kernel 2.6.25.

The error message is as follows:
(I also tried downloading other files, but with the same issue)
# wget http://172.31.42.217/move.rar &
# Connecting to 172.31.42.217 (172.31.42.217:80)
move.rar              14% |****                           | 21061k
00:16:07 ETA[  270.720049] NETDEV WATCHDOG: eth0: transmit timed out
[  270.725166] libertas: tx watch dog timeout
move.rar              14% |****                           | 21061k  -
stalled -[  275.720063] libertas: Command 1f timed out
[  275.724291] libertas: requeueing command 1f due to timeout (#1)
move.rar              14% |****                           | 21061k  -
stalled -[  280.720062] NETDEV WATCHDOG: eth0: transmit timed out
[  280.725176] libertas: tx watch dog timeout
move.rar              14% |****                           | 21061k  -
stalled -[  285.720062] libertas: Command 1f timed out
[  285.724284] libertas: requeueing command 1f due to timeout (#2)
move.rar              14% |****                           | 21061k  -
stalled -[  290.720049] NETDEV WATCHDOG: eth0: transmit timed out
[  290.725162] libertas: tx watch dog timeout
move.rar              14% |****                           | 21061k  -
stalled -[  295.720063] libertas: Command 1f timed out
[  295.724288] libertas: requeueing command 1f due to timeout (#3)
????
Then the downloading process stuck at here.

With the libertas debug info is fully enabled, the message is as follows:
-------------------------------------------------------------------------------------------------------------------------------------------
??
[ 1172.260000] libertas enter (INT): lbs_hard_start_xmit():69
[ 1172.260000] libertas TX Data: 00 1d 09 01 18 75 00 1a 6b a0 c7 58
08 00 45 00
[ 1172.270000] libertas TX Data: 00 34 a2 2f 40 00 40 06 ea a2 ac 1f
2a da ac 1f
[ 1172.280000] libertas TX Data: 2a d9 e1 68 00 50 43 df 34 c7 58 9e
ca 00 80 10
[ 1172.290000] libertas TX Data: 68 ae 43 8d 00 00 01 01 08 0a 00 01
53 3c 00 1a
[ 1172.290000] libertas TX Data: 4c 3a
[ 1172.300000] libertas txpd: 48 0e 06 c5 a8 c6 03 c0 00 06 d7 c3 00 00 00 00
[ 1172.300000] libertas txpd: 00 00 06 c5 00 06 d7 c3
[ 1172.310000] libertas Tx Data: 00 1d 09 01 18 75 00 1a 6b a0 c7 58
08 00 45 00
[ 1172.320000] libertas Tx Data: 00 34 a2 2f 40 00 40 06 ea a2 ac 1f
2a da ac 1f
[ 1172.320000] libertas Tx Data: 2a d9 e1 68 00 50 43 df 34 c7 58 9e
ca 00 80 10
[ 1172.330000] libertas Tx Data: 68 ae 43 8d 00 00 01 01 08 0a 00 01
53 3c 00 1a
[ 1172.340000] libertas Tx Data: 4c 3a
[ 1172.340000] libertas tx (INT): lbs_hard_start_xmit lined up packet
[ 1172.350000] libertas leave (INT): lbs_hard_start_xmit():169, ret 0

[ 1172.360000] libertas enter: if_sdio_host_to_card_worker():361
[ 1172.360000] libertas thread: main-thread 111: intcounter=0
currenttxskb=00000000 dnld_sent=1
[ 1172.370000] libertas thread: main-thread sleeping... Conn=0 IntC=0
PS_mode=0 PS_State=0

10M.mp3               24% |*******                        |  2510k  -
stalled -[ 1178.000000] NETDEV WATCHDOG: eth0: transmit timed out
[ 1178.000000] libertas enter (INT): lbs_tx_timeout():472
[ 1178.010000] libertas: tx watch dog timeout
[ 1178.010000] libertas enter (INT): lbs_host_to_card_done():500
[ 1178.020000] libertas leave (INT): lbs_host_to_card_done():511
[ 1178.020000] libertas enter (INT): lbs_prepare_and_send_command():1318
[ 1178.030000] libertas enter (INT): lbs_get_cmd_ctrl_node():1679
[ 1178.030000] libertas leave (INT): lbs_get_cmd_ctrl_node():1697
[ 1178.040000] libertas enter (INT): lbs_set_cmd_ctrl_node():1720
[ 1178.050000] libertas leave (INT): lbs_set_cmd_ctrl_node():1728
[ 1178.050000] libertas host (INT): PREP_CMD: command 0x001f
[ 1178.060000] libertas enter (INT): lbs_cmd_802_11_rssi():830
[ 1178.060000] libertas leave (INT): lbs_cmd_802_11_rssi():843
[ 1178.070000] libertas enter (INT): lbs_queue_cmd():1093
[ 1178.070000] libertas host (INT): QUEUE_CMD: inserted command 0x001f
into cmdpendingq
[ 1178.080000] libertas leave (INT): lbs_queue_cmd():1128
[ 1178.090000] libertas leave (INT): lbs_prepare_and_send_command():1577, ret 0
[ 1178.090000] libertas leave (INT): lbs_tx_timeout():493
[ 1178.100000] libertas thread: main-thread 222 (waking up):
intcounter=0 currenttxskb=00000000 dnld_sent=0
[ 1178.110000] libertas thread: main-thread 333: intcounter=0
currenttxskb=00000000 dnld_sent=0
[ 1178.120000] libertas thread: main-thread 444: intcounter=0
currenttxskb=00000000 dnld_sent=0
[ 1178.130000] libertas enter: lbs_execute_next_command():1749
[ 1178.130000] libertas host: EXEC_NEXT_CMD: OK to send command 0x001f
in psstate 0
[ 1178.140000] libertas host: EXEC_NEXT_CMD: sending command 0x001f
[ 1178.140000] libertas enter: lbs_submit_command():1141
[ 1178.150000] libertas host: DNLD_CMD: command 0x001f, seq 21, size
16, jiffies 87815
[ 1178.160000] libertas DNLD_CMD: 1f 00 10 00 15 00 00 00 08 00 00 00
00 00 00 00
[ 1178.170000] libertas enter: if_sdio_host_to_card(type 1, bytes 16):726
[ 1178.170000] libertas leave: if_sdio_host_to_card():796, ret 0
[ 1178.180000] libertas cmd: DNLD_CMD: sent command 0x001f, jiffies 87818
[ 1178.180000] libertas leave: lbs_submit_command():1176
[ 1178.190000] libertas leave: lbs_execute_next_command():1884
[ 1178.200000] libertas thread: main-thread 111: intcounter=0
currenttxskb=00000000 dnld_sent=2
[ 1178.200000] libertas thread: main-thread sleeping... Conn=0 IntC=0
PS_mode=0 PS_State=0
10M.mp3               24% |*******                        |  2510k  -
stalled -[ 1183.180000] libertas enter (INT): command_timer_fn():971
[ 1183.180000] libertas: Command 1f timed out
[ 1183.180000] libertas leave (INT): command_timer_fn():985
[ 1183.190000] libertas thread: main-thread 222 (waking up):
intcounter=0 currenttxskb=00000000 dnld_sent=2
[ 1183.200000] libertas thread: main-thread 333: intcounter=0
currenttxskb=00000000 dnld_sent=2
[ 1183.210000] libertas thread: main-thread 444: intcounter=0
currenttxskb=00000000 dnld_sent=2
[ 1183.210000] libertas: requeueing command 1f due to timeout (#1)
[ 1183.220000] libertas thread: main-thread 111: intcounter=0
currenttxskb=00000000 dnld_sent=2
[ 1183.230000] libertas thread: main-thread sleeping... Conn=0 IntC=0
PS_mode=0 PS_State=0
10M.mp3               24% |*******                        |  2510k  -
stalled -[ 1188.000000] NETDEV WATCHDOG: eth0: transmit timed out
[ 1188.000000] libertas enter (INT): lbs_tx_timeout():472
[ 1188.010000] libertas: tx watch dog timeout
[ 1188.010000] libertas enter (INT): lbs_host_to_card_done():500
[ 1188.020000] libertas leave (INT): lbs_host_to_card_done():511
[ 1188.020000] libertas enter (INT): lbs_prepare_and_send_command():1318
[ 1188.030000] libertas enter (INT): lbs_get_cmd_ctrl_node():1679
[ 1188.030000] libertas leave (INT): lbs_get_cmd_ctrl_node():1697
[ 1188.040000] libertas enter (INT): lbs_set_cmd_ctrl_node():1720
[ 1188.050000] libertas leave (INT): lbs_set_cmd_ctrl_node():1728
[ 1188.050000] libertas host (INT): PREP_CMD: command 0x001f
[ 1188.060000] libertas enter (INT): lbs_cmd_802_11_rssi():830
[ 1188.060000] libertas leave (INT): lbs_cmd_802_11_rssi():843
[ 1188.070000] libertas enter (INT): lbs_queue_cmd():1093
[ 1188.070000] libertas host (INT): QUEUE_CMD: inserted command 0x001f
into cmdpendingq
[ 1188.080000] libertas leave (INT): lbs_queue_cmd():1128
[ 1188.090000] libertas leave (INT): lbs_prepare_and_send_command():1577, ret 0
[ 1188.090000] libertas leave (INT): lbs_tx_timeout():493
[ 1188.100000] libertas thread: main-thread 222 (waking up):
intcounter=0 currenttxskb=00000000 dnld_sent=0
[ 1188.110000] libertas thread: main-thread 333: intcounter=0
currenttxskb=00000000 dnld_sent=0
[ 1188.120000] libertas thread: main-thread 444: intcounter=0
currenttxskb=00000000 dnld_sent=0
[ 1188.130000] libertas enter: lbs_execute_next_command():1749
[ 1188.130000] libertas host: EXEC_NEXT_CMD: OK to send command 0x001f
in psstate 0
[ 1188.140000] libertas host: EXEC_NEXT_CMD: sending command 0x001f
[ 1188.140000] libertas enter: lbs_submit_command():1141
[ 1188.150000] libertas host: DNLD_CMD: command 0x001f, seq 21, size
16, jiffies 88815
[ 1188.160000] libertas DNLD_CMD: 1f 00 10 00 15 00 00 00 08 00 00 00
00 00 00 00
[ 1188.170000] libertas enter: if_sdio_host_to_card(type 1, bytes 16):726
[ 1188.170000] libertas leave: if_sdio_host_to_card():796, ret 0
[ 1188.180000] libertas cmd: DNLD_CMD: sent command 0x001f, jiffies 88818
[ 1188.180000] libertas leave: lbs_submit_command():1176
[ 1188.190000] libertas leave: lbs_execute_next_command():1884
[ 1188.200000] libertas thread: main-thread 111: intcounter=0
currenttxskb=00000000 dnld_sent=2
[ 1188.200000] libertas thread: main-thread sleeping... Conn=0 IntC=0
PS_mode=0 PS_State=0
10M.mp3               24% |*******                        |  2510k  -
stalled -[ 1193.180000] libertas enter (INT): command_timer_fn():971
[ 1193.180000] libertas: Command 1f timed out
[ 1193.180000] libertas leave (INT): command_timer_fn():985
[ 1193.190000] libertas thread: main-thread 222 (waking up):
intcounter=0 currenttxskb=00000000 dnld_sent=2
[ 1193.200000] libertas thread: main-thread 333: intcounter=0
currenttxskb=00000000 dnld_sent=2
[ 1193.210000] libertas thread: main-thread 444: intcounter=0
currenttxskb=00000000 dnld_sent=2
[ 1193.210000] libertas: requeueing command 1f due to timeout (#2)
[ 1193.220000] libertas thread: main-thread 111: intcounter=0
currenttxskb=00000000 dnld_sent=2
[ 1193.230000] libertas thread: main-thread sleeping... Conn=0 IntC=0
PS_mode=0 PS_State=0
10M.mp3               24% |*******                        |  2510k  -
stalled -[ 1198.000000] NETDEV WATCHDOG: eth0: transmit timed out
??????
------------------------------------------------------------------------------------------------------

It would be highly appreciated if someone can provide any hints to fix
the issue.

Thanks

Regards
Dongas


From dcbw at redhat.com  Tue Jun 16 15:40:01 2009
From: dcbw at redhat.com (Dan Williams)
Date: Tue, 16 Jun 2009 15:40:01 -0400
Subject: [PATCH v2] net/libertas: don't recursive spin lock in if_spi_e2h()
In-Reply-To: <20090612193731.GA21528@Chamillionaire.breakpoint.cc>
References: <20090612094710.GA28098@www.tglx.de>
	<20090612193731.GA21528@Chamillionaire.breakpoint.cc>
Message-ID: <1245181201.28992.7.camel@130.81.190.10.in-addr.arpa>

On Fri, 2009-06-12 at 21:37 +0200, Sebastian Andrzej Siewior wrote:
> |BUG: spinlock recursion on CPU#0, lbs_spi_thread/1030
> | lock: dee9a1bc, .magic: dead4ead, .owner: lbs_spi_thread/1030, .owner_cpu: 0
> |Call Trace:
> |[deec3eb0] [c0007220] show_stack+0x4c/0x15c (unreliable)
> |[deec3ef0] [c0187720] spin_bug+0x9c/0xb0
> |[deec3f10] [c0187890] _raw_spin_lock+0x54/0x148
> |[deec3f40] [c02d260c] _spin_lock_irqsave+0x2c/0x44
> |[deec3f60] [e8671800] lbs_queue_event+0x7c/0x130 [libertas]
> |[deec3f80] [e8725f04] lbs_spi_thread+0x538/0x58c [libertas_spi]
> |[deec3fe0] [c004f270] kthread+0x4c/0x88
> |[deec3ff0] [c000f33c] kernel_thread+0x4c/0x68
> 
> if_spi_e2h() is grabbing ->driver_lock just while calling
> lbs_queue_event() which is grabbing the same lock.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>

Acked-by: Dan Williams <dcbw at redhat.com>

> ---
> v1..v2: remove flags
> 
>  drivers/net/wireless/libertas/if_spi.c |    4 ----
>  1 files changed, 0 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
> index f8c2898..583162c 100644
> --- a/drivers/net/wireless/libertas/if_spi.c
> +++ b/drivers/net/wireless/libertas/if_spi.c
> @@ -812,7 +812,6 @@ out:
>  static void if_spi_e2h(struct if_spi_card *card)
>  {
>  	int err = 0;
> -	unsigned long flags;
>  	u32 cause;
>  	struct lbs_private *priv = card->priv;
>  
> @@ -827,10 +826,7 @@ static void if_spi_e2h(struct if_spi_card *card)
>  	/* generate a card interrupt */
>  	spu_write_u16(card, IF_SPI_CARD_INT_CAUSE_REG, IF_SPI_CIC_HOST_EVENT);
>  
> -	spin_lock_irqsave(&priv->driver_lock, flags);
>  	lbs_queue_event(priv, cause & 0xff);
> -	spin_unlock_irqrestore(&priv->driver_lock, flags);
> -
>  out:
>  	if (err)
>  		lbs_pr_err("%s: error %d\n", __func__, err);



From dcbw at redhat.com  Tue Jun 16 15:40:54 2009
From: dcbw at redhat.com (Dan Williams)
Date: Tue, 16 Jun 2009 15:40:54 -0400
Subject: [PATCH v2] libertas: fix IEEE PS mode in GSPI driver
In-Reply-To: <1244835936-17188-1-git-send-email-andrey@cozybit.com>
References: <1244762625-29618-1-git-send-email-andrey@cozybit.com>
	<1244835936-17188-1-git-send-email-andrey@cozybit.com>
Message-ID: <1245181254.28992.8.camel@130.81.190.10.in-addr.arpa>

On Fri, 2009-06-12 at 12:45 -0700, Andrey Yurovsky wrote:
> The card firmware does not set the Command Download Ready interrupt bit
> when IEEE PS mode is enabled, preventing the driver from sending
> commands (such as the command to exit IEEE PS mode) since there is no
> indication that the card is ready to accept commands.
> 
> This patch works around the problem by using the the TX Download Ready
> bit in place of the Command Download Ready Bit while in IEEE PS mode.
> TX Download Ready is set in IEEE PS mode.
> 
> Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
> Signed-off-by: Javier Cardona <javier at cozybit.com>

Acked-by: Dan Williams <dcbw at redhat.com>

> ---
>  drivers/net/wireless/libertas/if_spi.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
> index f8c2898..dc2a1f6 100644
> --- a/drivers/net/wireless/libertas/if_spi.c
> +++ b/drivers/net/wireless/libertas/if_spi.c
> @@ -875,7 +875,12 @@ static int lbs_spi_thread(void *data)
>  			err = if_spi_c2h_data(card);
>  			if (err)
>  				goto err;
> -		if (hiStatus & IF_SPI_HIST_CMD_DOWNLOAD_RDY) {
> +
> +		/* workaround: in PS mode, the card does not set the Command
> +		 * Download Ready bit, but it sets TX Download Ready. */
> +		if (hiStatus & IF_SPI_HIST_CMD_DOWNLOAD_RDY ||
> +		   (card->priv->psstate != PS_STATE_FULL_POWER &&
> +		    (hiStatus & IF_SPI_HIST_TX_DOWNLOAD_RDY))) {
>  			/* This means two things. First of all,
>  			 * if there was a previous command sent, the card has
>  			 * successfully received it.



From dcbw at redhat.com  Tue Jun 16 15:45:40 2009
From: dcbw at redhat.com (Dan Williams)
Date: Tue, 16 Jun 2009 15:45:40 -0400
Subject: Libetas can not reload modules
In-Reply-To: <60ce8d250906151003g10ef1e56r38f2d43ba468cff3@mail.gmail.com>
References: <60ce8d250906121136g363ce5bfra0358ca90a89ea63@mail.gmail.com>
	<4A32B176.4000305@cam.ac.uk>
	<60ce8d250906132144y203c6daawea2f8b254bb89166@mail.gmail.com>
	<E14EEE7BCF0340BDB0C3BAA22013A6A7@irex.local>
	<4A3632F7.20003@cam.ac.uk>
	<60ce8d250906151003g10ef1e56r38f2d43ba468cff3@mail.gmail.com>
Message-ID: <1245181540.28992.12.camel@130.81.190.10.in-addr.arpa>

On Tue, 2009-06-16 at 01:03 +0800, Dongas wrote:
> 2009/6/15 Jonathan Cameron <jic23 at cam.ac.uk>:
> >> 2009/6/13 Jonathan Cameron <jic23 at cam.ac.uk>:
> >>> Dongas wrote:
> >>>> Dear ALL,
> >>>>
> >>>> The issue i encounterred is that libertas modules can not be reloaed.
> >>>> (It works well when i first insmod them)
> >>>> I want to rmmod them and do the re-insmod, but the error message is
> >>>> shown as follows:
> >>>> # insmod libertas_sdio.ko
> >>>> libertas_sdio: Libertas SDIO driver
> >>>> libertas_sdio: Copyright Pierre Ossman
> >>>> ??
> >>>> libertas: failed to load helper firmware
> >>>> libertas leave: if_sdio_prog_helper(), ret -110
> >>>>
> >>>> After digging in the code, i found that the libertas driver will check
> >>>> IF_SDIO_IO_RDY and IF_SDIO_DL_RDY bit in IF_SDIO_STATUS register for
> >>>> the firmware downloading(CMD53 write) operation.
> >>>> However, the SDIO status read back of mine card indicated that the
> >>>> card IF_SDIO_DL_RDY bit was alway not set during the module reload
> >>>> operation.Then the timeout happened with '-ETIMEDOUT' returned.
> >>>>
> >>>> Is there any body know why?
> >>> This turns up on the mailing list from time to time.
> >>> I think the firmware still still doesn't play ball.
> >>
> >> Jonathan , thanks for your reply.
> >> (I havn't searched out many related mails failed by this issue in the maillist.)
> >> Could you please clarify a bit more?
> >
> > I think the last discussion about this was the one following on from...
> >
> > http://lists.infradead.org/pipermail/libertas-dev/2008-September/001928.html
> >
> >> Why the firmware still still doesn't play ball?
> > Don't know. Unfortunately I wasn't in a position to run Marvell's driver and find
> > out whether their reset code actually works, but we never managed to replicate it
> > using the in kernel code.
> >> Is there any way to fix this issue?
> > We never really managed to isolate the cause I'm afraid.
> >
> 
> I also tried two methods in the thread you mentioned, a)
> enable/disable function and b) CMD_802_11_RESET command, but they
> didn't work as you experienced.
> From the discussion in that thread, it seems this issue has some
> relationship with HW errata of Marvell WiFi chip , right?
> 
> I wonder did you find a work around solution for this issue at last?
> 
> Since i'm using libertas driver in kernel 2.6.25, i'd also like to
> know if this issue still exists in kernel 2.6.29?

It probably does.  If you're using an embedded system, you might be able
to hook up a GPIO to kill power to the card like the OLPC USB driver
does.  But at this time, there is no known way of fully resetting the
device other than cutting power to the 8686/8688 device.

We'd need some insight into the firmware and bus-level stuff to figure
out why the card doesn't reset itself from CMD_802_11_RESET.  Maybe we
should investigate that again; the v10 docs still say CMD_802_11_RESET
is the correct method to return the card to a clean state.

The sd8688 has additional commands that could also help here, Bing Zhao
has been adding support for those to 2.6.31 and later.  But I assume
you're using 8686 and thus those commands aren't supported.

Dan


Dan




From dcbw at redhat.com  Tue Jun 16 15:53:24 2009
From: dcbw at redhat.com (Dan Williams)
Date: Tue, 16 Jun 2009 15:53:24 -0400
Subject: [PATCH] libertas: Fix re-enabling IEEE PS with WPA/WPA2
In-Reply-To: <1245096111-20884-1-git-send-email-andrey@cozybit.com>
References: <1245096111-20884-1-git-send-email-andrey@cozybit.com>
Message-ID: <1245182004.28992.18.camel@130.81.190.10.in-addr.arpa>

On Mon, 2009-06-15 at 13:01 -0700, Andrey Yurovsky wrote:
> With IEEE PS enabled, the driver will temporarily take the device out of
> PS mode to issue commands and then re-enable PS once the commands have
> completed.  With WPA or WPA2 security, the driver fails to re-enable PS
> mode because of a check for key lengths that are always zero.
> 
> This patch removes the key lengths check (the local copy of the keys is
> not maintained) and fixes IEEE PS mode with WPA or WPA2 security.
> Tested on GSPI and SDIO interfaces with V9 firmware.

I have no idea what this code was trying to do originally (I'm pretty
sure it's a left-over from the vendor driver), but it seems like maybe
it was ensuring that the adapter did *not* return to power-save mode
until the supplicant had set the GTK?  There's a window where the GTK
won't be set, and we probably shouldn't be entering PS mode until that
window is closed.  Old sd8385 code from a Motorola phone has:

	if ((Adapter->PSMode != Wlan802_11PowerModeCAM) &&
			(Adapter->PSState == PS_STATE_FULL_POWER) &&
			(Adapter->MediaConnectStatus == 
			 WlanMediaStateConnected)) {
		if(Adapter->SecInfo.WPAEnabled
			|| Adapter->SecInfo.WPA2Enabled
		) {
			if(Adapter->IsGTK_SET == TRUE) {
				PRINTM(INFO, "EXEC_NEXT_CMD: WPA enabled and GTK_SET"
					" go back to PS_SLEEP");
				PSSleep(priv, 0);
			}
		} else
		{
			PRINTM(INFO, "EXEC_NEXT_CMD: Command PendQ is empty," 
				" go back to PS_SLEEP");
			PSSleep(priv, 0);
		}
	}

Says to me, "if WPA is enabled but the GTK hasn't been set yet, don't go
to sleep".

Does that sound like a plausible explanation of what the original bits
intended to do?  Like I said, it was inherited, but there might have
been a good reason for it.

Dan

> Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
> ---
>  drivers/net/wireless/libertas/cmd.c |   29 +++++++----------------------
>  1 files changed, 7 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
> index 01db705..5825396 100644
> --- a/drivers/net/wireless/libertas/cmd.c
> +++ b/drivers/net/wireless/libertas/cmd.c
> @@ -1782,32 +1782,17 @@ int lbs_execute_next_command(struct lbs_private *priv)
>  		lbs_deb_host("EXEC_NEXT_CMD: sending command 0x%04x\n",
>  			    le16_to_cpu(cmd->command));
>  		lbs_submit_command(priv, cmdnode);
> -	} else {
> +	} else if ((priv->psmode != LBS802_11POWERMODECAM) &&
> +		   (priv->psstate == PS_STATE_FULL_POWER) &&
> +		   ((priv->connect_status == LBS_CONNECTED) ||
> +		   (priv->mesh_connect_status == LBS_CONNECTED))) {
>  		/*
>  		 * check if in power save mode, if yes, put the device back
>  		 * to PS mode
>  		 */
> -		if ((priv->psmode != LBS802_11POWERMODECAM) &&
> -		    (priv->psstate == PS_STATE_FULL_POWER) &&
> -		    ((priv->connect_status == LBS_CONNECTED) ||
> -		    (priv->mesh_connect_status == LBS_CONNECTED))) {
> -			if (priv->secinfo.WPAenabled ||
> -			    priv->secinfo.WPA2enabled) {
> -				/* check for valid WPA group keys */
> -				if (priv->wpa_mcast_key.len ||
> -				    priv->wpa_unicast_key.len) {
> -					lbs_deb_host(
> -					       "EXEC_NEXT_CMD: WPA enabled and GTK_SET"
> -					       " go back to PS_SLEEP");
> -					lbs_ps_sleep(priv, 0);
> -				}
> -			} else {
> -				lbs_deb_host(
> -				       "EXEC_NEXT_CMD: cmdpendingq empty, "
> -				       "go back to PS_SLEEP");
> -				lbs_ps_sleep(priv, 0);
> -			}
> -		}
> +		lbs_deb_host("EXEC_NEXT_CMD: cmdpendingq empty, "
> +				"go back to PS_SLEEP");
> +		lbs_ps_sleep(priv, 0);
>  	}
>  
>  	ret = 0;



From dcbw at redhat.com  Tue Jun 16 15:57:02 2009
From: dcbw at redhat.com (Dan Williams)
Date: Tue, 16 Jun 2009 15:57:02 -0400
Subject: [PATCH] libertas: Fix interface driver unload with PS mode
In-Reply-To: <1245104960-2199-1-git-send-email-andrey@cozybit.com>
References: <1245104960-2199-1-git-send-email-andrey@cozybit.com>
Message-ID: <1245182222.28992.19.camel@130.81.190.10.in-addr.arpa>

On Mon, 2009-06-15 at 15:29 -0700, Andrey Yurovsky wrote:
> When IEEE PS mode is enabled, lbs_remove_card needs to exit PS mode
> before returning.  It will then set surpriseremoved=1, which blocks any
> further attempts to issue commands.  In the SDIO, SPI, and USB drivers,
> lbs_remove_card is called with surpriseremoved already set, which makes
> it impossible to exit PS mode.  As a result, reloading the driver while
> PS mode is enabled does not work.
> 
> This patch removes the setting of surpriseremoved in the interface
> drivers and corrects the order in which lbs_stop_card and
> lbs_remove_card are called.  Tested on SPI with V9 firmware.

Makes me a bit nervious; any chance you can test with usb8388 or SDIO
firmware and hot-unplug or rmmod?

Dan

> Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
> ---
>  drivers/net/wireless/libertas/if_sdio.c |    2 --
>  drivers/net/wireless/libertas/if_spi.c  |    4 ++--
>  drivers/net/wireless/libertas/if_usb.c  |    1 -
>  3 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
> index 8cdb88c..6bb95ce 100644
> --- a/drivers/net/wireless/libertas/if_sdio.c
> +++ b/drivers/net/wireless/libertas/if_sdio.c
> @@ -1096,8 +1096,6 @@ static void if_sdio_remove(struct sdio_func *func)
>  			lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n");
>  	}
>  
> -	card->priv->surpriseremoved = 1;
> -
>  	lbs_deb_sdio("call remove card\n");
>  	lbs_stop_card(card->priv);
>  	lbs_remove_card(card->priv);
> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
> index 923ed58..757352c 100644
> --- a/drivers/net/wireless/libertas/if_spi.c
> +++ b/drivers/net/wireless/libertas/if_spi.c
> @@ -1171,12 +1171,12 @@ static int __devexit libertas_spi_remove(struct spi_device *spi)
>  
>  	lbs_deb_spi("libertas_spi_remove\n");
>  	lbs_deb_enter(LBS_DEB_SPI);
> -	priv->surpriseremoved = 1;
>  
>  	lbs_stop_card(priv);
> +	lbs_remove_card(priv); /* will call free_netdev */
> +
>  	free_irq(spi->irq, card);
>  	if_spi_terminate_spi_thread(card);
> -	lbs_remove_card(priv); /* will call free_netdev */
>  	if (card->pdata->teardown)
>  		card->pdata->teardown(spi);
>  	free_if_spi_card(card);
> diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
> index ea3dc03..7e03f0e 100644
> --- a/drivers/net/wireless/libertas/if_usb.c
> +++ b/drivers/net/wireless/libertas/if_usb.c
> @@ -357,7 +357,6 @@ static void if_usb_disconnect(struct usb_interface *intf)
>  	cardp->surprise_removed = 1;
>  
>  	if (priv) {
> -		priv->surpriseremoved = 1;
>  		lbs_stop_card(priv);
>  		lbs_remove_card(priv);
>  	}



From andrey at cozybit.com  Tue Jun 16 16:03:43 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Tue, 16 Jun 2009 13:03:43 -0700
Subject: [PATCH] libertas: Fix re-enabling IEEE PS with WPA/WPA2
In-Reply-To: <1245182004.28992.18.camel@130.81.190.10.in-addr.arpa>
References: <1245096111-20884-1-git-send-email-andrey@cozybit.com>
	<1245182004.28992.18.camel@130.81.190.10.in-addr.arpa>
Message-ID: <45e8e6c40906161303y7be52452vf4cd16bbc3cc7e43@mail.gmail.com>

On Tue, Jun 16, 2009 at 12:53 PM, Dan Williams<dcbw at redhat.com> wrote:
> On Mon, 2009-06-15 at 13:01 -0700, Andrey Yurovsky wrote:
>> With IEEE PS enabled, the driver will temporarily take the device out of
>> PS mode to issue commands and then re-enable PS once the commands have
>> completed. ?With WPA or WPA2 security, the driver fails to re-enable PS
>> mode because of a check for key lengths that are always zero.
>>
>> This patch removes the key lengths check (the local copy of the keys is
>> not maintained) and fixes IEEE PS mode with WPA or WPA2 security.
>> Tested on GSPI and SDIO interfaces with V9 firmware.
>
> I have no idea what this code was trying to do originally (I'm pretty
> sure it's a left-over from the vendor driver), but it seems like maybe
> it was ensuring that the adapter did *not* return to power-save mode
> until the supplicant had set the GTK? ?There's a window where the GTK
> won't be set, and we probably shouldn't be entering PS mode until that
> window is closed. ?Old sd8385 code from a Motorola phone has:
>
> ? ? ? ?if ((Adapter->PSMode != Wlan802_11PowerModeCAM) &&
> ? ? ? ? ? ? ? ? ? ? ? ?(Adapter->PSState == PS_STATE_FULL_POWER) &&
> ? ? ? ? ? ? ? ? ? ? ? ?(Adapter->MediaConnectStatus ==
> ? ? ? ? ? ? ? ? ? ? ? ? WlanMediaStateConnected)) {
> ? ? ? ? ? ? ? ?if(Adapter->SecInfo.WPAEnabled
> ? ? ? ? ? ? ? ? ? ? ? ?|| Adapter->SecInfo.WPA2Enabled
> ? ? ? ? ? ? ? ?) {
> ? ? ? ? ? ? ? ? ? ? ? ?if(Adapter->IsGTK_SET == TRUE) {
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PRINTM(INFO, "EXEC_NEXT_CMD: WPA enabled and GTK_SET"
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?" go back to PS_SLEEP");
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PSSleep(priv, 0);
> ? ? ? ? ? ? ? ? ? ? ? ?}
> ? ? ? ? ? ? ? ?} else
> ? ? ? ? ? ? ? ?{
> ? ? ? ? ? ? ? ? ? ? ? ?PRINTM(INFO, "EXEC_NEXT_CMD: Command PendQ is empty,"
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?" go back to PS_SLEEP");
> ? ? ? ? ? ? ? ? ? ? ? ?PSSleep(priv, 0);
> ? ? ? ? ? ? ? ?}
> ? ? ? ?}
>
> Says to me, "if WPA is enabled but the GTK hasn't been set yet, don't go
> to sleep".
>
> Does that sound like a plausible explanation of what the original bits
> intended to do? ?Like I said, it was inherited, but there might have
> been a good reason for it.

That might be the original intention, but assoc_helper_wpa_keys() sets
both and lbs_cmd_802_11_key_material() then clears out the driver's
copy, which is then (incorrectly) checked when deciding whether to go
back to sleep.  As I understand it, the execution path for WPA/WPA2
association shouldn't cause this situation where WPA is enabled but
the GTK isn't set yet and we're deciding to go back to sleep.  Do you
agree?  Should we even be keeping the 'driver copy' of the keys?  I
don't see why we want to do that.  Thanks,

  -Andrey

>> Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
>> ---
>> ?drivers/net/wireless/libertas/cmd.c | ? 29 +++++++----------------------
>> ?1 files changed, 7 insertions(+), 22 deletions(-)
>>
>> diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
>> index 01db705..5825396 100644
>> --- a/drivers/net/wireless/libertas/cmd.c
>> +++ b/drivers/net/wireless/libertas/cmd.c
>> @@ -1782,32 +1782,17 @@ int lbs_execute_next_command(struct lbs_private *priv)
>> ? ? ? ? ? ? ? lbs_deb_host("EXEC_NEXT_CMD: sending command 0x%04x\n",
>> ? ? ? ? ? ? ? ? ? ? ? ? ? le16_to_cpu(cmd->command));
>> ? ? ? ? ? ? ? lbs_submit_command(priv, cmdnode);
>> - ? ? } else {
>> + ? ? } else if ((priv->psmode != LBS802_11POWERMODECAM) &&
>> + ? ? ? ? ? ? ? ?(priv->psstate == PS_STATE_FULL_POWER) &&
>> + ? ? ? ? ? ? ? ?((priv->connect_status == LBS_CONNECTED) ||
>> + ? ? ? ? ? ? ? ?(priv->mesh_connect_status == LBS_CONNECTED))) {
>> ? ? ? ? ? ? ? /*
>> ? ? ? ? ? ? ? ?* check if in power save mode, if yes, put the device back
>> ? ? ? ? ? ? ? ?* to PS mode
>> ? ? ? ? ? ? ? ?*/
>> - ? ? ? ? ? ? if ((priv->psmode != LBS802_11POWERMODECAM) &&
>> - ? ? ? ? ? ? ? ? (priv->psstate == PS_STATE_FULL_POWER) &&
>> - ? ? ? ? ? ? ? ? ((priv->connect_status == LBS_CONNECTED) ||
>> - ? ? ? ? ? ? ? ? (priv->mesh_connect_status == LBS_CONNECTED))) {
>> - ? ? ? ? ? ? ? ? ? ? if (priv->secinfo.WPAenabled ||
>> - ? ? ? ? ? ? ? ? ? ? ? ? priv->secinfo.WPA2enabled) {
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* check for valid WPA group keys */
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (priv->wpa_mcast_key.len ||
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? priv->wpa_unicast_key.len) {
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? lbs_deb_host(
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"EXEC_NEXT_CMD: WPA enabled and GTK_SET"
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?" go back to PS_SLEEP");
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? lbs_ps_sleep(priv, 0);
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
>> - ? ? ? ? ? ? ? ? ? ? } else {
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? lbs_deb_host(
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"EXEC_NEXT_CMD: cmdpendingq empty, "
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"go back to PS_SLEEP");
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? lbs_ps_sleep(priv, 0);
>> - ? ? ? ? ? ? ? ? ? ? }
>> - ? ? ? ? ? ? }
>> + ? ? ? ? ? ? lbs_deb_host("EXEC_NEXT_CMD: cmdpendingq empty, "
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? "go back to PS_SLEEP");
>> + ? ? ? ? ? ? lbs_ps_sleep(priv, 0);
>> ? ? ? }
>>
>> ? ? ? ret = 0;
>
>


From andrey at cozybit.com  Tue Jun 16 16:09:45 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Tue, 16 Jun 2009 13:09:45 -0700
Subject: [PATCH] libertas: Fix interface driver unload with PS mode
In-Reply-To: <1245182222.28992.19.camel@130.81.190.10.in-addr.arpa>
References: <1245104960-2199-1-git-send-email-andrey@cozybit.com>
	<1245182222.28992.19.camel@130.81.190.10.in-addr.arpa>
Message-ID: <45e8e6c40906161309t27825adchc6d281a8be7ae33f@mail.gmail.com>

On Tue, Jun 16, 2009 at 12:57 PM, Dan Williams<dcbw at redhat.com> wrote:
> On Mon, 2009-06-15 at 15:29 -0700, Andrey Yurovsky wrote:
>> When IEEE PS mode is enabled, lbs_remove_card needs to exit PS mode
>> before returning. ?It will then set surpriseremoved=1, which blocks any
>> further attempts to issue commands. ?In the SDIO, SPI, and USB drivers,
>> lbs_remove_card is called with surpriseremoved already set, which makes
>> it impossible to exit PS mode. ?As a result, reloading the driver while
>> PS mode is enabled does not work.
>>
>> This patch removes the setting of surpriseremoved in the interface
>> drivers and corrects the order in which lbs_stop_card and
>> lbs_remove_card are called. ?Tested on SPI with V9 firmware.
>
> Makes me a bit nervious; any chance you can test with usb8388 or SDIO
> firmware and hot-unplug or rmmod?


I'll comment on these separately:

- For USB, we hit the case where if_usb.c doesn't like the response
for CMD_802_11_FW_WAKE_METHOD and therefore decides that PS mode isn't
supported even though it is.  I suspect the IEEE PS would work
otherwise but I haven't had a chance to try it and I don't want to
cause a regression for whoever needed this wake-method check unless
it's really irrelevant.
- I've tested with SDIO, however reloading the module doesn't work due
to the other known issues being discussed and I don't have an '8688 to
try where it might work.  That said, with this patch SDIO does the
right thing in turning off IEEE PS, so I should have said that it has
been tested on SDIO as well.  On SPI I can also say that I can then
load the driver again and things work properly.

The setting of surpriseremoved=1 before calling lbs_remove_card is
wrong regardless because lbs_remove_card is then unable to actually
send commands.

 -Andrey

>> Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
>> ---
>> ?drivers/net/wireless/libertas/if_sdio.c | ? ?2 --
>> ?drivers/net/wireless/libertas/if_spi.c ?| ? ?4 ++--
>> ?drivers/net/wireless/libertas/if_usb.c ?| ? ?1 -
>> ?3 files changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
>> index 8cdb88c..6bb95ce 100644
>> --- a/drivers/net/wireless/libertas/if_sdio.c
>> +++ b/drivers/net/wireless/libertas/if_sdio.c
>> @@ -1096,8 +1096,6 @@ static void if_sdio_remove(struct sdio_func *func)
>> ? ? ? ? ? ? ? ? ? ? ? lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n");
>> ? ? ? }
>>
>> - ? ? card->priv->surpriseremoved = 1;
>> -
>> ? ? ? lbs_deb_sdio("call remove card\n");
>> ? ? ? lbs_stop_card(card->priv);
>> ? ? ? lbs_remove_card(card->priv);
>> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
>> index 923ed58..757352c 100644
>> --- a/drivers/net/wireless/libertas/if_spi.c
>> +++ b/drivers/net/wireless/libertas/if_spi.c
>> @@ -1171,12 +1171,12 @@ static int __devexit libertas_spi_remove(struct spi_device *spi)
>>
>> ? ? ? lbs_deb_spi("libertas_spi_remove\n");
>> ? ? ? lbs_deb_enter(LBS_DEB_SPI);
>> - ? ? priv->surpriseremoved = 1;
>>
>> ? ? ? lbs_stop_card(priv);
>> + ? ? lbs_remove_card(priv); /* will call free_netdev */
>> +
>> ? ? ? free_irq(spi->irq, card);
>> ? ? ? if_spi_terminate_spi_thread(card);
>> - ? ? lbs_remove_card(priv); /* will call free_netdev */
>> ? ? ? if (card->pdata->teardown)
>> ? ? ? ? ? ? ? card->pdata->teardown(spi);
>> ? ? ? free_if_spi_card(card);
>> diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
>> index ea3dc03..7e03f0e 100644
>> --- a/drivers/net/wireless/libertas/if_usb.c
>> +++ b/drivers/net/wireless/libertas/if_usb.c
>> @@ -357,7 +357,6 @@ static void if_usb_disconnect(struct usb_interface *intf)
>> ? ? ? cardp->surprise_removed = 1;
>>
>> ? ? ? if (priv) {
>> - ? ? ? ? ? ? priv->surpriseremoved = 1;
>> ? ? ? ? ? ? ? lbs_stop_card(priv);
>> ? ? ? ? ? ? ? lbs_remove_card(priv);
>> ? ? ? }
>
>


From andrey at cozybit.com  Tue Jun 16 16:20:01 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Tue, 16 Jun 2009 13:20:01 -0700
Subject: [PATCH v2] libertas: remove ps_supported flag, use fwcapinfo
In-Reply-To: <1245182438.28992.21.camel@130.81.190.10.in-addr.arpa>
References: <1245182438.28992.21.camel@130.81.190.10.in-addr.arpa>
Message-ID: <1245183601-5214-1-git-send-email-andrey@cozybit.com>

Power save support depends on the firmware capabilities rather than the
card's hardware interface.  Use the FW_CAPINFO_PS bit in the firmware
capabilities mask throughout the driver in place of the redundant
ps_supported flag and don't make decisions about PS support in the
interface drivers (with the exception of a special case in the USB
driver).

V2: put the USB special case in the right place.

Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
---
 drivers/net/wireless/libertas/dev.h     |    1 -
 drivers/net/wireless/libertas/if_cs.c   |    3 ---
 drivers/net/wireless/libertas/if_sdio.c |    3 ---
 drivers/net/wireless/libertas/if_spi.c  |    1 -
 drivers/net/wireless/libertas/if_usb.c  |    3 ++-
 drivers/net/wireless/libertas/wext.c    |    2 +-
 6 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index f9ec69e..578c697 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -260,7 +260,6 @@ struct lbs_private {
 	u16 psmode;		/* Wlan802_11PowermodeCAM=disable
 				   Wlan802_11PowermodeMAX_PSP=enable */
 	u32 psstate;
-	char ps_supported;
 	u8 needtowakeup;
 
 	struct assoc_request * pending_assoc_req;
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 2a5b083..f658fd6 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -933,9 +933,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
 		goto out3;
 	}
 
-	/* The firmware for the CF card supports powersave */
-	priv->ps_supported = 1;
-
 	ret = 0;
 	goto out;
 
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 8cdb88c..89396a7 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -1039,9 +1039,6 @@ static int if_sdio_probe(struct sdio_func *func,
 	if (ret)
 		goto err_activate_card;
 
-	if (priv->fwcapinfo & FW_CAPINFO_PS)
-		priv->ps_supported = 1;
-
 out:
 	lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
 
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 923ed58..956566b 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -1118,7 +1118,6 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 	priv->card = card;
 	priv->hw_host_to_card = if_spi_host_to_card;
 	priv->fw_ready = 1;
-	priv->ps_supported = 1;
 
 	/* Initialize interrupt handling stuff. */
 	card->run_thread = 1;
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index ea3dc03..16653c1 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -185,13 +185,14 @@ static void if_usb_setup_firmware(struct lbs_private *priv)
 	wake_method.action = cpu_to_le16(CMD_ACT_GET);
 	if (lbs_cmd_with_response(priv, CMD_802_11_FW_WAKE_METHOD, &wake_method)) {
 		lbs_pr_info("Firmware does not seem to support PS mode\n");
+		priv->fwcapinfo &= ~FW_CAPINFO_PS;
 	} else {
 		if (le16_to_cpu(wake_method.method) == CMD_WAKE_METHOD_COMMAND_INT) {
 			lbs_deb_usb("Firmware seems to support PS with wake-via-command\n");
-			priv->ps_supported = 1;
 		} else {
 			/* The versions which boot up this way don't seem to
 			   work even if we set it to the command interrupt */
+			priv->fwcapinfo &= ~FW_CAPINFO_PS;
 			lbs_pr_info("Firmware doesn't wake via command interrupt; disabling PS mode\n");
 		}
 	}
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 8bc1907..e96451c 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -712,7 +712,7 @@ static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,
 
 	lbs_deb_enter(LBS_DEB_WEXT);
 
-	if (!priv->ps_supported) {
+	if (!(priv->fwcapinfo & FW_CAPINFO_PS)) {
 		if (vwrq->disabled)
 			return 0;
 		else
-- 
1.5.6.3



From dcbw at redhat.com  Tue Jun 16 16:41:33 2009
From: dcbw at redhat.com (Dan Williams)
Date: Tue, 16 Jun 2009 16:41:33 -0400
Subject: [PATCH v2] libertas: remove ps_supported flag, use fwcapinfo
In-Reply-To: <1245183601-5214-1-git-send-email-andrey@cozybit.com>
References: <1245182438.28992.21.camel@130.81.190.10.in-addr.arpa>
	<1245183601-5214-1-git-send-email-andrey@cozybit.com>
Message-ID: <1245184893.28992.37.camel@130.81.190.10.in-addr.arpa>

On Tue, 2009-06-16 at 13:20 -0700, Andrey Yurovsky wrote:
> Power save support depends on the firmware capabilities rather than the
> card's hardware interface.  Use the FW_CAPINFO_PS bit in the firmware
> capabilities mask throughout the driver in place of the redundant
> ps_supported flag and don't make decisions about PS support in the
> interface drivers (with the exception of a special case in the USB
> driver).
> 
> V2: put the USB special case in the right place.
> 
> Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>

Acked-by: Dan Williams <dcbw at redhat.com>

> ---
>  drivers/net/wireless/libertas/dev.h     |    1 -
>  drivers/net/wireless/libertas/if_cs.c   |    3 ---
>  drivers/net/wireless/libertas/if_sdio.c |    3 ---
>  drivers/net/wireless/libertas/if_spi.c  |    1 -
>  drivers/net/wireless/libertas/if_usb.c  |    3 ++-
>  drivers/net/wireless/libertas/wext.c    |    2 +-
>  6 files changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
> index f9ec69e..578c697 100644
> --- a/drivers/net/wireless/libertas/dev.h
> +++ b/drivers/net/wireless/libertas/dev.h
> @@ -260,7 +260,6 @@ struct lbs_private {
>  	u16 psmode;		/* Wlan802_11PowermodeCAM=disable
>  				   Wlan802_11PowermodeMAX_PSP=enable */
>  	u32 psstate;
> -	char ps_supported;
>  	u8 needtowakeup;
>  
>  	struct assoc_request * pending_assoc_req;
> diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
> index 2a5b083..f658fd6 100644
> --- a/drivers/net/wireless/libertas/if_cs.c
> +++ b/drivers/net/wireless/libertas/if_cs.c
> @@ -933,9 +933,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
>  		goto out3;
>  	}
>  
> -	/* The firmware for the CF card supports powersave */
> -	priv->ps_supported = 1;
> -
>  	ret = 0;
>  	goto out;
>  
> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
> index 8cdb88c..89396a7 100644
> --- a/drivers/net/wireless/libertas/if_sdio.c
> +++ b/drivers/net/wireless/libertas/if_sdio.c
> @@ -1039,9 +1039,6 @@ static int if_sdio_probe(struct sdio_func *func,
>  	if (ret)
>  		goto err_activate_card;
>  
> -	if (priv->fwcapinfo & FW_CAPINFO_PS)
> -		priv->ps_supported = 1;
> -
>  out:
>  	lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret);
>  
> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
> index 923ed58..956566b 100644
> --- a/drivers/net/wireless/libertas/if_spi.c
> +++ b/drivers/net/wireless/libertas/if_spi.c
> @@ -1118,7 +1118,6 @@ static int __devinit if_spi_probe(struct spi_device *spi)
>  	priv->card = card;
>  	priv->hw_host_to_card = if_spi_host_to_card;
>  	priv->fw_ready = 1;
> -	priv->ps_supported = 1;
>  
>  	/* Initialize interrupt handling stuff. */
>  	card->run_thread = 1;
> diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
> index ea3dc03..16653c1 100644
> --- a/drivers/net/wireless/libertas/if_usb.c
> +++ b/drivers/net/wireless/libertas/if_usb.c
> @@ -185,13 +185,14 @@ static void if_usb_setup_firmware(struct lbs_private *priv)
>  	wake_method.action = cpu_to_le16(CMD_ACT_GET);
>  	if (lbs_cmd_with_response(priv, CMD_802_11_FW_WAKE_METHOD, &wake_method)) {
>  		lbs_pr_info("Firmware does not seem to support PS mode\n");
> +		priv->fwcapinfo &= ~FW_CAPINFO_PS;
>  	} else {
>  		if (le16_to_cpu(wake_method.method) == CMD_WAKE_METHOD_COMMAND_INT) {
>  			lbs_deb_usb("Firmware seems to support PS with wake-via-command\n");
> -			priv->ps_supported = 1;
>  		} else {
>  			/* The versions which boot up this way don't seem to
>  			   work even if we set it to the command interrupt */
> +			priv->fwcapinfo &= ~FW_CAPINFO_PS;
>  			lbs_pr_info("Firmware doesn't wake via command interrupt; disabling PS mode\n");
>  		}
>  	}
> diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
> index 8bc1907..e96451c 100644
> --- a/drivers/net/wireless/libertas/wext.c
> +++ b/drivers/net/wireless/libertas/wext.c
> @@ -712,7 +712,7 @@ static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,
>  
>  	lbs_deb_enter(LBS_DEB_WEXT);
>  
> -	if (!priv->ps_supported) {
> +	if (!(priv->fwcapinfo & FW_CAPINFO_PS)) {
>  		if (vwrq->disabled)
>  			return 0;
>  		else
> -- 
> 1.5.6.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



From dcbw at redhat.com  Tue Jun 16 17:06:47 2009
From: dcbw at redhat.com (Dan Williams)
Date: Tue, 16 Jun 2009 17:06:47 -0400
Subject: [PATCH] libertas: Fix re-enabling IEEE PS with WPA/WPA2
In-Reply-To: <45e8e6c40906161303y7be52452vf4cd16bbc3cc7e43@mail.gmail.com>
References: <1245096111-20884-1-git-send-email-andrey@cozybit.com>
	<1245182004.28992.18.camel@130.81.190.10.in-addr.arpa>
	<45e8e6c40906161303y7be52452vf4cd16bbc3cc7e43@mail.gmail.com>
Message-ID: <1245186407.28992.59.camel@130.81.190.10.in-addr.arpa>

On Tue, 2009-06-16 at 13:03 -0700, Andrey Yurovsky wrote:
> On Tue, Jun 16, 2009 at 12:53 PM, Dan Williams<dcbw at redhat.com> wrote:
> > On Mon, 2009-06-15 at 13:01 -0700, Andrey Yurovsky wrote:
> >> With IEEE PS enabled, the driver will temporarily take the device out of
> >> PS mode to issue commands and then re-enable PS once the commands have
> >> completed.  With WPA or WPA2 security, the driver fails to re-enable PS
> >> mode because of a check for key lengths that are always zero.
> >>
> >> This patch removes the key lengths check (the local copy of the keys is
> >> not maintained) and fixes IEEE PS mode with WPA or WPA2 security.
> >> Tested on GSPI and SDIO interfaces with V9 firmware.
> >
> > I have no idea what this code was trying to do originally (I'm pretty
> > sure it's a left-over from the vendor driver), but it seems like maybe
> > it was ensuring that the adapter did *not* return to power-save mode
> > until the supplicant had set the GTK?  There's a window where the GTK
> > won't be set, and we probably shouldn't be entering PS mode until that
> > window is closed.  Old sd8385 code from a Motorola phone has:
> >
> >        if ((Adapter->PSMode != Wlan802_11PowerModeCAM) &&
> >                        (Adapter->PSState == PS_STATE_FULL_POWER) &&
> >                        (Adapter->MediaConnectStatus ==
> >                         WlanMediaStateConnected)) {
> >                if(Adapter->SecInfo.WPAEnabled
> >                        || Adapter->SecInfo.WPA2Enabled
> >                ) {
> >                        if(Adapter->IsGTK_SET == TRUE) {
> >                                PRINTM(INFO, "EXEC_NEXT_CMD: WPA enabled and GTK_SET"
> >                                        " go back to PS_SLEEP");
> >                                PSSleep(priv, 0);
> >                        }
> >                } else
> >                {
> >                        PRINTM(INFO, "EXEC_NEXT_CMD: Command PendQ is empty,"
> >                                " go back to PS_SLEEP");
> >                        PSSleep(priv, 0);
> >                }
> >        }
> >
> > Says to me, "if WPA is enabled but the GTK hasn't been set yet, don't go
> > to sleep".
> >
> > Does that sound like a plausible explanation of what the original bits
> > intended to do?  Like I said, it was inherited, but there might have
> > been a good reason for it.
> 
> That might be the original intention, but assoc_helper_wpa_keys() sets
> both and lbs_cmd_802_11_key_material() then clears out the driver's
> copy, which is then (incorrectly) checked when deciding whether to go
> back to sleep.  As I understand it, the execution path for WPA/WPA2
> association shouldn't cause this situation where WPA is enabled but
> the GTK isn't set yet and we're deciding to go back to sleep.  Do you
> agree?  Should we even be keeping the 'driver copy' of the keys?  I
> don't see why we want to do that.  Thanks,

It might be possible to remove the priv->... bits; but here's why they
exist.

We keep shadow copies of the WEP & WPA keys in the priv structure to
represent the "current" values there, so that we don't have to hit the
hardware up every time somebody does an iwconfig.  That's somewhat bogus
because drivers don't actually guarantee that the current key will be
returned, but it's nice to have.

Second, we need to populate a new assoc_request with the "current" state
of the card when building up a change request.  That involves copying
that current state into the new association request, same as all the
other "current" values get stuffed into the request.  There are other
ways to do the association request stuff than this, like a list of
"change events", but some commands require more state than just the
particular thing to be changed, thus the assoc_request is trying to be a
picture of the adapter at the time it's created.

If we wanted to just hit the hardware up for the WEP & WPA keys when
doing 'iwconfig' then we could certainly just split up
lbs_cmd_802_11_key_material() into a getter and setter, which should
probably be done anway.

But that doesn't fix the issue of building up the assoc_request.  This
*could* all go away if/when we convert to cfg80211's WEXT compat stuff.
At that point we ditch the assoc_request junk (which was only there to
ensure 'iwconfig key xxxxx; iwconfig essid foobar' and the supplicant's
WEXT driver worked correctly) and maybe the private key copies in the
driver.

I think the bug here is actually that the driver isn't copying the keys
from the assoc_req to priv in assoc_helper_wpa_keys().  Thus the only
way the priv->wpa* get set is by getting them explicitly.

Dan

>   -Andrey
> 
> >> Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
> >> ---
> >>  drivers/net/wireless/libertas/cmd.c |   29 +++++++----------------------
> >>  1 files changed, 7 insertions(+), 22 deletions(-)
> >>
> >> diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
> >> index 01db705..5825396 100644
> >> --- a/drivers/net/wireless/libertas/cmd.c
> >> +++ b/drivers/net/wireless/libertas/cmd.c
> >> @@ -1782,32 +1782,17 @@ int lbs_execute_next_command(struct lbs_private *priv)
> >>               lbs_deb_host("EXEC_NEXT_CMD: sending command 0x%04x\n",
> >>                           le16_to_cpu(cmd->command));
> >>               lbs_submit_command(priv, cmdnode);
> >> -     } else {
> >> +     } else if ((priv->psmode != LBS802_11POWERMODECAM) &&
> >> +                (priv->psstate == PS_STATE_FULL_POWER) &&
> >> +                ((priv->connect_status == LBS_CONNECTED) ||
> >> +                (priv->mesh_connect_status == LBS_CONNECTED))) {
> >>               /*
> >>                * check if in power save mode, if yes, put the device back
> >>                * to PS mode
> >>                */
> >> -             if ((priv->psmode != LBS802_11POWERMODECAM) &&
> >> -                 (priv->psstate == PS_STATE_FULL_POWER) &&
> >> -                 ((priv->connect_status == LBS_CONNECTED) ||
> >> -                 (priv->mesh_connect_status == LBS_CONNECTED))) {
> >> -                     if (priv->secinfo.WPAenabled ||
> >> -                         priv->secinfo.WPA2enabled) {
> >> -                             /* check for valid WPA group keys */
> >> -                             if (priv->wpa_mcast_key.len ||
> >> -                                 priv->wpa_unicast_key.len) {
> >> -                                     lbs_deb_host(
> >> -                                            "EXEC_NEXT_CMD: WPA enabled and GTK_SET"
> >> -                                            " go back to PS_SLEEP");
> >> -                                     lbs_ps_sleep(priv, 0);
> >> -                             }
> >> -                     } else {
> >> -                             lbs_deb_host(
> >> -                                    "EXEC_NEXT_CMD: cmdpendingq empty, "
> >> -                                    "go back to PS_SLEEP");
> >> -                             lbs_ps_sleep(priv, 0);
> >> -                     }
> >> -             }
> >> +             lbs_deb_host("EXEC_NEXT_CMD: cmdpendingq empty, "
> >> +                             "go back to PS_SLEEP");
> >> +             lbs_ps_sleep(priv, 0);
> >>       }
> >>
> >>       ret = 0;
> >
> >



From dongas86 at gmail.com  Tue Jun 16 22:08:59 2009
From: dongas86 at gmail.com (Dongas)
Date: Wed, 17 Jun 2009 10:08:59 +0800
Subject: Libetas can not reload modules
In-Reply-To: <1245181540.28992.12.camel@130.81.190.10.in-addr.arpa>
References: <60ce8d250906121136g363ce5bfra0358ca90a89ea63@mail.gmail.com>
	<4A32B176.4000305@cam.ac.uk>
	<60ce8d250906132144y203c6daawea2f8b254bb89166@mail.gmail.com>
	<E14EEE7BCF0340BDB0C3BAA22013A6A7@irex.local>
	<4A3632F7.20003@cam.ac.uk>
	<60ce8d250906151003g10ef1e56r38f2d43ba468cff3@mail.gmail.com>
	<1245181540.28992.12.camel@130.81.190.10.in-addr.arpa>
Message-ID: <60ce8d250906161908sfdf7a2do15b0e65d73c28e83@mail.gmail.com>

2009/6/17 Dan Williams <dcbw at redhat.com>:
> On Tue, 2009-06-16 at 01:03 +0800, Dongas wrote:
>> 2009/6/15 Jonathan Cameron <jic23 at cam.ac.uk>:
>> >> 2009/6/13 Jonathan Cameron <jic23 at cam.ac.uk>:
>> >>> Dongas wrote:
>> >>>> Dear ALL,
>> >>>>
>> >>>> The issue i encounterred is that libertas modules can not be reloaed.
>> >>>> (It works well when i first insmod them)
>> >>>> I want to rmmod them and do the re-insmod, but the error message is
>> >>>> shown as follows:
>> >>>> # insmod libertas_sdio.ko
>> >>>> libertas_sdio: Libertas SDIO driver
>> >>>> libertas_sdio: Copyright Pierre Ossman
>> >>>> ??
>> >>>> libertas: failed to load helper firmware
>> >>>> libertas leave: if_sdio_prog_helper(), ret -110
>> >>>>
>> >>>> After digging in the code, i found that the libertas driver will check
>> >>>> IF_SDIO_IO_RDY and IF_SDIO_DL_RDY bit in IF_SDIO_STATUS register for
>> >>>> the firmware downloading(CMD53 write) operation.
>> >>>> However, the SDIO status read back of mine card indicated that the
>> >>>> card IF_SDIO_DL_RDY bit was alway not set during the module reload
>> >>>> operation.Then the timeout happened with '-ETIMEDOUT' returned.
>> >>>>
>> >>>> Is there any body know why?
>> >>> This turns up on the mailing list from time to time.
>> >>> I think the firmware still still doesn't play ball.
>> >>
>> >> Jonathan , thanks for your reply.
>> >> (I havn't searched out many related mails failed by this issue in the maillist.)
>> >> Could you please clarify a bit more?
>> >
>> > I think the last discussion about this was the one following on from...
>> >
>> > http://lists.infradead.org/pipermail/libertas-dev/2008-September/001928.html
>> >
>> >> Why the firmware still still doesn't play ball?
>> > Don't know. Unfortunately I wasn't in a position to run Marvell's driver and find
>> > out whether their reset code actually works, but we never managed to replicate it
>> > using the in kernel code.
>> >> Is there any way to fix this issue?
>> > We never really managed to isolate the cause I'm afraid.
>> >
>>
>> I also tried two methods in the thread you mentioned, a)
>> enable/disable function and b) CMD_802_11_RESET command, but they
>> didn't work as you experienced.
>> From the discussion in that thread, it seems this issue has some
>> relationship with HW errata of Marvell WiFi chip , right?
>>
>> I wonder did you find a work around solution for this issue at last?
>>
>> Since i'm using libertas driver in kernel 2.6.25, i'd also like to
>> know if this issue still exists in kernel 2.6.29?
>
> It probably does. ?If you're using an embedded system, you might be able
> to hook up a GPIO to kill power to the card like the OLPC USB driver
> does. ?But at this time, there is no known way of fully resetting the
> device other than cutting power to the 8686/8688 device.

Thanks a lot, Dan.
Yes, i'm using an embedded system based on ARM926 core.
We will try the HW method you mentioned.

> We'd need some insight into the firmware and bus-level stuff to figure
> out why the card doesn't reset itself from CMD_802_11_RESET. ?Maybe we
> should investigate that again; the v10 docs still say CMD_802_11_RESET
> is the correct method to return the card to a clean state.

Hmmm, i know Marvell  doesn't play well with community.
AFAIK, Marvell never release the firmware code, right?
So it may be hard to find the root cause.

BTW, it seems you have checked Mobin driver,
How does it treat this issue?

> The sd8688 has additional commands that could also help here, Bing Zhao
> has been adding support for those to 2.6.31 and later. ?But I assume
> you're using 8686 and thus those commands aren't supported.
>
I'm using 8686.

Thanks again for your kindly help.

Regards
Dongas


From dcbw at redhat.com  Wed Jun 17 09:43:19 2009
From: dcbw at redhat.com (Dan Williams)
Date: Wed, 17 Jun 2009 09:43:19 -0400
Subject: Libetas can not reload modules
In-Reply-To: <60ce8d250906161908sfdf7a2do15b0e65d73c28e83@mail.gmail.com>
References: <60ce8d250906121136g363ce5bfra0358ca90a89ea63@mail.gmail.com>
	<4A32B176.4000305@cam.ac.uk>
	<60ce8d250906132144y203c6daawea2f8b254bb89166@mail.gmail.com>
	<E14EEE7BCF0340BDB0C3BAA22013A6A7@irex.local>
	<4A3632F7.20003@cam.ac.uk>
	<60ce8d250906151003g10ef1e56r38f2d43ba468cff3@mail.gmail.com>
	<1245181540.28992.12.camel@130.81.190.10.in-addr.arpa>
	<60ce8d250906161908sfdf7a2do15b0e65d73c28e83@mail.gmail.com>
Message-ID: <1245246199.2646.5.camel@130.81.190.10.in-addr.arpa>

On Wed, 2009-06-17 at 10:08 +0800, Dongas wrote:
> 2009/6/17 Dan Williams <dcbw at redhat.com>:
> > On Tue, 2009-06-16 at 01:03 +0800, Dongas wrote:
> >> 2009/6/15 Jonathan Cameron <jic23 at cam.ac.uk>:
> >> >> 2009/6/13 Jonathan Cameron <jic23 at cam.ac.uk>:
> >> >>> Dongas wrote:
> >> >>>> Dear ALL,
> >> >>>>
> >> >>>> The issue i encounterred is that libertas modules can not be reloaed.
> >> >>>> (It works well when i first insmod them)
> >> >>>> I want to rmmod them and do the re-insmod, but the error message is
> >> >>>> shown as follows:
> >> >>>> # insmod libertas_sdio.ko
> >> >>>> libertas_sdio: Libertas SDIO driver
> >> >>>> libertas_sdio: Copyright Pierre Ossman
> >> >>>> ??
> >> >>>> libertas: failed to load helper firmware
> >> >>>> libertas leave: if_sdio_prog_helper(), ret -110
> >> >>>>
> >> >>>> After digging in the code, i found that the libertas driver will check
> >> >>>> IF_SDIO_IO_RDY and IF_SDIO_DL_RDY bit in IF_SDIO_STATUS register for
> >> >>>> the firmware downloading(CMD53 write) operation.
> >> >>>> However, the SDIO status read back of mine card indicated that the
> >> >>>> card IF_SDIO_DL_RDY bit was alway not set during the module reload
> >> >>>> operation.Then the timeout happened with '-ETIMEDOUT' returned.
> >> >>>>
> >> >>>> Is there any body know why?
> >> >>> This turns up on the mailing list from time to time.
> >> >>> I think the firmware still still doesn't play ball.
> >> >>
> >> >> Jonathan , thanks for your reply.
> >> >> (I havn't searched out many related mails failed by this issue in the maillist.)
> >> >> Could you please clarify a bit more?
> >> >
> >> > I think the last discussion about this was the one following on from...
> >> >
> >> > http://lists.infradead.org/pipermail/libertas-dev/2008-September/001928.html
> >> >
> >> >> Why the firmware still still doesn't play ball?
> >> > Don't know. Unfortunately I wasn't in a position to run Marvell's driver and find
> >> > out whether their reset code actually works, but we never managed to replicate it
> >> > using the in kernel code.
> >> >> Is there any way to fix this issue?
> >> > We never really managed to isolate the cause I'm afraid.
> >> >
> >>
> >> I also tried two methods in the thread you mentioned, a)
> >> enable/disable function and b) CMD_802_11_RESET command, but they
> >> didn't work as you experienced.
> >> From the discussion in that thread, it seems this issue has some
> >> relationship with HW errata of Marvell WiFi chip , right?
> >>
> >> I wonder did you find a work around solution for this issue at last?
> >>
> >> Since i'm using libertas driver in kernel 2.6.25, i'd also like to
> >> know if this issue still exists in kernel 2.6.29?
> >
> > It probably does.  If you're using an embedded system, you might be able
> > to hook up a GPIO to kill power to the card like the OLPC USB driver
> > does.  But at this time, there is no known way of fully resetting the
> > device other than cutting power to the 8686/8688 device.
> 
> Thanks a lot, Dan.
> Yes, i'm using an embedded system based on ARM926 core.
> We will try the HW method you mentioned.

See if that works; that's probably the *most* foolproof method at this
time.  On module unload, you'd toggle power to the card or something,
and then wait a few seconds, and then bring power back up so that
there's something to bind the driver to.

> > We'd need some insight into the firmware and bus-level stuff to figure
> > out why the card doesn't reset itself from CMD_802_11_RESET.  Maybe we
> > should investigate that again; the v10 docs still say CMD_802_11_RESET
> > is the correct method to return the card to a clean state.
> 
> Hmmm, i know Marvell  doesn't play well with community.
> AFAIK, Marvell never release the firmware code, right?
> So it may be hard to find the root cause.

Marvell is actually fairly good about playing with the community these
days, particularly in the ARM and ethernet space, and is fairly good
about the wifi space.

> BTW, it seems you have checked Mobin driver,
> How does it treat this issue?

I haven't checked, but it might make sense to do so.  I'd also actually
like to try CMD_802_11_RESET again just to make sure.

Dan

> > The sd8688 has additional commands that could also help here, Bing Zhao
> > has been adding support for those to 2.6.31 and later.  But I assume
> > you're using 8686 and thus those commands aren't supported.
> >
> I'm using 8686.
> 
> Thanks again for your kindly help.
> 
> Regards
> Dongas
> 
> _______________________________________________
> libertas-dev mailing list
> libertas-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev



From dongas86 at gmail.com  Wed Jun 17 10:27:56 2009
From: dongas86 at gmail.com (Dongas)
Date: Wed, 17 Jun 2009 22:27:56 +0800
Subject: Libetas can not reload modules
In-Reply-To: <1245246199.2646.5.camel@130.81.190.10.in-addr.arpa>
References: <60ce8d250906121136g363ce5bfra0358ca90a89ea63@mail.gmail.com>
	<4A32B176.4000305@cam.ac.uk>
	<60ce8d250906132144y203c6daawea2f8b254bb89166@mail.gmail.com>
	<E14EEE7BCF0340BDB0C3BAA22013A6A7@irex.local>
	<4A3632F7.20003@cam.ac.uk>
	<60ce8d250906151003g10ef1e56r38f2d43ba468cff3@mail.gmail.com>
	<1245181540.28992.12.camel@130.81.190.10.in-addr.arpa>
	<60ce8d250906161908sfdf7a2do15b0e65d73c28e83@mail.gmail.com>
	<1245246199.2646.5.camel@130.81.190.10.in-addr.arpa>
Message-ID: <60ce8d250906170727g7f6bb879kca8b084d83696d87@mail.gmail.com>

2009/6/17 Dan Williams <dcbw at redhat.com>:
>> Thanks a lot, Dan.
>> Yes, i'm using an embedded system based on ARM926 core.
>> We will try the HW method you mentioned.
>
> See if that works; that's probably the *most* foolproof method at this
> time. ?On module unload, you'd toggle power to the card or something,
> and then wait a few seconds, and then bring power back up so that
> there's something to bind the driver to.

We have tried this method today.
God hates me , the issue i encounterred is that when we toggled the
power off after unloaded libertas modules,
the SDIO card registered in kernel would be removed automaticlly since
a card(remove) detection interrupt happened.
The message is "mmc1: card 0001 removed".
But when we powered on the card again, there's no card (insert)
detection interrupt happened, so the SDIO card can not be registered
into kernel aucomaticlly.

Anway, this may have something with our HW.
I will consult with our HW engineer and i will also try the waiting a
few seconds before power up again as you said.

>> > We'd need some insight into the firmware and bus-level stuff to figure
>> > out why the card doesn't reset itself from CMD_802_11_RESET. ?Maybe we
>> > should investigate that again; the v10 docs still say CMD_802_11_RESET
>> > is the correct method to return the card to a clean state.
>>
>> Hmmm, i know Marvell ?doesn't play well with community.
>> AFAIK, Marvell never release the firmware code, right?
>> So it may be hard to find the root cause.
>
> Marvell is actually fairly good about playing with the community these
> days, particularly in the ARM and ethernet space, and is fairly good
> about the wifi space.

Good news.

>> BTW, it seems you have checked Mobin driver,
>> How does it treat this issue?
>
> I haven't checked, but it might make sense to do so. ?I'd also actually
> like to try CMD_802_11_RESET again just to make sure.

Yes, it would be worthwhile giving a try.
Good luck! :-)

Thanks

Regard
Dongas


From dongas86 at gmail.com  Wed Jun 17 11:05:21 2009
From: dongas86 at gmail.com (Dongas)
Date: Wed, 17 Jun 2009 23:05:21 +0800
Subject: transmit timed out when downloading files
In-Reply-To: <60ce8d250906160754m2312d387kf37052b9aa25afdc@mail.gmail.com>
References: <60ce8d250906160754m2312d387kf37052b9aa25afdc@mail.gmail.com>
Message-ID: <60ce8d250906170805m40ef30fn4a210dc815517a3c@mail.gmail.com>

2009/6/16 Dongas <dongas86 at gmail.com>:
> Dear ALL,
>
> I'm facing a urgent issue that 'transmit timed out' issue frequently
> happened when i downloaded files with WiFi function.
> The WiFi modules i used is based on Marvell 8686 chipset and the
> dirver is libertas in kernel 2.6.25.
>
> The error message is as follows:
> (I also tried downloading other files, but with the same issue)
> # wget http://172.31.42.217/move.rar &
> # Connecting to 172.31.42.217 (172.31.42.217:80)
> move.rar ? ? ? ? ? ? ?14% |**** ? ? ? ? ? ? ? ? ? ? ? ? ? | 21061k
> 00:16:07 ETA[ ?270.720049] NETDEV WATCHDOG: eth0: transmit timed out
> [ ?270.725166] libertas: tx watch dog timeout
> move.rar ? ? ? ? ? ? ?14% |**** ? ? ? ? ? ? ? ? ? ? ? ? ? | 21061k ?-
> stalled -[ ?275.720063] libertas: Command 1f timed out
> [ ?275.724291] libertas: requeueing command 1f due to timeout (#1)
> move.rar ? ? ? ? ? ? ?14% |**** ? ? ? ? ? ? ? ? ? ? ? ? ? | 21061k ?-
> stalled -[ ?280.720062] NETDEV WATCHDOG: eth0: transmit timed out
> [ ?280.725176] libertas: tx watch dog timeout
> move.rar ? ? ? ? ? ? ?14% |**** ? ? ? ? ? ? ? ? ? ? ? ? ? | 21061k ?-
> stalled -[ ?285.720062] libertas: Command 1f timed out
> [ ?285.724284] libertas: requeueing command 1f due to timeout (#2)
> move.rar ? ? ? ? ? ? ?14% |**** ? ? ? ? ? ? ? ? ? ? ? ? ? | 21061k ?-
> stalled -[ ?290.720049] NETDEV WATCHDOG: eth0: transmit timed out
> [ ?290.725162] libertas: tx watch dog timeout
> move.rar ? ? ? ? ? ? ?14% |**** ? ? ? ? ? ? ? ? ? ? ? ? ? | 21061k ?-
> stalled -[ ?295.720063] libertas: Command 1f timed out
> [ ?295.724288] libertas: requeueing command 1f due to timeout (#3)
> ????
> Then the downloading process stuck at here.
>
> With the libertas debug info is fully enabled, the message is as follows:
> -------------------------------------------------------------------------------------------------------------------------------------------
> ??
> [ 1172.260000] libertas enter (INT): lbs_hard_start_xmit():69
> [ 1172.260000] libertas TX Data: 00 1d 09 01 18 75 00 1a 6b a0 c7 58
> 08 00 45 00
> [ 1172.270000] libertas TX Data: 00 34 a2 2f 40 00 40 06 ea a2 ac 1f
> 2a da ac 1f
> [ 1172.280000] libertas TX Data: 2a d9 e1 68 00 50 43 df 34 c7 58 9e
> ca 00 80 10
> [ 1172.290000] libertas TX Data: 68 ae 43 8d 00 00 01 01 08 0a 00 01
> 53 3c 00 1a
> [ 1172.290000] libertas TX Data: 4c 3a
> [ 1172.300000] libertas txpd: 48 0e 06 c5 a8 c6 03 c0 00 06 d7 c3 00 00 00 00
> [ 1172.300000] libertas txpd: 00 00 06 c5 00 06 d7 c3
> [ 1172.310000] libertas Tx Data: 00 1d 09 01 18 75 00 1a 6b a0 c7 58
> 08 00 45 00
> [ 1172.320000] libertas Tx Data: 00 34 a2 2f 40 00 40 06 ea a2 ac 1f
> 2a da ac 1f
> [ 1172.320000] libertas Tx Data: 2a d9 e1 68 00 50 43 df 34 c7 58 9e
> ca 00 80 10
> [ 1172.330000] libertas Tx Data: 68 ae 43 8d 00 00 01 01 08 0a 00 01
> 53 3c 00 1a
> [ 1172.340000] libertas Tx Data: 4c 3a
> [ 1172.340000] libertas tx (INT): lbs_hard_start_xmit lined up packet
> [ 1172.350000] libertas leave (INT): lbs_hard_start_xmit():169, ret 0
>
> [ 1172.360000] libertas enter: if_sdio_host_to_card_worker():361
> [ 1172.360000] libertas thread: main-thread 111: intcounter=0
> currenttxskb=00000000 dnld_sent=1
> [ 1172.370000] libertas thread: main-thread sleeping... Conn=0 IntC=0
> PS_mode=0 PS_State=0
>
> 10M.mp3 ? ? ? ? ? ? ? 24% |******* ? ? ? ? ? ? ? ? ? ? ? ?| ?2510k ?-
> stalled -[ 1178.000000] NETDEV WATCHDOG: eth0: transmit timed out
> [ 1178.000000] libertas enter (INT): lbs_tx_timeout():472
> [ 1178.010000] libertas: tx watch dog timeout
> [ 1178.010000] libertas enter (INT): lbs_host_to_card_done():500
> [ 1178.020000] libertas leave (INT): lbs_host_to_card_done():511
> [ 1178.020000] libertas enter (INT): lbs_prepare_and_send_command():1318
> [ 1178.030000] libertas enter (INT): lbs_get_cmd_ctrl_node():1679
> [ 1178.030000] libertas leave (INT): lbs_get_cmd_ctrl_node():1697
> [ 1178.040000] libertas enter (INT): lbs_set_cmd_ctrl_node():1720
> [ 1178.050000] libertas leave (INT): lbs_set_cmd_ctrl_node():1728
> [ 1178.050000] libertas host (INT): PREP_CMD: command 0x001f
> [ 1178.060000] libertas enter (INT): lbs_cmd_802_11_rssi():830
> [ 1178.060000] libertas leave (INT): lbs_cmd_802_11_rssi():843
> [ 1178.070000] libertas enter (INT): lbs_queue_cmd():1093
> [ 1178.070000] libertas host (INT): QUEUE_CMD: inserted command 0x001f
> into cmdpendingq
> [ 1178.080000] libertas leave (INT): lbs_queue_cmd():1128
> [ 1178.090000] libertas leave (INT): lbs_prepare_and_send_command():1577, ret 0
> [ 1178.090000] libertas leave (INT): lbs_tx_timeout():493
> [ 1178.100000] libertas thread: main-thread 222 (waking up):
> intcounter=0 currenttxskb=00000000 dnld_sent=0
> [ 1178.110000] libertas thread: main-thread 333: intcounter=0
> currenttxskb=00000000 dnld_sent=0
> [ 1178.120000] libertas thread: main-thread 444: intcounter=0
> currenttxskb=00000000 dnld_sent=0
> [ 1178.130000] libertas enter: lbs_execute_next_command():1749
> [ 1178.130000] libertas host: EXEC_NEXT_CMD: OK to send command 0x001f
> in psstate 0
> [ 1178.140000] libertas host: EXEC_NEXT_CMD: sending command 0x001f
> [ 1178.140000] libertas enter: lbs_submit_command():1141
> [ 1178.150000] libertas host: DNLD_CMD: command 0x001f, seq 21, size
> 16, jiffies 87815
> [ 1178.160000] libertas DNLD_CMD: 1f 00 10 00 15 00 00 00 08 00 00 00
> 00 00 00 00
> [ 1178.170000] libertas enter: if_sdio_host_to_card(type 1, bytes 16):726
> [ 1178.170000] libertas leave: if_sdio_host_to_card():796, ret 0
> [ 1178.180000] libertas cmd: DNLD_CMD: sent command 0x001f, jiffies 87818
> [ 1178.180000] libertas leave: lbs_submit_command():1176
> [ 1178.190000] libertas leave: lbs_execute_next_command():1884
> [ 1178.200000] libertas thread: main-thread 111: intcounter=0
> currenttxskb=00000000 dnld_sent=2
> [ 1178.200000] libertas thread: main-thread sleeping... Conn=0 IntC=0
> PS_mode=0 PS_State=0
> 10M.mp3 ? ? ? ? ? ? ? 24% |******* ? ? ? ? ? ? ? ? ? ? ? ?| ?2510k ?-
> stalled -[ 1183.180000] libertas enter (INT): command_timer_fn():971
> [ 1183.180000] libertas: Command 1f timed out
> [ 1183.180000] libertas leave (INT): command_timer_fn():985
> [ 1183.190000] libertas thread: main-thread 222 (waking up):
> intcounter=0 currenttxskb=00000000 dnld_sent=2
> [ 1183.200000] libertas thread: main-thread 333: intcounter=0
> currenttxskb=00000000 dnld_sent=2
> [ 1183.210000] libertas thread: main-thread 444: intcounter=0
> currenttxskb=00000000 dnld_sent=2
> [ 1183.210000] libertas: requeueing command 1f due to timeout (#1)
> [ 1183.220000] libertas thread: main-thread 111: intcounter=0
> currenttxskb=00000000 dnld_sent=2
> [ 1183.230000] libertas thread: main-thread sleeping... Conn=0 IntC=0
> PS_mode=0 PS_State=0
> 10M.mp3 ? ? ? ? ? ? ? 24% |******* ? ? ? ? ? ? ? ? ? ? ? ?| ?2510k ?-
> stalled -[ 1188.000000] NETDEV WATCHDOG: eth0: transmit timed out
> [ 1188.000000] libertas enter (INT): lbs_tx_timeout():472
> [ 1188.010000] libertas: tx watch dog timeout
> [ 1188.010000] libertas enter (INT): lbs_host_to_card_done():500
> [ 1188.020000] libertas leave (INT): lbs_host_to_card_done():511
> [ 1188.020000] libertas enter (INT): lbs_prepare_and_send_command():1318
> [ 1188.030000] libertas enter (INT): lbs_get_cmd_ctrl_node():1679
> [ 1188.030000] libertas leave (INT): lbs_get_cmd_ctrl_node():1697
> [ 1188.040000] libertas enter (INT): lbs_set_cmd_ctrl_node():1720
> [ 1188.050000] libertas leave (INT): lbs_set_cmd_ctrl_node():1728
> [ 1188.050000] libertas host (INT): PREP_CMD: command 0x001f
> [ 1188.060000] libertas enter (INT): lbs_cmd_802_11_rssi():830
> [ 1188.060000] libertas leave (INT): lbs_cmd_802_11_rssi():843
> [ 1188.070000] libertas enter (INT): lbs_queue_cmd():1093
> [ 1188.070000] libertas host (INT): QUEUE_CMD: inserted command 0x001f
> into cmdpendingq
> [ 1188.080000] libertas leave (INT): lbs_queue_cmd():1128
> [ 1188.090000] libertas leave (INT): lbs_prepare_and_send_command():1577, ret 0
> [ 1188.090000] libertas leave (INT): lbs_tx_timeout():493
> [ 1188.100000] libertas thread: main-thread 222 (waking up):
> intcounter=0 currenttxskb=00000000 dnld_sent=0
> [ 1188.110000] libertas thread: main-thread 333: intcounter=0
> currenttxskb=00000000 dnld_sent=0
> [ 1188.120000] libertas thread: main-thread 444: intcounter=0
> currenttxskb=00000000 dnld_sent=0
> [ 1188.130000] libertas enter: lbs_execute_next_command():1749
> [ 1188.130000] libertas host: EXEC_NEXT_CMD: OK to send command 0x001f
> in psstate 0
> [ 1188.140000] libertas host: EXEC_NEXT_CMD: sending command 0x001f
> [ 1188.140000] libertas enter: lbs_submit_command():1141
> [ 1188.150000] libertas host: DNLD_CMD: command 0x001f, seq 21, size
> 16, jiffies 88815
> [ 1188.160000] libertas DNLD_CMD: 1f 00 10 00 15 00 00 00 08 00 00 00
> 00 00 00 00
> [ 1188.170000] libertas enter: if_sdio_host_to_card(type 1, bytes 16):726
> [ 1188.170000] libertas leave: if_sdio_host_to_card():796, ret 0
> [ 1188.180000] libertas cmd: DNLD_CMD: sent command 0x001f, jiffies 88818
> [ 1188.180000] libertas leave: lbs_submit_command():1176
> [ 1188.190000] libertas leave: lbs_execute_next_command():1884
> [ 1188.200000] libertas thread: main-thread 111: intcounter=0
> currenttxskb=00000000 dnld_sent=2
> [ 1188.200000] libertas thread: main-thread sleeping... Conn=0 IntC=0
> PS_mode=0 PS_State=0
> 10M.mp3 ? ? ? ? ? ? ? 24% |******* ? ? ? ? ? ? ? ? ? ? ? ?| ?2510k ?-
> stalled -[ 1193.180000] libertas enter (INT): command_timer_fn():971
> [ 1193.180000] libertas: Command 1f timed out
> [ 1193.180000] libertas leave (INT): command_timer_fn():985
> [ 1193.190000] libertas thread: main-thread 222 (waking up):
> intcounter=0 currenttxskb=00000000 dnld_sent=2
> [ 1193.200000] libertas thread: main-thread 333: intcounter=0
> currenttxskb=00000000 dnld_sent=2
> [ 1193.210000] libertas thread: main-thread 444: intcounter=0
> currenttxskb=00000000 dnld_sent=2
> [ 1193.210000] libertas: requeueing command 1f due to timeout (#2)
> [ 1193.220000] libertas thread: main-thread 111: intcounter=0
> currenttxskb=00000000 dnld_sent=2
> [ 1193.230000] libertas thread: main-thread sleeping... Conn=0 IntC=0
> PS_mode=0 PS_State=0
> 10M.mp3 ? ? ? ? ? ? ? 24% |******* ? ? ? ? ? ? ? ? ? ? ? ?| ?2510k ?-
> stalled -[ 1198.000000] NETDEV WATCHDOG: eth0: transmit timed out
> ??????
> ------------------------------------------------------------------------------------------------------
>
> It would be highly appreciated if someone can provide any hints to fix
> the issue.
>

I know the 'transmission timeout' coud be considered as a normal
phenomenon for network driver caused by its nature.
Each driver should be capable of handling this issue properly to
complete the transmission .

However the issue i encountered is that once the transmit timeout
happened, the libertas driver never has the opportunity to resume the
transfer, alway timeout.

I'm not very familiar with Libertas driver, maybe someone of you can
provide some hints for me to debug this issue quickly since the tight
time i have.

After digging in the code , i found when the transmit timeout
happened, the libertas will try to send a CMD_802_11_RSSI command to
help resume the transfer.
But from the log above, during the invoking of if_sdio_host_to_card
function, when the "packet_worker" is waken for the next real data
transfer, the if_sdio_host_to_card_worker function should be excuted
soon.
But in my error log, this function was never excuted once the timeout
issue happened.
There's must be something wrong.

I'm not sure if this has something to do with my "trasnmit timeout"
issue, but up to this point , i only found it.
I will continue to investigate this issue.

I hope someone can give me some hints which would be high appreciated.

Thanks

Best Regards
Dongas


From andrey at cozybit.com  Wed Jun 17 21:30:27 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Wed, 17 Jun 2009 18:30:27 -0700
Subject: [PATCH] libertas: copy WPA keys to priv when associating
In-Reply-To: <1245186407.28992.59.camel@130.81.190.10.in-addr.arpa>
References: <1245186407.28992.59.camel@130.81.190.10.in-addr.arpa>
Message-ID: <1245288627-21442-1-git-send-email-andrey@cozybit.com>

Libertas currently maintains a copy of the WPA unicast and group keys
when using WPA or WPA2.  This copy is checked when deciding whether or
not to return to sleep in IEEE PS mode but the actual copying back to
priv was omitted, which breaks IEEE PS mode with WPA/WPA2 when one
issues commands that require temporarily keeping the device awake.

This patch introduces the omitted copy-back of the keys so that IEEE PS
functions correctly in WPA/WPA2 mode.  Thanks to Dan Williams for
clearing up the issue.

Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
---
 drivers/net/wireless/libertas/assoc.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index b9b3741..b7c7cb0 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -1368,11 +1368,17 @@ static int assoc_helper_wpa_keys(struct lbs_private *priv,
 	if (ret)
 		goto out;
 
+	memcpy(&priv->wpa_unicast_key, &assoc_req->wpa_mcast_key,
+			sizeof(struct enc_key));
+
 	if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) {
 		clear_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags);
 
 		ret = lbs_cmd_802_11_key_material(priv, CMD_ACT_SET, assoc_req);
 		assoc_req->flags = flags;
+
+		memcpy(&priv->wpa_mcast_key, &assoc_req->wpa_mcast_key,
+				sizeof(struct enc_key));
 	}
 
 out:
-- 
1.5.6.3



From andrey at cozybit.com  Wed Jun 17 21:45:34 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Wed, 17 Jun 2009 18:45:34 -0700
Subject: [PATCH V2] libertas: copy WPA keys to priv when associating
In-Reply-To: <1245186407.28992.59.camel@130.81.190.10.in-addr.arpa>
References: <1245186407.28992.59.camel@130.81.190.10.in-addr.arpa>
Message-ID: <1245289534-21888-1-git-send-email-andrey@cozybit.com>

Libertas currently maintains a copy of the WPA unicast and group keys
when using WPA or WPA2.  This copy is checked when deciding whether or
not to return to sleep in IEEE PS mode but the actual copying back to
priv was omitted, which breaks IEEE PS mode with WPA/WPA2 when one
issues commands that require temporarily keeping the device awake.

This patch introduces the omitted copy-back of the keys so that IEEE PS
functions correctly in WPA/WPA2 mode.  Thanks to Dan Williams for
clearing up the issue.

V2: fix typo.  Also, this has been tested on GSPI and SDIO with V9 firmware.

Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
---
 drivers/net/wireless/libertas/assoc.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index b9b3741..b7c7cb0 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -1368,11 +1368,17 @@ static int assoc_helper_wpa_keys(struct lbs_private *priv,
 	if (ret)
 		goto out;
 
+	memcpy(&priv->wpa_unicast_key, &assoc_req->wpa_unicast_key,
+			sizeof(struct enc_key));
+
 	if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) {
 		clear_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags);
 
 		ret = lbs_cmd_802_11_key_material(priv, CMD_ACT_SET, assoc_req);
 		assoc_req->flags = flags;
+
+		memcpy(&priv->wpa_mcast_key, &assoc_req->wpa_mcast_key,
+				sizeof(struct enc_key));
 	}
 
 out:
-- 
1.5.6.3



From andrey at cozybit.com  Wed Jun 17 22:08:45 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Wed, 17 Jun 2009 19:08:45 -0700
Subject: [PATCH] libertas: correct card cleanup order in SPI driver
Message-ID: <1245290925-25468-1-git-send-email-andrey@cozybit.com>

The SPI driver does a couple of card cleanup steps in the wrong order on
module removal.  If IEEE PS is enabled, this results in the card being
left in IEEE PS mode and subsequent failures to reload the module.  The
problem is that the surpriseremoved flag is set before calling
lbs_remove_card, but that function needs to issue a command to exit IEEE
PS mode (the flag blocks the command path).  In addition, lbs_stop_card
should be called first because it clears out any pending commands.

Tested on a GSPI device with V9 firmware by confirming that we can
reload the module with or without IEEE PS enabled.

Also fix a warning from the wrong uint format in a printk.

Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
---
 drivers/net/wireless/libertas/if_spi.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 923ed58..8d8bc0b 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -737,7 +737,7 @@ static int if_spi_c2h_data(struct if_spi_card *card)
 		goto out;
 	} else if (len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
 		lbs_pr_err("%s: error: card has %d bytes of data, but "
-			   "our maximum skb size is %lu\n",
+			   "our maximum skb size is %u\n",
 			   __func__, len, MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
 		err = -EINVAL;
 		goto out;
@@ -1171,12 +1171,13 @@ static int __devexit libertas_spi_remove(struct spi_device *spi)
 
 	lbs_deb_spi("libertas_spi_remove\n");
 	lbs_deb_enter(LBS_DEB_SPI);
-	priv->surpriseremoved = 1;
 
 	lbs_stop_card(priv);
+	lbs_remove_card(priv); /* will call free_netdev */
+
+	priv->surpriseremoved = 1;
 	free_irq(spi->irq, card);
 	if_spi_terminate_spi_thread(card);
-	lbs_remove_card(priv); /* will call free_netdev */
 	if (card->pdata->teardown)
 		card->pdata->teardown(spi);
 	free_if_spi_card(card);
-- 
1.5.6.3



From andrey at cozybit.com  Wed Jun 17 22:15:19 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Wed, 17 Jun 2009 19:15:19 -0700
Subject: [PATCH] libertas: fix card cleanup order in SDIO driver
Message-ID: <1245291319-26118-1-git-send-email-andrey@cozybit.com>

The SDIO driver sets the surpriseremoved flag before calling
lbs_remove_card.  With IEEE PS enabled, lbs_remove_card must issue a
command to exit IEEE PS mode, however with that flag set the command
path is blocked and the card is never taken out of IEEE PS mode.  This
step is required to ensure that the driver can be reloaded.  This patch
moves the setting of surpriseremoved after lbs_remove_card is called.

Tested with V9 firmware by ensuring that IEEE PS is disabled when the
driver is removed.  Reloading the driver is not fully tested due to a
separate issue with module reload in the SDIO driver, however this
patch at least leaves the card in a better state when we bring the
driver down.

Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
---
 drivers/net/wireless/libertas/if_sdio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 8cdb88c..d48ed62 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -1096,11 +1096,11 @@ static void if_sdio_remove(struct sdio_func *func)
 			lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n");
 	}
 
-	card->priv->surpriseremoved = 1;
 
 	lbs_deb_sdio("call remove card\n");
 	lbs_stop_card(card->priv);
 	lbs_remove_card(card->priv);
+	card->priv->surpriseremoved = 1;
 
 	flush_workqueue(card->workqueue);
 	destroy_workqueue(card->workqueue);
-- 
1.5.6.3



From sebastian at breakpoint.cc  Thu Jun 18 04:12:06 2009
From: sebastian at breakpoint.cc (Sebastian Andrzej Siewior)
Date: Thu, 18 Jun 2009 10:12:06 +0200
Subject: [PATCH] libertas: correct card cleanup order in SPI driver
In-Reply-To: <1245290925-25468-1-git-send-email-andrey@cozybit.com>
References: <1245290925-25468-1-git-send-email-andrey@cozybit.com>
Message-ID: <20090618081206.GB2770@Chamillionaire.breakpoint.cc>

* Andrey Yurovsky | 2009-06-17 19:08:45 [-0700]:

>Also fix a warning from the wrong uint format in a printk.
>
>Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
>---
> drivers/net/wireless/libertas/if_spi.c |    7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
>index 923ed58..8d8bc0b 100644
>--- a/drivers/net/wireless/libertas/if_spi.c
>+++ b/drivers/net/wireless/libertas/if_spi.c
>@@ -737,7 +737,7 @@ static int if_spi_c2h_data(struct if_spi_card *card)
> 		goto out;
> 	} else if (len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
> 		lbs_pr_err("%s: error: card has %d bytes of data, but "
>-			   "our maximum skb size is %lu\n",
>+			   "our maximum skb size is %u\n",
ehm, this reverts commit 9b171ffe1 aka "libertas: fix format warning" in
Dave's next tree [0]. Max skb is defined via

|#define MRVDRV_ETH_RX_PACKET_BUFFER_SIZE \
|    (ETH_FRAME_LEN + sizeof(struct rxpd) \
|     + MRVDRV_SNAP_HEADER_LEN + EXTRA_LEN)

and sizeof() probably says which type it is, so this is probably 32bit
vs 64bit. Wouldn't this be the perfect place for the z modifier?

[0]
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=9b171ffe1b3004587f4a90ef293531a4a262e538

Sebastian


From andrey at cozybit.com  Thu Jun 18 12:51:57 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Thu, 18 Jun 2009 09:51:57 -0700
Subject: [PATCH] libertas: correct card cleanup order in SPI driver
In-Reply-To: <20090618081206.GB2770@Chamillionaire.breakpoint.cc>
References: <20090618081206.GB2770@Chamillionaire.breakpoint.cc>
Message-ID: <1245343917-15534-1-git-send-email-andrey@cozybit.com>

The SPI driver does a couple of card cleanup steps in the wrong order on
module removal.  If IEEE PS is enabled, this results in the card being
left in IEEE PS mode and subsequent failures to reload the module.  The
problem is that the surpriseremoved flag is set before calling
lbs_remove_card, but that function needs to issue a command to exit IEEE
PS mode (the flag blocks the command path).  In addition, lbs_stop_card
should be called first because it clears out any pending commands.

Tested on a GSPI device with V9 firmware by confirming that we can
reload the module with or without IEEE PS enabled.

Also fix a warning from the wrong uint format in a printk.

V2: use z modifier, thanks Sebastian.

Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
---
 drivers/net/wireless/libertas/if_spi.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 923ed58..8d8bc0b 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -737,7 +737,7 @@ static int if_spi_c2h_data(struct if_spi_card *card)
 		goto out;
 	} else if (len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
 		lbs_pr_err("%s: error: card has %d bytes of data, but "
-			   "our maximum skb size is %lu\n",
+			   "our maximum skb size is %zu\n",
 			   __func__, len, MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
 		err = -EINVAL;
 		goto out;
@@ -1171,12 +1171,13 @@ static int __devexit libertas_spi_remove(struct spi_device *spi)
 
 	lbs_deb_spi("libertas_spi_remove\n");
 	lbs_deb_enter(LBS_DEB_SPI);
-	priv->surpriseremoved = 1;
 
 	lbs_stop_card(priv);
+	lbs_remove_card(priv); /* will call free_netdev */
+
+	priv->surpriseremoved = 1;
 	free_irq(spi->irq, card);
 	if_spi_terminate_spi_thread(card);
-	lbs_remove_card(priv); /* will call free_netdev */
 	if (card->pdata->teardown)
 		card->pdata->teardown(spi);
 	free_if_spi_card(card);
-- 
1.5.6.3



From pgf at laptop.org  Fri Jun 19 10:55:29 2009
From: pgf at laptop.org (Paul Fox)
Date: Fri, 19 Jun 2009 10:55:29 -0400
Subject: bug: sleeping function called from invalid context ... libertas/cmd.c
Message-ID: <14415.1245423329@foxharp.boston.ma.us>

hi --

on the OLPC XO laptop, i'm seeing the following backtrace fairly
often.  my network management program uses iwconfig a lot, so i
may see it more than others might.  i'm running 2.6.30 (slightly
OLPC-modified, but not at this level), so i think the libertas
driver is pretty current.

btw, this has been mentioned before on this list:
    http://lists.infradead.org/pipermail/libertas-dev/2008-May/001532.html
but i didn't see a resolution -- was there one?  (i haven't yet
convinced myself of exactly when it occurs for me, so i can't say
my symptom is identical to that poster's.)

paul


 [47060.669580] BUG: sleeping function called from invalid context at drivers/net/wireless/libertas/cmd.c:2084
 [47060.669615] in_atomic(): 1, irqs_disabled(): 0, pid: 1994, name: iwconfig
 [47060.669646] Pid: 1994, comm: iwconfig Tainted: G        W  2.6.30pgf #10
 [47060.669667] Call Trace:
 [47060.669710]  [<c0411753>] __might_sleep+0xd6/0xdb
 [47060.669853]  [<cc8154d8>] __lbs_cmd+0x8d/0x17c [libertas]
 [47060.669891]  [<c051ed4d>] ? vsnprintf+0x22a/0x267
 [47060.670087]  [<cc813366>] lbs_get_wireless_stats+0x1c9/0x2f3 [libertas]
 [47060.670183]  [<cc814d7f>] ? lbs_cmd_copyback+0x0/0x48 [libertas]
 [47060.670185]  [<c065b9fc>] wireless_seq_show+0x45/0xdd
 [47060.670185]  [<c048455c>] seq_read+0x2a3/0x372
 [47060.670185]  [<c04a2fcf>] proc_reg_read+0x6a/0x84
 [47060.670185]  [<c04842b9>] ? seq_read+0x0/0x372
 [47060.670185]  [<c04a2fcf>] ? proc_reg_read+0x6a/0x84
 [47060.670185]  [<c047066b>] vfs_read+0x88/0x106
 [47060.670185]  [<c04a2f65>] ? proc_reg_read+0x0/0x84
 [47060.670185]  [<c04707a2>] sys_read+0x4a/0x7a
 [47060.670185]  [<c0403434>] sysenter_do_call+0x12/0x26
 [47060.670185]  [<c0403434>] ? sysenter_do_call+0x12/0x26
 [47060.670185] BUG: scheduling while atomic: iwconfig/1994/0x00000002
 [47060.670185] Modules linked in: rfcomm bnep l2cap uinput usb8xxx libertas btusb bluetooth usbhid mousedev lib80211 psmouse ehci_hcd serio_raw ohci_hcd cs5535_gpio usbcore [last unloaded: rfcomm]
 [47060.670185] Pid: 1994, comm: iwconfig Tainted: G        W  2.6.30pgf #10
 [47060.670185] Call Trace:
 [47060.670185]  [<c041241c>] __schedule_bug+0x47/0x4c
 [47060.670185]  [<c06629d5>] __schedule+0x6e/0x47e
 [47060.670185]  [<c0405371>] ? show_trace+0x10/0x14
 [47060.670185]  [<c0662df7>] schedule+0x12/0x2b
 [47060.670185]  [<c0662df7>] ? schedule+0x12/0x2b
 [47060.670185]  [<cc815532>] __lbs_cmd+0xe7/0x17c [libertas]
 [47060.670185]  [<c0427f45>] ? autoremove_wake_function+0x0/0x2f
 [47060.670185]  [<cc813366>] lbs_get_wireless_stats+0x1c9/0x2f3 [libertas]
 [47060.670185]  [<cc814d7f>] ? lbs_cmd_copyback+0x0/0x48 [libertas]
 [47060.670185]  [<c065b9fc>] wireless_seq_show+0x45/0xdd
 [47060.670185]  [<c048455c>] seq_read+0x2a3/0x372
 [47060.670185]  [<c04a2fcf>] proc_reg_read+0x6a/0x84
 [47060.670185]  [<c04842b9>] ? seq_read+0x0/0x372
 [47060.670185]  [<c04a2fcf>] ? proc_reg_read+0x6a/0x84
 [47060.670185]  [<c047066b>] vfs_read+0x88/0x106
 [47060.670185]  [<c04a2f65>] ? proc_reg_read+0x0/0x84
 [47060.670185]  [<c04707a2>] sys_read+0x4a/0x7a
 [47060.670185]  [<c0403434>] sysenter_do_call+0x12/0x26
 [47060.670185]  [<c0403434>] ? sysenter_do_call+0x12/0x26
 [47060.672482] BUG: scheduling while atomic: iwconfig/1994/0x00000002
 [47060.672502] Modules linked in: rfcomm bnep l2cap uinput usb8xxx libertas btusb bluetooth usbhid mousedev lib80211 psmouse ehci_hcd serio_raw ohci_hcd cs5535_gpio usbcore [last unloaded: rfcomm]
 [47060.672648] Pid: 1994, comm: iwconfig Tainted: G        W  2.6.30pgf #10
 [47060.672669] Call Trace:
 [47060.672702]  [<c041241c>] __schedule_bug+0x47/0x4c
 [47060.672737]  [<c06629d5>] __schedule+0x6e/0x47e
 [47060.672768]  [<c0411313>] ? __wake_up+0x32/0x3b
 [47060.672806]  [<c0662df7>] schedule+0x12/0x2b
 [47060.672838]  [<c0662df7>] ? schedule+0x12/0x2b
 [47060.672935]  [<cc815532>] __lbs_cmd+0xe7/0x17c [libertas]
 [47060.672974]  [<c0427f45>] ? autoremove_wake_function+0x0/0x2f
 [47060.673071]  [<cc813366>] lbs_get_wireless_stats+0x1c9/0x2f3 [libertas]
 [47060.673166]  [<cc814d7f>] ? lbs_cmd_copyback+0x0/0x48 [libertas]
 [47060.673211]  [<c065b9fc>] wireless_seq_show+0x45/0xdd
 [47060.673244]  [<c048455c>] seq_read+0x2a3/0x372
 [47060.673283]  [<c04a2fcf>] proc_reg_read+0x6a/0x84
 [47060.673312]  [<c04842b9>] ? seq_read+0x0/0x372
 [47060.673344]  [<c04a2fcf>] ? proc_reg_read+0x6a/0x84
 [47060.673378]  [<c047066b>] vfs_read+0x88/0x106
 [47060.673410]  [<c04a2f65>] ? proc_reg_read+0x0/0x84
 [47060.673441]  [<c04707a2>] sys_read+0x4a/0x7a
 [47060.673477]  [<c0403434>] sysenter_do_call+0x12/0x26
 [47060.673508]  [<c0403434>] ? sysenter_do_call+0x12/0x26


=---------------------
 paul fox, pgf at laptop.org


From andrey at cozybit.com  Fri Jun 19 18:39:28 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Fri, 19 Jun 2009 15:39:28 -0700
Subject: [RFC] libertas: remove TX queues from GSPI driver
Message-ID: <1245451168-3336-1-git-send-email-andrey@cozybit.com>

Posting this as an RFC in case others want to help test it.  This
work-in-progress patch removes the redundant command and data TX queues
from the Libertas GSPI driver, it also therefore removes a memcpy from
if_spi_host_to_card and the locking mechanisms for the queues in
question.  The goal is to improve performance and reduce overhead by
simplifying the TX path.

The driver works after this patch, however IEEE PS is somewhat broken
(especially temporarily waking the device to issue commands).  This is
caused, in part, by the IRQ handler preempting the libertas main thread
(for example, when the main thread calls if_spi_host_to_card and an IRQ
comes in) so we need a synchronization solution that allows interrupt
servicing to be done when it's safe to do so, that is we need to lock
the bus properly.

Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>
---
 drivers/net/wireless/libertas/if_spi.c |  133 ++------------------------------
 1 files changed, 7 insertions(+), 126 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 956566b..622cbc7 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -32,12 +32,6 @@
 #include "dev.h"
 #include "if_spi.h"
 
-struct if_spi_packet {
-	struct list_head		list;
-	u16				blen;
-	u8				buffer[0] __attribute__((aligned(4)));
-};
-
 struct if_spi_card {
 	struct spi_device		*spi;
 	struct lbs_private		*priv;
@@ -66,33 +60,12 @@ struct if_spi_card {
 	struct semaphore		spi_thread_terminated;
 
 	u8				cmd_buffer[IF_SPI_CMD_BUF_SIZE];
-
-	/* A buffer of incoming packets from libertas core.
-	 * Since we can't sleep in hw_host_to_card, we have to buffer
-	 * them. */
-	struct list_head		cmd_packet_list;
-	struct list_head		data_packet_list;
-
-	/* Protects cmd_packet_list and data_packet_list */
-	spinlock_t			buffer_lock;
 };
 
 static void free_if_spi_card(struct if_spi_card *card)
 {
-	struct list_head *cursor, *next;
-	struct if_spi_packet *packet;
-
 	BUG_ON(card->run_thread);
-	list_for_each_safe(cursor, next, &card->cmd_packet_list) {
-		packet = container_of(cursor, struct if_spi_packet, list);
-		list_del(&packet->list);
-		kfree(packet);
-	}
-	list_for_each_safe(cursor, next, &card->data_packet_list) {
-		packet = container_of(cursor, struct if_spi_packet, list);
-		list_del(&packet->list);
-		kfree(packet);
-	}
+
 	spi_set_drvdata(card->spi, NULL);
 	kfree(card);
 }
@@ -774,40 +747,6 @@ out:
 	return err;
 }
 
-/* Move data or a command from the host to the card. */
-static void if_spi_h2c(struct if_spi_card *card,
-			struct if_spi_packet *packet, int type)
-{
-	int err = 0;
-	u16 int_type, port_reg;
-
-	switch (type) {
-	case MVMS_DAT:
-		int_type = IF_SPI_CIC_TX_DOWNLOAD_OVER;
-		port_reg = IF_SPI_DATA_RDWRPORT_REG;
-		break;
-	case MVMS_CMD:
-		int_type = IF_SPI_CIC_CMD_DOWNLOAD_OVER;
-		port_reg = IF_SPI_CMD_RDWRPORT_REG;
-		break;
-	default:
-		lbs_pr_err("can't transfer buffer of type %d\n", type);
-		err = -EINVAL;
-		goto out;
-	}
-
-	/* Write the data to the card */
-	err = spu_write(card, port_reg, packet->buffer, packet->blen);
-	if (err)
-		goto out;
-
-out:
-	kfree(packet);
-
-	if (err)
-		lbs_pr_err("%s: error %d\n", __func__, err);
-}
-
 /* Inform the host about a card event */
 static void if_spi_e2h(struct if_spi_card *card)
 {
@@ -837,8 +776,6 @@ static int lbs_spi_thread(void *data)
 	int err;
 	struct if_spi_card *card = data;
 	u16 hiStatus;
-	unsigned long flags;
-	struct if_spi_packet *packet;
 
 	while (1) {
 		/* Wait to be woken up by one of two things.  First, our ISR
@@ -877,43 +814,10 @@ static int lbs_spi_thread(void *data)
 		if (hiStatus & IF_SPI_HIST_CMD_DOWNLOAD_RDY ||
 		   (card->priv->psstate != PS_STATE_FULL_POWER &&
 		    (hiStatus & IF_SPI_HIST_TX_DOWNLOAD_RDY))) {
-			/* This means two things. First of all,
-			 * if there was a previous command sent, the card has
-			 * successfully received it.
-			 * Secondly, it is now ready to download another
-			 * command.
-			 */
 			lbs_host_to_card_done(card->priv);
 
-			/* Do we have any command packets from the host to
-			 * send? */
-			packet = NULL;
-			spin_lock_irqsave(&card->buffer_lock, flags);
-			if (!list_empty(&card->cmd_packet_list)) {
-				packet = (struct if_spi_packet *)(card->
-						cmd_packet_list.next);
-				list_del(&packet->list);
-			}
-			spin_unlock_irqrestore(&card->buffer_lock, flags);
-
-			if (packet)
-				if_spi_h2c(card, packet, MVMS_CMD);
 		}
-		if (hiStatus & IF_SPI_HIST_TX_DOWNLOAD_RDY) {
-			/* Do we have any data packets from the host to
-			 * send? */
-			packet = NULL;
-			spin_lock_irqsave(&card->buffer_lock, flags);
-			if (!list_empty(&card->data_packet_list)) {
-				packet = (struct if_spi_packet *)(card->
-						data_packet_list.next);
-				list_del(&packet->list);
-			}
-			spin_unlock_irqrestore(&card->buffer_lock, flags);
 
-			if (packet)
-				if_spi_h2c(card, packet, MVMS_DAT);
-		}
 		if (hiStatus & IF_SPI_HIST_CARD_EVENT)
 			if_spi_e2h(card);
 
@@ -942,40 +846,20 @@ static int if_spi_host_to_card(struct lbs_private *priv,
 				u8 type, u8 *buf, u16 nb)
 {
 	int err = 0;
-	unsigned long flags;
 	struct if_spi_card *card = priv->card;
-	struct if_spi_packet *packet;
-	u16 blen;
 
 	lbs_deb_enter_args(LBS_DEB_SPI, "type %d, bytes %d", type, nb);
 
-	if (nb == 0) {
-		lbs_pr_err("%s: invalid size requested: %d\n", __func__, nb);
-		err = -EINVAL;
-		goto out;
-	}
-	blen = ALIGN(nb, 4);
-	packet = kzalloc(sizeof(struct if_spi_packet) + blen, GFP_ATOMIC);
-	if (!packet) {
-		err = -ENOMEM;
-		goto out;
-	}
-	packet->blen = blen;
-	memcpy(packet->buffer, buf, nb);
-	memset(packet->buffer + nb, 0, blen - nb);
+	nb = ALIGN(nb, 4);
 
 	switch (type) {
 	case MVMS_CMD:
 		priv->dnld_sent = DNLD_CMD_SENT;
-		spin_lock_irqsave(&card->buffer_lock, flags);
-		list_add_tail(&packet->list, &card->cmd_packet_list);
-		spin_unlock_irqrestore(&card->buffer_lock, flags);
+		err = spu_write(card, IF_SPI_CMD_RDWRPORT_REG, buf, nb);
 		break;
 	case MVMS_DAT:
 		priv->dnld_sent = DNLD_DATA_SENT;
-		spin_lock_irqsave(&card->buffer_lock, flags);
-		list_add_tail(&packet->list, &card->data_packet_list);
-		spin_unlock_irqrestore(&card->buffer_lock, flags);
+		err = spu_write(card, IF_SPI_DATA_RDWRPORT_REG, buf, nb);
 		break;
 	default:
 		lbs_pr_err("can't transfer buffer of type %d", type);
@@ -983,9 +867,6 @@ static int if_spi_host_to_card(struct lbs_private *priv,
 		break;
 	}
 
-	/* Wake up the spi thread */
-	up(&card->spi_ready);
-out:
 	lbs_deb_leave_args(LBS_DEB_SPI, "err=%d", err);
 	return err;
 }
@@ -1062,9 +943,6 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 
 	sema_init(&card->spi_ready, 0);
 	sema_init(&card->spi_thread_terminated, 0);
-	INIT_LIST_HEAD(&card->cmd_packet_list);
-	INIT_LIST_HEAD(&card->data_packet_list);
-	spin_lock_init(&card->buffer_lock);
 
 	/* Initialize the SPI Interface Unit */
 	err = spu_init(card, pdata->use_dummy_writes);
@@ -1138,6 +1016,9 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 		goto terminate_thread;
 	}
 
+	/* poke the interrupt handler, otherwise we miss the first interrupt */
+	up(&card->spi_ready);
+
 	/* Start the card.
 	 * This will call register_netdev, and we'll start
 	 * getting interrupts... */
-- 
1.5.6.3



From dcbw at redhat.com  Mon Jun 22 10:29:00 2009
From: dcbw at redhat.com (Dan Williams)
Date: Mon, 22 Jun 2009 10:29:00 -0400
Subject: [PATCH V2] libertas: copy WPA keys to priv when associating
In-Reply-To: <1245289534-21888-1-git-send-email-andrey@cozybit.com>
References: <1245186407.28992.59.camel@130.81.190.10.in-addr.arpa>
	<1245289534-21888-1-git-send-email-andrey@cozybit.com>
Message-ID: <1245680940.4338.20.camel@dhcp-100-3-98.bos.redhat.com>

On Wed, 2009-06-17 at 18:45 -0700, Andrey Yurovsky wrote:
> Libertas currently maintains a copy of the WPA unicast and group keys
> when using WPA or WPA2.  This copy is checked when deciding whether or
> not to return to sleep in IEEE PS mode but the actual copying back to
> priv was omitted, which breaks IEEE PS mode with WPA/WPA2 when one
> issues commands that require temporarily keeping the device awake.
> 
> This patch introduces the omitted copy-back of the keys so that IEEE PS
> functions correctly in WPA/WPA2 mode.  Thanks to Dan Williams for
> clearing up the issue.
> 
> V2: fix typo.  Also, this has been tested on GSPI and SDIO with V9 firmware.
> 
> Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>

Acked-by: Dan Williams <dcbw at redhat.com>

Thanks!

> ---
>  drivers/net/wireless/libertas/assoc.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
> index b9b3741..b7c7cb0 100644
> --- a/drivers/net/wireless/libertas/assoc.c
> +++ b/drivers/net/wireless/libertas/assoc.c
> @@ -1368,11 +1368,17 @@ static int assoc_helper_wpa_keys(struct lbs_private *priv,
>  	if (ret)
>  		goto out;
>  
> +	memcpy(&priv->wpa_unicast_key, &assoc_req->wpa_unicast_key,
> +			sizeof(struct enc_key));
> +
>  	if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) {
>  		clear_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags);
>  
>  		ret = lbs_cmd_802_11_key_material(priv, CMD_ACT_SET, assoc_req);
>  		assoc_req->flags = flags;
> +
> +		memcpy(&priv->wpa_mcast_key, &assoc_req->wpa_mcast_key,
> +				sizeof(struct enc_key));
>  	}
>  
>  out:



From dcbw at redhat.com  Mon Jun 22 10:33:42 2009
From: dcbw at redhat.com (Dan Williams)
Date: Mon, 22 Jun 2009 10:33:42 -0400
Subject: bug: sleeping function called from invalid context ...
	libertas/cmd.c
In-Reply-To: <14415.1245423329@foxharp.boston.ma.us>
References: <14415.1245423329@foxharp.boston.ma.us>
Message-ID: <1245681222.4338.22.camel@dhcp-100-3-98.bos.redhat.com>

On Fri, 2009-06-19 at 10:55 -0400, Paul Fox wrote:
> hi --
> 
> on the OLPC XO laptop, i'm seeing the following backtrace fairly
> often.  my network management program uses iwconfig a lot, so i
> may see it more than others might.  i'm running 2.6.30 (slightly
> OLPC-modified, but not at this level), so i think the libertas
> driver is pretty current.
> 
> btw, this has been mentioned before on this list:
>     http://lists.infradead.org/pipermail/libertas-dev/2008-May/001532.html
> but i didn't see a resolution -- was there one?  (i haven't yet
> convinced myself of exactly when it occurs for me, so i can't say
> my symptom is identical to that poster's.)

This occurs because the GET_LOG command is sent from the get_stats
handler in wext.c, and that grabs some spinlocks and disables
interrupts.  The only way to fix this is to cache the values in the
driver and check them periodically or when data comes in or something
like that, and the reflect the cached values from the get_stats WEXT
handler.  That means cat /proc/net/wireless and such won't always return
current statistics, but its the best we can do for now.

Dan

> paul
> 
> 
>  [47060.669580] BUG: sleeping function called from invalid context at drivers/net/wireless/libertas/cmd.c:2084
>  [47060.669615] in_atomic(): 1, irqs_disabled(): 0, pid: 1994, name: iwconfig
>  [47060.669646] Pid: 1994, comm: iwconfig Tainted: G        W  2.6.30pgf #10
>  [47060.669667] Call Trace:
>  [47060.669710]  [<c0411753>] __might_sleep+0xd6/0xdb
>  [47060.669853]  [<cc8154d8>] __lbs_cmd+0x8d/0x17c [libertas]
>  [47060.669891]  [<c051ed4d>] ? vsnprintf+0x22a/0x267
>  [47060.670087]  [<cc813366>] lbs_get_wireless_stats+0x1c9/0x2f3 [libertas]
>  [47060.670183]  [<cc814d7f>] ? lbs_cmd_copyback+0x0/0x48 [libertas]
>  [47060.670185]  [<c065b9fc>] wireless_seq_show+0x45/0xdd
>  [47060.670185]  [<c048455c>] seq_read+0x2a3/0x372
>  [47060.670185]  [<c04a2fcf>] proc_reg_read+0x6a/0x84
>  [47060.670185]  [<c04842b9>] ? seq_read+0x0/0x372
>  [47060.670185]  [<c04a2fcf>] ? proc_reg_read+0x6a/0x84
>  [47060.670185]  [<c047066b>] vfs_read+0x88/0x106
>  [47060.670185]  [<c04a2f65>] ? proc_reg_read+0x0/0x84
>  [47060.670185]  [<c04707a2>] sys_read+0x4a/0x7a
>  [47060.670185]  [<c0403434>] sysenter_do_call+0x12/0x26
>  [47060.670185]  [<c0403434>] ? sysenter_do_call+0x12/0x26
>  [47060.670185] BUG: scheduling while atomic: iwconfig/1994/0x00000002
>  [47060.670185] Modules linked in: rfcomm bnep l2cap uinput usb8xxx libertas btusb bluetooth usbhid mousedev lib80211 psmouse ehci_hcd serio_raw ohci_hcd cs5535_gpio usbcore [last unloaded: rfcomm]
>  [47060.670185] Pid: 1994, comm: iwconfig Tainted: G        W  2.6.30pgf #10
>  [47060.670185] Call Trace:
>  [47060.670185]  [<c041241c>] __schedule_bug+0x47/0x4c
>  [47060.670185]  [<c06629d5>] __schedule+0x6e/0x47e
>  [47060.670185]  [<c0405371>] ? show_trace+0x10/0x14
>  [47060.670185]  [<c0662df7>] schedule+0x12/0x2b
>  [47060.670185]  [<c0662df7>] ? schedule+0x12/0x2b
>  [47060.670185]  [<cc815532>] __lbs_cmd+0xe7/0x17c [libertas]
>  [47060.670185]  [<c0427f45>] ? autoremove_wake_function+0x0/0x2f
>  [47060.670185]  [<cc813366>] lbs_get_wireless_stats+0x1c9/0x2f3 [libertas]
>  [47060.670185]  [<cc814d7f>] ? lbs_cmd_copyback+0x0/0x48 [libertas]
>  [47060.670185]  [<c065b9fc>] wireless_seq_show+0x45/0xdd
>  [47060.670185]  [<c048455c>] seq_read+0x2a3/0x372
>  [47060.670185]  [<c04a2fcf>] proc_reg_read+0x6a/0x84
>  [47060.670185]  [<c04842b9>] ? seq_read+0x0/0x372
>  [47060.670185]  [<c04a2fcf>] ? proc_reg_read+0x6a/0x84
>  [47060.670185]  [<c047066b>] vfs_read+0x88/0x106
>  [47060.670185]  [<c04a2f65>] ? proc_reg_read+0x0/0x84
>  [47060.670185]  [<c04707a2>] sys_read+0x4a/0x7a
>  [47060.670185]  [<c0403434>] sysenter_do_call+0x12/0x26
>  [47060.670185]  [<c0403434>] ? sysenter_do_call+0x12/0x26
>  [47060.672482] BUG: scheduling while atomic: iwconfig/1994/0x00000002
>  [47060.672502] Modules linked in: rfcomm bnep l2cap uinput usb8xxx libertas btusb bluetooth usbhid mousedev lib80211 psmouse ehci_hcd serio_raw ohci_hcd cs5535_gpio usbcore [last unloaded: rfcomm]
>  [47060.672648] Pid: 1994, comm: iwconfig Tainted: G        W  2.6.30pgf #10
>  [47060.672669] Call Trace:
>  [47060.672702]  [<c041241c>] __schedule_bug+0x47/0x4c
>  [47060.672737]  [<c06629d5>] __schedule+0x6e/0x47e
>  [47060.672768]  [<c0411313>] ? __wake_up+0x32/0x3b
>  [47060.672806]  [<c0662df7>] schedule+0x12/0x2b
>  [47060.672838]  [<c0662df7>] ? schedule+0x12/0x2b
>  [47060.672935]  [<cc815532>] __lbs_cmd+0xe7/0x17c [libertas]
>  [47060.672974]  [<c0427f45>] ? autoremove_wake_function+0x0/0x2f
>  [47060.673071]  [<cc813366>] lbs_get_wireless_stats+0x1c9/0x2f3 [libertas]
>  [47060.673166]  [<cc814d7f>] ? lbs_cmd_copyback+0x0/0x48 [libertas]
>  [47060.673211]  [<c065b9fc>] wireless_seq_show+0x45/0xdd
>  [47060.673244]  [<c048455c>] seq_read+0x2a3/0x372
>  [47060.673283]  [<c04a2fcf>] proc_reg_read+0x6a/0x84
>  [47060.673312]  [<c04842b9>] ? seq_read+0x0/0x372
>  [47060.673344]  [<c04a2fcf>] ? proc_reg_read+0x6a/0x84
>  [47060.673378]  [<c047066b>] vfs_read+0x88/0x106
>  [47060.673410]  [<c04a2f65>] ? proc_reg_read+0x0/0x84
>  [47060.673441]  [<c04707a2>] sys_read+0x4a/0x7a
>  [47060.673477]  [<c0403434>] sysenter_do_call+0x12/0x26
>  [47060.673508]  [<c0403434>] ? sysenter_do_call+0x12/0x26
> 
> 
> =---------------------
>  paul fox, pgf at laptop.org
> 
> _______________________________________________
> libertas-dev mailing list
> libertas-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev



From dcbw at redhat.com  Mon Jun 22 10:48:02 2009
From: dcbw at redhat.com (Dan Williams)
Date: Mon, 22 Jun 2009 10:48:02 -0400
Subject: [PATCH] libertas: fix card cleanup order in SDIO driver
In-Reply-To: <1245291319-26118-1-git-send-email-andrey@cozybit.com>
References: <1245291319-26118-1-git-send-email-andrey@cozybit.com>
Message-ID: <1245682082.4338.25.camel@dhcp-100-3-98.bos.redhat.com>

On Wed, 2009-06-17 at 19:15 -0700, Andrey Yurovsky wrote:
> The SDIO driver sets the surpriseremoved flag before calling
> lbs_remove_card.  With IEEE PS enabled, lbs_remove_card must issue a
> command to exit IEEE PS mode, however with that flag set the command
> path is blocked and the card is never taken out of IEEE PS mode.  This
> step is required to ensure that the driver can be reloaded.  This patch
> moves the setting of surpriseremoved after lbs_remove_card is called.
> 
> Tested with V9 firmware by ensuring that IEEE PS is disabled when the
> driver is removed.  Reloading the driver is not fully tested due to a
> separate issue with module reload in the SDIO driver, however this
> patch at least leaves the card in a better state when we bring the
> driver down.
> 
> Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>

Acked-by: Dan Williams <dcbw at redhat.com>

> ---
>  drivers/net/wireless/libertas/if_sdio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
> index 8cdb88c..d48ed62 100644
> --- a/drivers/net/wireless/libertas/if_sdio.c
> +++ b/drivers/net/wireless/libertas/if_sdio.c
> @@ -1096,11 +1096,11 @@ static void if_sdio_remove(struct sdio_func *func)
>  			lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n");
>  	}
>  
> -	card->priv->surpriseremoved = 1;
>  
>  	lbs_deb_sdio("call remove card\n");
>  	lbs_stop_card(card->priv);
>  	lbs_remove_card(card->priv);
> +	card->priv->surpriseremoved = 1;
>  
>  	flush_workqueue(card->workqueue);
>  	destroy_workqueue(card->workqueue);



From dcbw at redhat.com  Mon Jun 22 10:48:13 2009
From: dcbw at redhat.com (Dan Williams)
Date: Mon, 22 Jun 2009 10:48:13 -0400
Subject: [PATCH] libertas: correct card cleanup order in SPI driver
In-Reply-To: <1245343917-15534-1-git-send-email-andrey@cozybit.com>
References: <20090618081206.GB2770@Chamillionaire.breakpoint.cc>
	<1245343917-15534-1-git-send-email-andrey@cozybit.com>
Message-ID: <1245682093.4338.26.camel@dhcp-100-3-98.bos.redhat.com>

On Thu, 2009-06-18 at 09:51 -0700, Andrey Yurovsky wrote:
> The SPI driver does a couple of card cleanup steps in the wrong order on
> module removal.  If IEEE PS is enabled, this results in the card being
> left in IEEE PS mode and subsequent failures to reload the module.  The
> problem is that the surpriseremoved flag is set before calling
> lbs_remove_card, but that function needs to issue a command to exit IEEE
> PS mode (the flag blocks the command path).  In addition, lbs_stop_card
> should be called first because it clears out any pending commands.
> 
> Tested on a GSPI device with V9 firmware by confirming that we can
> reload the module with or without IEEE PS enabled.
> 
> Also fix a warning from the wrong uint format in a printk.
> 
> V2: use z modifier, thanks Sebastian.
> 
> Signed-off-by: Andrey Yurovsky <andrey at cozybit.com>

Acked-by: Dan Williams <dcbw at redhat.com>

> ---
>  drivers/net/wireless/libertas/if_spi.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
> index 923ed58..8d8bc0b 100644
> --- a/drivers/net/wireless/libertas/if_spi.c
> +++ b/drivers/net/wireless/libertas/if_spi.c
> @@ -737,7 +737,7 @@ static int if_spi_c2h_data(struct if_spi_card *card)
>  		goto out;
>  	} else if (len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
>  		lbs_pr_err("%s: error: card has %d bytes of data, but "
> -			   "our maximum skb size is %lu\n",
> +			   "our maximum skb size is %zu\n",
>  			   __func__, len, MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
>  		err = -EINVAL;
>  		goto out;
> @@ -1171,12 +1171,13 @@ static int __devexit libertas_spi_remove(struct spi_device *spi)
>  
>  	lbs_deb_spi("libertas_spi_remove\n");
>  	lbs_deb_enter(LBS_DEB_SPI);
> -	priv->surpriseremoved = 1;
>  
>  	lbs_stop_card(priv);
> +	lbs_remove_card(priv); /* will call free_netdev */
> +
> +	priv->surpriseremoved = 1;
>  	free_irq(spi->irq, card);
>  	if_spi_terminate_spi_thread(card);
> -	lbs_remove_card(priv); /* will call free_netdev */
>  	if (card->pdata->teardown)
>  		card->pdata->teardown(spi);
>  	free_if_spi_card(card);



From andrey at cozybit.com  Mon Jun 22 11:10:32 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Mon, 22 Jun 2009 08:10:32 -0700
Subject: [RFC] libertas: remove TX queues from GSPI driver
In-Reply-To: <20090622080402.GA9514@Chamillionaire.breakpoint.cc>
References: <1245451168-3336-1-git-send-email-andrey@cozybit.com>
	<20090622080402.GA9514@Chamillionaire.breakpoint.cc>
Message-ID: <45e8e6c40906220810y78deb90dq889b6b2cbba26391@mail.gmail.com>

On Mon, Jun 22, 2009 at 1:04 AM, Sebastian Andrzej
Siewior<sebatian at breakpoint.cc> wrote:
> * Andrey Yurovsky | 2009-06-19 15:39:28 [-0700]:
>
>>Posting this as an RFC in case others want to help test it. ?This
>>work-in-progress patch removes the redundant command and data TX queues
>>from the Libertas GSPI driver, it also therefore removes a memcpy from
>>if_spi_host_to_card and the locking mechanisms for the queues in
>>question. ?The goal is to improve performance and reduce overhead by
>>simplifying the TX path.
>>
>>The driver works after this patch, however IEEE PS is somewhat broken
>>(especially temporarily waking the device to issue commands). ?This is
>>caused, in part, by the IRQ handler preempting the libertas main thread
>>(for example, when the main thread calls if_spi_host_to_card and an IRQ
>>comes in) so we need a synchronization solution that allows interrupt
>>servicing to be done when it's safe to do so, that is we need to lock
>>the bus properly.
>
> Why is it now okay now to block in if_spi_host_to_card()? Was this never
> an issue?

We don't really block, if_spi_host_to_card is called by the main
thread (synchronized by the dnld_sent flag, which gets cleared by the
IRQ handler) and it writes out the command or TX packet directly and
then returns.  The issue is that you can't sleep in a real IRQ
handler, like the GPIO IRQ that we have in this driver.

> Would it help if you replace request_irq() with request_threaded_irq()?
> With that change it should similar to other interfaces since you can
> read from the chip within the interrupt handler.

It's an actual IRQ handler that takes care of a GPIO interrupt.  This
is different from, say, SDIO, where you use a bus interrupt that the
subsystem provides you.  We can never sleep in that handler, hence the
additional thread.  Almost any implementation of the underlying SPI
controller will sleep at some point, so we can't check, for example,
the IRQ status register right in the handler.

  -Andrey


From sebastian at breakpoint.cc  Mon Jun 22 11:29:51 2009
From: sebastian at breakpoint.cc (Sebastian Andrzej Siewior)
Date: Mon, 22 Jun 2009 17:29:51 +0200
Subject: [RFC] libertas: remove TX queues from GSPI driver
In-Reply-To: <45e8e6c40906220810y78deb90dq889b6b2cbba26391@mail.gmail.com>
References: <1245451168-3336-1-git-send-email-andrey@cozybit.com>
	<20090622080402.GA9514@Chamillionaire.breakpoint.cc>
	<45e8e6c40906220810y78deb90dq889b6b2cbba26391@mail.gmail.com>
Message-ID: <20090622152951.GA12829@Chamillionaire.breakpoint.cc>

* Andrey Yurovsky | 2009-06-22 08:10:32 [-0700]:

>On Mon, Jun 22, 2009 at 1:04 AM, Sebastian Andrzej
>Siewior<sebatian at breakpoint.cc> wrote:
>> * Andrey Yurovsky | 2009-06-19 15:39:28 [-0700]:
>>
>>>Posting this as an RFC in case others want to help test it. ?This
>>>work-in-progress patch removes the redundant command and data TX queues
>>>from the Libertas GSPI driver, it also therefore removes a memcpy from
>>>if_spi_host_to_card and the locking mechanisms for the queues in
>>>question. ?The goal is to improve performance and reduce overhead by
>>>simplifying the TX path.
>>>
>>>The driver works after this patch, however IEEE PS is somewhat broken
>>>(especially temporarily waking the device to issue commands). ?This is
>>>caused, in part, by the IRQ handler preempting the libertas main thread
>>>(for example, when the main thread calls if_spi_host_to_card and an IRQ
>>>comes in) so we need a synchronization solution that allows interrupt
>>>servicing to be done when it's safe to do so, that is we need to lock
>>>the bus properly.
>>
>> Why is it now okay now to block in if_spi_host_to_card()? Was this never
>> an issue?
>
>We don't really block, if_spi_host_to_card is called by the main
>thread (synchronized by the dnld_sent flag, which gets cleared by the
>IRQ handler) and it writes out the command or TX packet directly and
>then returns.
you get blocked in spu_write(). I though earlier that
if_spi_host_to_card() is called by the core driver and we are atomic due
to network core or the libertas driver itself.

>The issue is that you can't sleep in a real IRQ
>handler, like the GPIO IRQ that we have in this driver.
That is not 100% true as of current mainline, read below.

>
>> Would it help if you replace request_irq() with request_threaded_irq()?
>> With that change it should similar to other interfaces since you can
>> read from the chip within the interrupt handler.
>
>It's an actual IRQ handler that takes care of a GPIO interrupt.  This
>is different from, say, SDIO, where you use a bus interrupt that the
>subsystem provides you.  We can never sleep in that handler, hence the
>additional thread.  Almost any implementation of the underlying SPI
>controller will sleep at some point, so we can't check, for example,
>the IRQ status register right in the handler.

If your interrupt controller is correctly implemented then you can sleep
in the interrupt handler if you use request_threaded_irq(). That one got
merged in v2.6.30 and you have to provide two callback functions:
- one short check function which finds out if your device really issued
  an interrupt. This only matters on shared lines
- the real interrupt handler which executed "later" as a thread.

>  -Andrey

Sebastian


From andrey at cozybit.com  Mon Jun 22 14:39:36 2009
From: andrey at cozybit.com (Andrey Yurovsky)
Date: Mon, 22 Jun 2009 11:39:36 -0700
Subject: [RFC] libertas: remove TX queues from GSPI driver
In-Reply-To: <20090622152951.GA12829@Chamillionaire.breakpoint.cc>
References: <1245451168-3336-1-git-send-email-andrey@cozybit.com>
	<20090622080402.GA9514@Chamillionaire.breakpoint.cc>
	<45e8e6c40906220810y78deb90dq889b6b2cbba26391@mail.gmail.com>
	<20090622152951.GA12829@Chamillionaire.breakpoint.cc>
Message-ID: <45e8e6c40906221139n19ff8f16g6e3af6afc95ea134@mail.gmail.com>

On Mon, Jun 22, 2009 at 8:29 AM, Sebastian Andrzej
Siewior<sebastian at breakpoint.cc> wrote:
> * Andrey Yurovsky | 2009-06-22 08:10:32 [-0700]:
>
>>On Mon, Jun 22, 2009 at 1:04 AM, Sebastian Andrzej
>>Siewior<sebatian at breakpoint.cc> wrote:
>>> * Andrey Yurovsky | 2009-06-19 15:39:28 [-0700]:
>>>
>>>>Posting this as an RFC in case others want to help test it. ?This
>>>>work-in-progress patch removes the redundant command and data TX queues
>>>>from the Libertas GSPI driver, it also therefore removes a memcpy from
>>>>if_spi_host_to_card and the locking mechanisms for the queues in
>>>>question. ?The goal is to improve performance and reduce overhead by
>>>>simplifying the TX path.
>>>>
>>>>The driver works after this patch, however IEEE PS is somewhat broken
>>>>(especially temporarily waking the device to issue commands). ?This is
>>>>caused, in part, by the IRQ handler preempting the libertas main thread
>>>>(for example, when the main thread calls if_spi_host_to_card and an IRQ
>>>>comes in) so we need a synchronization solution that allows interrupt
>>>>servicing to be done when it's safe to do so, that is we need to lock
>>>>the bus properly.
>>>
>>> Why is it now okay now to block in if_spi_host_to_card()? Was this never
>>> an issue?
>>
>>We don't really block, if_spi_host_to_card is called by the main
>>thread (synchronized by the dnld_sent flag, which gets cleared by the
>>IRQ handler) and it writes out the command or TX packet directly and
>>then returns.
> you get blocked in spu_write(). I though earlier that
> if_spi_host_to_card() is called by the core driver and we are atomic due
> to network core or the libertas driver itself.

That's right, but we can block that thread.

>>The issue is that you can't sleep in a real IRQ
>>handler, like the GPIO IRQ that we have in this driver.
> That is not 100% true as of current mainline, read below.
>
>>
>>> Would it help if you replace request_irq() with request_threaded_irq()?
>>> With that change it should similar to other interfaces since you can
>>> read from the chip within the interrupt handler.
>>
>>It's an actual IRQ handler that takes care of a GPIO interrupt. ?This
>>is different from, say, SDIO, where you use a bus interrupt that the
>>subsystem provides you. ?We can never sleep in that handler, hence the
>>additional thread. ?Almost any implementation of the underlying SPI
>>controller will sleep at some point, so we can't check, for example,
>>the IRQ status register right in the handler.
>
> If your interrupt controller is correctly implemented then you can sleep
> in the interrupt handler if you use request_threaded_irq(). That one got
> merged in v2.6.30 and you have to provide two callback functions:
> - one short check function which finds out if your device really issued
> ?an interrupt. This only matters on shared lines
> - the real interrupt handler which executed "later" as a thread.

Thanks Sebastian, I didn't know about this new API and I'll read up
about it, that sounds like what we want to use.

  -Andrey


From pgf at laptop.org  Tue Jun 23 16:24:26 2009
From: pgf at laptop.org (Paul Fox)
Date: Tue, 23 Jun 2009 16:24:26 -0400
Subject: bug: sleeping function called from invalid context ...
	libertas/cmd.c 
In-Reply-To: <1245681222.4338.22.camel@dhcp-100-3-98.bos.redhat.com>
	(sfid-20090622_104120_257262_21E1168E) 
References: <14415.1245423329@foxharp.boston.ma.us>
	<1245681222.4338.22.camel@dhcp-100-3-98.bos.redhat.com>
	(sfid-20090622_104120_257262_21E1168E)
Message-ID: <8218.1245788666@foxharp.boston.ma.us>

dan wrote:
 > On Fri, 2009-06-19 at 10:55 -0400, Paul Fox wrote:
 > > hi --
 > > 
 > > on the OLPC XO laptop, i'm seeing the following backtrace fairly
 > > often.  my network management program uses iwconfig a lot, so i
 > > may see it more than others might.  i'm running 2.6.30 (slightly
 > > OLPC-modified, but not at this level), so i think the libertas
 > > driver is pretty current.
 > > 
 > > btw, this has been mentioned before on this list:
 > >     http://lists.infradead.org/pipermail/libertas-dev/2008-May/001532.html
 > > but i didn't see a resolution -- was there one?  (i haven't yet
 > > convinced myself of exactly when it occurs for me, so i can't say
 > > my symptom is identical to that poster's.)
 > 
 > This occurs because the GET_LOG command is sent from the get_stats
 > handler in wext.c, and that grabs some spinlocks and disables
 > interrupts.  The only way to fix this is to cache the values in the
 > driver and check them periodically or when data comes in or something
 > like that, and the reflect the cached values from the get_stats WEXT
 > handler.  That means cat /proc/net/wireless and such won't always return
 > current statistics, but its the best we can do for now.
 > 
 > Dan
 > 

thanks dan.

might this be helped by commit 87057825824973f29cf2f37cff1e549170b2d7e6 ?
(daniel drake spotted this and pointed it out to me.)

paul

    commit 87057825824973f29cf2f37cff1e549170b2d7e6
    Author: Johannes Berg <johannes at sipsolutions.net>
    Date:   Tue May 19 17:19:36 2009 +0200

	wext: remove atomic requirement for wireless stats
	
	The requirement for wireless stats to be atomic is now mostly
	artificial since we hold the rtnl _and_ the dev_base_lock for
	iterating the device list. Doing that is not required, just the
	rtnl is sufficient (and the rtnl is required for other reasons
	outlined in commit "wext: fix get_wireless_stats locking").
	
	This will fix http://bugzilla.kernel.org/show_bug.cgi?id=13344
	and make things easier for drivers.
	
	Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
	Signed-off-by: John W. Linville <linville at tuxdriver.com>


=---------------------
 paul fox, pgf at laptop.org


From fourth at hungariatour.cz  Fri Jun 26 05:52:30 2009
From: fourth at hungariatour.cz (Stammel)
Date: Fri, 26 Jun 2009 09:52:30 +0000
Subject: Incgredible Tips On How To Become AA sexual Magnet - Be The Leader Of
	The Pack
Message-ID: <1246009951.interpolator@hungariatour.cz>

Incredible Tipps On How To Become A sexual Magnnet - Be The Leader Of The Pack www . med92 . com



From dcbw at redhat.com  Sat Jun 27 08:18:03 2009
From: dcbw at redhat.com (Dan Williams)
Date: Sat, 27 Jun 2009 08:18:03 -0400
Subject: bug: sleeping function called from invalid context ...
	libertas/cmd.c
In-Reply-To: <8218.1245788666@foxharp.boston.ma.us>
References: <14415.1245423329@foxharp.boston.ma.us>
	<1245681222.4338.22.camel@dhcp-100-3-98.bos.redhat.com>
	(sfid-20090622_104120_257262_21E1168E)
	<8218.1245788666@foxharp.boston.ma.us>
Message-ID: <1246105083.6615.10.camel@localhost.localdomain>

On Tue, 2009-06-23 at 16:24 -0400, Paul Fox wrote:
> dan wrote:
>  > On Fri, 2009-06-19 at 10:55 -0400, Paul Fox wrote:
>  > > hi --
>  > > 
>  > > on the OLPC XO laptop, i'm seeing the following backtrace fairly
>  > > often.  my network management program uses iwconfig a lot, so i
>  > > may see it more than others might.  i'm running 2.6.30 (slightly
>  > > OLPC-modified, but not at this level), so i think the libertas
>  > > driver is pretty current.
>  > > 
>  > > btw, this has been mentioned before on this list:
>  > >     http://lists.infradead.org/pipermail/libertas-dev/2008-May/001532.html
>  > > but i didn't see a resolution -- was there one?  (i haven't yet
>  > > convinced myself of exactly when it occurs for me, so i can't say
>  > > my symptom is identical to that poster's.)
>  > 
>  > This occurs because the GET_LOG command is sent from the get_stats
>  > handler in wext.c, and that grabs some spinlocks and disables
>  > interrupts.  The only way to fix this is to cache the values in the
>  > driver and check them periodically or when data comes in or something
>  > like that, and the reflect the cached values from the get_stats WEXT
>  > handler.  That means cat /proc/net/wireless and such won't always return
>  > current statistics, but its the best we can do for now.
>  > 
>  > Dan
>  > 
> 
> thanks dan.
> 
> might this be helped by commit 87057825824973f29cf2f37cff1e549170b2d7e6 ?
> (daniel drake spotted this and pointed it out to me.)

Yup, that will probably fix this issue without the need for patching
libertas.

Dan

> paul
> 
>     commit 87057825824973f29cf2f37cff1e549170b2d7e6
>     Author: Johannes Berg <johannes at sipsolutions.net>
>     Date:   Tue May 19 17:19:36 2009 +0200
> 
> 	wext: remove atomic requirement for wireless stats
> 	
> 	The requirement for wireless stats to be atomic is now mostly
> 	artificial since we hold the rtnl _and_ the dev_base_lock for
> 	iterating the device list. Doing that is not required, just the
> 	rtnl is sufficient (and the rtnl is required for other reasons
> 	outlined in commit "wext: fix get_wireless_stats locking").
> 	
> 	This will fix http://bugzilla.kernel.org/show_bug.cgi?id=13344
> 	and make things easier for drivers.
> 	
> 	Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
> 	Signed-off-by: John W. Linville <linville at tuxdriver.com>
> 
> 
> =---------------------
>  paul fox, pgf at laptop.org
> 
> _______________________________________________
> libertas-dev mailing list
> libertas-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev



From aviations at labelpack.com  Tue Jun 30 05:38:11 2009
From: aviations at labelpack.com (Beltrami)
Date: Tue, 30 Jun 2009 08:38:11 -0100
Subject: Sexual Arousal and Exciitement - Hoow to Maximize Them
Message-ID: <1246351063_uncompress@labelpack.com>

Sexual Arousal abnd Excitement - How too Maximize Them www. med26. com. Keith Ricchards Says Hee Snorted Dad's Ashes


