Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932902Ab1C3UTJ (ORCPT ); Wed, 30 Mar 2011 16:19:09 -0400 Received: from ist.d-labs.de ([213.239.218.44]:45247 "EHLO mx01.d-labs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755177Ab1C3UTH (ORCPT ); Wed, 30 Mar 2011 16:19:07 -0400 From: Florian Mickler To: stable@kernel.org Cc: linux-kernel@vger.kernel.org, "Lee, Chun-Yi" , Carlos Corbacho , Matthew Garrett , Dmitry Torokhov , Corentin Chary , Johannes Berg , "Lee, Chun-Yi" , Florian Mickler Subject: [PATCH] acer-wmi: does not set persistence state by rfkill_init_sw_state Date: Wed, 30 Mar 2011 22:17:57 +0200 Message-Id: <1301516277-1752-1-git-send-email-florian@mickler.org> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2971 Lines: 99 From: Lee, Chun-Yi Acer BIOS keeps devices state when system reboot, but reset to default device states (Wlan on, Bluetooth off, wwan on) if system cold boot. That means BIOS's initial state is not always real persistence. So, removed rfkill_init_sw_state because it sets initial state to persistence then replicate to other new killswitch when rfkill-input enabled. After removed it, acer-wmi set initial soft-block state after rfkill register, and doesn't allow set_block until rfkill initial finished. Reference: bko#31002 https://bugzilla.kernel.org/show_bug.cgi?id=31002 Cc: Carlos Corbacho Cc: Matthew Garrett Cc: Dmitry Torokhov Cc: Corentin Chary Cc: Johannes Berg Signed-off-by: Lee, Chun-Yi Signed-off-by: Matthew Garrett Tested-by: Oldřich Jedlička Signed-off-by: Florian Mickler --- This fixes a regression, but no stable annotation was given... Oversight? Matthew/Chun-Yi please take a look. drivers/platform/x86/acer-wmi.c | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index d798314..652a84e 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -217,6 +217,7 @@ struct acer_debug { static struct rfkill *wireless_rfkill; static struct rfkill *bluetooth_rfkill; static struct rfkill *threeg_rfkill; +static bool rfkill_inited; /* Each low-level interface must define at least some of the following */ struct wmi_interface { @@ -1157,9 +1158,13 @@ static int acer_rfkill_set(void *data, bool blocked) { acpi_status status; u32 cap = (unsigned long)data; - status = set_u32(!blocked, cap); - if (ACPI_FAILURE(status)) - return -ENODEV; + + if (rfkill_inited) { + status = set_u32(!blocked, cap); + if (ACPI_FAILURE(status)) + return -ENODEV; + } + return 0; } @@ -1183,14 +1188,16 @@ static struct rfkill *acer_rfkill_register(struct device *dev, return ERR_PTR(-ENOMEM); status = get_device_status(&state, cap); - if (ACPI_SUCCESS(status)) - rfkill_init_sw_state(rfkill_dev, !state); err = rfkill_register(rfkill_dev); if (err) { rfkill_destroy(rfkill_dev); return ERR_PTR(err); } + + if (ACPI_SUCCESS(status)) + rfkill_set_sw_state(rfkill_dev, !state); + return rfkill_dev; } @@ -1225,6 +1232,8 @@ static int acer_rfkill_init(struct device *dev) } } + rfkill_inited = true; + schedule_delayed_work(&acer_rfkill_work, round_jiffies_relative(HZ)); return 0; -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/