linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH 3.10 12/53] rt2x00: fix rfkill regression on rt2500pci
Date: Mon,  7 Jul 2014 16:57:57 -0700	[thread overview]
Message-ID: <20140707235829.664612888@linuxfoundation.org> (raw)
In-Reply-To: <20140707235829.281783607@linuxfoundation.org>

3.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Stanislaw Gruszka <stf_xl@wp.pl>

commit 616a8394b5df8c88f4dd416f4527439a4e365034 upstream.

As reported by Niels, starting rfkill polling during device probe
(commit e2bc7c5, generally sane change) broke rfkill on rt2500pci
device. I considered that bug as some initalization issue, which
should be fixed on rt2500pci specific code. But after several
attempts (see bug report for details) we fail to find working solution.
Hence I decided to revert to old behaviour on rt2500pci to fix
regression.

Additionally patch also unregister rfkill on device remove instead
of ifconfig down, what was another issue introduced by bad commit.

Bug report:
https://bugzilla.kernel.org/show_bug.cgi?id=73821

Fixes: e2bc7c5f3cb8 ("rt2x00: Fix rfkill_polling register function.")
Bisected-by: Niels <nille0386@googlemail.com>
Reported-and-tested-by: Niels <nille0386@googlemail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/rt2x00/rt2500pci.c |    7 ++++++-
 drivers/net/wireless/rt2x00/rt2x00.h    |    1 +
 drivers/net/wireless/rt2x00/rt2x00dev.c |   24 +++++++++++++++++++++---
 3 files changed, 28 insertions(+), 4 deletions(-)

--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1684,8 +1684,13 @@ static int rt2500pci_init_eeprom(struct
 	/*
 	 * Detect if this device has an hardware controlled radio.
 	 */
-	if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO))
+	if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) {
 		__set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags);
+		/*
+		 * On this device RFKILL initialized during probe does not work.
+		 */
+		__set_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags);
+	}
 
 	/*
 	 * Check if the BBP tuning should be enabled.
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -708,6 +708,7 @@ enum rt2x00_capability_flags {
 	REQUIRE_SW_SEQNO,
 	REQUIRE_HT_TX_DESC,
 	REQUIRE_PS_AUTOWAKE,
+	REQUIRE_DELAYED_RFKILL,
 
 	/*
 	 * Capabilities
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -1128,9 +1128,10 @@ static void rt2x00lib_uninitialize(struc
 		return;
 
 	/*
-	 * Unregister extra components.
+	 * Stop rfkill polling.
 	 */
-	rt2x00rfkill_unregister(rt2x00dev);
+	if (test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags))
+		rt2x00rfkill_unregister(rt2x00dev);
 
 	/*
 	 * Allow the HW to uninitialize.
@@ -1168,6 +1169,12 @@ static int rt2x00lib_initialize(struct r
 
 	set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags);
 
+	/*
+	 * Start rfkill polling.
+	 */
+	if (test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags))
+		rt2x00rfkill_register(rt2x00dev);
+
 	return 0;
 }
 
@@ -1363,7 +1370,12 @@ int rt2x00lib_probe_dev(struct rt2x00_de
 	rt2x00link_register(rt2x00dev);
 	rt2x00leds_register(rt2x00dev);
 	rt2x00debug_register(rt2x00dev);
-	rt2x00rfkill_register(rt2x00dev);
+
+	/*
+	 * Start rfkill polling.
+	 */
+	if (!test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags))
+		rt2x00rfkill_register(rt2x00dev);
 
 	return 0;
 
