linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libertas sdio: fix suspend when interface is down
@ 2012-09-03 19:49 Daniel Drake
  2012-09-04 14:15 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Drake @ 2012-09-03 19:49 UTC (permalink / raw)
  To: linville, dcbw; +Cc: linux-wireless, libertas-dev

When the interface is down, the hardware is powered off.
However, the suspend handler currently tries to send host sleep commands
(when wakeup params are set) in this configuration, causing a system hang
when going into suspend (the commands will never complete).

Avoid this by detecting this situation and simply returning from
the suspend handler without doing anything special.

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

diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index e970897..4cb2343 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -1326,6 +1326,11 @@ static int if_sdio_suspend(struct device *dev)
 
 	mmc_pm_flag_t flags = sdio_get_host_pm_caps(func);
 
+	/* If we're powered off anyway, just let the mmc layer remove the
+	 * card. */
+	if (!lbs_iface_active(card->priv))
+		return -ENOSYS;
+
 	dev_info(dev, "%s: suspend: PM flags = 0x%x\n",
 		 sdio_func_id(func), flags);
 
-- 
1.7.11.4


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

* Re: [PATCH] libertas sdio: fix suspend when interface is down
  2012-09-03 19:49 [PATCH] libertas sdio: fix suspend when interface is down Daniel Drake
@ 2012-09-04 14:15 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2012-09-04 14:15 UTC (permalink / raw)
  To: Daniel Drake; +Cc: linville, linux-wireless, libertas-dev

On Mon, 2012-09-03 at 15:49 -0400, Daniel Drake wrote:
> When the interface is down, the hardware is powered off.
> However, the suspend handler currently tries to send host sleep commands
> (when wakeup params are set) in this configuration, causing a system hang
> when going into suspend (the commands will never complete).
> 
> Avoid this by detecting this situation and simply returning from
> the suspend handler without doing anything special.
> 
> Signed-off-by: Daniel Drake <dsd@laptop.org>

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

> ---
>  drivers/net/wireless/libertas/if_sdio.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
> index e970897..4cb2343 100644
> --- a/drivers/net/wireless/libertas/if_sdio.c
> +++ b/drivers/net/wireless/libertas/if_sdio.c
> @@ -1326,6 +1326,11 @@ static int if_sdio_suspend(struct device *dev)
>  
>  	mmc_pm_flag_t flags = sdio_get_host_pm_caps(func);
>  
> +	/* If we're powered off anyway, just let the mmc layer remove the
> +	 * card. */
> +	if (!lbs_iface_active(card->priv))
> +		return -ENOSYS;
> +
>  	dev_info(dev, "%s: suspend: PM flags = 0x%x\n",
>  		 sdio_func_id(func), flags);
>  



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

end of thread, other threads:[~2012-09-04 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-03 19:49 [PATCH] libertas sdio: fix suspend when interface is down Daniel Drake
2012-09-04 14:15 ` 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).