.. | .. |
---|
261 | 261 | if (!last_disp_cpu_assoc || !cur_disp_cpu_assoc) |
---|
262 | 262 | return -EIO; |
---|
263 | 263 | |
---|
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); |
---|
265 | 265 | } |
---|
266 | 266 | |
---|
267 | 267 | static int cpu_home_node_dispatch_distance(int disp_cpu) |
---|
.. | .. |
---|
281 | 281 | if (!disp_cpu_assoc || !vcpu_assoc) |
---|
282 | 282 | return -EIO; |
---|
283 | 283 | |
---|
284 | | - return cpu_distance(disp_cpu_assoc, vcpu_assoc); |
---|
| 284 | + return cpu_relative_distance(disp_cpu_assoc, vcpu_assoc); |
---|
285 | 285 | } |
---|
286 | 286 | |
---|
287 | 287 | static void update_vcpu_disp_stat(int disp_cpu) |
---|
.. | .. |
---|
637 | 637 | |
---|
638 | 638 | static int __init vcpudispatch_stats_procfs_init(void) |
---|
639 | 639 | { |
---|
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()) |
---|
647 | 641 | return 0; |
---|
648 | | - } |
---|
649 | | - preempt_enable(); |
---|
650 | 642 | |
---|
651 | 643 | if (!proc_create("powerpc/vcpudispatch_stats", 0600, NULL, |
---|
652 | 644 | &vcpudispatch_stats_proc_ops)) |
---|
.. | .. |
---|
1433 | 1425 | |
---|
1434 | 1426 | void __init pseries_lpar_read_hblkrm_characteristics(void) |
---|
1435 | 1427 | { |
---|
| 1428 | + const s32 token = rtas_token("ibm,get-system-parameter"); |
---|
1436 | 1429 | unsigned char local_buffer[SPLPAR_TLB_BIC_MAXLENGTH]; |
---|
1437 | 1430 | int call_status, len, idx, bpsize; |
---|
1438 | 1431 | |
---|
1439 | 1432 | if (!firmware_has_feature(FW_FEATURE_BLOCK_REMOVE)) |
---|
1440 | 1433 | return; |
---|
1441 | 1434 | |
---|
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)); |
---|
1452 | 1444 | |
---|
1453 | 1445 | if (call_status != 0) { |
---|
1454 | 1446 | pr_warn("%s %s Error calling get-system-parameter (0x%x)\n", |
---|