linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Kemnade <andreas@kemnade.info>
To: libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org, hns@goldelico.com
Cc: Andreas Kemnade <andreas@kemnade.info>
Subject: [PATCH v2 5/6] wireless:libertas: fix ps-mode related removal problems
Date: Wed, 20 Jan 2016 08:35:38 +0100	[thread overview]
Message-ID: <1453275339-25122-6-git-send-email-andreas@kemnade.info> (raw)
In-Reply-To: <1453275339-25122-1-git-send-email-andreas@kemnade.info>

When the device is remove e.g. because of going to suspend
 mode with powersaving enabled, lbs_remove_card tries to exit
powersaving state even when already woken up. That command is
not processed properly in that situation, since the command
processing queue is already stopped, so it waits forever
for the command being processed, so disable it.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
changes in v2: improved commit message, reordered: was 6/6
 drivers/net/wireless/libertas/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 8079560..b35b8bc 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1060,7 +1060,12 @@ void lbs_remove_card(struct lbs_private *priv)
 
 	if (priv->psmode == LBS802_11POWERMODEMAX_PSP) {
 		priv->psmode = LBS802_11POWERMODECAM;
-		lbs_set_ps_mode(priv, PS_MODE_ACTION_EXIT_PS, true);
+		/* no need to wakeup if already woken up,
+		 * on suspend, this exit ps command is not processed
+		 * the driver hangs
+		 */
+		if (priv->psstate != PS_STATE_FULL_POWER)
+			lbs_set_ps_mode(priv, PS_MODE_ACTION_EXIT_PS, true);
 	}
 
 	if (priv->is_deep_sleep) {
-- 
2.1.4

  parent reply	other threads:[~2016-01-20  7:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20  7:35 [PATCH 0/6] wireless:libertas: ieee80211 powersave mode Andreas Kemnade
2016-01-20  7:35 ` [PATCH v2 1/6] wireless:libertas: fix pointer bugs for PS_MODE commands Andreas Kemnade
2016-01-20  7:35 ` [PATCH v2 2/6] wireless:libertas: check whether bus can do more than polling Andreas Kemnade
2016-01-20  7:35 ` [PATCH v2 3/6] wireless:libertas: do not confirm sleep if commands are pending Andreas Kemnade
2016-01-20  7:35 ` [PATCH v2 4/6] wireless:libertas: go back to ps mode without commands pending Andreas Kemnade
2016-01-20  7:35 ` Andreas Kemnade [this message]
2016-01-20  7:35 ` [PATCH v2 6/6] wireless:libertas: add an cfg80211 interface for powersaving Andreas Kemnade

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453275339-25122-6-git-send-email-andreas@kemnade.info \
    --to=andreas@kemnade.info \
    --cc=hns@goldelico.com \
    --cc=libertas-dev@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).