Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1447621lqj; Tue, 4 Jun 2024 01:36:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXRVevHMAlum8BRTrpHoHa2kHKOjunqpm+tFxJdpgtafcoAWc3uGKqE9jYDWdtlePEodQZ2biIr+I8JF9wwMunD6D/aIeBW4yGRuK+sZQ== X-Google-Smtp-Source: AGHT+IFQH2Vr1hJJSo92r20YR/HBu7LDMUNclWFXkqxJB5yLYRdRgnkrlIRDsppyFjVOJMErVL6u X-Received: by 2002:a17:903:32c2:b0:1f3:2e5d:902d with SMTP id d9443c01a7336-1f636fd9704mr127179745ad.4.1717490187883; Tue, 04 Jun 2024 01:36:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717490187; cv=pass; d=google.com; s=arc-20160816; b=FOs/giVhwkZxYtXIIO552Ml44MUbHQbn3dit6evln0/q4FwUpMQQryVeAcq198+0h5 11sfmCQVb7bZTErF24DYPwJl9oUJN4dcnwaZ6vzsbzpnDwcG/E+WxCA7P7u0ElYafkzP GE2sPtYPNxfgbXfLkwiUatJjIN4Nq3fXlr6ZgWV9dA1nVMwBjD/mTsz7yMuEq/xwoToc k2A3uLQ+SYqTNCPsqUvMX3lPNe6zSS/ZWe8ySkhSEl3CCEnvo3i90qGg2h27xhepq7Xd +Qffpyt3vu/UFCdhMz2OZey8QjhOnfKZqYApX0C/4whI5oMGbDjTN6daU/HiE1YABuMK 328g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=27yHvoqXvTKgDtibjbQpIqsEZ0fGGVbEGRHK5/yVtA0=; fh=TB40nJxdONdf4WtVAnDt8DWbDrzJeBBXgHK/mPL12mo=; b=hpMkt/qcDsL2SVYBz0SUTuybmUwVAAChPMjcLnMA1QF2vF7QTkGrJnBDEA9Z2kxY6W f6lsD8mVWbJOndZZGUDy6zUsPZflBmtavfBMLxSlQHORG55ySHBayYrvrY33tNdmUTII vl2suF0GP4ZJy46441MWLHlN8cTqNLQZamI2x3OEm6RIR8kGKJ0bVD51FKwnzpX2BYyw 1pGhmR6Hzutm0/bCov1IB+/gvmh/uTeS7RVBtdm+UvyOctM8SyCa3CZok6bQ7YnlFDUb ngpH+NiDCwKYWyHnxiOtXXLllVj1ucDmab6glzWBNOTJj0FyvgmuXmKvLNQfR4Nyw4PJ cKPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@jubnut.com header.s=MBO0001 header.b=vHPS4Tah; arc=pass (i=1 spf=pass spfdomain=jubnut.com dkim=pass dkdomain=jubnut.com dmarc=pass fromdomain=jubnut.com); spf=pass (google.com: domain of linux-kernel+bounces-198654-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198654-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=jubnut.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6323dd7e7si7279835ad.316.2024.06.04.01.36.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 01:36:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198654-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@jubnut.com header.s=MBO0001 header.b=vHPS4Tah; arc=pass (i=1 spf=pass spfdomain=jubnut.com dkim=pass dkdomain=jubnut.com dmarc=pass fromdomain=jubnut.com); spf=pass (google.com: domain of linux-kernel+bounces-198654-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198654-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=jubnut.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EE8EC2825FB for ; Mon, 3 Jun 2024 06:40:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3EF246434; Mon, 3 Jun 2024 06:39:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=jubnut.com header.i=@jubnut.com header.b="vHPS4Tah" Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) (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 62CF63F8F7 for ; Mon, 3 Jun 2024 06:39:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.161 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717396745; cv=none; b=RZCwz7W6H6iWJSSEyeF6dXeiGXYk7g790SoeOTg8dOVkIh5M5Y0G6WQqWTtVzsL62go7HNcPqqX8gtYqR51stS1nIHdFfyIUbBRcV15YeTFpQD40uuIQPF6+NMzI9EMY4iPDtNp+2GS/uZczMcJUP4HqBN9yq++MGi4M+Xn3rDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717396745; c=relaxed/simple; bh=hkNs5q0Ag3u8/av4iTBEluUDEHvKgcU6hIRJDGCuqBk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fGeo6xsvPC65dvuwM5Fh4FFmlenTvDtC+xeLjTODofWnbwhBLHcqG4te3sHYt/yLvlpTD/MC36yVDZH3sEBshSDfglyPlVza1dJnGcU/nGkwMLo4ldb8dwTP0OHyB4ahjncbzRJy1aOjZ2aZ+TH3sHuq4rs6M/VbzEhh9tQxaXg= 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=vHPS4Tah; arc=none smtp.client-ip=80.241.56.161 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 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (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-103.mailbox.org (Postfix) with ESMTPS id 4Vt3wJ5W4Bz9sT7; Mon, 3 Jun 2024 08:38:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jubnut.com; s=MBO0001; t=1717396736; 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: in-reply-to:in-reply-to:references:references; bh=27yHvoqXvTKgDtibjbQpIqsEZ0fGGVbEGRHK5/yVtA0=; b=vHPS4TahH1ywsnpjIC/gz2MLCRnPUnGVg8OXoyzlUWg6fQKUjnPJOOaOygoKujO1heUODL UmCK8uCIPaGkevvzAG30lvFSY08XDM3QahnqNJ+JRYvRVBW72eSPlY3DzORgiXloyGat+2 haE39ARYb406DPPYK3FZmj0+aND9GefcnxgYMWE6h2w+K3tExVeM3mwcw1Q5cP7Qc+9P1U 9epBHYLFYkiKDNSZx4EdPDhlH03VAWwqYeIDtXzP+GCZ6ZI2+O6DpGpS6+bI0bUVo2VVei hj+Byj8O7J531Q4wpQNcZWEiBZS/QMRKCcYC8ar+AmKMUY/zrvSbl7WUy/0q9g== 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 v2 4/5] platform/chrome: cros_ec_lpc: Add a new quirk for AML mutex Date: Mon, 3 Jun 2024 07:38:33 +0100 Message-ID: <20240603063834.5580-5-ben@jubnut.com> In-Reply-To: <20240603063834.5580-1-ben@jubnut.com> References: <20240603063834.5580-1-ben@jubnut.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add a new quirk "CROS_EC_LPC_QUIRK_AML_MUTEX" which provides the name of an AML mutex to protect MEC memory access. Signed-off-by: Ben Walsh --- drivers/platform/chrome/cros_ec_lpc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c index c1c26a7ba6d4..60627c5a596b 100644 --- a/drivers/platform/chrome/cros_ec_lpc.c +++ b/drivers/platform/chrome/cros_ec_lpc.c @@ -44,6 +44,11 @@ static bool cros_ec_lpc_acpi_device_found; * the ACPI device. */ #define CROS_EC_LPC_QUIRK_ACPI_ID BIT(1) +/* + * Indicates that lpc_driver_data.quirk_aml_mutex_name should be used + * to find an AML mutex to protect access to Microchip EC. + */ +#define CROS_EC_LPC_QUIRK_AML_MUTEX BIT(2) /** * struct lpc_driver_data - driver data attached to a DMI device ID to indicate @@ -52,11 +57,14 @@ static bool cros_ec_lpc_acpi_device_found; * @quirk_mmio_memory_base: The first I/O port addressing EC mapped memory (used * when quirk ...REMAP_MEMORY is set.) * @quirk_acpi_id: An ACPI HID to be used to find the ACPI device. + * @quirk_aml_mutex_name: The name of an AML mutex to be used to protect access + * to Microchip EC. */ struct lpc_driver_data { u32 quirks; u16 quirk_mmio_memory_base; const char *quirk_acpi_id; + const char *quirk_aml_mutex_name; }; /** @@ -484,6 +492,18 @@ static int cros_ec_lpc_probe(struct platform_device *pdev) } ACPI_COMPANION_SET(dev, adev); } + + if (quirks & CROS_EC_LPC_QUIRK_AML_MUTEX) { + const char *name + = driver_data->quirk_aml_mutex_name; + ret = cros_ec_lpc_mec_acpi_mutex(adev, name); + if (ret) { + dev_err(dev, "failed to get AML mutex '%s'", name); + return ret; + } + + dev_info(dev, "got AML mutex '%s'", name); + } } /* -- 2.45.1