aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-11 20:34:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-11 20:34:00 -0400
commitfd9879b9bb3258ebc27a4cc6d2d29f528f71901f (patch)
tree48b68994f5e8083aafe116533e8143cb2bf30c85 /arch/powerpc/platforms/pseries
parent81ae31d78239318610d7c2acb3e2610d622a5aa4 (diff)
parentd53ba6b3bba33432cc37b7101a86f8f3392c46e7 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux
Pull powerpc updates from Michael Ellerman: "Here's a first pull request for powerpc updates for 3.18. The bulk of the additions are for the "cxl" driver, for IBM's Coherent Accelerator Processor Interface (CAPI). Most of it's in drivers/misc, which Greg & Arnd maintain, Greg said he was happy for us to take it through our tree. There's the usual minor cleanups and fixes, including a bit of noise in drivers from some of those. A bunch of updates to our EEH code, which has been getting more testing. Several nice speedups from Anton, including 20% in clear_page(). And a bunch of updates for freescale from Scott" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux: (130 commits) cxl: Fix afu_read() not doing finish_wait() on signal or non-blocking cxl: Add documentation for userspace APIs cxl: Add driver to Kbuild and Makefiles cxl: Add userspace header file cxl: Driver code for powernv PCIe based cards for userspace access cxl: Add base builtin support powerpc/mm: Add hooks for cxl powerpc/opal: Add PHB to cxl mode call powerpc/mm: Add new hash_page_mm() powerpc/powerpc: Add new PCIe functions for allocating cxl interrupts cxl: Add new header for call backs and structs powerpc/powernv: Split out set MSI IRQ chip code powerpc/mm: Export mmu_kernel_ssize and mmu_linear_psize powerpc/msi: Improve IRQ bitmap allocator powerpc/cell: Make spu_flush_all_slbs() generic powerpc/cell: Move data segment faulting code out of cell platform powerpc/cell: Move spu_handle_mm_fault() out of cell platform powerpc/pseries: Use new defines when calling H_SET_MODE powerpc: Update contact info in Documentation files powerpc/perf/hv-24x7: Simplify catalog_read() ...
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-rw-r--r--arch/powerpc/platforms/pseries/cmm.c1
-rw-r--r--arch/powerpc/platforms/pseries/dlpar.c29
-rw-r--r--arch/powerpc/platforms/pseries/eeh_pseries.c40
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c10
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-memory.c1
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c51
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c4
-rw-r--r--arch/powerpc/platforms/pseries/nvram.c12
-rw-r--r--arch/powerpc/platforms/pseries/pci.c1
-rw-r--r--arch/powerpc/platforms/pseries/ras.c2
-rw-r--r--arch/powerpc/platforms/pseries/setup.c2
11 files changed, 77 insertions, 76 deletions
diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
index 2d8bf15879fd..fc44ad0475f8 100644
--- a/arch/powerpc/platforms/pseries/cmm.c
+++ b/arch/powerpc/platforms/pseries/cmm.c
@@ -555,7 +555,6 @@ static int cmm_mem_going_offline(void *arg)
555 pa_last = pa_last->next; 555 pa_last = pa_last->next;
556 free_page((unsigned long)cmm_page_list); 556 free_page((unsigned long)cmm_page_list);
557 cmm_page_list = pa_last; 557 cmm_page_list = pa_last;
558 continue;
559 } 558 }
560 } 559 }
561 pa_curr = pa_curr->next; 560 pa_curr = pa_curr->next;
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index a2450b8a50a5..fdf01b660d59 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -17,6 +17,7 @@
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/of.h> 18#include <linux/of.h>
19#include "offline_states.h" 19#include "offline_states.h"
20#include "pseries.h"
20 21
21#include <asm/prom.h> 22#include <asm/prom.h>
22#include <asm/machdep.h> 23#include <asm/machdep.h>
@@ -363,7 +364,8 @@ static int dlpar_online_cpu(struct device_node *dn)
363 int rc = 0; 364 int rc = 0;
364 unsigned int cpu; 365 unsigned int cpu;
365 int len, nthreads, i; 366 int len, nthreads, i;
366 const u32 *intserv; 367 const __be32 *intserv;
368 u32 thread;
367 369
368 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len); 370 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len);
369 if (!intserv) 371 if (!intserv)
@@ -373,8 +375,9 @@ static int dlpar_online_cpu(struct device_node *dn)
373 375
374 cpu_maps_update_begin(); 376 cpu_maps_update_begin();
375 for (i = 0; i < nthreads; i++) { 377 for (i = 0; i < nthreads; i++) {
378 thread = be32_to_cpu(intserv[i]);
376 for_each_present_cpu(cpu) { 379 for_each_present_cpu(cpu) {
377 if (get_hard_smp_processor_id(cpu) != intserv[i]) 380 if (get_hard_smp_processor_id(cpu) != thread)
378 continue; 381 continue;
379 BUG_ON(get_cpu_current_state(cpu) 382 BUG_ON(get_cpu_current_state(cpu)
380 != CPU_STATE_OFFLINE); 383 != CPU_STATE_OFFLINE);
@@ -388,7 +391,7 @@ static int dlpar_online_cpu(struct device_node *dn)
388 } 391 }
389 if (cpu == num_possible_cpus()) 392 if (cpu == num_possible_cpus())
390 printk(KERN_WARNING "Could not find cpu to online " 393 printk(KERN_WARNING "Could not find cpu to online "
391 "with physical id 0x%x\n", intserv[i]); 394 "with physical id 0x%x\n", thread);
392 } 395 }
393 cpu_maps_update_done(); 396 cpu_maps_update_done();
394 397
@@ -442,7 +445,8 @@ static int dlpar_offline_cpu(struct device_node *dn)
442 int rc = 0; 445 int rc = 0;
443 unsigned int cpu; 446 unsigned int cpu;
444 int len, nthreads, i; 447 int len, nthreads, i;
445 const u32 *intserv; 448 const __be32 *intserv;
449 u32 thread;
446 450
447 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len); 451 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len);
448 if (!intserv) 452 if (!intserv)
@@ -452,8 +456,9 @@ static int dlpar_offline_cpu(struct device_node *dn)
452 456
453 cpu_maps_update_begin(); 457 cpu_maps_update_begin();
454 for (i = 0; i < nthreads; i++) { 458 for (i = 0; i < nthreads; i++) {
459 thread = be32_to_cpu(intserv[i]);
455 for_each_present_cpu(cpu) { 460 for_each_present_cpu(cpu) {
456 if (get_hard_smp_processor_id(cpu) != intserv[i]) 461 if (get_hard_smp_processor_id(cpu) != thread)
457 continue; 462 continue;
458 463
459 if (get_cpu_current_state(cpu) == CPU_STATE_OFFLINE) 464 if (get_cpu_current_state(cpu) == CPU_STATE_OFFLINE)
@@ -475,14 +480,14 @@ static int dlpar_offline_cpu(struct device_node *dn)
475 * Upgrade it's state to CPU_STATE_OFFLINE. 480 * Upgrade it's state to CPU_STATE_OFFLINE.
476 */ 481 */
477 set_preferred_offline_state(cpu, CPU_STATE_OFFLINE); 482 set_preferred_offline_state(cpu, CPU_STATE_OFFLINE);
478 BUG_ON(plpar_hcall_norets(H_PROD, intserv[i]) 483 BUG_ON(plpar_hcall_norets(H_PROD, thread)
479 != H_SUCCESS); 484 != H_SUCCESS);
480 __cpu_die(cpu); 485 __cpu_die(cpu);
481 break; 486 break;
482 } 487 }
483 if (cpu == num_possible_cpus()) 488 if (cpu == num_possible_cpus())
484 printk(KERN_WARNING "Could not find cpu to offline " 489 printk(KERN_WARNING "Could not find cpu to offline "
485 "with physical id 0x%x\n", intserv[i]); 490 "with physical id 0x%x\n", thread);
486 } 491 }
487 cpu_maps_update_done(); 492 cpu_maps_update_done();
488 493
@@ -494,15 +499,15 @@ out:
494static ssize_t dlpar_cpu_release(const char *buf, size_t count) 499static ssize_t dlpar_cpu_release(const char *buf, size_t count)
495{ 500{
496 struct device_node *dn; 501 struct device_node *dn;
497 const u32 *drc_index; 502 u32 drc_index;
498 int rc; 503 int rc;
499 504
500 dn = of_find_node_by_path(buf); 505 dn = of_find_node_by_path(buf);
501 if (!dn) 506 if (!dn)
502 return -EINVAL; 507 return -EINVAL;
503 508
504 drc_index = of_get_property(dn, "ibm,my-drc-index", NULL); 509 rc = of_property_read_u32(dn, "ibm,my-drc-index", &drc_index);
505 if (!drc_index) { 510 if (rc) {
506 of_node_put(dn); 511 of_node_put(dn);
507 return -EINVAL; 512 return -EINVAL;
508 } 513 }
@@ -513,7 +518,7 @@ static ssize_t dlpar_cpu_release(const char *buf, size_t count)
513 return -EINVAL; 518 return -EINVAL;
514 } 519 }
515 520
516 rc = dlpar_release_drc(*drc_index); 521 rc = dlpar_release_drc(drc_index);
517 if (rc) { 522 if (rc) {
518 of_node_put(dn); 523 of_node_put(dn);
519 return rc; 524 return rc;
@@ -521,7 +526,7 @@ static ssize_t dlpar_cpu_release(const char *buf, size_t count)
521 526
522 rc = dlpar_detach_node(dn); 527 rc = dlpar_detach_node(dn);
523 if (rc) { 528 if (rc) {
524 dlpar_acquire_drc(*drc_index); 529 dlpar_acquire_drc(drc_index);
525 return rc; 530 return rc;
526 } 531 }
527 532
diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c
index b08053819d99..a6c7e19f5eb3 100644
--- a/arch/powerpc/platforms/pseries/eeh_pseries.c
+++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
@@ -88,29 +88,14 @@ static int pseries_eeh_init(void)
88 * and its variant since the old firmware probably support address 88 * and its variant since the old firmware probably support address
89 * of domain/bus/slot/function for EEH RTAS operations. 89 * of domain/bus/slot/function for EEH RTAS operations.
90 */ 90 */
91 if (ibm_set_eeh_option == RTAS_UNKNOWN_SERVICE) { 91 if (ibm_set_eeh_option == RTAS_UNKNOWN_SERVICE ||
92 pr_warn("%s: RTAS service <ibm,set-eeh-option> invalid\n", 92 ibm_set_slot_reset == RTAS_UNKNOWN_SERVICE ||
93 __func__); 93 (ibm_read_slot_reset_state2 == RTAS_UNKNOWN_SERVICE &&
94 return -EINVAL; 94 ibm_read_slot_reset_state == RTAS_UNKNOWN_SERVICE) ||
95 } else if (ibm_set_slot_reset == RTAS_UNKNOWN_SERVICE) { 95 ibm_slot_error_detail == RTAS_UNKNOWN_SERVICE ||
96 pr_warn("%s: RTAS service <ibm,set-slot-reset> invalid\n", 96 (ibm_configure_pe == RTAS_UNKNOWN_SERVICE &&
97 __func__); 97 ibm_configure_bridge == RTAS_UNKNOWN_SERVICE)) {
98 return -EINVAL; 98 pr_info("EEH functionality not supported\n");
99 } else if (ibm_read_slot_reset_state2 == RTAS_UNKNOWN_SERVICE &&
100 ibm_read_slot_reset_state == RTAS_UNKNOWN_SERVICE) {
101 pr_warn("%s: RTAS service <ibm,read-slot-reset-state2> and "
102 "<ibm,read-slot-reset-state> invalid\n",
103 __func__);
104 return -EINVAL;
105 } else if (ibm_slot_error_detail == RTAS_UNKNOWN_SERVICE) {
106 pr_warn("%s: RTAS service <ibm,slot-error-detail> invalid\n",
107 __func__);
108 return -EINVAL;
109 } else if (ibm_configure_pe == RTAS_UNKNOWN_SERVICE &&
110 ibm_configure_bridge == RTAS_UNKNOWN_SERVICE) {
111 pr_warn("%s: RTAS service <ibm,configure-pe> and "
112 "<ibm,configure-bridge> invalid\n",
113 __func__);
114 return -EINVAL; 99 return -EINVAL;
115 } 100 }
116 101
@@ -118,11 +103,11 @@ static int pseries_eeh_init(void)
118 spin_lock_init(&slot_errbuf_lock); 103 spin_lock_init(&slot_errbuf_lock);
119 eeh_error_buf_size = rtas_token("rtas-error-log-max"); 104 eeh_error_buf_size = rtas_token("rtas-error-log-max");
120 if (eeh_error_buf_size == RTAS_UNKNOWN_SERVICE) { 105 if (eeh_error_buf_size == RTAS_UNKNOWN_SERVICE) {
121 pr_warn("%s: unknown EEH error log size\n", 106 pr_info("%s: unknown EEH error log size\n",
122 __func__); 107 __func__);
123 eeh_error_buf_size = 1024; 108 eeh_error_buf_size = 1024;
124 } else if (eeh_error_buf_size > RTAS_ERROR_LOG_MAX) { 109 } else if (eeh_error_buf_size > RTAS_ERROR_LOG_MAX) {
125 pr_warn("%s: EEH error log size %d exceeds the maximal %d\n", 110 pr_info("%s: EEH error log size %d exceeds the maximal %d\n",
126 __func__, eeh_error_buf_size, RTAS_ERROR_LOG_MAX); 111 __func__, eeh_error_buf_size, RTAS_ERROR_LOG_MAX);
127 eeh_error_buf_size = RTAS_ERROR_LOG_MAX; 112 eeh_error_buf_size = RTAS_ERROR_LOG_MAX;
128 } 113 }
@@ -349,7 +334,9 @@ static int pseries_eeh_set_option(struct eeh_pe *pe, int option)
349 if (pe->addr) 334 if (pe->addr)
350 config_addr = pe->addr; 335 config_addr = pe->addr;
351 break; 336 break;
352 337 case EEH_OPT_FREEZE_PE:
338 /* Not support */
339 return 0;
353 default: 340 default:
354 pr_err("%s: Invalid option %d\n", 341 pr_err("%s: Invalid option %d\n",
355 __func__, option); 342 __func__, option);
@@ -729,6 +716,7 @@ static struct eeh_ops pseries_eeh_ops = {
729 .wait_state = pseries_eeh_wait_state, 716 .wait_state = pseries_eeh_wait_state,
730 .get_log = pseries_eeh_get_log, 717 .get_log = pseries_eeh_get_log,
731 .configure_bridge = pseries_eeh_configure_bridge, 718 .configure_bridge = pseries_eeh_configure_bridge,
719 .err_inject = NULL,
732 .read_config = pseries_eeh_read_config, 720 .read_config = pseries_eeh_read_config,
733 .write_config = pseries_eeh_write_config, 721 .write_config = pseries_eeh_write_config,
734 .next_error = NULL, 722 .next_error = NULL,
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 20d62975856f..b174fa751d26 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -90,7 +90,7 @@ static void rtas_stop_self(void)
90{ 90{
91 static struct rtas_args args = { 91 static struct rtas_args args = {
92 .nargs = 0, 92 .nargs = 0,
93 .nret = 1, 93 .nret = cpu_to_be32(1),
94 .rets = &args.args[0], 94 .rets = &args.args[0],
95 }; 95 };
96 96
@@ -312,7 +312,8 @@ static void pseries_remove_processor(struct device_node *np)
312{ 312{
313 unsigned int cpu; 313 unsigned int cpu;
314 int len, nthreads, i; 314 int len, nthreads, i;
315 const u32 *intserv; 315 const __be32 *intserv;
316 u32 thread;
316 317
317 intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &len); 318 intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &len);
318 if (!intserv) 319 if (!intserv)
@@ -322,8 +323,9 @@ static void pseries_remove_processor(struct device_node *np)
322 323
323 cpu_maps_update_begin(); 324 cpu_maps_update_begin();
324 for (i = 0; i < nthreads; i++) { 325 for (i = 0; i < nthreads; i++) {
326 thread = be32_to_cpu(intserv[i]);
325 for_each_present_cpu(cpu) { 327 for_each_present_cpu(cpu) {
326 if (get_hard_smp_processor_id(cpu) != intserv[i]) 328 if (get_hard_smp_processor_id(cpu) != thread)
327 continue; 329 continue;
328 BUG_ON(cpu_online(cpu)); 330 BUG_ON(cpu_online(cpu));
329 set_cpu_present(cpu, false); 331 set_cpu_present(cpu, false);
@@ -332,7 +334,7 @@ static void pseries_remove_processor(struct device_node *np)
332 } 334 }
333 if (cpu >= nr_cpu_ids) 335 if (cpu >= nr_cpu_ids)
334 printk(KERN_WARNING "Could not find cpu to remove " 336 printk(KERN_WARNING "Could not find cpu to remove "
335 "with physical id 0x%x\n", intserv[i]); 337 "with physical id 0x%x\n", thread);
336 } 338 }
337 cpu_maps_update_done(); 339 cpu_maps_update_done();
338} 340}
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 34064f50945e..3c4c0dcd90d3 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -20,6 +20,7 @@
20#include <asm/machdep.h> 20#include <asm/machdep.h>
21#include <asm/prom.h> 21#include <asm/prom.h>
22#include <asm/sparsemem.h> 22#include <asm/sparsemem.h>
23#include "pseries.h"
23 24
24unsigned long pseries_memory_block_size(void) 25unsigned long pseries_memory_block_size(void)
25{ 26{
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 4642d6a4d356..de1ec54a2a57 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -329,16 +329,16 @@ struct direct_window {
329 329
330/* Dynamic DMA Window support */ 330/* Dynamic DMA Window support */
331struct ddw_query_response { 331struct ddw_query_response {
332 __be32 windows_available; 332 u32 windows_available;
333 __be32 largest_available_block; 333 u32 largest_available_block;
334 __be32 page_size; 334 u32 page_size;
335 __be32 migration_capable; 335 u32 migration_capable;
336}; 336};
337 337
338struct ddw_create_response { 338struct ddw_create_response {
339 __be32 liobn; 339 u32 liobn;
340 __be32 addr_hi; 340 u32 addr_hi;
341 __be32 addr_lo; 341 u32 addr_lo;
342}; 342};
343 343
344static LIST_HEAD(direct_window_list); 344static LIST_HEAD(direct_window_list);
@@ -725,16 +725,18 @@ static void remove_ddw(struct device_node *np, bool remove_prop)
725{ 725{
726 struct dynamic_dma_window_prop *dwp; 726 struct dynamic_dma_window_prop *dwp;
727 struct property *win64; 727 struct property *win64;
728 const u32 *ddw_avail; 728 u32 ddw_avail[3];
729 u64 liobn; 729 u64 liobn;
730 int len, ret = 0; 730 int ret = 0;
731
732 ret = of_property_read_u32_array(np, "ibm,ddw-applicable",
733 &ddw_avail[0], 3);
731 734
732 ddw_avail = of_get_property(np, "ibm,ddw-applicable", &len);
733 win64 = of_find_property(np, DIRECT64_PROPNAME, NULL); 735 win64 = of_find_property(np, DIRECT64_PROPNAME, NULL);
734 if (!win64) 736 if (!win64)
735 return; 737 return;
736 738
737 if (!ddw_avail || len < 3 * sizeof(u32) || win64->length < sizeof(*dwp)) 739 if (ret || win64->length < sizeof(*dwp))
738 goto delprop; 740 goto delprop;
739 741
740 dwp = win64->value; 742 dwp = win64->value;
@@ -872,8 +874,9 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
872 874
873 do { 875 do {
874 /* extra outputs are LIOBN and dma-addr (hi, lo) */ 876 /* extra outputs are LIOBN and dma-addr (hi, lo) */
875 ret = rtas_call(ddw_avail[1], 5, 4, (u32 *)create, cfg_addr, 877 ret = rtas_call(ddw_avail[1], 5, 4, (u32 *)create,
876 BUID_HI(buid), BUID_LO(buid), page_shift, window_shift); 878 cfg_addr, BUID_HI(buid), BUID_LO(buid),
879 page_shift, window_shift);
877 } while (rtas_busy_delay(ret)); 880 } while (rtas_busy_delay(ret));
878 dev_info(&dev->dev, 881 dev_info(&dev->dev,
879 "ibm,create-pe-dma-window(%x) %x %x %x %x %x returned %d " 882 "ibm,create-pe-dma-window(%x) %x %x %x %x %x returned %d "
@@ -910,7 +913,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
910 int page_shift; 913 int page_shift;
911 u64 dma_addr, max_addr; 914 u64 dma_addr, max_addr;
912 struct device_node *dn; 915 struct device_node *dn;
913 const u32 *uninitialized_var(ddw_avail); 916 u32 ddw_avail[3];
914 struct direct_window *window; 917 struct direct_window *window;
915 struct property *win64; 918 struct property *win64;
916 struct dynamic_dma_window_prop *ddwprop; 919 struct dynamic_dma_window_prop *ddwprop;
@@ -942,8 +945,9 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
942 * for the given node in that order. 945 * for the given node in that order.
943 * the property is actually in the parent, not the PE 946 * the property is actually in the parent, not the PE
944 */ 947 */
945 ddw_avail = of_get_property(pdn, "ibm,ddw-applicable", &len); 948 ret = of_property_read_u32_array(pdn, "ibm,ddw-applicable",
946 if (!ddw_avail || len < 3 * sizeof(u32)) 949 &ddw_avail[0], 3);
950 if (ret)
947 goto out_failed; 951 goto out_failed;
948 952
949 /* 953 /*
@@ -966,11 +970,11 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
966 dev_dbg(&dev->dev, "no free dynamic windows"); 970 dev_dbg(&dev->dev, "no free dynamic windows");
967 goto out_failed; 971 goto out_failed;
968 } 972 }
969 if (be32_to_cpu(query.page_size) & 4) { 973 if (query.page_size & 4) {
970 page_shift = 24; /* 16MB */ 974 page_shift = 24; /* 16MB */
971 } else if (be32_to_cpu(query.page_size) & 2) { 975 } else if (query.page_size & 2) {
972 page_shift = 16; /* 64kB */ 976 page_shift = 16; /* 64kB */
973 } else if (be32_to_cpu(query.page_size) & 1) { 977 } else if (query.page_size & 1) {
974 page_shift = 12; /* 4kB */ 978 page_shift = 12; /* 4kB */
975 } else { 979 } else {
976 dev_dbg(&dev->dev, "no supported direct page size in mask %x", 980 dev_dbg(&dev->dev, "no supported direct page size in mask %x",
@@ -980,7 +984,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
980 /* verify the window * number of ptes will map the partition */ 984 /* verify the window * number of ptes will map the partition */
981 /* check largest block * page size > max memory hotplug addr */ 985 /* check largest block * page size > max memory hotplug addr */
982 max_addr = memory_hotplug_max(); 986 max_addr = memory_hotplug_max();
983 if (be32_to_cpu(query.largest_available_block) < (max_addr >> page_shift)) { 987 if (query.largest_available_block < (max_addr >> page_shift)) {
984 dev_dbg(&dev->dev, "can't map partiton max 0x%llx with %u " 988 dev_dbg(&dev->dev, "can't map partiton max 0x%llx with %u "
985 "%llu-sized pages\n", max_addr, query.largest_available_block, 989 "%llu-sized pages\n", max_addr, query.largest_available_block,
986 1ULL << page_shift); 990 1ULL << page_shift);
@@ -1006,8 +1010,9 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
1006 if (ret != 0) 1010 if (ret != 0)
1007 goto out_free_prop; 1011 goto out_free_prop;
1008 1012
1009 ddwprop->liobn = create.liobn; 1013 ddwprop->liobn = cpu_to_be32(create.liobn);
1010 ddwprop->dma_base = cpu_to_be64(of_read_number(&create.addr_hi, 2)); 1014 ddwprop->dma_base = cpu_to_be64(((u64)create.addr_hi << 32) |
1015 create.addr_lo);
1011 ddwprop->tce_shift = cpu_to_be32(page_shift); 1016 ddwprop->tce_shift = cpu_to_be32(page_shift);
1012 ddwprop->window_shift = cpu_to_be32(len); 1017 ddwprop->window_shift = cpu_to_be32(len);
1013 1018
@@ -1039,7 +1044,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
1039 list_add(&window->list, &direct_window_list); 1044 list_add(&window->list, &direct_window_list);
1040 spin_unlock(&direct_window_list_lock); 1045 spin_unlock(&direct_window_list_lock);
1041 1046
1042 dma_addr = of_read_number(&create.addr_hi, 2); 1047 dma_addr = be64_to_cpu(ddwprop->dma_base);
1043 goto out_unlock; 1048 goto out_unlock;
1044 1049
1045out_free_window: 1050out_free_window:
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 34e64237fff9..8c509d5397c6 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -59,8 +59,6 @@ EXPORT_SYMBOL(plpar_hcall);
59EXPORT_SYMBOL(plpar_hcall9); 59EXPORT_SYMBOL(plpar_hcall9);
60EXPORT_SYMBOL(plpar_hcall_norets); 60EXPORT_SYMBOL(plpar_hcall_norets);
61 61
62extern void pSeries_find_serial_port(void);
63
64void vpa_init(int cpu) 62void vpa_init(int cpu)
65{ 63{
66 int hwcpu = get_hard_smp_processor_id(cpu); 64 int hwcpu = get_hard_smp_processor_id(cpu);
@@ -642,7 +640,7 @@ EXPORT_SYMBOL(arch_free_page);
642#endif 640#endif
643 641
644#ifdef CONFIG_TRACEPOINTS 642#ifdef CONFIG_TRACEPOINTS
645#ifdef CONFIG_JUMP_LABEL 643#ifdef HAVE_JUMP_LABEL
646struct static_key hcall_tracepoint_key = STATIC_KEY_INIT; 644struct static_key hcall_tracepoint_key = STATIC_KEY_INIT;
647 645
648void hcall_tracepoint_regfunc(void) 646void hcall_tracepoint_regfunc(void)
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index 0cc240b7f694..11a3b617ef5d 100644
--- a/arch/powerpc/platforms/pseries/nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
@@ -276,8 +276,10 @@ static ssize_t pSeries_nvram_get_size(void)
276 * sequence #: The unique sequence # for each event. (until it wraps) 276 * sequence #: The unique sequence # for each event. (until it wraps)
277 * error log: The error log from event_scan 277 * error log: The error log from event_scan
278 */ 278 */
279int nvram_write_os_partition(struct nvram_os_partition *part, char * buff, 279static int nvram_write_os_partition(struct nvram_os_partition *part,
280 int length, unsigned int err_type, unsigned int error_log_cnt) 280 char *buff, int length,
281 unsigned int err_type,
282 unsigned int error_log_cnt)
281{ 283{
282 int rc; 284 int rc;
283 loff_t tmp_index; 285 loff_t tmp_index;
@@ -330,9 +332,9 @@ int nvram_write_error_log(char * buff, int length,
330 * 332 *
331 * Reads nvram partition for at most 'length' 333 * Reads nvram partition for at most 'length'
332 */ 334 */
333int nvram_read_partition(struct nvram_os_partition *part, char *buff, 335static int nvram_read_partition(struct nvram_os_partition *part, char *buff,
334 int length, unsigned int *err_type, 336 int length, unsigned int *err_type,
335 unsigned int *error_log_cnt) 337 unsigned int *error_log_cnt)
336{ 338{
337 int rc; 339 int rc;
338 loff_t tmp_index; 340 loff_t tmp_index;
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
index c413ec158ff5..67e48594040c 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -29,6 +29,7 @@
29#include <asm/pci-bridge.h> 29#include <asm/pci-bridge.h>
30#include <asm/prom.h> 30#include <asm/prom.h>
31#include <asm/ppc-pci.h> 31#include <asm/ppc-pci.h>
32#include "pseries.h"
32 33
33#if 0 34#if 0
34void pcibios_name_device(struct pci_dev *dev) 35void pcibios_name_device(struct pci_dev *dev)
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index dff05b9eb946..5a4d0fc03b03 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -126,7 +126,7 @@ struct epow_errorlog {
126#define EPOW_MAIN_ENCLOSURE 5 126#define EPOW_MAIN_ENCLOSURE 5
127#define EPOW_POWER_OFF 7 127#define EPOW_POWER_OFF 7
128 128
129void rtas_parse_epow_errlog(struct rtas_error_log *log) 129static void rtas_parse_epow_errlog(struct rtas_error_log *log)
130{ 130{
131 struct pseries_errorlog *pseries_log; 131 struct pseries_errorlog *pseries_log;
132 struct epow_errorlog *epow_log; 132 struct epow_errorlog *epow_log;
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index e724d3186e73..125c589eeef5 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -561,7 +561,7 @@ void pSeries_coalesce_init(void)
561 * fw_cmo_feature_init - FW_FEATURE_CMO is not stored in ibm,hypertas-functions, 561 * fw_cmo_feature_init - FW_FEATURE_CMO is not stored in ibm,hypertas-functions,
562 * handle that here. (Stolen from parse_system_parameter_string) 562 * handle that here. (Stolen from parse_system_parameter_string)
563 */ 563 */
564void pSeries_cmo_feature_init(void) 564static void pSeries_cmo_feature_init(void)
565{ 565{
566 char *ptr, *key, *value, *end; 566 char *ptr, *key, *value, *end;
567 int call_status; 567 int call_status;