From patchwork Thu Feb 22 17:05:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Limonciello, Mario" X-Patchwork-Id: 10235979 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 8E1CC60209 for ; Thu, 22 Feb 2018 17:05:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D2F928F36 for ; Thu, 22 Feb 2018 17:05:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F44C28F34; Thu, 22 Feb 2018 17:05:43 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 AE1A228F0A for ; Thu, 22 Feb 2018 17:05:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933195AbeBVRFm (ORCPT ); Thu, 22 Feb 2018 12:05:42 -0500 Received: from esa1.dell-outbound.iphmx.com ([68.232.153.90]:57246 "EHLO esa1.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933193AbeBVRFl (ORCPT ); Thu, 22 Feb 2018 12:05:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1519318909; x=1550854909; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=XGw/cfziPRXPKXRVjlNIn3u1PE7dk2UErd3iPg18Hho=; b=o8jP7AJUHtpbDH6KNsX9JnLUdts6FUtsLRkQzsmlp3ERDGsxeY+eX5jZ 1VZ39PhW2Blcqhp4ImUZN9R4Bf6Iulj4PSMzt98iPI/a+6gTmCKu7Al4T 9aPEu3qPmkQ0BeFuCC+p0Y4XdmsS5/VgGMNFF7jjrjCfrjYlhugv8xbZi w=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2G/AQCj945ah8uZ6ERcGQEBAQEBAQEBA?= =?us-ascii?q?QEBAQcBAQEBAYQlgQAoCoNemCGCAoEWaocXjk2CFgqFNAIaghRVFwECAQEBAQE?= =?us-ascii?q?BAgECEAEBAQoLCQgoL4I4IoJKAQEBBCMEDUUMBAIBCBEEAQEBAgIjAwICAh8lA?= =?us-ascii?q?QIBBQgCBAENBQiKAwMVqxeBbTqHNw2BMoIXAQEBAQEBAQEBAQEBAQEBAQEBAQE?= =?us-ascii?q?BHYEPhAqCJ4M+gy6BSQGBIoI+ECOCXYJlBaQKNQmRA4UCgimGKIt8jlSJVoE8I?= =?us-ascii?q?QGCCHCDEoJkghJ4AYwVgRkBAQE?= X-IPAS-Result: =?us-ascii?q?A2G/AQCj945ah8uZ6ERcGQEBAQEBAQEBAQEBAQcBAQEBAYQ?= =?us-ascii?q?lgQAoCoNemCGCAoEWaocXjk2CFgqFNAIaghRVFwECAQEBAQEBAgECEAEBAQoLC?= =?us-ascii?q?QgoL4I4IoJKAQEBBCMEDUUMBAIBCBEEAQEBAgIjAwICAh8lAQIBBQgCBAENBQi?= =?us-ascii?q?KAwMVqxeBbTqHNw2BMoIXAQEBAQEBAQEBAQEBAQEBAQEBAQEBHYEPhAqCJ4M+g?= =?us-ascii?q?y6BSQGBIoI+ECOCXYJlBaQKNQmRA4UCgimGKIt8jlSJVoE8IQGCCHCDEoJkghJ?= =?us-ascii?q?4AYwVgRkBAQE?= Received: from esa5.dell-outbound2.iphmx.com ([68.232.153.203]) by esa1.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Feb 2018 11:01:49 -0600 From: Received: from ausxippc110.us.dell.com ([143.166.85.200]) by esa5.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Feb 2018 22:54:59 +0600 X-LoopCount0: from 10.166.132.152 X-IronPort-AV: E=Sophos;i="5.47,378,1515477600"; d="scan'208";a="621284715" X-DLP: DLP_GlobalPCIDSS To: , CC: , , , , , Subject: RE: Regression: Dell XPS 13 9360 keyboard no longer works Thread-Topic: Regression: Dell XPS 13 9360 keyboard no longer works Thread-Index: AQHTq5v56OaYoDnjuECSi8YlbIDbbaOwiM4igAAAcxCAAHAoAP//n4VwgABlkoD//5uHsIAAa4MA//+bj0A= Date: Thu, 22 Feb 2018 17:05:39 +0000 Message-ID: <88473a72368b43bdacebca279092ab0f@ausx13mpc120.AMER.DELL.COM> References: <01000161bbeed4e3-8160ffbc-0998-453d-9afd-14b7dd80dd53-000000@email.amazonses.com> <1628582.nV6hDClBbL@phobos> <01000161bdd7f206-c8d87cce-1b8c-4888-8d6a-5247198b3ead-000000@email.amazonses.com> <01000161be3d1072-1c155203-359c-4566-9af6-2ebc33ad43ee-000000@email.amazonses.com> <01000161be4dbc6d-571d7479-35a2-4c6d-b3e0-f2405fc2064a-000000@email.amazonses.com> <722a48c6c0354609bf34f86c4269aef9@ausx13mpc120.AMER.DELL.COM> <01000161be64cac2-b17509ef-f7e5-4134-9188-941d7f5ac687-000000@email.amazonses.com> In-Reply-To: <01000161be64cac2-b17509ef-f7e5-4134-9188-941d7f5ac687-000000@email.amazonses.com> 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.18.86] MIME-Version: 1.0 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 > -----Original Message----- > From: platform-driver-x86-owner@vger.kernel.org [mailto:platform-driver-x86- > owner@vger.kernel.org] On Behalf Of Jeremy Cline > Sent: Thursday, February 22, 2018 10:42 AM > To: Limonciello, Mario ; notmart@gmail.com > Cc: pali.rohar@gmail.com; andriy.shevchenko@linux.intel.com; > mjg59@srcf.ucam.org; dvhart@infradead.org; platform-driver- > x86@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: Regression: Dell XPS 13 9360 keyboard no longer works > > On 02/22/2018 11:17 AM, Mario.Limonciello@dell.com wrote: > >> -----Original Message----- > >> From: platform-driver-x86-owner@vger.kernel.org [mailto:platform-driver-x86- > >> owner@vger.kernel.org] On Behalf Of Jeremy Cline > >> Sent: Thursday, February 22, 2018 10:17 AM > >> To: Limonciello, Mario ; notmart@gmail.com > >> Cc: pali.rohar@gmail.com; andriy.shevchenko@linux.intel.com; > >> mjg59@srcf.ucam.org; dvhart@infradead.org; platform-driver- > >> x86@vger.kernel.org; linux-kernel@vger.kernel.org > >> Subject: Re: Regression: Dell XPS 13 9360 keyboard no longer works > >> > >> On 02/22/2018 11:14 AM, Mario.Limonciello@dell.com wrote: > >>>> -----Original Message----- > >>>> From: Jeremy Cline [mailto:jeremy@jcline.org] > >>>> Sent: Thursday, February 22, 2018 9:59 AM > >>>> To: Limonciello, Mario ; notmart@gmail.com > >>>> Cc: pali.rohar@gmail.com; andriy.shevchenko@linux.intel.com; > >>>> mjg59@srcf.ucam.org; dvhart@infradead.org; platform-driver- > >>>> x86@vger.kernel.org; linux-kernel@vger.kernel.org > >>>> Subject: Re: Regression: Dell XPS 13 9360 keyboard no longer works > >>>> > >>>> On 02/22/2018 10:21 AM, Mario.Limonciello@dell.com wrote:> I guess that > >>>> means we got this wrong and the patch should be reverted > >>>>> until we figure this out. > >>>>> > >>>>> Jeremy, > >>>>> > >>>>> Can you please confirm what BIOS version you are on? > >>>>> Also Is this a 9360 with 7th or 8th gen Intel CPU? > >>>> > >>>> Hi Mario, > >>>> > >>>> I've got BIOS version 2.5.0 with the 7th gen Intel CPU. > >>>> > >>>> > >>>> Regards, > >>>> Jeremy > >>> > >>> Jeremy, > >>> > >>> Thanks. Do you have any of the Dell docks (TB16/WD15)? If so are you > connected > >> to any dock > >>> when reproducing this problem? > >> > >> Mario, > >> > >> I do have a TB16. I can reproduce this whether or not I'm connected to > >> the dock, though. > >> > >> > >> Regards, > >> Jeremy > > > > Jeremy, > > > > Can you try booting up from a cold boot with it connected to see if it still > happens? > > > > Mario, > > Yup, it still happens from a cold boot when connected to the dock. OK thanks for confirming. Here's what I've concluded: * So looking through the ACPI tables on the 9360 it initializes that status (slate vs laptop mode) bit to "slate" mode. The 9360 isn't a 2-in1- so that seems wrong to me, but that's what it does. It only gets updated based on dock status. The 9365 (which is a 2 in 1) however seems to initialize the status properly. So that's an impasse of what to do. It's not clear to me what is really happening: a) We're missing something else in this driver (eg something else that indicates whether to trust VGBS output) b) Mis-interpreting the results from it (we shouldn't report the switch for tablet mode based on what we do) c) 9360 has a BIOS bug (seems unlikely since Windows doesn't freak out and show virtual keyboard at wrong time) I'm leaning on it's probably . We should check for tablet mode should only be run if chassis type matches 2-in-1 (chassis type 0x1F). I believe that should fix the problem on the 9360, let it continue to work on the 9365 (and other 2-in-1's). Can you guys please test this? If that works I'll split up the routine and submit it. diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c index b703d6f..07bc489 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -102,6 +103,7 @@ static int intel_vbtn_probe(struct platform_device *device) struct acpi_buffer vgbs_output = { ACPI_ALLOCATE_BUFFER, NULL }; acpi_handle handle = ACPI_HANDLE(&device->dev); struct intel_vbtn_priv *priv; + const char *chassis_type; acpi_status status; int err; @@ -123,22 +125,24 @@ static int intel_vbtn_probe(struct platform_device *device) } /* - * VGBS being present and returning something means we have - * a tablet mode switch. + * Running on 2-in-1 chassis, VGBS being present and + * returning something means we have a tablet mode switch. */ - status = acpi_evaluate_object(handle, "VGBS", NULL, &vgbs_output); - if (ACPI_SUCCESS(status)) { - union acpi_object *obj = vgbs_output.pointer; + chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE); + if (chassis_type && strcmp(chassis_type, "31")) { + status = acpi_evaluate_object(handle, "VGBS", NULL, &vgbs_output); + if (ACPI_SUCCESS(status)) { + union acpi_object *obj = vgbs_output.pointer; - if (obj && obj->type == ACPI_TYPE_INTEGER) { - int m = !(obj->integer.value & TABLET_MODE_FLAG); + if (obj && obj->type == ACPI_TYPE_INTEGER) { + int m = !(obj->integer.value & TABLET_MODE_FLAG); - input_report_switch(priv->input_dev, SW_TABLET_MODE, m); + input_report_switch(priv->input_dev, SW_TABLET_MODE, m); + } } + kfree(vgbs_output.pointer); } - kfree(vgbs_output.pointer); - status = acpi_install_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler,