Tolerate runtime service initialization failure
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>
Thu, 20 Feb 2014 17:19:39 +0000 (17:19 +0000)
committerDan Handley <dan.handley@arm.com>
Wed, 26 Feb 2014 19:53:48 +0000 (19:53 +0000)
At present, the firmware panics if a runtime service fails to
initialize. An earlier patch had implemented late binding for all
runtime service handlers.

With that in place, this patch allows the firmware to proceed even when
a service fails to initialize.

Change-Id: I6cf4de2cecea9719f4cd48272a77cf459b080d4e

common/runtime_svc.c

index 6e8a1bb093ded63fb2cecc111f9eee562b2b703a..1628e8dbb4a714bbf67d6efe8679d19c2fa367d1 100644 (file)
@@ -119,24 +119,25 @@ void runtime_svc_init()
                        goto error;
                }
 
-               /*
-                * Fill the indices corresponding to the start and end owning
-                * entity numbers with the index of the descriptor which will
-                * handle the SMCs for this owning entity range.
-                */
-               start_idx = get_unique_oen(rt_svc_descs[index].start_oen,
-                                          rt_svc_descs[index].call_type);
-               end_idx = get_unique_oen(rt_svc_descs[index].end_oen,
-                                        rt_svc_descs[index].call_type);
-               for (; start_idx <= end_idx; start_idx++)
-                       rt_svc_descs_indices[start_idx] = index;
-
                /* Call the initialisation routine for this runtime service */
                rc = rt_svc_descs[index].init();
                if (rc) {
                        ERROR("Error initializing runtime service %s\n",
                                        rt_svc_descs[index].name);
-                       goto error;
+               } else {
+                       /*
+                        * Fill the indices corresponding to the start and end
+                        * owning entity numbers with the index of the
+                        * descriptor which will handle the SMCs for this owning
+                        * entity range.
+                        */
+                       start_idx = get_unique_oen(rt_svc_descs[index].start_oen,
+                                       rt_svc_descs[index].call_type);
+                       end_idx = get_unique_oen(rt_svc_descs[index].end_oen,
+                                       rt_svc_descs[index].call_type);
+
+                       for (; start_idx <= end_idx; start_idx++)
+                               rt_svc_descs_indices[start_idx] = index;
                }
        }