diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries/lpar.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/lpar.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 9235c469449e..2cbaedb17f3e 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
@@ -19,7 +19,8 @@ | |||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #undef DEBUG_LOW | 22 | /* Enables debugging of low-level hash table routines - careful! */ |
23 | #undef DEBUG | ||
23 | 24 | ||
24 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
25 | #include <linux/dma-mapping.h> | 26 | #include <linux/dma-mapping.h> |
@@ -42,11 +43,6 @@ | |||
42 | #include "plpar_wrappers.h" | 43 | #include "plpar_wrappers.h" |
43 | #include "pseries.h" | 44 | #include "pseries.h" |
44 | 45 | ||
45 | #ifdef DEBUG_LOW | ||
46 | #define DBG_LOW(fmt...) do { udbg_printf(fmt); } while(0) | ||
47 | #else | ||
48 | #define DBG_LOW(fmt...) do { } while(0) | ||
49 | #endif | ||
50 | 46 | ||
51 | /* in hvCall.S */ | 47 | /* in hvCall.S */ |
52 | EXPORT_SYMBOL(plpar_hcall); | 48 | EXPORT_SYMBOL(plpar_hcall); |
@@ -196,6 +192,8 @@ void __init udbg_init_debug_lpar(void) | |||
196 | udbg_putc = udbg_putcLP; | 192 | udbg_putc = udbg_putcLP; |
197 | udbg_getc = udbg_getcLP; | 193 | udbg_getc = udbg_getcLP; |
198 | udbg_getc_poll = udbg_getc_pollLP; | 194 | udbg_getc_poll = udbg_getc_pollLP; |
195 | |||
196 | register_early_udbg_console(); | ||
199 | } | 197 | } |
200 | 198 | ||
201 | /* returns 0 if couldn't find or use /chosen/stdout as console */ | 199 | /* returns 0 if couldn't find or use /chosen/stdout as console */ |
@@ -288,15 +286,15 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group, | |||
288 | unsigned long hpte_v, hpte_r; | 286 | unsigned long hpte_v, hpte_r; |
289 | 287 | ||
290 | if (!(vflags & HPTE_V_BOLTED)) | 288 | if (!(vflags & HPTE_V_BOLTED)) |
291 | DBG_LOW("hpte_insert(group=%lx, va=%016lx, pa=%016lx, " | 289 | pr_debug("hpte_insert(group=%lx, va=%016lx, pa=%016lx, " |
292 | "rflags=%lx, vflags=%lx, psize=%d)\n", | 290 | "rflags=%lx, vflags=%lx, psize=%d)\n", |
293 | hpte_group, va, pa, rflags, vflags, psize); | 291 | hpte_group, va, pa, rflags, vflags, psize); |
294 | 292 | ||
295 | hpte_v = hpte_encode_v(va, psize, ssize) | vflags | HPTE_V_VALID; | 293 | hpte_v = hpte_encode_v(va, psize, ssize) | vflags | HPTE_V_VALID; |
296 | hpte_r = hpte_encode_r(pa, psize) | rflags; | 294 | hpte_r = hpte_encode_r(pa, psize) | rflags; |
297 | 295 | ||
298 | if (!(vflags & HPTE_V_BOLTED)) | 296 | if (!(vflags & HPTE_V_BOLTED)) |
299 | DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r); | 297 | pr_debug(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r); |
300 | 298 | ||
301 | /* Now fill in the actual HPTE */ | 299 | /* Now fill in the actual HPTE */ |
302 | /* Set CEC cookie to 0 */ | 300 | /* Set CEC cookie to 0 */ |
@@ -313,7 +311,7 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group, | |||
313 | lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot); | 311 | lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot); |
314 | if (unlikely(lpar_rc == H_PTEG_FULL)) { | 312 | if (unlikely(lpar_rc == H_PTEG_FULL)) { |
315 | if (!(vflags & HPTE_V_BOLTED)) | 313 | if (!(vflags & HPTE_V_BOLTED)) |
316 | DBG_LOW(" full\n"); | 314 | pr_debug(" full\n"); |
317 | return -1; | 315 | return -1; |
318 | } | 316 | } |
319 | 317 | ||
@@ -324,11 +322,11 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group, | |||
324 | */ | 322 | */ |
325 | if (unlikely(lpar_rc != H_SUCCESS)) { | 323 | if (unlikely(lpar_rc != H_SUCCESS)) { |
326 | if (!(vflags & HPTE_V_BOLTED)) | 324 | if (!(vflags & HPTE_V_BOLTED)) |
327 | DBG_LOW(" lpar err %d\n", lpar_rc); | 325 | pr_debug(" lpar err %lu\n", lpar_rc); |
328 | return -2; | 326 | return -2; |
329 | } | 327 | } |
330 | if (!(vflags & HPTE_V_BOLTED)) | 328 | if (!(vflags & HPTE_V_BOLTED)) |
331 | DBG_LOW(" -> slot: %d\n", slot & 7); | 329 | pr_debug(" -> slot: %lu\n", slot & 7); |
332 | 330 | ||
333 | /* Because of iSeries, we have to pass down the secondary | 331 | /* Because of iSeries, we have to pass down the secondary |
334 | * bucket bit here as well | 332 | * bucket bit here as well |
@@ -420,17 +418,17 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot, | |||
420 | 418 | ||
421 | want_v = hpte_encode_avpn(va, psize, ssize); | 419 | want_v = hpte_encode_avpn(va, psize, ssize); |
422 | 420 | ||
423 | DBG_LOW(" update: avpnv=%016lx, hash=%016lx, f=%x, psize: %d ... ", | 421 | pr_debug(" update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...", |
424 | want_v, slot, flags, psize); | 422 | want_v, slot, flags, psize); |
425 | 423 | ||
426 | lpar_rc = plpar_pte_protect(flags, slot, want_v); | 424 | lpar_rc = plpar_pte_protect(flags, slot, want_v); |
427 | 425 | ||
428 | if (lpar_rc == H_NOT_FOUND) { | 426 | if (lpar_rc == H_NOT_FOUND) { |
429 | DBG_LOW("not found !\n"); | 427 | pr_debug("not found !\n"); |
430 | return -1; | 428 | return -1; |
431 | } | 429 | } |
432 | 430 | ||
433 | DBG_LOW("ok\n"); | 431 | pr_debug("ok\n"); |
434 | 432 | ||
435 | BUG_ON(lpar_rc != H_SUCCESS); | 433 | BUG_ON(lpar_rc != H_SUCCESS); |
436 | 434 | ||
@@ -505,8 +503,8 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va, | |||
505 | unsigned long lpar_rc; | 503 | unsigned long lpar_rc; |
506 | unsigned long dummy1, dummy2; | 504 | unsigned long dummy1, dummy2; |
507 | 505 | ||
508 | DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d", | 506 | pr_debug(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n", |
509 | slot, va, psize, local); | 507 | slot, va, psize, local); |
510 | 508 | ||
511 | want_v = hpte_encode_avpn(va, psize, ssize); | 509 | want_v = hpte_encode_avpn(va, psize, ssize); |
512 | lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v, &dummy1, &dummy2); | 510 | lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v, &dummy1, &dummy2); |