netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Cc: netdev@vger.kernel.org
Subject: Re: rfkill rewrite bug
Date: Sat, 18 Apr 2009 10:28:02 +0200	[thread overview]
Message-ID: <1240043283.5792.0.camel@johannes.local> (raw)
In-Reply-To: <49E98C86.2040308@tuffmail.co.uk> (sfid-20090418_101208_980691_83127E2F)

[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]

On Sat, 2009-04-18 at 09:17 +0100, Alan Jenkins wrote:

> When I looked at the code earlier, I saw no obvious replacement for 
> rfkill_set_default().  So I tried disabling the wireless and rebooting 
> to see what happened.  It didn't like that :-).

Ok that wasn't too hard -- try this on top if you get a chance:

--- wireless-testing.orig/net/rfkill/core.c	2009-04-18 10:16:53.000000000 +0200
+++ wireless-testing/net/rfkill/core.c	2009-04-18 10:18:17.000000000 +0200
@@ -401,6 +401,9 @@ bool rfkill_set_hw_state(struct rfkill *
 
 	ret = __rfkill_set_hw_state(rfkill, blocked, &change);
 
+	if (!rfkill->registered)
+		return ret;
+
 	if (change)
 		schedule_work(&rfkill->uevent_work);
 
@@ -422,13 +425,17 @@ bool rfkill_set_sw_state(struct rfkill *
 					    &rfkill->blocked);
 
 	hwblock = !!test_bit(RFKILL_BLOCK_HW_BIT, &rfkill->blocked);
+	blocked = blocked || hwblock;
+
+	if (!rfkill->registered)
+		return blocked;
 
 	if (prev != blocked && !hwblock)
 		schedule_work(&rfkill->uevent_work);
 
 	rfkill_led_trigger_event(rfkill);
 
-	return blocked || hwblock;
+	return blocked;
 }
 EXPORT_SYMBOL(rfkill_set_sw_state);
 
@@ -452,6 +459,9 @@ void rfkill_set_states(struct rfkill *rf
 		hwprev = !!test_and_clear_bit(RFKILL_BLOCK_HW_BIT,
 					      &rfkill->blocked);
 
+	if (!rfkill->registered)
+		return;
+
 	if (swprev != sw || hwprev != hw)
 		schedule_work(&rfkill->uevent_work);
 


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      parent reply	other threads:[~2009-04-18  8:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08 13:37 [PATCH] rfkill: document removal of notifier chain Alan Jenkins
2009-04-08 15:21 ` Johannes Berg
2009-04-08 17:21   ` Alan Jenkins
2009-04-13 19:00     ` rfkill rewrite bug Alan Jenkins
2009-04-13 18:56       ` Johannes Berg
2009-04-14 20:46       ` Johannes Berg
2009-04-18  8:17         ` Alan Jenkins
2009-04-18  8:15           ` Johannes Berg
2009-04-18  8:28           ` Johannes Berg [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=1240043283.5792.0.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=alan-jenkins@tuffmail.co.uk \
    --cc=netdev@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).