@@ -1379,6 +1391,12 @@ void rt2x00lib_remove_dev(struct rt2x00_
 	clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
 
 	/*
+	 * Stop rfkill polling.
+	 */
+	if (!test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags))
+		rt2x00rfkill_unregister(rt2x00dev);
+
+	/*
 	 * Disable radio.
 	 */
 	rt2x00lib_disable_radio(rt2x00dev);



  parent reply	other threads:[~2014-07-08  0:22 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 23:57 [PATCH 3.10 00/53] 3.10.48-stable review Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 01/53] ibmvscsi: Abort init sequence during error recovery Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 02/53] ibmvscsi: Add memory barriers for send / receive Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 03/53] virtio-scsi: avoid cancelling uninitialized work items Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 04/53] virtio-scsi: fix various bad behavior on aborted requests Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 05/53] xhci: correct burst count field for isoc transfers on 1.0 xhci hosts Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 06/53] xhci: Fix runtime suspended xhci from blocking system suspend Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 07/53] USB: option: add device ID for SpeedUp SU9800 usb 3g modem Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 09/53] USB: ftdi_sio: fix null deref at port probe Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 11/53] rt2x00: disable TKIP on USB Greg Kroah-Hartman
2014-07-07 23:57 ` Greg Kroah-Hartman [this message]
2014-07-07 23:57 ` [PATCH 3.10 13/53] mtd: eLBC NAND: fix subpage write support Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 14/53] mtd: nand: omap: fix BCHx ecc.correct to return detected bit-flips in erased-page Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 15/53] drm/radeon: only apply hdmi bpc pll flags when encoder mode is hdmi Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 16/53] drm/radeon: fix typo in radeon_connector_is_dp12_capable() Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 17/53] drm/radeon/dp: fix lane/clock setup for dp 1.2 capable devices Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 18/53] drm/radeon/atom: fix dithering on certain panels Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 20/53] drm/vmwgfx: Fix incorrect write to read-only register v2: Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 21/53] Bluetooth: Fix SSP acceptor just-works confirmation without MITM Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 22/53] Bluetooth: Fix check for connection encryption Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 23/53] Bluetooth: Fix locking of hdev when calling into SMP code Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 24/53] dm thin: update discard_granularity to reflect the thin-pool blocksize Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 25/53] rbd: use reference counts for image requests Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 26/53] rbd: handle parent_overlap on writes correctly Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 27/53] hwmon: (ina2xx) Cast to s16 on shunt and current regs Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 28/53] mac80211: dont check netdev state for debugfs read/write Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 30/53] iwlwifi: pcie: try to get ownership several times Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 31/53] ARM: OMAP2+: Fix parser-bug in platform muxing code Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 34/53] CIFS: fix mount failure with broken pathnames when smb3 mount with mapchars option Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 35/53] ext4: Fix buffer double free in ext4_alloc_branch() Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 36/53] ext4: Fix hole punching for files with indirect blocks Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 37/53] KVM: x86: Increase the number of fixed MTRR regs to 10 Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 38/53] KVM: x86: preserve the high 32-bits of the PAT register Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 39/53] iio: of_iio_channel_get_by_name() returns non-null pointers for error legs Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 40/53] nfsd: fix rare symlink decoding bug Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 41/53] tools: ffs-test: fix header values endianess Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 42/53] tracing: Remove ftrace_stop/start() from reading the trace file Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 43/53] md: flush writes before starting a recovery Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 44/53] irqchip: spear_shirq: Fix interrupt offset Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 45/53] mmc: rtsx: add R1-no-CRC mmc command type handle Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 46/53] serial: 8250_dw: Report CTS asserted for auto flow Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 47/53] serial: 8250_dw: Improve unwritable LCR workaround Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 48/53] serial: 8250_dw: Fix LCR workaround regression Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 49/53] ALSA: usb-audio: Suppress repetitive debug messages from retire_playback_urb() Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 50/53] ALSA: usb-audio: Prevent printk ratelimiting from spamming kernel log while DEBUG not defined Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 51/53] arch/unicore32/mm/alignment.c: include "asm/pgtable.h" to avoid compiling error Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 52/53] drivers/video/fbdev/fb-puv3.c: Add header files for function unifb_mmap Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 53/53] sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue Greg Kroah-Hartman
2014-07-08 13:19 ` [PATCH 3.10 00/53] 3.10.48-stable review Guenter Roeck
2014-07-08 22:15   ` Greg Kroah-Hartman
2014-07-09 10:21     ` Luis Henriques
2014-07-15  0:59     ` Greg Kroah-Hartman
2014-07-08 19:31 ` Shuah Khan

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=20140707235829.664612888@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=stable@vger.kernel.org \
    --cc=stf_xl@wp.pl \
    /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).