chrome-platform.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] platform/chrome: Fix MEC concurrency problems for Framework Laptop
@ 2024-06-03  6:38 Ben Walsh
  2024-06-03  6:38 ` [PATCH v2 1/5] platform/chrome: cros_ec_lpc: MEC access can return error code Ben Walsh
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Ben Walsh @ 2024-06-03  6:38 UTC (permalink / raw)
  To: Benson Leung, Tzung-Bi Shih, Guenter Roeck, Dustin L. Howett,
	Kieran Levin, Thomas Weißschuh, Mario Limonciello,
	chrome-platform, linux-kernel
  Cc: Ben Walsh

Framework Laptops with the Microchip EC have a problem where the EC
"stops working" after a while. Symptoms include the Fn key not
working, and "bad packet checksum" errors appearing in the system log.

The problem is caused by ACPI code which accesses the Microchip EC
(MEC) memory using the Microchip EMI protocol. It uses an AML mutex to
prevent concurrent access. But the cros_ec_lpc driver is not aware of
this mutex. The ACPI code and LPC driver both attempt to talk to the
EC at the same time, messing up communication with the EC.

The solution is to have the cros_ec_lpc_mec code find and use the AML
mutex. But to make it all work we have to do a few more things:

  * Allow the cros_ec_lpc_mec code to return error codes in case it
    can't lock the mutex.

  * Have the cros_ec_lpc code find the correct ACPI device (PNP0C09)
    and then the AML mutex itself.

  * Use the quirks mechanism to specify the AML mutex name.

The code has been tested on an 11th-generation Intel Framework Laptop
(with Microchip EC) and an AMD Framework Laptop (without Microchip
EC). It has _not_ been tested on any Chromebook devices.

Changes in v2:

  * Put ACPI id in a quirk, not the acpi_match_table.
  * Add return code check for mutex unlock.
  * Remove "in_range" check which belongs in a separate patch.
  * Use "ret" not "sum" variable (same value but clearer).
  * Remove excessive error logging.
  * Rebase to latest ChromeOS for-next branch.

Ben Walsh (5):
  platform/chrome: cros_ec_lpc: MEC access can return error code
  platform/chrome: cros_ec_lpc: MEC access can use an AML mutex
  platform/chrome: cros_ec_lpc: Add a new quirk for ACPI id
  platform/chrome: cros_ec_lpc: Add a new quirk for AML mutex
  platform/chrome: cros_ec_lpc: Add quirks for Framework Laptop

 drivers/platform/chrome/cros_ec_lpc.c      | 210 +++++++++++++++------
 drivers/platform/chrome/cros_ec_lpc_mec.c  |  87 ++++++++-
 drivers/platform/chrome/cros_ec_lpc_mec.h  |  18 +-
 drivers/platform/chrome/wilco_ec/mailbox.c |  22 ++-
 4 files changed, 264 insertions(+), 73 deletions(-)


base-commit: bc3e45258096f2ea2116302abefde4b1cb9bc3c1
-- 
2.45.1


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

end of thread, other threads:[~2024-06-04  2:30 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-03  6:38 [PATCH v2 0/5] platform/chrome: Fix MEC concurrency problems for Framework Laptop Ben Walsh
2024-06-03  6:38 ` [PATCH v2 1/5] platform/chrome: cros_ec_lpc: MEC access can return error code Ben Walsh
2024-06-03  9:30   ` Tzung-Bi Shih
2024-06-03 19:26     ` Ben Walsh
2024-06-03  6:38 ` [PATCH v2 2/5] platform/chrome: cros_ec_lpc: MEC access can use an AML mutex Ben Walsh
2024-06-03  9:30   ` Tzung-Bi Shih
2024-06-03  6:38 ` [PATCH v2 3/5] platform/chrome: cros_ec_lpc: Add a new quirk for ACPI id Ben Walsh
2024-06-03  9:30   ` Tzung-Bi Shih
2024-06-03 16:00     ` Mario Limonciello
2024-06-03 19:10       ` Ben Walsh
2024-06-04  2:30       ` Tzung-Bi Shih
2024-06-03  6:38 ` [PATCH v2 4/5] platform/chrome: cros_ec_lpc: Add a new quirk for AML mutex Ben Walsh
2024-06-03  9:31   ` Tzung-Bi Shih
2024-06-03  6:38 ` [PATCH v2 5/5] platform/chrome: cros_ec_lpc: Add quirks for Framework Laptop Ben Walsh
2024-06-03 18:28 ` [PATCH v2 0/5] platform/chrome: Fix MEC concurrency problems " Dustin Howett
2024-06-03 19:06   ` Ben Walsh

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).