LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec_lpc: do not try DMI match when ACPI device found
@ 2018-05-22 23:08 Dmitry Torokhov
  2018-05-22 23:48 ` Benson Leung
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Torokhov @ 2018-05-22 23:08 UTC (permalink / raw)
  To: Benson Leung
  Cc: Olof Johansson, Gwendal Grignou, Shawn Nematbakhsh,
	Vittorio Gambaletta, Guenter Roeck, linux-kernel

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 <dmitry.torokhov@gmail.com>
---
 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/chrome: cros_ec_lpc: do not try DMI match when ACPI device found
  2018-05-22 23:08 [PATCH] platform/chrome: cros_ec_lpc: do not try DMI match when ACPI device found Dmitry Torokhov
@ 2018-05-22 23:48 ` Benson Leung
  0 siblings, 0 replies; 2+ messages in thread
From: Benson Leung @ 2018-05-22 23:48 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Benson Leung, Olof Johansson, Gwendal Grignou, Shawn Nematbakhsh,
	Vittorio Gambaletta, Guenter Roeck, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 792 bytes --]

Hi Dmitry,

On Tue, May 22, 2018 at 04:08:41PM -0700, Dmitry Torokhov wrote:
> 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 <dmitry.torokhov@gmail.com>

Nice fix. Applied. 

Thanks,
Benson

-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-22 23:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-22 23:08 [PATCH] platform/chrome: cros_ec_lpc: do not try DMI match when ACPI device found Dmitry Torokhov
2018-05-22 23:48 ` Benson Leung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).