Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp210193lqt; Thu, 6 Jun 2024 00:52:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUulSgMdl9T/7yGuAkpFvsNeUYvybZh6xPR44gM6QSegCxGp2PfKaqyRBkrd2hOu2xGo9bCvg9lJPmSg6g5hi9lS2W8+00ZGzLIVxV3dA== X-Google-Smtp-Source: AGHT+IH/vIc9/YJSB9899oHPboOnndoRq+1cP63gE86A+V1Zq/d0xsrSn10HyT+TZ63nogyvWYiz X-Received: by 2002:a17:903:2346:b0:1f6:1a86:37ba with SMTP id d9443c01a7336-1f6b8c79e8fmr26806765ad.2.1717660328347; Thu, 06 Jun 2024 00:52:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717660328; cv=pass; d=google.com; s=arc-20160816; b=ArqQTq6WLU4WXQUPwAIRcpIcAYocrjdY4NflzUCQI2+9seWY8t/mkc5aCX0zMmAOwz ixaz1+bWFcJpKNRkRCRI4PIc2MtoOVOTz6p8PuOmtksTWqekpkJ8ZpVVt8h4F1oZ0Z3a YQPHwgZ5QS3smgxme5DVh9kk+ZiPWgAgX409Lnnlpk0Ggu/tochxWKPmaOuH+6/DCHS+ TK5FG3Gfh6XTzqAcYEUn6H+cShuFM1b1jAXuLubJbyDfdx+rk3qt0g76xpbA5XiRLFay 9PamZJtY+J45NzEuGjyUTCGi96jQW3dW7uVedS0ysiend+yIYk3kkV4yIiB9pUpN2R9i 36gg== 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=drjap9tia8UdmkKJqnXc1ZCFCy2/bIrsAH1vVPQ//D0=; fh=TB40nJxdONdf4WtVAnDt8DWbDrzJeBBXgHK/mPL12mo=; b=s90sTV//cecfgkW6whSHCp508zG5DYllI0xJCFcuBxQXk9DQjO/E2yfoy1C+R15P3T dBTJ0Nzl9LG+3Zxz3DSWB2Z2DuSxqbgmH+zIfRBb8yyuqdnbfOMjleFUi+L1FuXJi1RA GrI6SPoRkeprBGXuY3TGc5blnRRCvNjaGWjqsagrbeK5iwJMWcuHenbxjO4CfAHmvDJF zjfeiIKdgxmVSFSMyzQeweUbPK+pGGuHsiwTl48SyxmgtSlSN9VzTDpMTpOwAGubeJHF rCKgqzLONm19mpYH+rjiwYJXL4lvgSCMWWLSUyWMUDUE8CtH9UWWHZo8Kg+KB1WUuYa2 VmJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@jubnut.com header.s=MBO0001 header.b=S36yVREk; 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-201813-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201813-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. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd76d01csi7592515ad.196.2024.06.06.00.52.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 00:52:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201813-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@jubnut.com header.s=MBO0001 header.b=S36yVREk; 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-201813-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201813-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 1D2B2288B71 for ; Wed, 5 Jun 2024 06:35:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 416CC190478; Wed, 5 Jun 2024 06:34:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=jubnut.com header.i=@jubnut.com header.b="S36yVREk" 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 CB23818C345 for ; Wed, 5 Jun 2024 06:34:20 +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=1717569262; cv=none; b=JJOdUkSjzJjCCxyy8EYcXjjG8utGc5ces2cRb4ADz0BaFjVacTJIh4l7OlZ6GiraaP/exqUIxCRz2uevpW/yJaEV9CnJVubDhAcL0as9OYzXOS6DgVlHKeUDZrfRCCvWOEaEpnpNquSd+2XdmMSfPHjwcJ+anfuHGe7anbwVQDU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717569262; c=relaxed/simple; bh=lhDXj1RB5ptV6uXT4ckCeg8oBkuwyd08q0QZzlPROxM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NSWWBGhETQVEoEekHNs3+Mjpiz6rdvvoFPb/QHrtc+m4BUb0zpcJ/L/32vF2llPYT/LXcA4JFxcFGyJSzCo+JHpLfvkHthv1xjcWZkHdrl6toAWWCZTuBgJz+QSQPqW4d/n7jLth0Qu2q/Freb3duOWFfYlmAyrHgmz/QiMCfSU= 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=S36yVREk; 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 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (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 4VvHjv2k9xz9t1h; Wed, 5 Jun 2024 08:34:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jubnut.com; s=MBO0001; t=1717569251; 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=drjap9tia8UdmkKJqnXc1ZCFCy2/bIrsAH1vVPQ//D0=; b=S36yVREk5LH90meIPR5eibShC3SN6nQnRv4x2u/vwC51c3Lo9UDdb4ZIjfPrgzNV0mpevw oTGBTdA1/STkOJeMoYkvB/hldoOYTBiqd38o3vunmieoTYTr1eLQ6gIhAkuGDazkSUYQWn enRUQFX+E6VdURe+JRmPps+H9B6Sruk5j8+NW99xAGORbRHNX/GDrdQjKYJaVscnvqOZRL Tb0jYhdQMJ1nhNkt3XNIuwVa6MPzeCRi/9xKOwtzeq4WBk3Wd1Cw2S/DYC6EpMFf6BzKeX bcUMp66AgTdbRzdp3ErzcF6rijeDkYuDAIhrf2YdwO5q/6VVdxuxF8DJBJVrdg== 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 v3 4/5] platform/chrome: cros_ec_lpc: Add a new quirk for AML mutex Date: Wed, 5 Jun 2024 07:33:50 +0100 Message-ID: <20240605063351.14836-5-ben@jubnut.com> In-Reply-To: <20240605063351.14836-1-ben@jubnut.com> References: <20240605063351.14836-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 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c index fa6606da802a..5d9cc8df208b 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; }; /** @@ -482,6 +490,17 @@ 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(ACPI_COMPANION(dev), 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