Skip to content

Commit 6f47023

Browse files
committed
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/[email protected] Tested-by: Jens Wiklander <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
1 parent 95520fc commit 6f47023

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drivers/firmware/arm_ffa/driver.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,11 +1422,7 @@ static void ffa_notifications_setup(void)
14221422
hash_init(drv_info->notifier_hash);
14231423
mutex_init(&drv_info->notify_lock);
14241424

1425-
/* Register internal scheduling callback */
1426-
ret = ffa_sched_recv_cb_update(drv_info->vm_id, ffa_self_notif_handle,
1427-
drv_info, true);
1428-
if (!ret)
1429-
return;
1425+
return;
14301426
cleanup:
14311427
pr_info("Notification setup failed %d, not enabled\n", ret);
14321428
ffa_notifications_cleanup();
@@ -1483,12 +1479,17 @@ static int __init ffa_init(void)
14831479
mutex_init(&drv_info->rx_lock);
14841480
mutex_init(&drv_info->tx_lock);
14851481

1486-
ffa_setup_partitions();
1487-
14881482
ffa_set_up_mem_ops_native_flag();
14891483

14901484
ffa_notifications_setup();
14911485

1486+
ffa_setup_partitions();
1487+
1488+
ret = ffa_sched_recv_cb_update(drv_info->vm_id, ffa_self_notif_handle,
1489+
drv_info, true);
1490+
if (ret)
1491+
pr_info("Failed to register driver sched callback %d\n", ret);
1492+
14921493
return 0;
14931494
free_pages:
14941495
if (drv_info->tx_buffer)

0 commit comments

Comments
 (0)