All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Bob Copeland <me@bobcopeland.com>,
	linux-wireless@vger.kernel.org,
	linux-pm@lists.linux-foundation.org,
	USB list <linux-usb@vger.kernel.org>,
	Hin-Tak Leung <htl10@users.sourceforge.net>,
	Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Subject: Re: [linux-pm] rtl8187 usb wifi adaptor causes suspend hang
Date: Tue, 30 Dec 2008 11:52:44 -0600	[thread overview]
Message-ID: <495A5FEC.5070608@lwfinger.net> (raw)
In-Reply-To: <495A5AE5.1040902@tuffmail.co.uk>

Alan Jenkins wrote:
> That won't fix hibernation though.  The disconnect method can still get
> called in resume from hibernation, before the workqueue gets unfrozen. 
> To be honest, I'm far more interested in suspend-to-disk than
> suspend-to-ram.

Does this patch fix your problem? It works here, but I only did one
test. The patch is for wireless-testing.

Larry


Index: wireless-testing/drivers/net/wireless/rtl818x/rtl8187_dev.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ wireless-testing/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -1464,6 +1464,32 @@ static int __devinit rtl8187_probe(struc
 	return err;
 }

+#ifdef CONFIG_PM
+
+static int rtl8187_suspend(struct usb_interface *intf, pm_message_t
state)
+{
+	struct ieee80211_hw *dev = usb_get_intfdata(intf);
+	struct rtl8187_priv *priv;
+        int time;
+
+	if (!dev)
+		return 0;
+
+	priv = dev->priv;
+
+	time = usb_wait_anchor_empty_timeout(&priv->anchored, 1000);
+	if (!time)
+		usb_kill_anchored_urbs(&priv->anchored);
+	return 0;
+}
+
+static int rtl8187_resume(struct usb_interface *intf)
+{
+	return 0;
+}
+
+#endif /* CONFIG_PM */
+
 static void __devexit rtl8187_disconnect(struct usb_interface *intf)
 {
 	struct ieee80211_hw *dev = usb_get_intfdata(intf);
@@ -1484,6 +1510,10 @@ static struct usb_driver rtl8187_driver
 	.id_table	= rtl8187_table,
 	.probe		= rtl8187_probe,
 	.disconnect	= __devexit_p(rtl8187_disconnect),
+#ifdef CONFIG_PM
+	.suspend	= rtl8187_suspend,
+	.resume		= rtl8187_resume,
+#endif /* CONFIG_PM */
 };

 static int __init rtl8187_init(void)

  reply	other threads:[~2008-12-30 17:52 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-30 10:51 rtl8187 usb wifi adaptor causes suspend hang Alan Jenkins
2008-12-30 13:10 ` Alan Jenkins
2008-12-30 13:10 ` Alan Jenkins
2008-12-30 15:45   ` [linux-pm] " Alan Stern
2008-12-30 16:45     ` Bob Copeland
2008-12-30 16:45     ` [linux-pm] " Bob Copeland
2008-12-30 16:48       ` Alan Jenkins
2008-12-30 16:48       ` [linux-pm] " Alan Jenkins
2008-12-30 17:25       ` Alan Stern
2008-12-30 17:25       ` [linux-pm] " Alan Stern
2008-12-30 17:31         ` Alan Jenkins
2008-12-30 17:31         ` [linux-pm] " Alan Jenkins
2008-12-30 17:52           ` Larry Finger [this message]
2008-12-30 18:05             ` Hin-Tak Leung
2008-12-30 18:05             ` [linux-pm] " Hin-Tak Leung
2008-12-30 18:05             ` Oliver Neukum
2008-12-30 18:05             ` [linux-pm] " Oliver Neukum
2008-12-30 18:09               ` Larry Finger
2008-12-30 18:09               ` Larry Finger
2008-12-31  0:59             ` Hin-Tak Leung
2008-12-31  0:59             ` [linux-pm] " Hin-Tak Leung
2008-12-31 14:33               ` Alan Jenkins
2008-12-31 15:57                 ` Bob Copeland
2008-12-31 17:10                   ` Alan Jenkins
2008-12-31 17:10                   ` [linux-pm] " Alan Jenkins
2008-12-31 15:57                 ` Bob Copeland
2008-12-31 17:16                 ` [linux-pm] " Oliver Neukum
2008-12-31 17:16                 ` Oliver Neukum
2008-12-31 19:33                 ` [linux-pm] " Larry Finger
2008-12-31 23:00                   ` Larry Finger
2008-12-31 23:00                   ` [linux-pm] " Larry Finger
2008-12-31 23:26                     ` Bob Copeland
2008-12-31 23:26                     ` Bob Copeland
2009-01-01  0:16                     ` Alan Stern
2009-01-01  0:16                     ` [linux-pm] " Alan Stern
2009-01-01  6:06                   ` Hin-Tak Leung
2009-01-01 22:25                     ` Alan Stern
2009-01-01 22:25                     ` [linux-pm] " Alan Stern
2009-01-01 23:42                       ` Hin-Tak Leung
2009-01-01 23:42                       ` [linux-pm] " Hin-Tak Leung
2009-01-02  2:24                         ` Alan Stern
2009-01-02  2:24                         ` [linux-pm] " Alan Stern
2009-01-01  6:06                   ` Hin-Tak Leung
2008-12-31 19:33                 ` Larry Finger
2009-01-01  6:18                 ` [linux-pm] " Hin-Tak Leung
2009-01-01 13:07                   ` Alan Jenkins
2009-01-01 13:40                     ` Stefanik Gábor
2009-01-01 14:39                       ` Hin-Tak Leung
2009-01-01 16:38                         ` Larry Finger
2009-01-01 16:38                         ` [linux-pm] " Larry Finger
2009-01-01 14:39                       ` Hin-Tak Leung
2009-01-01 13:40                     ` Stefanik Gábor
2009-01-01 13:07                   ` Alan Jenkins
2009-01-01  6:18                 ` Hin-Tak Leung
2008-12-31 14:33               ` Alan Jenkins
2008-12-30 17:52           ` Larry Finger
2008-12-30 15:45   ` Alan Stern

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=495A5FEC.5070608@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=alan-jenkins@tuffmail.co.uk \
    --cc=herton@mandriva.com.br \
    --cc=htl10@users.sourceforge.net \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=me@bobcopeland.com \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.