@@ -1044,6 +1044,8 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt)
prd_register_reserved_memory();
+ add_dt_max_async_completions();
+
load_and_boot_kernel(false);
}
@@ -19,9 +19,12 @@
#include <opal-msg.h>
#include <opal-api.h>
#include <lock.h>
+#include <device.h>
#define OPAL_MAX_MSGS (OPAL_MSG_TYPE_MAX + OPAL_MAX_ASYNC_COMP - 1)
+static int max_async_comp;
+
struct opal_msg_entry {
struct list_node link;
void (*consumed)(void *data);
@@ -149,12 +152,12 @@ static int64_t opal_check_completion(uint64_t *buffer, uint64_t size,
}
opal_call(OPAL_CHECK_ASYNC_COMPLETION, opal_check_completion, 3);
-void opal_init_msg(void)
+void alloc_opal_msg_list(int num)
{
struct opal_msg_entry *entry;
int i;
- for (i = 0; i < OPAL_MAX_MSGS; i++, entry++) {
+ for (i = 0; i < num; i++, entry++) {
entry = zalloc(sizeof(*entry));
if (!entry)
goto err;
@@ -170,3 +173,18 @@ err:
}
}
+void add_dt_max_async_completions(void)
+{
+ dt_add_property_cells(opal_node, "opal-msg-async-num", max_async_comp);
+}
+
+void update_max_async_completions(int num)
+{
+ max_async_comp += num;
+}
+
+void opal_init_msg(void)
+{
+ max_async_comp = OPAL_MAX_ASYNC_COMP;
+ alloc_opal_msg_list(OPAL_MAX_MSGS);
+}
@@ -201,7 +201,6 @@ void add_opal_node(void)
else
dt_add_property_strings(opal_node, "compatible", "ibm,opal-v3");
- dt_add_property_cells(opal_node, "opal-msg-async-num", OPAL_MAX_ASYNC_COMP);
dt_add_property_cells(opal_node, "opal-msg-size", sizeof(struct opal_msg));
dt_add_property_u64(opal_node, "opal-base-address", base);
dt_add_property_u64(opal_node, "opal-entry-address", entry);
@@ -37,5 +37,8 @@ int _opal_queue_msg(enum opal_msg_type msg_type, void *data,
(u64[]) {__VA_ARGS__});
void opal_init_msg(void);
+void alloc_opal_msg_list(int num);
+void update_max_async_completions(int num);
+void add_dt_max_async_completions(void);
#endif /* __OPALMSG_H */
Add support to increase the maximum async completions passed to kernel and also add helpers to increase the pre-allocation of free buffers in msg_free_list. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> --- core/init.c | 2 ++ core/opal-msg.c | 22 ++++++++++++++++++++-- core/opal.c | 1 - include/opal-msg.h | 3 +++ 4 files changed, 25 insertions(+), 3 deletions(-)