Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp164847imm; Tue, 22 May 2018 16:10:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZotAV/b53BRJEakc6YuiK1xQQx4OuTAIt5SjDuKayyw1kf6HS93fIYjUHtG43uhHqf6lODy X-Received: by 2002:a63:8dca:: with SMTP id z193-v6mr330957pgd.418.1527030619811; Tue, 22 May 2018 16:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527030619; cv=none; d=google.com; s=arc-20160816; b=xU9XDogyYn4uVwWbdhWkmbPEUxpyEqtAVEq+YqOSQ5VmIR8IQEdigYDMsfjnvFfMOD lpx6lyPaCSb24q1lFTkK2qjcuquuL9+uMm0HDnjlOUTzEoemBHcY7MlO/rg0fH7flgef H03yNZ57bNuHHw7OWu85k+wwxB4DITW9AoOcZumDYFuAIKoIXckWcAMl5hVLPpc+Bl5r LA0Exxf2PWMO+UgHwezalIEK21/dC4VsX3l/cwKPtzdFXVPMtDE4qdY7uAaOkJ7bJqXL udXwD1fhEgaqPS+CiZ2ewnoWZ67ymxeynxDvBIyk258ovJD8GB28vjp7Og4Rv/jTJQXd DSbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=0G1rTvNkoDNvAoED5fh1DGmAKOKLe5eIdSoqXsBw4Tg=; b=C/xiMg/1w6kYgAZOb05CMpOPGXwjblXEQhAlNEE7RZjFgtiJ2KMuhZOv15ZgkphVdn 7eVpyg9q3jXqCwRNh5tmj9qXVZtB8xfdT0qK1q4oDvvt3Pj279V+uuFsNxExy1yTWlwB cH/GeIWwOnVHhdbJ0HOW6WP9nAVKVxzl1n7FESGIjXUMXdF+uMEqwssyxA2LT6VUmP4x KyNYXk2bU3TWwvQtIJYKVQeWacIbEf5WLmbtaLz1+23nOCQXyiyyGJG3KtCEqEIYxDBl ZyvrAwKIvDLK8xT3Tfg2zZg6iiM8FGVndDxIZ2yExJ4UPlr2md/90xdz5Figu7i29hLr LZQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jYjx6/f3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67-v6si17263220pla.475.2018.05.22.16.10.04; Tue, 22 May 2018 16:10:19 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jYjx6/f3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753277AbeEVXIq (ORCPT + 99 others); Tue, 22 May 2018 19:08:46 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:42650 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753002AbeEVXIp (ORCPT ); Tue, 22 May 2018 19:08:45 -0400 Received: by mail-pf0-f195.google.com with SMTP id p14-v6so9484438pfh.9 for ; Tue, 22 May 2018 16:08:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=0G1rTvNkoDNvAoED5fh1DGmAKOKLe5eIdSoqXsBw4Tg=; b=jYjx6/f3Yrgyvtl5A+UmPgcwz2YWfdWMHq038hefYKorvahl/W1drcn98MjjSu2SmD aynBxyn6BevzXgFfMoli5lYN+g+j+pfnSYwW+/lPyvwaN2mD1My0+u7E7vSLkQl5XImv 9DBNCgz7mKa/4uvG43cmE8D1ZBOlZO3NRO1346qOhs48DBgyGIRhpkvc/3QyTLXDA5KZ JaZYiKFQu4ZJf+48HNJf8JVOFQqC0tfvtxBnGd3ld5sQ6GQPvSrmRgwouSvOErJfkBHP ywmu7yoFMJowfrrgI8Sx+KSKFcJ6nqUsaZMh/wGGFKtWysRjL3DtfN9XYSGl2naR2Vt5 ESwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=0G1rTvNkoDNvAoED5fh1DGmAKOKLe5eIdSoqXsBw4Tg=; b=irej5Mb6QOOgkxtC4l63a/cIw05oqC+wyCFLB2e1F9naVS6TC3s4Ta7VkXjYNd2JIn ZpnZLGL0J/ywydKCXGw5G3yHKeCpL0gkh26k8PF0RDW6LbceZGVNXU+qNqAEprg8mZig rFWRoQHDE0DT9XiLUFbvd5Lkbxorwj48h0XwPMFhGFcStbVXdkNbzkd+2rVKJSDOgDMY SUwtET8wtfMeXpYId/Ba3vggNd8SrhBYU63x6TNd8vj3R7dKbZw28jiDoJkzJVEXUA4g FjAUbTrvw4Npia5IA/8rz1OlNfawrcppIfq7RBnRgx3mkl4MOWBU9xDP0STiEeH0xdnf R3FQ== X-Gm-Message-State: ALKqPweiLpPW78gzr9MutBQneFPxYfbEOAjIExbSbt3TKrq8RysLY/Z/ qui5KbHc8J+pfN1BC7i/sEubo5KU X-Received: by 2002:a62:d8c7:: with SMTP id e190-v6mr386346pfg.161.1527030524416; Tue, 22 May 2018 16:08:44 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id a5-v6sm39703010pff.8.2018.05.22.16.08.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 May 2018 16:08:43 -0700 (PDT) Date: Tue, 22 May 2018 16:08:41 -0700 From: Dmitry Torokhov To: Benson Leung Cc: Olof Johansson , Gwendal Grignou , Shawn Nematbakhsh , Vittorio Gambaletta , Guenter Roeck , linux-kernel@vger.kernel.org Subject: [PATCH] platform/chrome: cros_ec_lpc: do not try DMI match when ACPI device found Message-ID: <20180522230841.GA22026@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/platform/chrome/cros_ec_lpc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c index af89e82eecd23..a000d2fbbb0be 100644 --- a/drivers/platform/chrome/cros_ec_lpc.c +++ b/drivers/platform/chrome/cros_ec_lpc.c @@ -419,7 +419,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; } @@ -434,11 +440,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); -- 2.17.0.441.gb46fe60e1d-goog -- Dmitry