Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp403909pxk; Wed, 2 Sep 2020 04:56:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1B2WZVtoE9FGqcQbNTwcjmvPv162UhCcJbAZOXZXAtM/+Z45QSgQv5FQBLcS1PSPBmgTr X-Received: by 2002:a17:906:130a:: with SMTP id w10mr5756115ejb.106.1599047779331; Wed, 02 Sep 2020 04:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599047779; cv=none; d=google.com; s=arc-20160816; b=Wuuv4Fwjx8VxdKSseUzq1yEQWF82MD7ore16+avKvsi/xpiDyMEUFVi17AS88ZKxYm qHyiuIG4m1aUuogCMMuvgv1AJns5czBYMrbD4+ltz9eoyJlTpXvljbar5QSc706JCXfe 06vQLdykVZZGQU82aqZn9PW5H1qvgI4aysjmXGxweaaGFPZBoR6KAoFj8al7CqNAUhBq 5/1ggzhrcrhtQXgmm2iBpkuhJ4vxDrWsymYfgbAg5zXtKBZyg5H2jrkNc1TxNxS9unN2 CIhzznOTMDB2hMmGu/tdwtnlT0ia5ZcMrXXda5kGf7fa98omrH0ORSL44zvl2uFDBYhz hw9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=/9wZw2QS26CdeFeKK3QxLNjMCxnyIXlCV1if01FWWtI=; b=FmNu7zws7MeIF5IPc1keaTbzHIB9blvWHJpynVKWbN08JQ/075t+TGyhyAgKi9hbPm 7Ciwy/HT6sx8AHdH3jT1RjTEMMTP/sBolrU+GrxMsqhVJXB6Fdfu4Jr53/ag7TxqmbSW aGsvcNZbgYn8o1E1ZKsIrf4IA6FkUwPCnavDIySM1tZX+hUfgRI3eoMLtzVk/JVLk04j PLWme33uQR7hG/Y1XBQrwP75bjMiQISP624P+aMkikWC0B8Q9GUMGblgOLEUQdy9KevO RlLv8/zuTWNntWeLwsqktQwPsnNE144zzW8SFpckhVeTGjOfLriWX6KocLBVYd0ixk1M ftIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TTPpAecc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt2si2686391ejc.67.2020.09.02.04.55.54; Wed, 02 Sep 2020 04:56:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TTPpAecc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726323AbgIBLwe (ORCPT + 99 others); Wed, 2 Sep 2020 07:52:34 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:58138 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726140AbgIBLw1 (ORCPT ); Wed, 2 Sep 2020 07:52:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599047540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/9wZw2QS26CdeFeKK3QxLNjMCxnyIXlCV1if01FWWtI=; b=TTPpAeccgN8z3wbjt84Pt+cGxK2vLpS5AHrRaYokrcGJzkjC2xfDSv+28Q/LUDq6SQi0nB D9u+7aopKsILQiv0+kkAuRjLZOqNKAfJQff7vxjRxyV3GMulXvE686cRf8na0NObBfWZqv 9VGI7tmVDpFZUGAI0PdJxnryKVLUcH4= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-356--2H_wkibNoKoaUuqW0-TcQ-1; Wed, 02 Sep 2020 07:52:16 -0400 X-MC-Unique: -2H_wkibNoKoaUuqW0-TcQ-1 Received: by mail-ed1-f70.google.com with SMTP id g8so2115173edm.6 for ; Wed, 02 Sep 2020 04:52:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/9wZw2QS26CdeFeKK3QxLNjMCxnyIXlCV1if01FWWtI=; b=RNu7ql8rXCXwqrKEDP0dovtcDgqrTSohVGT8QdW0fscvmZqAkCAlFV/fwUhYkkhrW0 ujMlFfTXA7JdpRD3lWQCaiuINtpTbt6oLIoBrOttm0H0lnsjbUepfdhdG7DIGCQBFDwg GK+bhEhmTN72mWkN0pyRAffsQnSpSgIN+50Aui3aw5hHlJm2sh3set/qPvo+YvZ3CXDb 8WDe5EULdSJYod7NU7UBZwrruRC8ipN237wWQA697GdUBvYndEgktm4VamQw+4ZmwoqM HqS2rS3JcN2IA4pke0XsguyjaGaaoQRf894MZPimLWvmz6yjknHTq4pZ+oIECThKPhit 0KCA== X-Gm-Message-State: AOAM533nzQB9PdbmAXCx/pbdpA5gKeDxC19UdePZhLR0bA44lpOB2zul imbx/Oia1ehQcPMKgy91Z+Km5NELDNV4HW+94VfHkbRwczhcHcPtCTGMu5G0CHn5uD2D/T9uWdh NUcBwOh4Yna87pcIqJw3wMQm7 X-Received: by 2002:a17:906:15c4:: with SMTP id l4mr1600392ejd.78.1599047534642; Wed, 02 Sep 2020 04:52:14 -0700 (PDT) X-Received: by 2002:a17:906:15c4:: with SMTP id l4mr1600370ejd.78.1599047534384; Wed, 02 Sep 2020 04:52:14 -0700 (PDT) Received: from x1.localdomain (2001-1c00-0c0c-fe00-d2ea-f29d-118b-24dc.cable.dynamic.v6.ziggo.nl. [2001:1c00:c0c:fe00:d2ea:f29d:118b:24dc]) by smtp.gmail.com with ESMTPSA id t14sm3720198edc.7.2020.09.02.04.52.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Sep 2020 04:52:13 -0700 (PDT) Subject: Re: platform/x86: asus-wmi: SW_TABLET_MODE is always 1 on some devices To: =?UTF-8?Q?Samuel_=c4=8cavoj?= , Andy Shevchenko , Corentin Chary Cc: acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200901215536.qcouepovmfxje4n5@fastboi.localdomain> From: Hans de Goede Message-ID: <0f7302c9-b508-a078-8c62-5ad5a03d92c2@redhat.com> Date: Wed, 2 Sep 2020 13:52:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200901215536.qcouepovmfxje4n5@fastboi.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 9/1/20 11:55 PM, Samuel Čavoj wrote: > Hello! > > A bug was introduced with the following commit[1]: > > b0dbd97de: platform/x86: asus-wmi: Add support for SW_TABLET_MODE > > The SW_TABLET_MODE switch seems to be always 1 on some devices, > including my UX360CA and a UX390UAK[2]. > > This can be seen in the output of evtest: > > # evtest /dev/input/by-path/platform-asus-nb-wmi-event > Input driver version is 1.0.1 > Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0 > Input device name: "Asus WMI hotkeys" > Supported events: > (...) > Event type 5 (EV_SW) > Event code 1 (SW_TABLET_MODE) state 1 > > And directly results in libinput disabling the trackpad and keyboard via > its tablet-mode mechanism, rendering X.org and Wayland unusable (not even > switching to VT works without sysrq+r): > > # libinput debug-events > (...) > -event8 DEVICE_ADDED Asus WMI hotkeys seat0 default group10 cap:kS > event8 SWITCH_TOGGLE +0.000s switch tablet-mode state 1 > (...) > > I have been using the following workaround to get my input working > again: > > # cat /usr/share/libinput/50-system-asus.quirks > (...) > [Asus WMI hotkeys] > MatchName=*Asus WMI hotkeys* > ModelTabletModeSwitchUnreliable=1 > > Another option would be to rmmod asus_nb_wmi and blacklist it for now. > > I am not sure what the solution would be as I am not acquainted with the > WMI module. However, I can provide some information about my hardware: > > The UX360CA fully disables the keyboard in hardware(firmware?) when the > lid is flipped beyond 180 degrees (tablet mode). The trackpad is not > disabled. A KEY_PROG2 event is generated by the same "Asus WMI hotkeys" > input device at this moment, it however does not carry the actual state > -- a 1 is sent and a 0 follows immediately[3]. The same KEY_PROG2 > sequence is generated when the lid is returned back to laptop position. > The SW_TABLET_MODE switch does not change state at all during this. > Thank you. Thank you for your detailed bug report. I have only tested the new TABLET_MODE support on Bay Trail and Cherry Trail based devices. So one possible solution would be to limit the support based on cpu-id. But I would rather try to figure out a better way. Can you create an acpidump, by as root running: acpidump -o acpidump.asus-UX360CA And then send me a direct (so without including the list) email with the generated acpidump.asus-UX360CA file attached please? Also, if necessary are you capable of building your own kernel with a (test)patch applied ? Regards, Hans