Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752238AbaLYULM (ORCPT ); Thu, 25 Dec 2014 15:11:12 -0500 Received: from mail-wi0-f178.google.com ([209.85.212.178]:44644 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751429AbaLYULK (ORCPT ); Thu, 25 Dec 2014 15:11:10 -0500 From: Pali =?utf-8?q?Roh=C3=A1r?= To: Alex Hung Subject: Re: [PATCH 0/3] Dell Airplane Mode Switch driver Date: Thu, 25 Dec 2014 21:11:05 +0100 User-Agent: KMail/1.13.7 (Linux/3.13.0-44-generic; KDE/4.14.2; x86_64; ; ) Cc: Gabriele Mazzotta , Darren Hart , Matthew Garrett , "platform-driver-x86@vger.kernel.org" , linux-kernel@vger.kernel.org References: <1416755361-17357-1-git-send-email-pali.rohar@gmail.com> <5019255.GNGyxISxsX@xps13> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart7413113.BHI8kDSqPo"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201412252111.06004@pali> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart7413113.BHI8kDSqPo Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I will try to recap all information which we have... *) We should not send wireless key press to userspace when BIOS=20 already handles wireless state (and enable/disable wifi):=20 http://www.spinics.net/lists/platform-driver-x86/msg05922.html *) some tested dell machines does not implement GRBT method (or=20 report constant value) which could return state of wireless=20 (enabled/disabled) -- e.g. Inspiron 7447 *) dell-wireless driver is doing nothing on devices which have=20 wireless slider switch (except calling CRBT/ARBT methods) *) all tested machines emit key with keycode 240 (scancode is=20 probably 136 =3D 0x88) to userspace via i8042 bus/AT keyboard when=20 wireless button/slider is pressed/switched *) both drivers dell-wireless and dell-rbtn do not implement=20 setting soft rfkill state (or change wifi state) So in my opinion: if we decide to use driver for acpi DELLABCE=20 device we should use dell-rbnt for devices with hw slider switch=20 and dell-wireless for devices with fn button. I think it does not=20 make sense to use dell-wireless for devices with hw slider=20 because it do nothing and dell-rbtn for devices with fn key=20 button as GRBT does not working properly. And second note: Do we need some driver for acpi DELLABCE device?=20 Which problem is trying acpi DELLABCE device to solve? Is not=20 everything working fine without driver for DELLABCE device? My dell-rbtn approach is trying to export rfkill interface from=20 DELLABCE device and eliminate using i8042 hook function in smbios=20 dell-laptop driver. Alex, can you check if scancode of wireless change generated by=20 BIOS is on all machines same: 136 (0x88)? And is send by keyboard=20 controller (not acpi/wmi)? On Thursday 25 December 2014 04:13:02 Alex Hung wrote: > I usually prefer to stick with formal document as everything > else can be changed without reasons. >=20 > I am not certain whether the keypress is defined in Dell's > document, and I will confirm with Dell. If this keypress is > well defined, it is a good idea to use it. >=20 >=20 > On Wed, Dec 24, 2014 at 7:40 PM, Gabriele Mazzotta >=20 > wrote: > > On Wednesday 24 December 2014 17:13:45 Alex Hung wrote: > >> I uploaded acpidump files [1] (except for XPS 13 which is > >> not available), and this should help clarify what has been > >> tested. > >>=20 > >> Does Inspirion 5721 does not have either DELLABCE or > >> DELRBTN. It is used for comparison. My apologies that I > >> did not point this out in previous email. > >>=20 > >> When calling ARBT(1), BIOS will no longer issue scancode > >> and will not pull low hardware pin "W_DISABLE#" on mini > >> card. This essentially gives all wireless control to OS. > >> This is likely the answer to Microsoft's Windows > >> Certification Program > >> System.Client.RadioManagement.HardwareButton [2] as below: > >>=20 > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >> If a PC has a physical (hardware) button switch on a PC > >> that turns wireless radios on and off, it must be software > >> controllable and interact appropriately with the Radio > >> Management UI > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>=20 > >> Dell's BIOS does issue a notify(RBTN, 0x80). This is done > >> purposely to re-enumerate the state of radio switch which > >> may be changed when system is in S3 or S4. I think this > >> should not occur when CRBT returns 0 or 1 (for hotkey that > >> cannot be changed during S3 or S4), but that's how it is > >> done currently. > >=20 > > The notification is sent on my XPS13 (CRBT returns 0), > > toggling the WiFi state on resume. > >=20 > >> dell-wireless does not handle this notification in S3 or S4 > >> for following reasons: > >>=20 > >> 1. dell-wireless does not handle slider (i.e. CRBT =3D 2 or > >> 3). Device drivers should read the hardware pin, > >> "W_DISABLE#" on mini spec and change hard block > >> accordingly. This pin is commonly used by OEM today. > >>=20 > >> 2. it is not possible to distinguish the notification > >> (0x80) from hotkey press or S3/S4. I also concerned this > >> may mis-trigger state change when resuming from S3 or S4, > >> but it does not. Does any know how to ignore this > >> notification during resume only? > >>=20 > >> dell-rbtn can use this notification + method (GRBT) [2] to > >> solve the problem that slider state. > >=20 > > Unfortunately this won't solve the problem for me. After > > ARBT is called with 1 as parameter, it seems that GRBT > > always returns 1. > >=20 > > I don't know how to ignore the notification on resume, if > > not through a flag set by a PM callback. > >=20 > > Given that all the tested laptops reported a keypress on the > > i8042 bus, isn't it better to rely on that instead? > >=20 > >> [1] http://people.canonical.com/~alexhung/dell-acpidump/ > >> [2] > >> http://msdn.microsoft.com/en-us/library/windows/hardware/j > >> j128256.aspx [3] It seems GRBT may not always be > >> implemented... > >>=20 > >> I'd love to do more tests and share the results on any > >> particular systems, but I may need some more detailed > >> instructions. > >>=20 > >>=20 > >>=20 > >> On Tue, Dec 23, 2014 at 3:16 AM, Gabriele Mazzotta > >>=20 > >> wrote: > >> > On Monday 22 December 2014 15:27:57 Alex Hung wrote: > >> >> =3D Testing =3D > >> >>=20 > >> >> I tested six Dell systems for two sets of patches for > >> >> dell radio button - two system with radio slider and > >> >> four with radio hotkey. There are also two systems with > >> >> working ARBT method. > >> >>=20 > >> >> =3D=3D Basic Information =3D=3D > >> >> Based OS: Ubuntu 14.10 (kernel 3.16 [1]) and kernel 3.18 > >> >> [2] > >> >>=20 > >> >> Patches: > >> >> 1. dell-wireless v3 =3D original v2 + Gabriele's > >> >> suggestion [3] 2. dell-rbtn [4] > >> >>=20 > >> >> Method: > >> >> 1. run "rfkill list" and press hotkey / toggle slider > >> >> during runtime 2. run "rfkill list" and toggle slider > >> >> during S3 > >> >>=20 > >> >> =3D=3D Results =3D=3D > >> >>=20 > >> >> I summarized the tests in Google sheet as below. Please > >> >> advise if anyone has problem reading it. > >> >>=20 > >> >> https://docs.google.com/spreadsheets/d/1voffS6dNglwAExSG > >> >> h3UmG__UAO2qfZ829CkJLPo06aI/edit?usp=3Dsharing > >> >>=20 > >> >> PS. The document will stay as long as possible for > >> >> future references. > >> >>=20 > >> >> =3D=3D Summary =3D=3D > >> >>=20 > >> >> 1. I did not observed a duplicated event. However, > >> >> keycode 240 (unknown) is generated on many UUT. It is > >> >> not issued by dell-laptop or del-wmi. I am suspecting > >> >> it is the other event Pali observes but it can be the > >> >> result of different distro. > >> >>=20 > >> >> 2. Some system issues scancode "0xe0 0x73 0xe0 0xf3". It > >> >> can also be used toggle wireless state but this can > >> >> also be distro-dependent. This scancode does nothing on > >> >> Ubuntu 14.10. > >> >>=20 > >> >> 2. There are two systems with working ARBT (XPS 13 9333 > >> >> and Inspiron 7447). Calling ARBT(1) changes BIOS > >> >> behaviours, and this matches to Dell's document. We > >> >> should include it in the patch for maximum capability. > >> >>=20 > >> >>=20 > >> >> [1] dell-wireless is only tested 3.16. > >> >> [2] dell-rbtn is tested on 3.16 and 3.18, but no > >> >> differences are observed. [3] > >> >> http://people.canonical.com/~alexhung/dell-wireless/ > >> >> [4] http://people.canonical.com/~alexhung/dell-rbtn/ > >> >=20 > >> > I've just tried the last revision of dell-wireless and > >> > noticed that a notification (0x80) is sent to DELLABCE > >> > after a transition from S3 to S0, causing dell-wireless > >> > to send KEY_RFKILL. This shouldn't happen. Same thing > >> > for transitions from S4 to S0. > >> >=20 > >> > Gabriele =2D-=20 Pali Roh=C3=A1r pali.rohar@gmail.com --nextPart7413113.BHI8kDSqPo Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAlScb1kACgkQi/DJPQPkQ1KJgACdE4YHrjGDSsjs0ckU1sf6S/iS D3IAoLRpITrEiDhS+qY3GIeQpXm3TrFj =hrXd -----END PGP SIGNATURE----- --nextPart7413113.BHI8kDSqPo-- -- 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/