public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Fix MEC concurrency problems for Framework Laptop
@ 2024-05-15  5:56 Ben Walsh
  2024-05-15  5:56 ` [PATCH 1/6] platform/chrome: cros_ec_lpc: MEC access can return error code Ben Walsh
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Ben Walsh @ 2024-05-15  5:56 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.

Ben Walsh (6):
  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: Pass driver_data in static variable
  platform/chrome: cros_ec_lpc: Add a new quirk for AML mutex
  platform/chrome: cros_ec_lpc: Correct ACPI name for Framework Laptop
  platform/chrome: cros_ec_lpc: Add AML mutex for Framework Laptop

 drivers/platform/chrome/cros_ec_lpc.c      | 232 ++++++++++++++-------
 drivers/platform/chrome/cros_ec_lpc_mec.c  |  89 +++++++-
 drivers/platform/chrome/cros_ec_lpc_mec.h  |  18 +-
 drivers/platform/chrome/wilco_ec/mailbox.c |  22 +-
 4 files changed, 272 insertions(+), 89 deletions(-)


base-commit: 2fbe479c0024e1c6b992184a799055e19932aa48
-- 
2.45.0


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

end of thread, other threads:[~2024-05-28  3:08 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-15  5:56 [PATCH 0/6] Fix MEC concurrency problems for Framework Laptop Ben Walsh
2024-05-15  5:56 ` [PATCH 1/6] platform/chrome: cros_ec_lpc: MEC access can return error code Ben Walsh
2024-05-20  9:45   ` Tzung-Bi Shih
2024-05-15  5:56 ` [PATCH 2/6] platform/chrome: cros_ec_lpc: MEC access can use an AML mutex Ben Walsh
2024-05-20  9:46   ` Tzung-Bi Shih
2024-05-15  5:56 ` [PATCH 3/6] platform/chrome: cros_ec_lpc: Pass driver_data in static variable Ben Walsh
2024-05-20  9:46   ` Tzung-Bi Shih
2024-05-15  5:56 ` [PATCH 4/6] platform/chrome: cros_ec_lpc: Add a new quirk for AML mutex Ben Walsh
2024-05-15  5:56 ` [PATCH 5/6] platform/chrome: cros_ec_lpc: Correct ACPI name for Framework Laptop Ben Walsh
2024-05-20  9:47   ` Tzung-Bi Shih
2024-05-23 18:42     ` Ben Walsh
2024-05-24  2:26       ` Tzung-Bi Shih
2024-05-24 18:35         ` Ben Walsh
2024-05-24 18:39           ` Dustin Howett
2024-05-24 18:45             ` Ben Walsh
2024-05-26  1:26           ` Tzung-Bi Shih
2024-05-27 18:06             ` Ben Walsh
2024-05-28  3:08               ` Tzung-Bi Shih
2024-05-15  5:56 ` [PATCH 6/6] platform/chrome: cros_ec_lpc: Add AML mutex " Ben Walsh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox