From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752269AbdFPQeA (ORCPT ); Fri, 16 Jun 2017 12:34:00 -0400 Received: from esa6.dell-outbound.iphmx.com ([68.232.149.229]:62907 "EHLO esa6.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbdFPQd6 (ORCPT ); Fri, 16 Jun 2017 12:33:58 -0400 From: X-LoopCount0: from 10.175.216.249 X-IronPort-AV: E=Sophos;i="5.39,347,1493701200"; d="scan'208";a="954500177" To: , CC: , , , Subject: RE: [PATCH] RFC: platform/x86: wmi: Fix check for method instance number Thread-Topic: [PATCH] RFC: platform/x86: wmi: Fix check for method instance number Thread-Index: AQHS5d+kk/AocFU6lEu7pmrbLSyJ6aImB6YAgAGolAA= Date: Fri, 16 Jun 2017 16:33:54 +0000 Message-ID: References: <1495886134-8276-1-git-send-email-pali.rohar@gmail.com> <201706102115.57995@pali> <20170613164951.GI27850@fury> <201706132004.58051@pali> <20170613184228.GC22450@fury> <20170614154654.GA22981@pali> <20170615135902.GS5248@pali> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.143.242.75] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v5GGYFBc003341 > -----Original Message----- > From: Limonciello, Mario > Sent: Thursday, June 15, 2017 10:16 AM > To: 'Pali Rohár' ; Darren Hart > Cc: Andy Shevchenko ; Andy Lutomirski ; > platform-driver-x86@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: RE: [PATCH] RFC: platform/x86: wmi: Fix check for method instance > number > > > -----Original Message----- > > From: Pali Rohár [mailto:pali.rohar@gmail.com] > > Sent: Thursday, June 15, 2017 8:59 AM > > To: Limonciello, Mario ; Darren Hart > > > > Cc: Andy Shevchenko ; Andy Lutomirski > ; > > platform-driver-x86@vger.kernel.org; linux-kernel@vger.kernel.org > > Subject: Re: [PATCH] RFC: platform/x86: wmi: Fix check for method instance > > number > > > > Mario, are you able to check if instance number passed to > > wmi_evaluate_method in following dell WMI drivers is correct and should > > be really 1? > > > > I suspect that it should be zero, as instance number is indexed from > > zero. > > > > There is no comment in those dell WMI drivers why it is 1, nor what 1 > > means. > > > > Ideally it needs to be checked in ACPI byte code, MOF file and WDG dump. > > > I think you're likely correct. I don't have a box that supports alienware-wmi > or dell-wmi-led.c handy at the current moment to confirm this hypothesis though. > I'll confirm this later. > > I didn't realize it was zero indexed when I wrote alienware-wmi, and I'm guessing > the author of dell-wmi-led didn't either. > > The reason it's probably working is the ACPI byte code isn't actually checking > the instance since most times _WDG will only call out one instance. I confirmed you're correct. Switching instance over to 0 works properly on an ASM200 (supported by alienware-wmi). Since only one instance is supported the ASL doesn't check Arg0 at all. snippet: Method (WMAX, 3, NotSerialized) { If ((Arg1 == One)) { CreateByteField (Arg2, Zero, SOUR) If ((SOUR == One)) { GU01 = (GU01 | 0x80) GIO1 = (GIO1 & 0x7F) GL01 = (GL01 & 0x7F) Return (Zero) } If ((SOUR == 0x02)) { GU01 = (GU01 | 0x80) GIO1 = (GIO1 & 0x7F) GL01 = (GL01 | 0x80) Return (Zero) } If ((SOUR == 0x03)) { If ((CN00 == Zero)) { CN00 = One If (((GL01 & 0x80) == 0x80)) { GL01 &= 0x7F Return (Zero) } If (((GL01 & 0x80) == Zero)) { GL01 |= 0x80 Return (Zero) } } If ((CN00 == One)) { CN00 = Zero Return (Zero) } Return (One) } Return (One) } > > > On Wednesday 14 June 2017 17:46:54 Pali Rohár wrote: > > > Function wmi_evaluate_method: > > ... > > > alienware-wmi.c: > > > instance=1 /* no comment why, guid=A70591CE-A997-11DA-B012- > > B622A1EF5492 */ > > > instance=1 /* no comment why, guid=A80593CE-A997-11DA-B012- > > B622A1EF5492 */ > > > instance=1 /* no comment why, guid=A70591CE-A997-11DA-B012- > > B622A1EF5492 */ > > ... > > > dell-wmi-led.c: > > > instance=1 /* no comment why, guid=F6E4FE6E-909D-47cb-8BAB- > > C9F6F2F8D396 */ > > > > -- > > Pali Rohár > > pali.rohar@gmail.com