hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/powerpc/platforms/pseries/lpar.c
....@@ -261,7 +261,7 @@
261261 if (!last_disp_cpu_assoc || !cur_disp_cpu_assoc)
262262 return -EIO;
263263
264
- return cpu_distance(last_disp_cpu_assoc, cur_disp_cpu_assoc);
264
+ return cpu_relative_distance(last_disp_cpu_assoc, cur_disp_cpu_assoc);
265265 }
266266
267267 static int cpu_home_node_dispatch_distance(int disp_cpu)
....@@ -281,7 +281,7 @@
281281 if (!disp_cpu_assoc || !vcpu_assoc)
282282 return -EIO;
283283
284
- return cpu_distance(disp_cpu_assoc, vcpu_assoc);
284
+ return cpu_relative_distance(disp_cpu_assoc, vcpu_assoc);
285285 }
286286
287287 static void update_vcpu_disp_stat(int disp_cpu)
....@@ -637,16 +637,8 @@
637637
638638 static int __init vcpudispatch_stats_procfs_init(void)
639639 {
640
- /*
641
- * Avoid smp_processor_id while preemptible. All CPUs should have
642
- * the same value for lppaca_shared_proc.
643
- */
644
- preempt_disable();
645
- if (!lppaca_shared_proc(get_lppaca())) {
646
- preempt_enable();
640
+ if (!lppaca_shared_proc())
647641 return 0;
648
- }
649
- preempt_enable();
650642
651643 if (!proc_create("powerpc/vcpudispatch_stats", 0600, NULL,
652644 &vcpudispatch_stats_proc_ops))
....@@ -1433,22 +1425,22 @@
14331425
14341426 void __init pseries_lpar_read_hblkrm_characteristics(void)
14351427 {
1428
+ const s32 token = rtas_token("ibm,get-system-parameter");
14361429 unsigned char local_buffer[SPLPAR_TLB_BIC_MAXLENGTH];
14371430 int call_status, len, idx, bpsize;
14381431
14391432 if (!firmware_has_feature(FW_FEATURE_BLOCK_REMOVE))
14401433 return;
14411434
1442
- spin_lock(&rtas_data_buf_lock);
1443
- memset(rtas_data_buf, 0, RTAS_DATA_BUF_SIZE);
1444
- call_status = rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1,
1445
- NULL,
1446
- SPLPAR_TLB_BIC_TOKEN,
1447
- __pa(rtas_data_buf),
1448
- RTAS_DATA_BUF_SIZE);
1449
- memcpy(local_buffer, rtas_data_buf, SPLPAR_TLB_BIC_MAXLENGTH);
1450
- local_buffer[SPLPAR_TLB_BIC_MAXLENGTH - 1] = '\0';
1451
- spin_unlock(&rtas_data_buf_lock);
1435
+ do {
1436
+ spin_lock(&rtas_data_buf_lock);
1437
+ memset(rtas_data_buf, 0, RTAS_DATA_BUF_SIZE);
1438
+ call_status = rtas_call(token, 3, 1, NULL, SPLPAR_TLB_BIC_TOKEN,
1439
+ __pa(rtas_data_buf), RTAS_DATA_BUF_SIZE);
1440
+ memcpy(local_buffer, rtas_data_buf, SPLPAR_TLB_BIC_MAXLENGTH);
1441
+ local_buffer[SPLPAR_TLB_BIC_MAXLENGTH - 1] = '\0';
1442
+ spin_unlock(&rtas_data_buf_lock);
1443
+ } while (rtas_busy_delay(call_status));
14521444
14531445 if (call_status != 0) {
14541446 pr_warn("%s %s Error calling get-system-parameter (0x%x)\n",