diff options
author | Sudeep Holla <sudeep.holla@arm.com> | 2023-10-24 12:56:18 +0200 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2023-11-13 12:51:26 +0100 |
commit | 6f47023f7a52f3482937e9271ba41570b8752067 (patch) | |
tree | 5f17492835f9d63b5b5af6c5b938196c215b88d0 /drivers/firmware/arm_ffa | |
parent | firmware: arm_ffa: Allow FF-A initialisation even when notification fails (diff) | |
download | linux-6f47023f7a52f3482937e9271ba41570b8752067.tar.xz linux-6f47023f7a52f3482937e9271ba41570b8752067.zip |
firmware: arm_ffa: Setup the partitions after the notification initialisation
Currently the notifications are setup of the partitions are probed and
FF-A devices are added on the FF-A bus. The FF-A driver probe can be
called even before the FF-A notification setup happens which is wrong
and may result in failure or misbehaviour in the FF-A partition device
probe.
In order to ensure the FF-A notifications are setup before the FF-A
devices are probed, let us move the FF-A partition setup after the
completion of FF-A notification setup.
Link: https://lore.kernel.org/r/20231024-ffa-notification-fixes-v1-2-d552c0ec260d@arm.com
Tested-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware/arm_ffa')
-rw-r--r-- | drivers/firmware/arm_ffa/driver.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index 585632a444b4..69ad3add3175 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -1422,11 +1422,7 @@ static void ffa_notifications_setup(void) hash_init(drv_info->notifier_hash); mutex_init(&drv_info->notify_lock); - /* Register internal scheduling callback */ - ret = ffa_sched_recv_cb_update(drv_info->vm_id, ffa_self_notif_handle, - drv_info, true); - if (!ret) - return; + return; cleanup: pr_info("Notification setup failed %d, not enabled\n", ret); ffa_notifications_cleanup(); @@ -1483,12 +1479,17 @@ static int __init ffa_init(void) mutex_init(&drv_info->rx_lock); mutex_init(&drv_info->tx_lock); - ffa_setup_partitions(); - ffa_set_up_mem_ops_native_flag(); ffa_notifications_setup(); + ffa_setup_partitions(); + + ret = ffa_sched_recv_cb_update(drv_info->vm_id, ffa_self_notif_handle, + drv_info, true); + if (ret) + pr_info("Failed to register driver sched callback %d\n", ret); + return 0; free_pages: if (drv_info->tx_buffer) |