Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1801379rda; Tue, 24 Oct 2023 03:57:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjOoS8DvE6xmBxitA6wyJB4zeufw5z20tfAdCUEO06T0wSCyTJNBwZjo61fzM1LEusOQ+w X-Received: by 2002:a17:90a:52:b0:27d:237b:5592 with SMTP id 18-20020a17090a005200b0027d237b5592mr17260232pjb.13.1698145022403; Tue, 24 Oct 2023 03:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698145022; cv=none; d=google.com; s=arc-20160816; b=NQUXRHlIAlg+LFzMomN0o+YTkPUn2PhYJYJxRS6dwcxpFn5Eet/16497z4Ig/HlpYH E9DckB4ZKK/dZ90uOLg6jjiDfJSB4EY800u9iCOwAaUlnOGYEMsV6OqXpStgCU6d3wcx 72J3+wJGX1AAfR8PoyzX4oCZ1EgFe+CLh1A7K9sd7qFNhri0JUGiV9YHhcKFvpidd0fI rDxZkLbcvu05asAqLPcU5OIsdubIn9QxQ76B5TMduydhcarTY3g5+44edqbh4pzL/QtH cpl4aF2OliLryhmThixr5lWoiPqZnBHi0c96hde6NKJNPCyM/lEKDOHpWpKtbli/srBR Cm7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from; bh=tEDdeLsOsjfQOKGwnqNGRpvAHkTSgTNOFfAkS12Q1Ks=; fh=dhwPcdTtT0tgW4dVkTJhiiku0qpZ/EDNwmDp0A4M4v0=; b=B8rWLikJ0GzwDBOlAbl7+LlxGRosUlrZWbm0PUXDTnERQSjxdj0VMjiAAHPY8nEqC8 YpFcyBwO873PxRrFSrA5jqs/ubKKFVzU9YW4gjd/7rrLoEAVzMYZHxJ3dPIGmmQa9us/ g0slGp+IwNGLfMiiSAsg2WRmPAFBWuZrAixD6MCWo31C6xmkWbvlmq65IhedKS2p9NT1 Vt8PoZRq7ZB7zkpGiyDFN4g33rfdv4UWqGGio9N0OOncXJdCDesHT+N5Yp8sHtV1Uz5u e1sWVm9BtI1v9HPMxax+gaVFGFWcgLDIhkLPnLWWHVSZElqkZMpmLIvyS3g22BAwlSqo qW2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id jb22-20020a170903259600b001bbe13e753esi7765663plb.310.2023.10.24.03.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 03:57:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7CFD1806E3CD; Tue, 24 Oct 2023 03:56:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234443AbjJXK4c (ORCPT + 99 others); Tue, 24 Oct 2023 06:56:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232042AbjJXK4a (ORCPT ); Tue, 24 Oct 2023 06:56:30 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2417A109 for ; Tue, 24 Oct 2023 03:56:28 -0700 (PDT) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 24 Oct 2023 03:56:44 -0700 (PDT) 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); -- 2.42.0