From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 845B0381BE for ; Wed, 15 May 2024 05:56:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715752605; cv=none; b=dg5BbIIYOGXCcxqyenHLPd3kaYU2MH3R8aYtuGYLF2mvQstoHlnYfS8dYgiIBoChig4sQux6M2n0JASNwDagz3UJQ7KB+W036fNsDSWHjAKgY1sAV1kbMXS6TDSn8k70wJAlAQOXLKmwxF0QL8EQ4ehiNlON8xAL8iVksZEu0ho= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715752605; c=relaxed/simple; bh=9Hl91SIEd+s34idGW5CgOFE3Rr6Y6mx8V9dIfdZbL6Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GDoshn4zmMg0jv9ZLK8h7JmQsd4xFQ3zov4Cj1ckEI8azpmg4wsj5MEgq7zE9dl8myyaeBlDpnd5b2RRoIUri623mZCFnIy517JR1XyqeyAPocxXoMKYABIaD5T+0r94a4+nOytSwq54pVDHlSpquwKMkSO77vyShrRjZ19crg8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=jubnut.com; spf=pass smtp.mailfrom=jubnut.com; dkim=pass (2048-bit key) header.d=jubnut.com header.i=@jubnut.com header.b=IlnHUtuN; arc=none smtp.client-ip=80.241.56.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=jubnut.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jubnut.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=jubnut.com header.i=@jubnut.com header.b="IlnHUtuN" Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4VfMtC24D6z9sxM; Wed, 15 May 2024 07:56:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jubnut.com; s=MBO0001; t=1715752595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SAAnJB39oETaobvjyNLVzZbiebH8e/Lpq7MQVzYIcpA=; b=IlnHUtuNMpAwt104OSGNFknvLXGajo744vCksNh5dSdEyJJ5Q7qTFMyN7iWK+foRs2g3xX wIWh4ikjMl8trMNoestn6Z3w8x4GPEDdsTVAhgtSTab2h1R5tsbgjmOgqXQB7yqOqRkja4 XwiHUFArDF3wHJQbm2UJIWOE2Pj7SgQdy89UnMyj9BPPUSfZ3FRtArVj/yQ/JBakmyMzYy y/DOn/BEsWPCRr7zVREsV0bx0FTKD5TFwPFYf6P60NR00iRHZl4kRPXTm/meG5abQlSDov ik4PeuTXu/9Ck+idGyMU7GSrDiYhlePZsS3m0/Tvn7BeQH1LT5CLBTQLwJ/q+Q== From: Ben Walsh To: Benson Leung , Tzung-Bi Shih , Guenter Roeck , "Dustin L. Howett" , Kieran Levin , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Mario Limonciello , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Ben Walsh Subject: [PATCH 0/6] Fix MEC concurrency problems for Framework Laptop Date: Wed, 15 May 2024 06:56:25 +0100 Message-ID: <20240515055631.5775-1-ben@jubnut.com> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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