Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3023079imm; Sun, 1 Jul 2018 10:30:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdBJq+lr3bMbQ2GchcQWFzSmhfiNivZEz+KHAl8qGQo2w3bvVM/UJ8pfGOBwnJYlTckgALG X-Received: by 2002:a65:498c:: with SMTP id r12-v6mr10617989pgs.112.1530466213056; Sun, 01 Jul 2018 10:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530466213; cv=none; d=google.com; s=arc-20160816; b=vV+G/3e+QTy+mxSNaiV+CthITqK9UML8WltzT7zLC7q6moqQwCgx4yMxuJAYgjGxLx mT5yyxmq519ywWc+fVBVvhx2j5wJ4F148l6a+zkAUFyRXs0Rc8O1BZqUsiT2XHY8CUIV i0gQAPSIs9l1bNQCPq8ZK3tZYXavzBrcELt9z/x0bUTQo3ZmcLqIhP7eOwnq6DcWXdT+ XqIG0z6C6vVNPrpbhgvZHVV5S2mZ/axlEYiBvE1eiHFkqfsK4zGPlCyRydxKkB6pbIAE ZUJvbZHqzaEbxz/A1VsZqXd1K/3iZ6ztgIk35/9m3pLllC3FR4VC3HMBRx8wndXpIyy1 7m2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6PrNMyEjw6YyluozQCq3Iy0mkR3hMMYYNaZoqSmJl78=; b=HrXoM77MRpcKKN+sWqFlphwg16wTXQ4Q8FNWHncpFakwKJGCtSpnopr14scvvSx/rT LTxdBXXkedhzWXVOKXPR+ir5Mkohtg9cDkJotsqAzKkA+a1+SoEqrqgIsLMyEW/R6PmC ldY3OpqH/ohOTxQJtEypmN+feYkCPTtiolxSnfnN/l4N1lBFv4DiLVAmVqUX9Mct8E2h urDLlvuDx633Cq20WIMivxiiVtTp82uQ1XxDP3Z04cfB41RVANeMwFGEtgTk5ZxnVpfp D0110VijtSdzeOsMIsQVrvfhKKcrqYB9KeyFqA53bF2XMrl914mfJ1UBCBamSI4aZtwj 6zfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4-v6si12108749pgp.490.2018.07.01.10.29.58; Sun, 01 Jul 2018 10:30:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030947AbeGAR2n (ORCPT + 99 others); Sun, 1 Jul 2018 13:28:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36152 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031355AbeGAQg6 (ORCPT ); Sun, 1 Jul 2018 12:36:58 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0849FACC; Sun, 1 Jul 2018 16:36:57 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Torokhov , Benson Leung Subject: [PATCH 4.17 013/220] platform/chrome: cros_ec_lpc: do not try DMI match when ACPI device found Date: Sun, 1 Jul 2018 18:20:37 +0200 Message-Id: <20180701160908.910774417@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Torokhov commit b410b1226620b6c959f1e9c87529acd058e90caf upstream. Older models of Chromebooks did not describe the LPC EC in their ACPI tables; starting with Strago-based devices Google is using GOOG0004 device to describe EC LPC. DMI-based match is fragile and does not work reliably, especially when using custom firmware. It is also not needed when we can locate the right ACPI device, so let's stop bailing out when DMI does not match but the right ACPI device is present. Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Benson Leung Signed-off-by: Greg Kroah-Hartman --- drivers/platform/chrome/cros_ec_lpc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- a/drivers/platform/chrome/cros_ec_lpc.c +++ b/drivers/platform/chrome/cros_ec_lpc.c @@ -435,7 +435,13 @@ static int __init cros_ec_lpc_init(void) int ret; acpi_status status; - if (!dmi_check_system(cros_ec_lpc_dmi_table)) { + status = acpi_get_devices(ACPI_DRV_NAME, cros_ec_lpc_parse_device, + &cros_ec_lpc_acpi_device_found, NULL); + if (ACPI_FAILURE(status)) + pr_warn(DRV_NAME ": Looking for %s failed\n", ACPI_DRV_NAME); + + if (!cros_ec_lpc_acpi_device_found && + !dmi_check_system(cros_ec_lpc_dmi_table)) { pr_err(DRV_NAME ": unsupported system.\n"); return -ENODEV; } @@ -450,11 +456,6 @@ static int __init cros_ec_lpc_init(void) return ret; } - status = acpi_get_devices(ACPI_DRV_NAME, cros_ec_lpc_parse_device, - &cros_ec_lpc_acpi_device_found, NULL); - if (ACPI_FAILURE(status)) - pr_warn(DRV_NAME ": Looking for %s failed\n", ACPI_DRV_NAME); - if (!cros_ec_lpc_acpi_device_found) { /* Register the device, and it'll get hooked up automatically */ ret = platform_device_register(&cros_ec_lpc_device);