From patchwork Sun Aug 6 15:35:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 9883817 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 32EE2602B6 for ; Sun, 6 Aug 2017 15:35:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21CB4280FC for ; Sun, 6 Aug 2017 15:35:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12F83284F2; Sun, 6 Aug 2017 15:35:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2A9128426 for ; Sun, 6 Aug 2017 15:35:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751386AbdHFPff (ORCPT ); Sun, 6 Aug 2017 11:35:35 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:38015 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbdHFPfe (ORCPT ); Sun, 6 Aug 2017 11:35:34 -0400 Received: by mail-wr0-f177.google.com with SMTP id f21so31446417wrf.5; Sun, 06 Aug 2017 08:35:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-transfer-encoding:message-id; bh=rWRsl27tQYQgJcM4bDHyGqbraDL5CnuAdgthUjKfA94=; b=mIddrfy4kc2FVqzBF4ff9pVhnJmf+zSzfUxusRuD4oZ2TEu/Zbh0chmhYL2U4XRCpY PQS+w99v1kY9AAIBrWh1Q1zCfVkV3o9QlEI4+gXKvoyLZ+dlL9VM3sFqrQbKf2bneFOr Oj2fXVFU/afUU8OQtrrVsxjYvHDApZnMyp4N2rkCzODH45pg93QscPMeKuJtwIZrT+Vq IX5cdDkggWJEKw1BWWHeMx90vJ+nes913FDpxme/a+SyHN8gdRCw87Usjkqyfkfo9hBS Nv4yAwZnOsy8XKTz+cMa6t9GhRieTB8tkEzZ3LoVN7QFNk/a38Ip5jZUtWyeBM9waWcM MOfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-transfer-encoding:message-id; bh=rWRsl27tQYQgJcM4bDHyGqbraDL5CnuAdgthUjKfA94=; b=jFbQs11pI1NUUkSn/jUyptH/tb07lLKt4mwsJ2fOpK652Z2wcofWi1bw74W/Fk1/TR WyKWjJCdOI8mZ6RhI7IzCf+DF6UgfZey7c1+9mMxWwCFmBadAxIYIJvzMV6yca6bbDfQ PBIq0LUDWCO5+bosIcafaG1tqeYtGx6ZRF1X+u9GYLnMQW3ssRy3US/+ZjM7VuVNsZ5V /RV1thhyxsE2rCu+d2fDBHBDNX2ALQKZCBQ50L0undK5D/bQMKYtWOueqg8K/OeGcyit xQrtcB7L9VKZJbp8Clc5CBbXLoTScUP150jwttZqDc8p7CXNZdM3m1r14qSR441njXXq RrUw== X-Gm-Message-State: AIVw112ggxy9qtpD7mensW+EZNLHKDXeTqW/enWseJ9uFdXJLy95qXk9 vHcjvNltH3r0Kw== X-Received: by 10.223.150.208 with SMTP id u74mr6033021wrb.259.1502033732643; Sun, 06 Aug 2017 08:35:32 -0700 (PDT) Received: from pali-latitude.localnet (pali.kolej.mff.cuni.cz. [78.128.193.202]) by smtp.gmail.com with ESMTPSA id l2sm8088095wmi.31.2017.08.06.08.35.31 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 06 Aug 2017 08:35:31 -0700 (PDT) From: Pali =?utf-8?q?Roh=C3=A1r?= To: Darren Hart , Andy Shevchenko Subject: Re: [PATCH] RFC: platform/x86: wmi: Fix check for method instance number Date: Sun, 6 Aug 2017 17:35:30 +0200 User-Agent: KMail/1.13.7 (Linux/3.13.0-117-generic; KDE/4.14.2; x86_64; ; ) Cc: David Airlie , "Chun-Yi Lee" , Corentin Chary , acpi4asus-user@lists.sourceforge.net, Oleksij Rempel , =?utf-8?q?Jo=C3=A3o_Paulo_Rechi_Vita?= , Andy Lutomirski , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <1495886134-8276-1-git-send-email-pali.rohar@gmail.com> <1588258750.25982542.1499283035221.JavaMail.zimbra@redhat.com> <201707052224.20656@pali> In-Reply-To: <201707052224.20656@pali> MIME-Version: 1.0 Message-Id: <201708061735.31002@pali> Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wednesday 05 July 2017 22:24:20 Pali Rohár wrote: > On Wednesday 05 July 2017 21:30:35 David Airlie wrote: > > ----- Original Message ----- > > > > > From: "Pali Rohár" > > > To: "Chun-Yi Lee" , "Corentin Chary" > > > , acpi4asus-user@lists.sourceforge.net, > > > "Dave Airlie" , "Oleksij Rempel" > > > , "João Paulo Rechi Vita" > > > > > > Cc: "Darren Hart" , "Andy Shevchenko" > > > , "Andy Lutomirski" , > > > platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org > > > Sent: Wednesday, 5 July, 2017 7:51:13 PM > > > Subject: Re: [PATCH] RFC: platform/x86: wmi: Fix check for method > > > instance number > > > > > > On Saturday 17 June 2017 18:47:54 Pali Rohár wrote: > > > > > So problematic drivers which use instance=1 without any > > > > > comments > > > > > > > > > > are: > > > > > acer-wmi > > > > > asus-wmi > > > > > mxm-wmi > > > > > > > > Adding authors & maintainers of those drivers in loop. > > > > > > Hi! > > > > > > Dell drivers and acer-wmi are fixed now. So only asus-wmi and > > > mxm-wmi needs to be investigated. > > > > > > Adding more people who developed those drivers recently in loop. > > > Can you check if instance number is used correctly or not? > > > > I've no memory of why I picked 1 or 0, I probably cut-n-paste it > > from somewhere else. > > > > Dave. > > And do you have at least ACPI DSDT dumps from that machine? Or are > you able to find some? Hi! For mxm-wmi I found this document: https://lekensteyn.nl/files/docs/mxm-2.1-software-spec.pdf On page numbered 26 (resp. in PDF page 31) is information about WMI GUID {F6CB5C3C-9CAE-4EBD-B577-931EA32A2CC0} interface and there is written that instance count = 1. // Methods GUID {F6CB5C3C-9CAE-4ebd-B577-931EA32A2CC0} 0x3C, 0x5C, 0xCB, 0xF6, 0xAE, 0x9C, 0xbd, 0x4e, 0xB5, 0x77, 0x93, 0x1E, 0xA3, 0x2A, 0x2C, 0xC0, 0x4D, 0x58, // Object ID “MX” = method “WMMX” 1, // Instance Count 0x02, // Flags (WMIACPI_REGFLAG_METHOD) And ACPI method for handling this WMI call does not check Arg0 and Arg1 at all. So... Andy, Darren, any objections for following patch which changes instance number from one to zero? diff --git a/drivers/platform/x86/mxm-wmi.c b/drivers/platform/x86/mxm-wmi.c index f4bad83..35d8b9a 100644 --- a/drivers/platform/x86/mxm-wmi.c +++ b/drivers/platform/x86/mxm-wmi.c @@ -53,7 +53,7 @@ int mxm_wmi_call_mxds(int adapter) printk("calling mux switch %d\n", adapter); - status = wmi_evaluate_method(MXM_WMMX_GUID, 0x1, adapter, &input, + status = wmi_evaluate_method(MXM_WMMX_GUID, 0x0, adapter, &input, &output); if (ACPI_FAILURE(status)) @@ -78,7 +78,7 @@ int mxm_wmi_call_mxmx(int adapter) printk("calling mux switch %d\n", adapter); - status = wmi_evaluate_method(MXM_WMMX_GUID, 0x1, adapter, &input, + status = wmi_evaluate_method(MXM_WMMX_GUID, 0x0, adapter, &input, &output); if (ACPI_FAILURE(status))