From patchwork Thu Oct 22 10:44:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gabriele Mazzotta X-Patchwork-Id: 7464381 Return-Path: X-Original-To: patchwork-platform-driver-x86@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 31452BEEA4 for ; Thu, 22 Oct 2015 10:44:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 49D1920902 for ; Thu, 22 Oct 2015 10:44:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 40366208FC for ; Thu, 22 Oct 2015 10:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754669AbbJVKoM (ORCPT ); Thu, 22 Oct 2015 06:44:12 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:38675 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751235AbbJVKoL (ORCPT ); Thu, 22 Oct 2015 06:44:11 -0400 Received: by wicll6 with SMTP id ll6so112849844wic.1 for ; Thu, 22 Oct 2015 03:44:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=rmZco9BfWOoebCXuizca93KEV6S0/iTGDPGq6Iu0egQ=; b=Lf+9IWhy8CA98c/hOPpJ6tE6oPaIpv/G95aAIlMzOA1RR75+6ETJib07MaZCBMmoKi GkR6hL/BV5FUzVYVSp72CYS9Ps1Qi/H4t3WkGJeR6bneNt/0usuWjIlNr+hrf1+XEmZu ZHGSkXhtjab7e7C4sYFC6y3P4hTFbGo9+DtEVf5rZ3xNp/EajynDl2PtWIjlnIJNTfcM /+2C3XUNIvQwhJvlxr7s7lJX+4XCYBU1zngNarh+EHjJtZpP8HFdnlKTRSxICaa57tSd ULP2Y11PI9M34zT7wJQZtbwedYcrMOcVoyEaJU79tm4f7Fr+2VRUrMBrWLZYeP2sTr9f 0oaw== X-Received: by 10.194.158.136 with SMTP id wu8mr4953943wjb.150.1445510650512; Thu, 22 Oct 2015 03:44:10 -0700 (PDT) Received: from [192.168.42.200] (2-235-140-64.ip228.fastwebnet.it. [2.235.140.64]) by smtp.gmail.com with ESMTPSA id pi5sm21574130wic.3.2015.10.22.03.44.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2015 03:44:09 -0700 (PDT) Subject: Re: [Bug 106031] Regression in 4.2.x: in airplane mode each time I open my laptop lid To: =?UTF-8?Q?Pali_Roh=c3=a1r?= References: <20151021085724.GA87951@vmdeb7> <20151021091954.GD15219@pali> <20151021110059.GF15219@pali> <20151021111243.GB87951@vmdeb7> <20151022074937.GA2581@malice.jf.intel.com> <20151022085117.GQ15219@pali> Cc: Darren Hart , "platform-driver-x86@vger.kernel.org" , Alex Hung From: Gabriele Mazzotta Message-ID: <5628BDF8.9030506@gmail.com> Date: Thu, 22 Oct 2015 12:44:08 +0200 MIME-Version: 1.0 In-Reply-To: <20151022085117.GQ15219@pali> Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 22/10/2015 10:51, Pali Rohár wrote: > On Thursday 22 October 2015 10:26:47 Gabriele Mazzotta wrote: >> I'll see if I can find a batter way to deal with this problem, >> dell-laptop can detect the presence of an hardware switch. > > dell-rbtn.ko has acpi method CRBT which returns if notebook has hw switch or > toggle key. > > And rfkill implementation in dell-laptop.ko does not work correctly on > XPS machines. And because userspace implementation of smbios works fine, > I think that problem is in kernel driver rather in BIOS/firmware... I was thinking about something such as the following, which should favor the hardware slider when available. This should work if my assumption is correct, that is the laptops with a working RBTN method are the ones having problems. --- To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/platform/x86/dell-rbtn.c b/drivers/platform/x86/dell-rbtn.c index cd410e3..cf3c11c 100644 --- a/drivers/platform/x86/dell-rbtn.c +++ b/drivers/platform/x86/dell-rbtn.c @@ -321,6 +321,7 @@ static int rbtn_add(struct acpi_device *device) struct rbtn_data *rbtn_data; enum rbtn_type type; int ret = 0; + bool has_hardware_slider; /* get this with SMI */ type = rbtn_check(device); if (type == RBTN_UNKNOWN) { @@ -328,7 +329,7 @@ static int rbtn_add(struct acpi_device *device) return -EINVAL; } - ret = rbtn_acquire(device, true); + ret = rbtn_acquire(device, !has_hardware_slider); if (ret < 0) { dev_err(&device->dev, "Cannot enable device\n"); return ret; @@ -343,7 +344,10 @@ static int rbtn_add(struct acpi_device *device) switch (rbtn_data->type) { case RBTN_TOGGLE: - ret = rbtn_input_init(rbtn_data); + if (has_hardware_slider) + ret = 0; + else + ret = rbtn_input_init(rbtn_data); break; case RBTN_SLIDER: if (auto_remove_rfkill && rbtn_chain_head.head)