From patchwork Tue Oct 24 10:56:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13434229 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 59B8EC07545 for ; Tue, 24 Oct 2023 10:57:16 +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=OijyMpBXzJw+UUJnWcQT3OIV29nQHkW6R9Cue5fi/Ak=; b=K8oA+1xomwm+O9 OIoC0bjzZ6ltf17X20ljvmi67fys/1lNResoWZd3qfCoej0HxKCsaywD4zR7bMomDAUxxn8wCXzh2 xvmO5wiamLu7Spor8eQMilwkFNBqUgcOPvmzCosiYu6sFnpXbn11P+S4x4+h9YLaBycrgpg2/dLj+ D8/enQzyWcE1mIgrl2phQFyPhEEVtS8YANLoXUIwHZvBXQ81HF2Su0w9Jp4cyLWmFJgYbIsysOko1 UW4byHZWQWs9/7Ma1AIpFaXUF00rZptE/pDoG+roIBrelyTL8X68eqpnO+BenbbYFLPCtcipl7oja EhQRtnx4nPfwJoWNLpbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvF5U-009bLT-25; Tue, 24 Oct 2023 10:56:40 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvF5M-009bGa-0F for linux-arm-kernel@lists.infradead.org; Tue, 24 Oct 2023 10:56:33 +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 DAD05C15; Tue, 24 Oct 2023 03:57:08 -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 197BB3F64C; Tue, 24 Oct 2023 03:56:26 -0700 (PDT) From: Sudeep Holla Date: Tue, 24 Oct 2023 11:56:17 +0100 Subject: [PATCH 1/4] firmware: arm_ffa: Allow FF-A initialisation even when notification fails MIME-Version: 1.0 Message-Id: <20231024-ffa-notification-fixes-v1-1-d552c0ec260d@arm.com> References: <20231024-ffa-notification-fixes-v1-0-d552c0ec260d@arm.com> In-Reply-To: <20231024-ffa-notification-fixes-v1-0-d552c0ec260d@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Sudeep Holla , Jens Wiklander , Coboy Chen , Lorenzo Pieralisi X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2317; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=UW+oG+gsm0FKrpPXyKAnSuAo0QMzo5a2SfkP+2CJjXs=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlN6LZt+oDW+pFRLk3OWWPZo4Q2axp2luX1Qowh FMTLIcpzCyJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZTei2QAKCRAAQbq8MX7i mAFTEACpCDJLAhCp4Eu76ebowZKy1lZohQoC7AnD3RVB0A+S741ljXq/zk5k7p+3GHuk9GBoy+2 0GnK1CqbJ53cbrDL33KF4VzNSVRaGWdAMfMJUd5GUdbozL0Ew++JB5XVg9v2gZC/Q56DE4UhZ+C kj8mocLnf7kvJoRNpQN88qEXKATw+bdEHFh1JWhnfZi+6zUi9h1F4CtP72il69AVlCxis87YikG dLJFdjTxyZz8cRB+OaB90zXYP5xm9ff7QGcZnoD/8ZF2wP5InyTno3XuNOjLFwP7QSaLDr0iZgA LvA5Vz+yTvfXeIFwYks+CmBxwG4qp0KKzpgcGVduf8V9UBhjITXfJ014T0eXBqSoNyU/H1GbWIS Q8vYbiKNSpnmrPmSPwAYfHkVJUujkKRUo8qdbVtRuo9w+7qfbBeQci+quKHWLajxuCBJhqboFea qq+Y3ZAHrscn6Y++NI0YlxxAIuojDnU8LYhuHZku5B7Bn+NxLwM6ZcHgpQlTw97UmsC+h/mIyD+ gIGXSASEVM0zvZNqcPrjR05cH4tQ6w5MRFXtrLXrYnVF/jK5p4ynR17uveToNy5HQFZOrHW1q8n iyYdayr4SNF6tVQWsK1asEjJFpDJixAfDEUCD3Bg4PZLIAidnd9QoImOoZCI+WJI0EnogV1OEDE Aeznv2xfy7NdTzA== 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-20231024_035632_209181_95CBCC20 X-CRM114-Status: GOOD ( 12.61 ) 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 FF-A notifications are optional feature in the specification. Currently we allow to continue if the firmware reports no support for the notifications. However, we fail to continue and complete the FF-A driver initialisation if the notification setup fails for any reason. Let us allow the FF-A driver to complete the initialisation even if the notification fails to setup. We will just flag the error and continue to provide other features in the driver. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index 07b72c679247..b4ba52d674e5 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -1390,20 +1390,20 @@ static void ffa_notifications_cleanup(void) } } -static int ffa_notifications_setup(void) +static void ffa_notifications_setup(void) { int ret, irq; ret = ffa_features(FFA_NOTIFICATION_BITMAP_CREATE, 0, NULL, NULL); if (ret) { - pr_err("Notifications not supported, continuing with it ..\n"); - return 0; + pr_info("Notifications not supported, continuing with it ..\n"); + return; } ret = ffa_notification_bitmap_create(); if (ret) { - pr_err("notification_bitmap_create error %d\n", ret); - return ret; + pr_info("Notification bitmap create error %d\n", ret); + return; } drv_info->bitmap_created = true; @@ -1426,10 +1426,11 @@ static int ffa_notifications_setup(void) ret = ffa_sched_recv_cb_update(drv_info->vm_id, ffa_self_notif_handle, drv_info, true); if (!ret) - return ret; + return; cleanup: + pr_info("Notification setup failed %d, not enabled\n", ret); ffa_notifications_cleanup(); - return ret; + return; } static int __init ffa_init(void) @@ -1487,13 +1488,9 @@ static int __init ffa_init(void) ffa_set_up_mem_ops_native_flag(); - ret = ffa_notifications_setup(); - if (ret) - goto partitions_cleanup; + ffa_notifications_setup(); return 0; -partitions_cleanup: - ffa_partitions_cleanup(); free_pages: if (drv_info->tx_buffer) free_pages_exact(drv_info->tx_buffer, RXTX_BUFFER_SIZE);