Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp995488lqp; Thu, 23 May 2024 06:24:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVH+gKXoE0zdY3oIjt34M6dGqLIqVpRWl9rWE2fOAeI/klw5MBc4kQKGMIKBVFOZVJMGRHADcLnRMzl8ADz5EW58aJYl8TrmjWYcIX20Q== X-Google-Smtp-Source: AGHT+IGA7Ie0qTyXeJC9IZdIQNuOd/QxfKvhEJPd30c+Sp/6wcs1rp0GfmLwPr/azWvp9QVVMsuL X-Received: by 2002:a0c:b699:0:b0:6ab:996d:425b with SMTP id 6a1803df08f44-6ab996d42a7mr5235016d6.4.1716470681086; Thu, 23 May 2024 06:24:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716470681; cv=pass; d=google.com; s=arc-20160816; b=lP+oXFwNC7lDClH2/IDoSijhdZ6hV6Wh1EPGh9TH7CBbyoGIp+sSDVUvqO/rRScMPf y3BOemBSl90g2knicgwd4QvZqZ9fFl9tYIVhUjyZ9/tN4NVNScj6Y62XtrLlYVPxl1Ay bKhhxf1HZisBCN/VYwzPL9ZAwz2r/a/WZYuNy2rO/6MzYAx66ityy6R9IhDpoMdB6/6r YdoWut01WBkeR6d5NVd/FOY4lxMsUBJ/VZ2y1o4laYEKW1KbFe6HYKKUY1lJPdoc6gxF fJISkbjcBps6pc9zxki8YTWTeS+MIPpPwoSo5vKBaF/0GDfFjiQGX3PasntbCnAjdARp S9ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=V1nXAH0jeYsUQ3TAdK2+zg99GV70Fcl8FD/LKfpxJFE=; fh=Jh0TN2Q1fP1HXHrZHIV/kVcJxEaV1dt0AqJ6p+68Pjk=; b=QA3uumbxnzJoHJKlkxlxRrkFDOe4nQm+4QkclXRx3y3mkXXEy2Qx+xAUN8ylCjCoUt 3TKgR5U6wIUygdzp+5Ildzs6GJV4C0dSSfT0OH0gbsdaNIznzlHqfdVz6PkBzg7n3ozT cMbr0Y3hMXCBRvxc9yTz0gkwjm+YzKVrKVJrfmtHiT0smmox0beX+S4qC4dCFRtZNsG4 0GaNEjchP1ob6sP+aVWMv8Q28GRPB+XscqK9WKYwcorX1w3xIEA+RIfPdtJNbh9JA384 GvsQbrAjgWh+HGrrkjZeusqrswPbKIqCUjkofd1R+Jy6/qqKgQtt+fUCVV7QyLTUAtCb 9mQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-187572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187572-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ab7a7c8febsi53579536d6.300.2024.05.23.06.24.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 06:24:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-187572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187572-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C5CB41C21671 for ; Thu, 23 May 2024 13:24:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13E9914C584; Thu, 23 May 2024 13:23:55 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 A771214B95C for ; Thu, 23 May 2024 13:23:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716470634; cv=none; b=q1C1h9dRBZNhoRCos97bBRxLuMHjXEy4Xo0adYEsNCbas+HHhc6YdA1nOCwtY5pKTp+O3ZPiz5RnNvfls1Qph14qJ3t0GOfzoWnF9+K5+CR89w4g4NNazF1Bu2Ymr8k/0ZYAU5zmAfEr6BJgbU2sHQKUVXt3DZgUVdhUPbAX9eA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716470634; c=relaxed/simple; bh=jfoi1eZMaRi271oO//ba6KU8TVc2gQ7Tp96Z7KExp+I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IUYcffLSY/ep2QCw8tJCeG3L8rsr9hrqE8DidIqRq+gMqKPZ1hgucvYhzViljGnLbKwwtE2sNrAIr0ZSasI4mO78K78y8/yLFH2OnIL7jcLqfdhrbAeNjNoExUL8u8L4DNNd325b0vk4WUACvkFBvQw4rd/uIS5maw6ACcZdbQs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sA8Py-00046I-Ol; Thu, 23 May 2024 15:23:38 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sA8Pw-002fRw-0p; Thu, 23 May 2024 15:23:36 +0200 Received: from sha by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sA8Pv-009qGA-2y; Thu, 23 May 2024 15:23:35 +0200 Date: Thu, 23 May 2024 15:23:35 +0200 From: Sascha Hauer To: Pankaj Gupta Cc: Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Pengutronix Kernel Team , Fabio Estevam , Rob Herring , Krzysztof Kozlowski , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 4/5] firmware: imx: add driver for NXP EdgeLock Enclave Message-ID: References: <20240523-imx-se-if-v2-0-5a6fd189a539@nxp.com> <20240523-imx-se-if-v2-4-5a6fd189a539@nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240523-imx-se-if-v2-4-5a6fd189a539@nxp.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Thu, May 23, 2024 at 04:19:35PM +0530, Pankaj Gupta wrote: > NXP hardware IP(s) for secure-enclaves like Edgelock Enclave(ELE), > are embedded in the SoC to support the features like HSM, SHE & V2X, > using message based communication interface. > > The secure enclave FW communicates on a dedicated messaging unit(MU) > based interface(s) with application core, where kernel is running. > It exists on specific i.MX processors. e.g. i.MX8ULP, i.MX93. > > This patch adds the driver for communication interface to secure-enclave, > for exchanging messages with NXP secure enclave HW IP(s) like EdgeLock > Enclave (ELE) from Kernel-space, used by kernel management layers like > - DM-Crypt. > > Signed-off-by: Pankaj Gupta > --- > drivers/firmware/imx/Kconfig | 12 + > drivers/firmware/imx/Makefile | 2 + > drivers/firmware/imx/ele_base_msg.c | 286 +++++++++++++++++++ > drivers/firmware/imx/ele_base_msg.h | 92 +++++++ > drivers/firmware/imx/ele_common.c | 239 ++++++++++++++++ > drivers/firmware/imx/ele_common.h | 43 +++ > drivers/firmware/imx/se_ctrl.c | 531 ++++++++++++++++++++++++++++++++++++ > drivers/firmware/imx/se_ctrl.h | 99 +++++++ > include/linux/firmware/imx/se_api.h | 14 + > 9 files changed, 1318 insertions(+) [...] > > +int imx_ele_msg_send(struct se_if_priv *priv, void *tx_msg) > +{ > + struct se_msg_hdr *header; > + int err; > + > + header = (struct se_msg_hdr *) tx_msg; > + > + if (header->tag == priv->cmd_tag) > + lockdep_assert_held(&priv->se_if_cmd_lock); > + > + scoped_guard(mutex, &priv->se_if_lock); scoped_guard() with an empty block doesn't make much sense. Either use scope_guard() { /* do something locked */ }; or guard(). Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |