From patchwork Mon Jan 30 09:41:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 13120816 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F6E1C54EAA for ; Mon, 30 Jan 2023 09:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=i5iF0rIIc4X7IFQ4vFVvRCbYUBZ5P/YzLnrxpFjk6jw=; b=uw++D/rFJRSP1h YKpbHNhSeNj5pq/4D3aNGwlZueI1A8+sdNUxvAyT9X5f8owjkKeZgDagdcwMiaha/a89VExuZsesN aXkdP/BBjYGim4Eh3+njnzCR7FxKy+a67ro4tMGF5W8L8ZGj5MiYKdhEl+5rqBmMqLChPuQvwCHhK sJzYGyd2soCwaIbsKjatQP2+AEXQ2fdPxPJaojp9VBXya150QfINnFYZuMop38HAxVASQhE7Bs7s0 8reMkCRV+CKOC6nYtGhf19UUVd+BgItRiHNmGaIU7X9VOIRZE9Yo/2c37xtiuhz1kLy03Fge8f9ui JAbuzuN6REswwaBR9ROw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMQhE-002wmK-5Y; Mon, 30 Jan 2023 09:43:28 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMQg2-002wZg-T7 for linux-arm-kernel@lists.infradead.org; Mon, 30 Jan 2023 09:42:16 +0000 Received: by mail-wm1-x32a.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso7673781wmq.5 for ; Mon, 30 Jan 2023 01:42:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0t96y3FkXLiiInAiF7GMyUM6Gu9zpGQXe2nbijo00u8=; b=ybsShXm5tTFAPukgpSLb+cbxoAvhAgJCNnyXmTkKCJ37DAqqHf/XjSI0FbLgeK12w6 HZPRA/1JQiCBoKbAuXfluzsutzTcA/vkCzQC1w/ru5ZQ2WRPdornAJ2a+UNJ/mdgwHER rwu1hbj403wQ+qTpY8TNhv0KyZk5fQPmGRhwwESfxwkrcsRkAJtjJpyqRtm9ZpQ68H3I jADislAuT59q4au3Tclzf3OCxWclBO6hAAJ4Acsw1i4icQVLemj2+AjvPQxj6WMJOn3c nrZt86VmC2toRWTFJtTRKoY2E+E1faQu2UMGQTOG41OnJmYBxg00pzYLnPaf2HLrR4Ri P3JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0t96y3FkXLiiInAiF7GMyUM6Gu9zpGQXe2nbijo00u8=; b=EQto/kyn5J2oDXKnVJrQWZ8Ibk3208jw2Tt0tUsMFg52kanUkyCxT/fzU0K5tRY91g j1XGMoDIOWpUjZt6IV8dF0SQ5GXE1oX9EfYZtI1Lw5++5IrRqkzi1Eg9/IZNeJi/NFmP UDi8fpvDS1EwGsrMX7PpnCU5r4OSzPpGb7WL2iaBy1/HzkoggSKdZKirvrDouongu7qV v9ExRcqUzQchGOG5YyRbfVxuWWJzbd2CPK3/uiUvBaNHO+Gwm0LssUfyCIbTdOB0V/hX YLo1Y7hCWC5yPQuKtdLHN2JD6yhS6g54qgymUh7zvlvQQMEUXdASOr9TMy4awMixXiwj z10g== X-Gm-Message-State: AFqh2krWBr8Yf5t37Otbn7VwyW2kqpQda52+yX53e+xwwOEBji54gNEU U9GYf8MNuH1h4HfCxtt104/eog== X-Google-Smtp-Source: AMrXdXuC+dEKXJlmfv5Nn2MwvVWClowQHDNX7f6bEFuAizBj3VRG2y8pN35Le3YmF/KEKjYh0vUvIw== X-Received: by 2002:a05:600c:444b:b0:3da:fd06:a6f1 with SMTP id v11-20020a05600c444b00b003dafd06a6f1mr47372661wmn.31.1675071729531; Mon, 30 Jan 2023 01:42:09 -0800 (PST) Received: from lmecxl1178.lme.st.com ([80.215.193.251]) by smtp.gmail.com with ESMTPSA id i27-20020a05600c4b1b00b003dc54d9aeeasm3865606wmp.36.2023.01.30.01.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 01:42:09 -0800 (PST) From: Etienne Carriere To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Jens Wiklander , Sumit Garg , Sudeep Holla , Cristian Marussi , Etienne Carriere Subject: [PATCH 2/2] firmware: arm_scmi: optee: use optee system invocation Date: Mon, 30 Jan 2023 10:41:57 +0100 Message-Id: <20230130094157.1082712-2-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230130094157.1082712-1-etienne.carriere@linaro.org> References: <20230130094157.1082712-1-etienne.carriere@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230130_014214_975634_394765F7 X-CRM114-Status: GOOD ( 10.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Changes SCMI optee transport to enable sys_service capability of its tee context to leverage provisioned system resources in OP-TEE preventing possible deadlock. Such deadlock could happen when many Linux clients invoke OP-TEE are are all suspended waiting for an OP-TEE RPC request access an SCMI resource through the SCMI OP-TEE PTA service. Signed-off-by: Etienne Carriere Acked-by: Sudeep Holla --- drivers/firmware/arm_scmi/optee.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/firmware/arm_scmi/optee.c b/drivers/firmware/arm_scmi/optee.c index 2a7aeab40e54..91840345e946 100644 --- a/drivers/firmware/arm_scmi/optee.c +++ b/drivers/firmware/arm_scmi/optee.c @@ -559,6 +559,9 @@ static int scmi_optee_service_probe(struct device *dev) if (IS_ERR(tee_ctx)) return -ENODEV; + /* SCMI agent can used TEE system service resources */ + tee_ctx->sys_service = true; + agent = devm_kzalloc(dev, sizeof(*agent), GFP_KERNEL); if (!agent) { ret = -ENOMEM;