All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Cc: htl10@users.sourceforge.net, Michael Buesch <mb@bu3sch.de>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: RTL8187 warnings on suspend
Date: Tue, 08 Dec 2009 16:01:49 -0600	[thread overview]
Message-ID: <4B1ECCCD.2010603@lwfinger.net> (raw)
In-Reply-To: <200912011149.49427.herton@mandriva.com.br>

On 12/01/2009 07:49 AM, Herton Ronaldo Krzesinski wrote:
> Subject: [PATCH] rtl8187: add radio led and fix warnings on suspend
> 
> Michael Buesch reports that his rtl8187 gives warnings on suspend
> ("queueing ieee80211 work while going to suspend" warnings), as rtl8187
> can call ieee80211_queue_delayed_work after mac80211 is suspended.
> 
> This change enhances rtl8187 led code so we can avoid queuing work after
> mac80211 is suspended: now we register a radio led and make additional
> checks to ensure led is off/on properly as mac80211 wants.
> 
> Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
> ---
>  drivers/net/wireless/rtl818x/rtl8187.h      |    1 +
>  drivers/net/wireless/rtl818x/rtl8187_leds.c |   66 +++++++++++++++++---------
>  drivers/net/wireless/rtl818x/rtl8187_leds.h |    2 +
>  3 files changed, 46 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/net/wireless/rtl818x/rtl8187.h b/drivers/net/wireless/rtl818x/rtl8187.h
> index bf9175a..861ab0b 100644
> --- a/drivers/net/wireless/rtl818x/rtl8187.h
> +++ b/drivers/net/wireless/rtl818x/rtl8187.h
> @@ -104,6 +104,7 @@ struct rtl8187_priv {
>  	struct delayed_work work;
>  	struct ieee80211_hw *dev;
>  #ifdef CONFIG_RTL8187_LEDS
> +	struct rtl8187_led led_radio;
>  	struct rtl8187_led led_tx;
>  	struct rtl8187_led led_rx;
>  	struct delayed_work led_on;
> diff --git a/drivers/net/wireless/rtl818x/rtl8187_leds.c b/drivers/net/wireless/rtl818x/rtl8187_leds.c
> index cf8a4a4..84fdcdb 100644
> --- a/drivers/net/wireless/rtl818x/rtl8187_leds.c
> +++ b/drivers/net/wireless/rtl818x/rtl8187_leds.c
> @@ -106,18 +106,31 @@ static void rtl8187_led_brightness_set(struct led_classdev *led_dev,
>  					       led_dev);
>  	struct ieee80211_hw *hw = led->dev;
>  	struct rtl8187_priv *priv = hw->priv;
> -
> -	if (brightness == LED_OFF) {
> -		ieee80211_queue_delayed_work(hw, &priv->led_off, 0);
> -		/* The LED is off for 1/20 sec so that it just blinks. */
> -		ieee80211_queue_delayed_work(hw, &priv->led_on, HZ / 20);
> -	} else
> -		ieee80211_queue_delayed_work(hw, &priv->led_on, 0);
> +	static bool radio_on;
> +

	if (!hw)
		return;

> +	if (led->is_radio) {
> +		if (brightness == LED_FULL) {
> +			ieee80211_queue_delayed_work(hw, &priv->led_on, 0);

After adding the above change to stop processing for any LED that has
been deleted, the rmmod/insmod loop is running on my system. Still
testing, the the cycle count is nearing 200. After 4-500 cycles, I'll
try physically removing the device while active, and some of the
suspend to disk cycles as well.

Larry

      parent reply	other threads:[~2009-12-08 22:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 15:26 RTL8187 warnings on suspend Michael Buesch
2009-11-25 18:25 ` Herton Ronaldo Krzesinski
2009-11-25 19:29   ` Michael Buesch
2009-11-25 19:55     ` Herton Ronaldo Krzesinski
2009-11-25 20:57       ` Michael Buesch
2009-11-25 21:44         ` Herton Ronaldo Krzesinski
2009-11-25 22:18           ` Michael Buesch
2009-11-25 23:18             ` Herton Ronaldo Krzesinski
2009-11-26 18:04               ` Herton Ronaldo Krzesinski
2009-11-27  0:10                 ` Hin-Tak Leung
2009-11-27 11:45                   ` Herton Ronaldo Krzesinski
2009-11-27 12:33                     ` Hin-Tak Leung
2009-11-27 17:49                     ` Larry Finger
2009-12-01 13:49                       ` Herton Ronaldo Krzesinski
2009-12-01 20:11                         ` Larry Finger
2009-12-01 21:26                           ` Herton Ronaldo Krzesinski
2009-12-01 22:21                             ` Larry Finger
2009-12-08 22:01                         ` Larry Finger [this message]

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=4B1ECCCD.2010603@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=herton@mandriva.com.br \
    --cc=htl10@users.sourceforge.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mb@bu3sch.de \
    /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.