From patchwork Tue Dec 24 13:57:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13920142 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 2D47AE77188 for ; Tue, 24 Dec 2024 14:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S0+k3ZM3JtMWXlLNUUxvrkkZLMXDXhX+hu570K0txQk=; b=kk15eroAud0/muC7TqDnhU0sFd iu3Wgi8PzmireWtjslfc4CUKN9vjAvAqWGW6HoFeDAlY9tha1c/qMidI7V8/bw75QnSYtFuRiuoLy EVUHJfGhnacLwwr8Z/YeUA36Lej85xX/DKphCXZj0qO+HU7E8OBZATgm9LTXLyYlIYgf3jwAwq20U 4OljeS1O4A0xmTrSnG7/S6uZkKkh3KtzxJuMRGpye83HOZyMj+JrBLSdRxQryPD0PgeX06TVeFwRZ 2QsKwnreeHgvBgMTEOV4+pNeY+Es/nhKnMN9vcuOH/fSg8caZSdk6eSI8twXDxhVHRYNIp/vNgIBP i6KoJQ7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5UV-0000000C69R-2Bte; Tue, 24 Dec 2024 14:02:31 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5TF-0000000C5xa-3noX for linux-arm-kernel@lists.infradead.org; Tue, 24 Dec 2024 14:01:15 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 28FEB1C2B; Tue, 24 Dec 2024 06:01:39 -0800 (PST) Received: from e133711.arm.com (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7FB5C3F59E; Tue, 24 Dec 2024 06:01:10 -0800 (PST) From: Sudeep Holla Date: Tue, 24 Dec 2024 13:57:48 +0000 Subject: [PATCH 1/5] firmware: arm_ffa: Replace SCMI by FF-A in the macro MIME-Version: 1.0 Message-Id: <20241224-ffa_updates-v1-1-01233aba3e1e@arm.com> References: <20241224-ffa_updates-v1-0-01233aba3e1e@arm.com> In-Reply-To: <20241224-ffa_updates-v1-0-01233aba3e1e@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Arnd Bergmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1548; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=F0mUi+DToOzDCZQ+Cn7ewDbLcZibROUf9A/AQezLWS0=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBnar6lsBYaGgauK2/XjgFfso/PxaQaIrjb7IGW9 1FFiZFKnIWJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZ2q+pQAKCRAAQbq8MX7i mDiyEACJv6w3bvhfP5nsQ6fAoa+6aDeJSEMdWv4K72GoC4HyqsZbeDQe9yVa8KJ99FmLha27W68 aVy/eKGuqMUaUdeKEM9Cnou4KSpmfrVhxkU18w2R3Z5GQiEJpdX9aY9yDE/nG3FejyVMVC0+3Jl EdraLdx9jvTP4JNj1sR2yjoH5uNq3AnCXVLFK3DHDcQRE4FIesb7Q2PuDNW+d5I9ZjPW1QbKwjR di5rb/UrKeIEomMn107PvqABz38Y0knj+oyIrvLO7DSb+9JcruHJsJIUH298f0ur6p6DYU3Hylg IONN2Q7uRZYdCDN3lSmg+qinXF2NXpCu5HsO2qA1qcPMo6k3jAbNKHPJFDv9MdVADokFBHkiacm 5d5JC0KXY2UKj/mvdt2gALxQdNn2TxE7nlflNNrqLNVNw6rT2n5snaw7CKM6VIKTPX3MdAtBQ2B eLm951fV3g1FGZwZ2rsdcuhEJmgE/AD/A3VnSAfXiKGRCPoI1ry+iFSz01Zm5ZJxXTwI6LPY57x AjXuKrhAxcPZa6frb0wXu3JnnmeEJE002mD1bRY2S6PgieyC+Y/31SyF781/7PX/QtYKKNDDCxB a5DHpBn672gdOB6OP6oBdMjR+zvTwOAVfzoikmyMk2jQ08D6y3JIkDcmSIjVhhH3qjEACsAhcrp hBPzZyV7oUuAOtQ== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241224_060114_005924_E595716C X-CRM114-Status: GOOD ( 10.32 ) 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 Commit 22779149e93d ("firmware: arm_ffa: Emit modalias for FF-A devices") added modalias for FF-A devices. However the macro added used SCMI incorrectly. Replace the reference to SCMI by FF-A and update the macro. (i.e. s/SCMI/FFA/) No functional change. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c index dfda5ffc14db7208e8b622cdd648194c9cb1ef34..52b1f09209a0e51e321cd23a69aa7e4c4daa8dd1 100644 --- a/drivers/firmware/arm_ffa/bus.c +++ b/drivers/firmware/arm_ffa/bus.c @@ -15,7 +15,7 @@ #include "common.h" -#define SCMI_UEVENT_MODALIAS_FMT "arm_ffa:%04x:%pUb" +#define FFA_UEVENT_MODALIAS_FMT "arm_ffa:%04x:%pUb" static DEFINE_IDA(ffa_bus_id); @@ -68,7 +68,7 @@ static int ffa_device_uevent(const struct device *dev, struct kobj_uevent_env *e { const struct ffa_device *ffa_dev = to_ffa_dev(dev); - return add_uevent_var(env, "MODALIAS=" SCMI_UEVENT_MODALIAS_FMT, + return add_uevent_var(env, "MODALIAS=" FFA_UEVENT_MODALIAS_FMT, ffa_dev->vm_id, &ffa_dev->uuid); } @@ -77,7 +77,7 @@ static ssize_t modalias_show(struct device *dev, { struct ffa_device *ffa_dev = to_ffa_dev(dev); - return sysfs_emit(buf, SCMI_UEVENT_MODALIAS_FMT, ffa_dev->vm_id, + return sysfs_emit(buf, FFA_UEVENT_MODALIAS_FMT, ffa_dev->vm_id, &ffa_dev->uuid); } static DEVICE_ATTR_RO(modalias); From patchwork Tue Dec 24 13:57:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13920148 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 7668AE77188 for ; Tue, 24 Dec 2024 14:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=abfUfSyO0Ovqz60dSjdmWlKLDKX9WWl1WsL2R6WWMKY=; b=p5pq24Pln1dxa02ovvbsg3Unao doJwaZOUJ8oQZp2Bqir+5C9+X/P48O29iFqrfgRIBW2kQFuB6t3RA5fS1ReNsSTexKzgYLCys4/za /S/ZvxveJbfMSrlfHIxlwwKpwC0V48TO4VYIgf9afhr6DVOI7bfqNTlbWeQcAlat1UwbDgELnDtTw 5vQO11MIwTrTsLvaEzGr4jbazUpoRiev8yO+LAQ+qnoZs7yEWBu1YaYyJttfenbwPatWzAVbR4q/J tcre3kV7DJZzXj3EKyP/qIdpK/A27SyH9kFDYWOa9JhXGaA9HsqUrun2hO1Ygl2zEnSrCTOx7qYDp WgEhI5BQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5Wr-0000000C6X8-3u9u; Tue, 24 Dec 2024 14:04:57 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5TG-0000000C5xe-0Xk8 for linux-arm-kernel@lists.infradead.org; Tue, 24 Dec 2024 14:01:16 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DF3A61CDD; Tue, 24 Dec 2024 06:01:39 -0800 (PST) Received: from e133711.arm.com (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 41AC43F59E; Tue, 24 Dec 2024 06:01:11 -0800 (PST) From: Sudeep Holla Date: Tue, 24 Dec 2024 13:57:49 +0000 Subject: [PATCH 2/5] firmware: arm_ffa: Replace UUID buffer to standard UUID format MIME-Version: 1.0 Message-Id: <20241224-ffa_updates-v1-2-01233aba3e1e@arm.com> References: <20241224-ffa_updates-v1-0-01233aba3e1e@arm.com> In-Reply-To: <20241224-ffa_updates-v1-0-01233aba3e1e@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Arnd Bergmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1783; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=an0T8BaHmmjnOIWFrg0XcNclda/TDCEpL5ml8sjKwio=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBnar6lhi4yhEDslzvYCrjWKpW44hclMgOQaNwhi YMs6mHQP7+JAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZ2q+pQAKCRAAQbq8MX7i mLDyEACrsAezKlrginjjexiWtgrP7eT8IBa0q8aJSh0aqu7z8PezFY1ZgvF+kEjCexmJPryJGSZ ExnfLADqV43gJF/9cf6XUUfMit2MW9jR5Z9eqbRjr1+nGoSyxU1vcploxYGZooL0SwSClZCwFxt xPygmR2sAQ7Q9PIi+8cB0pYgMRfH6Bu6QWu98c9Ckq0DDdvydoMQpp05I7yWwKAO2qDBUlAKqE7 0WAB3vG5sXwadYzWRwaE0YcDfyeVekh4Qa2cYlKGasnE2sjfzPOym8D2BryK4iFMQvYJamkRtaQ jFA8iIWy18sf3/zAWCI48SaJ361jC3gp9XrbWKqOmPck47d6fHjEW+XZINkH9W/gA0qTL0yeBnR 9kWa9hzh5JODhjIOHxAwS2T7dy9qrVdbgE29uOshTB/Zvbs44EBaUCP69XhDfNRbzNr7Fb500kU Lz0LJsafAgGq7+NYByXsqxepIUEjTL5GPGD4/L+H3L7SNP6j2f9D1jme48SbakHpAQy1Woh5rIF QmrKljaKK+RQXhmDFoBrb3LFIfjIncKr1YWhfDmG0HBmfAMvQ5+KKgSPk5bU5rKrpoAXQIZiAVP UExZVOFa6deY4syNjd6BrRXGffcxEeP1e1mIE2SAzEORRT7PWMA+wm0rONKynmtaOzVsO34jj2q 0cj7zi87gOU+tzw== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241224_060114_222370_785CDA21 X-CRM114-Status: GOOD ( 11.37 ) 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 Currently ffa_partition_info structure holds the UUID in the format compatible with the firmware interface. However, most of the functions in the FF-A core driver deals directly with uuid_t type. Replace UUID buffer to standard UUID format in the ffa_partition_info structure. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/bus.c | 4 +--- include/linux/arm_ffa.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c index 52b1f09209a0e51e321cd23a69aa7e4c4daa8dd1..a90e2faa990219574ff20b8f573dbb7ca76137d9 100644 --- a/drivers/firmware/arm_ffa/bus.c +++ b/drivers/firmware/arm_ffa/bus.c @@ -192,7 +192,6 @@ ffa_device_register(const struct ffa_partition_info *part_info, const struct ffa_ops *ops) { int id, ret; - uuid_t uuid; struct device *dev; struct ffa_device *ffa_dev; @@ -218,8 +217,7 @@ ffa_device_register(const struct ffa_partition_info *part_info, ffa_dev->vm_id = part_info->id; ffa_dev->properties = part_info->properties; ffa_dev->ops = ops; - import_uuid(&uuid, (u8 *)part_info->uuid); - uuid_copy(&ffa_dev->uuid, &uuid); + uuid_copy(&ffa_dev->uuid, &part_info->uuid); ret = device_register(&ffa_dev->dev); if (ret) { diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h index 74169dd0f65948b05991732358855cdc31b54adb..abd0208f0f74c15ef4ee4c81de81eb7800a0eb1d 100644 --- a/include/linux/arm_ffa.h +++ b/include/linux/arm_ffa.h @@ -238,7 +238,7 @@ struct ffa_partition_info { /* partition runs in the AArch64 execution state. */ #define FFA_PARTITION_AARCH64_EXEC BIT(8) u32 properties; - u32 uuid[4]; + uuid_t uuid; }; static inline From patchwork Tue Dec 24 13:57:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13920149 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 08228E77188 for ; Tue, 24 Dec 2024 14:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0GYJNCreNKeiqS8nDDLgAEq5nbjMlv8pyHF1gavhYhw=; b=2NNLD5d5u3QKxYn3QFKm4ePufa N0MIvmCZPhLlz04dkZA3x788Ibe0r2p6UIy6zBVuzIC2OTWGUMA0BFMHivvRBuHwBKZekXXgaBQb5 deMrfGmeprdN1pKvXYkkmwvapskA+jH8ygxRWKPxTdG2CIpcN6XuYyOYlOEETVz87b3zWkghu897Z DApXFAuFi9/XeMuQewQ9eSqwqMfuj0qzulL1BiIZ42F7qd4mVRX5kQZG9X5kWiRcZ/jCd2ut2QB/d 3gyD7Mt5zymO9lDUcgtpB75dSKnspuf5AgMMThEmN7WQ/PFv5G5iJPb8raxjiHLZyIG8s/whIHrqO NcLSE7Fg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5Y2-0000000C6e5-2z7o; Tue, 24 Dec 2024 14:06:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5TH-0000000C5xi-1r6z for linux-arm-kernel@lists.infradead.org; Tue, 24 Dec 2024 14:01:16 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A10B01FC7; Tue, 24 Dec 2024 06:01:40 -0800 (PST) Received: from e133711.arm.com (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 03A8C3F59E; Tue, 24 Dec 2024 06:01:11 -0800 (PST) From: Sudeep Holla Date: Tue, 24 Dec 2024 13:57:50 +0000 Subject: [PATCH 3/5] firmware: arm_ffa: Align sync_send_receive{,2} function prototypes MIME-Version: 1.0 Message-Id: <20241224-ffa_updates-v1-3-01233aba3e1e@arm.com> References: <20241224-ffa_updates-v1-0-01233aba3e1e@arm.com> In-Reply-To: <20241224-ffa_updates-v1-0-01233aba3e1e@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Arnd Bergmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1948; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=llehAUqDTyE8tsnbqX0XKeEGbtFXiSKUAGLSD+1hoi8=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBnar6lKJfdHam6FeVWG42YUMpXeCsFSzOJsUilN hH0jV9Mu2qJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZ2q+pQAKCRAAQbq8MX7i mN82EADVvfvkYjVUKuiZ//EelRKjidbK7CzDOqavttrf0Ekezz4zeL6HxKSsNoyHDEghl3PU3/p c6QPtsp8pB0p9V8xQ++5xVLPdQx+N36ymHJbDuPa277xTgr34efa7KFbZQnRPg72xPBj2fCruvt rAGi0u+E6KRQ/7mFvNLcb6ZSs1O6mDP6dYo4fKtahXrR8wzqLz6bHPgQOCB9Hfw4quZQFgkg5on E35cdOTk5wCO0NR4ZIF2sr7VqREvYkajyXKbf3faEV0nyCJbOBZZ2u+KsvZMAAuQCsnHNXvtf3H w1WNjbiBnK8Q/TbZ91ceXE5P/2GulanKGN4SK6OY2Na9GPckTAax9TsTwLG/QZ/sTcwpw7/rYYr Fm84nspk5FMtW/ZZzhzlyUYtTePnAH8NS5wpIvsxok+KxXHhwud6POD6ZAi7sXHp/49JZJvMf2+ VAKxDFtHMTdOqnpJmJySFt17dXLm8N1xhBZlPrwga9BWMy+l1+kT643yLeS7l2jr5gfb2t8D9F0 3Cm+JEU+xPS4axMeY5B8nZt5i0N986t7PO8AwTP9Ni8XsCg0bELi6MWi4HHKlRbJmkS0W1yvTm5 +6/JWa2ABoVG+M8yUPp4GkETmMUV1B9GDRoJBQlWZr7lbqcLwEYHJSw88Oqjjabk4hytGDTddEK ScRstBTdD0ExdOQ== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241224_060115_534440_F7208586 X-CRM114-Status: GOOD ( 10.02 ) 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 Currently ffa_sync_send_receive2() takes UUID as a separate parameter instead of using the one available in ffa_device structure. Change the prototype of ffa_sync_send_receive2() to align with the ffa_sync_send_receive() and use ffa_device->uuid. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 4 ++-- include/linux/arm_ffa.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index 2c2ec3c35f15612168cdf0ef94022e00c08677b5..037e0d684994fd30971f40bf139367d1e45c1bf0 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -1018,14 +1018,14 @@ static int ffa_indirect_msg_send(struct ffa_device *dev, void *buf, size_t sz) return ffa_msg_send2(drv_info->vm_id, dev->vm_id, buf, sz); } -static int ffa_sync_send_receive2(struct ffa_device *dev, const uuid_t *uuid, +static int ffa_sync_send_receive2(struct ffa_device *dev, struct ffa_send_direct_data2 *data) { if (!drv_info->msg_direct_req2_supp) return -EOPNOTSUPP; return ffa_msg_send_direct_req2(drv_info->vm_id, dev->vm_id, - uuid, data); + &dev->uuid, data); } static int ffa_memory_share(struct ffa_mem_ops_args *args) diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h index abd0208f0f74c15ef4ee4c81de81eb7800a0eb1d..e8b8ae8b192ab11d5550c16fd33fa9d192b07f67 100644 --- a/include/linux/arm_ffa.h +++ b/include/linux/arm_ffa.h @@ -439,7 +439,7 @@ struct ffa_msg_ops { int (*sync_send_receive)(struct ffa_device *dev, struct ffa_send_direct_data *data); int (*indirect_send)(struct ffa_device *dev, void *buf, size_t sz); - int (*sync_send_receive2)(struct ffa_device *dev, const uuid_t *uuid, + int (*sync_send_receive2)(struct ffa_device *dev, struct ffa_send_direct_data2 *data); }; From patchwork Tue Dec 24 13:57:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13920151 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 AC065E77188 for ; Tue, 24 Dec 2024 14:08:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=77M7OzMT8CcBilT9EriBScvbhYmJy/Zk47gwOsgZtSQ=; b=MeZjduL4mE8FPkpTniVbs7I6y8 x9uXU+OMx4nt7Kwec07y4cI2W6Mx1nGziueP/7VDSx+Sqecoo9xTSmL1WvyBYxGMCe6NrIQi7jFHZ txgDvun7P9qZofxzpDzPJk7UkRdW8QnjQ1b0OMDvGdNK0WhsrCX1BgadG9U5yhtWPGxmDBuopYpcv vOHBHL4m27vtmc/Nb6AASfPvKWWDvDxHEcJuVK6/96S6CYuI+d/xFQotjymkR5G9fHExlUS6tFhHk DaTczz8kpkQoLyG5qMd8zVNW/CbGzBMvPm7q3Y45qz9QUl6DPAjcWlvE/PZwWJpg65NuZLdOJPVfW YOvOmJCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5aO-0000000C6rE-0g2C; Tue, 24 Dec 2024 14:08:36 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5TH-0000000C5xj-2HQn for linux-arm-kernel@lists.infradead.org; Tue, 24 Dec 2024 14:01:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 62B841FCD; Tue, 24 Dec 2024 06:01:41 -0800 (PST) Received: from e133711.arm.com (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B9A983F59E; Tue, 24 Dec 2024 06:01:12 -0800 (PST) From: Sudeep Holla Date: Tue, 24 Dec 2024 13:57:51 +0000 Subject: [PATCH 4/5] firmware: arm_ffa: Fix big-endian support in __ffa_partition_info_get() MIME-Version: 1.0 Message-Id: <20241224-ffa_updates-v1-4-01233aba3e1e@arm.com> References: <20241224-ffa_updates-v1-0-01233aba3e1e@arm.com> In-Reply-To: <20241224-ffa_updates-v1-0-01233aba3e1e@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Arnd Bergmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1735; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=2q64Jp03o3t6jzZXlU/yVP9FQTQM5OdzbtR25jurl9s=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBnar6l8cTinKnhnzQ/5CPB/Mfbn/B3tGfYPWhCg hUnEpQIuMKJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZ2q+pQAKCRAAQbq8MX7i mMm1D/46Tcd53xMZi42H9IY2wkrm8ejgt1x15l8mlXrf/+DcYzhZGBOrNyBUMB4GNuTMHn55WBD H53VzM8Rxvz3Nsifbm0CFVSg87kWy16MOWIIr2dZrGVbmqwQKogbEIrOb6TjO9PI0PNnIUBv9Ij UsHiKX7QvRx6HHK+FsBm4WTFhnpB2wg0CceNzB/bKZ1UhOQNPHRqSeooqi1EGFFgBxmqY2HTeuo mKkhdgWqz8XqNBPmkD5kAt7ziKOr08CtkDtUPUAWeVZFmmRjrzKOqgZ5Zkk1k5YBNA+0rmzrB+6 jwwx+cU5MSoYXKbXwMGU7A9eE3HmOyA8L5VwAxWJOH9jAI9zIyxAke29+UOokVB1J/b6aE1fJQI YYXJdiFNeajlwNRdSKEBU4QPt7kTUVSUSjNbiSRKH2jQCB4jVzUTK+2ORw6Cz6dfmLkTPCp2S3n 1ZtXqLanhhslx5ojZxEdXxgsNmEO68OI4STnn4tGC9ci1gIjf/d3WnHHzJm4qzjOHHOB4bPBnCO 5rstaGBUJmklTYvt7pTsxHhHl5wvMVJuH9+me9W795aJjThg2GfeOScodAE+uYVo0WunDLixuCW EWYWCVLCqiLJ6S9CPUsMJ7TOCb2prE7LFSczLoaagIoJZf5/8bXXjK7ORPEH6NMhQ3ejlf4Lgm6 D1YlIB4zG2/eK0w== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241224_060115_654614_6DD900F5 X-CRM114-Status: GOOD ( 13.02 ) 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 Currently the FF-A driver doesn't support big-endian correctly. It is hard to regularly test the setup due to lack of test infrastructure and tools. In order to support full stack, we need to take small steps in getting the support for big-endian kernel added slowly. This change fixes the support in __ffa_partition_info_get() so that the response from the firmware are converted correctly as required. With this change, we can enumerate all the FF-A devices correctly in the big-endian kernel. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index 037e0d684994fd30971f40bf139367d1e45c1bf0..bc6ffd25ad2e2fea0fe3610cf896718dbed8f0ad 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -276,9 +276,21 @@ __ffa_partition_info_get(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3, } if (buffer && count <= num_partitions) - for (idx = 0; idx < count; idx++) - memcpy(buffer + idx, drv_info->rx_buffer + idx * sz, - buf_sz); + for (idx = 0; idx < count; idx++) { + struct ffa_partition_info_le { + __le16 id; + __le16 exec_ctxt; + __le32 properties; + uuid_t uuid; + } *rx_buf = drv_info->rx_buffer + idx * sz; + struct ffa_partition_info *buf = buffer + idx; + + buf->id = le16_to_cpu(rx_buf->id); + buf->exec_ctxt = le16_to_cpu(rx_buf->exec_ctxt); + buf->properties = le32_to_cpu(rx_buf->properties); + if (buf_sz > 8) + import_uuid(&buf->uuid, (u8 *)&rx_buf->uuid); + } ffa_rx_release(); From patchwork Tue Dec 24 13:57:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13920150 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 C5AF2E77188 for ; Tue, 24 Dec 2024 14:07:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=loJQQ4pqZ47nrjW4300ckgAvNibzSRJeQXViPmPbc+8=; b=K6m6ke3lEncCMhN33OR6FoJdIV zeacBTq2e8YwdMPaJEINpRR3Kw5s38Vv/CuUERnep0D+0jKT7i/rbLjkA3HMMv81lHmQZ/y9HCCSa csDSGmJxQMrwxODGDU8lsDuoanah/apD6+1mSmBVgIeGJ02eGHLFvwQuJFXXunTfuyRvBpWGLv1Hm yrEhfP/bgroYfNR5DTH3Yh+Ew7empVCzld6i9H9rfwgc8RgVnO1LG5CqMiJRpiSoEgeowsaeake4U 1FaafUaHSzKKaq1XW7YROx0ra+xRkNZWVkcWB0AFhdI1Hu7ODGxY97A4xF16W6ow/L+YdHLqYEWgf f0hCD1KA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5ZD-0000000C6l4-1vC2; Tue, 24 Dec 2024 14:07:23 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tQ5TH-0000000C5yj-38co for linux-arm-kernel@lists.infradead.org; Tue, 24 Dec 2024 14:01:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 24EFC2008; Tue, 24 Dec 2024 06:01:42 -0800 (PST) Received: from e133711.arm.com (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7B7BD3F59E; Tue, 24 Dec 2024 06:01:13 -0800 (PST) From: Sudeep Holla Date: Tue, 24 Dec 2024 13:57:52 +0000 Subject: [PATCH 5/5] firmware: arm_ffa: Fix big-endian support in __ffa_partition_info_regs_get() MIME-Version: 1.0 Message-Id: <20241224-ffa_updates-v1-5-01233aba3e1e@arm.com> References: <20241224-ffa_updates-v1-0-01233aba3e1e@arm.com> In-Reply-To: <20241224-ffa_updates-v1-0-01233aba3e1e@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Arnd Bergmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2970; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=8PoYp80YnxCA99g/OmQlLeeIzCDfYeP4snzLnAUmwtk=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBnar6l3XRlKjtMg6uDxIl9RjBWqDRyRmdd59/2N VyB7K8D/euJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZ2q+pQAKCRAAQbq8MX7i mPFgD/46xOZxqIMfUkH+doPiOY3d1l16m+uMBdkipigRAb+Bs5e/OtOOgIZRaOoSDCNAgafxbra RkMNC5yvHwcCAjbOoJBOOuR95ck23XsI04/3lyhmAS8k832ljSonVzCxnS7VS5pawBGEhF5Q5FV uerkw6AXZ33/ritIJYvTLw8uk/lYrfIGm9tiuPK+dkcnsZMGbqsoAP+9Tyff1Rfs+s2dK6nsDhl A0runS0ku2xgx/Wsrxp3a3//oWzDakf6kc/qg4jhl5z4A2gc6OE0v0edL2r8052wY7bpM3cUci4 8EQIcg7epD6OsxjwnHdp07IkEGvB6dVDQRFpXLqkRGpo9VrD3CGGQDKzpSFCfiVWsxRzJoD3G4+ 5Q0w9kyfJdZmn041DUSTOwBDqfKwWzL1XP3tx3mbQP8FzDHYjHaopmNesDu09nfEeMVA5uGXMCV uBWkMAD2uec9ebJ5J/ihCtSQJiRJ/OgqS2LKfAEy+eXs6wRRq7Sr8ShS9wRC32XWlc59HfspZmI GkdCv/doWRHFfKSO6YLANEvuMQ7jZtPUbS9zfJ2JqH9s42yzZTlhBrUsqehpd/PLcuoVHZlLZxB zNBUUeGSAtkkb5jB803AEmA5twMzBEPSyU/ioptpPUOEv04bjUzXhofvaXL1uEbX21+OGrwQQlf VuoaGPZTUFvMHNg== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241224_060115_881154_0C0069EB X-CRM114-Status: GOOD ( 14.54 ) 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 Currently the FF-A driver doesn't support big-endian correctly. It is hard to regularly test the setup due to lack of test infrastructure and tools. In order to support full stack, we need to take small steps in getting the support for big-endian kernel added slowly. This change fixes the support in __ffa_partition_info_regs_get() so that the response from the firmware are converted correctly as required. With this change, we can enumerate all the FF-A devices correctly in the big-endian kernel if the FFA_PARTITION_INFO_REGS_GET is supported. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index bc6ffd25ad2e2fea0fe3610cf896718dbed8f0ad..87e106c728b89f3ce7c11219cf7cad9cc166dda2 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -307,14 +307,24 @@ __ffa_partition_info_get(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3, #define CURRENT_INDEX(x) ((u16)(FIELD_GET(CURRENT_INDEX_MASK, (x)))) #define UUID_INFO_TAG(x) ((u16)(FIELD_GET(UUID_INFO_TAG_MASK, (x)))) #define PARTITION_INFO_SZ(x) ((u16)(FIELD_GET(PARTITION_INFO_SZ_MASK, (x)))) +#define PART_INFO_ID_MASK GENMASK(15, 0) +#define PART_INFO_EXEC_CXT_MASK GENMASK(31, 16) +#define PART_INFO_PROPS_MASK GENMASK(63, 32) +#define PART_INFO_ID(x) ((u16)(FIELD_GET(PART_INFO_ID_MASK, (x)))) +#define PART_INFO_EXEC_CXT(x) ((u16)(FIELD_GET(PART_INFO_EXEC_CXT_MASK, (x)))) +#define PART_INFO_PROPERTIES(x) ((u32)(FIELD_GET(PART_INFO_PROPS_MASK, (x)))) static int __ffa_partition_info_get_regs(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3, struct ffa_partition_info *buffer, int num_parts) { u16 buf_sz, start_idx, cur_idx, count = 0, prev_idx = 0, tag = 0; + struct ffa_partition_info *buf = buffer; ffa_value_t partition_info; do { + __le64 *regs; + int idx; + start_idx = prev_idx ? prev_idx + 1 : 0; invoke_ffa_fn((ffa_value_t){ @@ -338,8 +348,25 @@ __ffa_partition_info_get_regs(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3, if (buf_sz > sizeof(*buffer)) buf_sz = sizeof(*buffer); - memcpy(buffer + prev_idx * buf_sz, &partition_info.a3, - (cur_idx - start_idx + 1) * buf_sz); + regs = (void *)&partition_info.a3; + for (idx = 0; idx < cur_idx - start_idx + 1; idx++, buf++) { + union { + uuid_t uuid; + u64 regs[2]; + } uuid_regs = { + .regs = { + le64_to_cpu(*(regs + 1)), + le64_to_cpu(*(regs + 2)), + } + }; + u64 val = *(u64 *)regs; + + buf->id = PART_INFO_ID(val); + buf->exec_ctxt = PART_INFO_EXEC_CXT(val); + buf->properties = PART_INFO_PROPERTIES(val); + uuid_copy(&buf->uuid, &uuid_regs.uuid); + regs += 3; + } prev_idx = cur_idx; } while (cur_idx < (count - 1));