From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB
---
kernel/arch/powerpc/perf/hv-24x7.c | 44 +++++++++++++++++++-------------------------
1 files changed, 19 insertions(+), 25 deletions(-)
diff --git a/kernel/arch/powerpc/perf/hv-24x7.c b/kernel/arch/powerpc/perf/hv-24x7.c
index 6e7e820..61a0874 100644
--- a/kernel/arch/powerpc/perf/hv-24x7.c
+++ b/kernel/arch/powerpc/perf/hv-24x7.c
@@ -79,9 +79,8 @@
*/
void read_24x7_sys_info(void)
{
- int call_status, len, ntypes;
-
- spin_lock(&rtas_data_buf_lock);
+ const s32 token = rtas_token("ibm,get-system-parameter");
+ int call_status;
/*
* Making system parameter: chips and sockets and cores per chip
@@ -91,32 +90,27 @@
phys_chipspersocket = 1;
phys_coresperchip = 1;
- call_status = rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1,
- NULL,
- PROCESSOR_MODULE_INFO,
- __pa(rtas_data_buf),
- RTAS_DATA_BUF_SIZE);
+ do {
+ spin_lock(&rtas_data_buf_lock);
+ call_status = rtas_call(token, 3, 1, NULL, PROCESSOR_MODULE_INFO,
+ __pa(rtas_data_buf), RTAS_DATA_BUF_SIZE);
+ if (call_status == 0) {
+ int ntypes = be16_to_cpup((__be16 *)&rtas_data_buf[2]);
+ int len = be16_to_cpup((__be16 *)&rtas_data_buf[0]);
+
+ if (len >= 8 && ntypes != 0) {
+ phys_sockets = be16_to_cpup((__be16 *)&rtas_data_buf[4]);
+ phys_chipspersocket = be16_to_cpup((__be16 *)&rtas_data_buf[6]);
+ phys_coresperchip = be16_to_cpup((__be16 *)&rtas_data_buf[8]);
+ }
+ }
+ spin_unlock(&rtas_data_buf_lock);
+ } while (rtas_busy_delay(call_status));
if (call_status != 0) {
pr_err("Error calling get-system-parameter %d\n",
call_status);
- } else {
- len = be16_to_cpup((__be16 *)&rtas_data_buf[0]);
- if (len < 8)
- goto out;
-
- ntypes = be16_to_cpup((__be16 *)&rtas_data_buf[2]);
-
- if (!ntypes)
- goto out;
-
- phys_sockets = be16_to_cpup((__be16 *)&rtas_data_buf[4]);
- phys_chipspersocket = be16_to_cpup((__be16 *)&rtas_data_buf[6]);
- phys_coresperchip = be16_to_cpup((__be16 *)&rtas_data_buf[8]);
}
-
-out:
- spin_unlock(&rtas_data_buf_lock);
}
/* Domains for which more than one result element are returned for each event. */
@@ -1416,7 +1410,7 @@
}
domain = event_get_domain(event);
- if (domain >= HV_PERF_DOMAIN_MAX) {
+ if (domain == 0 || domain >= HV_PERF_DOMAIN_MAX) {
pr_devel("invalid domain %d\n", domain);
return -EINVAL;
}
--
Gitblit v1.6.2