From patchwork Thu Jun 10 06:37:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keng-Yu Lin X-Patchwork-Id: 55156 X-Patchwork-Delegate: steve.conklin@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 2165E1007D9 for ; Thu, 10 Jun 2010 16:37:45 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OMbOT-0003iK-Ba; Thu, 10 Jun 2010 07:37:37 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OMbOR-0003ht-S7 for kernel-team@lists.ubuntu.com; Thu, 10 Jun 2010 07:37:35 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1OMbOR-0001fF-PW for ; Thu, 10 Jun 2010 07:37:35 +0100 Received: from [210.242.151.101] (helo=canonical.com) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1OMbOQ-0001pq-Rt for kernel-team@lists.ubuntu.com; Thu, 10 Jun 2010 07:37:35 +0100 From: Keng-Yu Lin To: kernel-team@lists.ubuntu.com Subject: [Lucid SRU] UBUNTU: SAUCE: dell-laptop: fire SMI when toggling hardware killswitch (revised) Date: Thu, 10 Jun 2010 14:37:26 +0800 Message-Id: <1276151846-5992-1-git-send-email-keng-yu.lin@canonical.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1276069479-28999-1-git-send-email-keng-yu.lin@canonical.com> References: <1276069479-28999-1-git-send-email-keng-yu.lin@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Revised: wrap the long line SRU Justification: Impact: A type of Dell Inspiron Mini does not turn off bluetooth physically when pressing F2 (rfkill hotkey). Fix: Current kernel code expects hardware to handle the hard-rfkill switching spontaneously and only notify rfkill subsystem with the status change. This patch makes kernel to explicitly fire a SMI to switch on/off rfkill devices if BIOS reports that the hardware switch is not supported. This patch depends on the following sauce patch in lucid kernel so is not going upstream: UBUNTU: SAUCE: dell-laptop: Store the HW switch status internally rather than requerying every time Testcase: I tested the patch on a Dell Mini 10. It works smoothly. Acked-by: Stefan Bader Acked-by: Chase Douglas --- From 59c4dae1334a279fc917ffb26a74ae4339ed8d65 Mon Sep 17 00:00:00 2001 From: Keng-Yu Lin Date: Thu, 10 Jun 2010 11:14:11 +0800 Subject: [PATCH] UBUNTU: SAUCE: dell-laptop: fire SMI when toggling hardware killswitch When BIOS reports hardware switch is not supported, it does not turn on/off all devices spontaneously. So it is neccessary to fire an SMI to switch the rfkill status explicitly when toggling the hardware killswitch. BugLink: http://bugs.launchpad.net/bugs/590607 Signed-off-by: Keng-Yu Lin --- drivers/platform/x86/dell-laptop.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index 15d96a0..a224f49 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -29,6 +29,7 @@ #define WLAN_SWITCH_MASK 0 #define BT_SWITCH_MASK 1 #define WWAN_SWITCH_MASK 2 +#define HW_SWITCH_SUPPORT 3 #define HW_SWITCH_MASK 16 /* This structure will be modified by the firmware when we enter @@ -240,7 +241,8 @@ static int dell_rfkill_set(void *data, bool blocked) int disable = blocked ? 1 : 0; unsigned long radio = (unsigned long)data; - if (!(hw_switch_status & BIT(radio-1)) || !(hw_switch_status & BIT(HW_SWITCH_MASK))) { + if (!(hw_switch_status & BIT(radio-1)) || !(hw_switch_status & BIT(HW_SWITCH_MASK)) || \ + !(hw_switch_status & BIT(HW_SWITCH_SUPPORT))) { memset(&buffer, 0, sizeof(struct calling_interface_buffer)); buffer.input[0] = (1 | (radio<<8) | (disable << 16)); dell_send_request(&buffer, 17, 11); @@ -258,6 +260,7 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data) dell_send_request(&buffer, 17, 11); status = buffer.output[1]; + hw_switch_status |= (status & BIT(0)) << BIT(HW_SWITCH_SUPPORT); hw_switch_status |= (status & BIT(HW_SWITCH_MASK)) ^ BIT(HW_SWITCH_MASK); /* HW switch control not supported