linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libertas: don't reset card on error when it is being removed
@ 2012-07-30 21:58 Daniel Drake
  2012-07-30 23:31 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Drake @ 2012-07-30 21:58 UTC (permalink / raw)
  To: linville; +Cc: libertas-dev, linux-wireless, dcbw

On an OLPC XO-1.5 we have seen the following situation:
 - the system starts going into suspend
 - no wake params are set, so the mmc layer removes the card
 - during remove, we send a command to the card
 - that command fails, causing if_sdio's reset method to try and remove
   the mmc card in attempt to reset it
 - the mmc layer is not happy about being asked to remove a card that
   it is already removing, and the kernel crashes

While the MMC layer could possibly be taught to behave better here,
it also seems sensible for libertas not to try and reset a card if
we're in the process of removing it anyway.

Signed-off-by: Daniel Drake <dsd@laptop.org>
---
 drivers/net/wireless/libertas/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index e96ee0a..8d17cac 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -565,7 +565,10 @@ static int lbs_thread(void *data)
 			netdev_info(dev, "Timeout submitting command 0x%04x\n",
 				    le16_to_cpu(cmdnode->cmdbuf->command));
 			lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
-			if (priv->reset_card)
+
+			/* Reset card, but only when it isn't in the process
+			 * of being shutdown anyway. */
+			if (!dev->dismantle && priv->reset_card)
 				priv->reset_card(priv);
 		}
 		priv->cmd_timed_out = 0;
-- 
1.7.11.2


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

* Re: [PATCH] libertas: don't reset card on error when it is being removed
  2012-07-30 21:58 [PATCH] libertas: don't reset card on error when it is being removed Daniel Drake
@ 2012-07-30 23:31 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2012-07-30 23:31 UTC (permalink / raw)
  To: Daniel Drake; +Cc: linville, linux-wireless, libertas-dev

On Mon, 2012-07-30 at 22:58 +0100, Daniel Drake wrote:
> On an OLPC XO-1.5 we have seen the following situation:
>  - the system starts going into suspend
>  - no wake params are set, so the mmc layer removes the card
>  - during remove, we send a command to the card
>  - that command fails, causing if_sdio's reset method to try and remove
>    the mmc card in attempt to reset it
>  - the mmc layer is not happy about being asked to remove a card that
>    it is already removing, and the kernel crashes
> 
> While the MMC layer could possibly be taught to behave better here,
> it also seems sensible for libertas not to try and reset a card if
> we're in the process of removing it anyway.
> 
> Signed-off-by: Daniel Drake <dsd@laptop.org>

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

> ---
>  drivers/net/wireless/libertas/main.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
> index e96ee0a..8d17cac 100644
> --- a/drivers/net/wireless/libertas/main.c
> +++ b/drivers/net/wireless/libertas/main.c
> @@ -565,7 +565,10 @@ static int lbs_thread(void *data)
>  			netdev_info(dev, "Timeout submitting command 0x%04x\n",
>  				    le16_to_cpu(cmdnode->cmdbuf->command));
>  			lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
> -			if (priv->reset_card)
> +
> +			/* Reset card, but only when it isn't in the process
> +			 * of being shutdown anyway. */
> +			if (!dev->dismantle && priv->reset_card)
>  				priv->reset_card(priv);
>  		}
>  		priv->cmd_timed_out = 0;



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

end of thread, other threads:[~2012-07-30 23:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30 21:58 [PATCH] libertas: don't reset card on error when it is being removed Daniel Drake
2012-07-30 23:31 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).