From patchwork Wed Apr 19 09:54:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13216580 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 EA54BC77B75 for ; Wed, 19 Apr 2023 09:55:37 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+ai4f3AoTEisK92AP5zmid4zUsGmm8s4F9VKqTKgjgs=; b=Gzq7sn1UoEpAg1 p+gGqHldPAG3QIlu6buW667OUgf0uAuDHR9bOcZP7/sLdHGbiDP+0uzv67XVb173S5294+FlRgu3Y E8xvjHnMwT1ueQSVVnlAkvqItvNMQMLPbLTpApjM41/E54QZIWsCXn6BPjERwSs+rDw3simVfZWIH mOvlyqIqg/I+HAzfvkifGIKCaFC9r8Xfj2nTflNQ0uIs5d1AIvK0gZiVBdsGKqFS6xjbBfGqygz1q qMHbkWATCs96249/0lxyalI6AnLinKCa6eSuh0XATWtRC66vX3UNYoHoW+94ZcJ5pPNAJ34nWXjwL flRJ87VaDOk7m2nqdGYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp4WT-004oo2-0t; Wed, 19 Apr 2023 09:54:45 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp4WP-004olW-0v for linux-arm-kernel@lists.infradead.org; Wed, 19 Apr 2023 09:54:43 +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 0B7C3143D; Wed, 19 Apr 2023 02:55:23 -0700 (PDT) Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 97EB03F6C4; Wed, 19 Apr 2023 02:54:38 -0700 (PDT) From: Sudeep Holla Date: Wed, 19 Apr 2023 10:54:16 +0100 Subject: [PATCH 2/3] firmware: arm_ffa: Fix usage of partition info get count flag MIME-Version: 1.0 Message-Id: <20230419-ffa_fixes_6-4-v1-2-1881ee6699f1@arm.com> References: <20230419-ffa_fixes_6-4-v1-0-1881ee6699f1@arm.com> In-Reply-To: <20230419-ffa_fixes_6-4-v1-0-1881ee6699f1@arm.com> To: linux-arm-kernel@lists.infradead.org Cc: Sudeep Holla , Lucian Paul-Trifu , Marc Bonnici , Jens Wiklander X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1612; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=BaJovvcDEbV5T8nCmponiQDcrQxcR/jv5bohyne1Yf4=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBkP7pcF3b2DXbPL9zqRVk6gyeWGcEGpvRXnKaQw 14Ty4zBgJ6JAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZD+6XAAKCRAAQbq8MX7i mGGEEACmYiJ25BKbrIr6NJoLsjlX/3mVViYtT1GtE8YTtqE16vMl4yAMuU53pNDzdjMRVhIM+/Z QJnM6iHaVT++60mGuLOZhJ6ZhL7w3peAAS0J66lIe+XGTFcgZ+l/A4SoSuKtM9inalo4GbFAYTt 5SVzaNqWlj2BEGv6z8vm1ZFwT8Skof2FUGn9jjgXUJD7GJfwbqp4WECYp2o21PXDo8H2hYaSYuA poFt3wkFa6e70UaofmQF9rrN9Qf5ehXrRtMAsnMmFS0wIBtge3RcQnPmBu6nc52D7tj6lO81zkz NM9yCboMGNwUfD0Ikgz++ILhD9TnxtTsYHbBhXMqcM6Qrrsbgwg9yEqKyarAZcaP4t3i+JXxur9 4C+bVzGTn270LlRvVE1YzFoguW06jgjNSCFQgo+p1vYmvK+sRYfszqYt3jtcRjHCYBTMKlnnWEE fuJ1foO1WJGQWrd/09VEWdTSGx72stxzpykZZ6HVP4OC4sABuIFmrr2O/dKen+uxfG7cgJv9KLb v2KBn/Atm1nM9iDWToYWUbd38RhhCSPOt6S+YQurG0J9O+uQSfk8dSOt48lFLhGQTej3CMDxI/D MLAJcc4kWKZsrRb3ZVi22CVJXNJKINdhzrzRc/IGFO15s9gvr897S2KvzwnQTDJ3nSmkbWDX2E5 hvyx+sI6qhb8W1A== 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-20230419_025441_367710_ED65E91A X-CRM114-Status: GOOD ( 12.63 ) 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 bb1be7498500 ("firmware: arm_ffa: Add v1.1 get_partition_info support") adds support to discovery the UUIDs of the partitions or just fetch the partition count using the PARTITION_INFO_GET_RETURN_COUNT_ONLY flag. However the commit doesn't handle the fact that the older version doesn't understand the flag and must be MBZ which results in firmware returning invalid parameter error. That results in the failure of the driver probe which is in correct. Limit the usage of the PARTITION_INFO_GET_RETURN_COUNT_ONLY flag for the versions above v1.0(i.e v1.1 and onwards) which fixes the issue. Fixes: bb1be7498500 ("firmware: arm_ffa: Add v1.1 get_partition_info support") Reported-by: Jens Wiklander Reported-by: Marc Bonnici Signed-off-by: Sudeep Holla Tested-by: Jens Wiklander Reviewed-by: Jens Wiklander --- drivers/firmware/arm_ffa/driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index fa85c64d3ded..4aced2e5b772 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -193,7 +193,8 @@ __ffa_partition_info_get(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3, int idx, count, flags = 0, sz, buf_sz; ffa_value_t partition_info; - if (!buffer || !num_partitions) /* Just get the count for now */ + if (drv_info->version > FFA_VERSION_1_0 && + (!buffer || !num_partitions)) /* Just get the count for now */ flags = PARTITION_INFO_GET_RETURN_COUNT_ONLY; mutex_lock(&drv_info->rx_lock);