aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-08-27 13:09:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-08-27 13:09:22 -0400
commit0c6b5c5b45c258e4aca65df8c5746838668fd99f (patch)
tree89e976bc2848f2702e2ae7f4d2c264668cb4e4d8
parent6dec97dc92946eb479e6ebb54a61f8226cceefec (diff)
parentd220980b701d838560a70de691b53be007e99e78 (diff)
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc fixes from Ben Herrenschmidt: "Here are 3 bug fixes that should probably go into 3.11 since I'm also tagging them for stable. Once fixes our old /proc/powerpc/lparcfg file which provides partition informations when running under our hypervisor and also acts as a user-triggerable Oops when hot :-( The other two respectively are a one liner to fix a HVSI protocol handshake problem causing the console to fail to show up on a bunch of machines until we reach userspace, which I deem annoying enough to warrant going to stable, and a nasty gcc miscompile causing us to pass virtual instead of physical addresses to the firmware under some circumstances" * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc/hvsi: Increase handshake timeout from 200ms to 400ms. powerpc: Work around gcc miscompilation of __pa() on 64-bit powerpc: Don't Oops when accessing /proc/powerpc/lparcfg without hypervisor
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/include/asm/page.h10
-rw-r--r--arch/powerpc/kernel/lparcfg.c22
-rw-r--r--drivers/tty/hvc/hvsi_lib.c4
4 files changed, 22 insertions, 15 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index dbd9d3c991e8..9cf59816d3e9 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -979,6 +979,7 @@ config RELOCATABLE
979 must live at a different physical address than the primary 979 must live at a different physical address than the primary
980 kernel. 980 kernel.
981 981
982# This value must have zeroes in the bottom 60 bits otherwise lots will break
982config PAGE_OFFSET 983config PAGE_OFFSET
983 hex 984 hex
984 default "0xc000000000000000" 985 default "0xc000000000000000"
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 988c812aab5b..b9f426212d3a 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -211,9 +211,19 @@ extern long long virt_phys_offset;
211#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET)) 211#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET))
212#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET) 212#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET)
213#else 213#else
214#ifdef CONFIG_PPC64
215/*
216 * gcc miscompiles (unsigned long)(&static_var) - PAGE_OFFSET
217 * with -mcmodel=medium, so we use & and | instead of - and + on 64-bit.
218 */
219#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) | PAGE_OFFSET))
220#define __pa(x) ((unsigned long)(x) & 0x0fffffffffffffffUL)
221
222#else /* 32-bit, non book E */
214#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START)) 223#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START))
215#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START) 224#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START)
216#endif 225#endif
226#endif
217 227
218/* 228/*
219 * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI, 229 * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI,
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index d92f3871e9cf..e2a0a162299b 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -35,7 +35,13 @@
35#include <asm/vdso_datapage.h> 35#include <asm/vdso_datapage.h>
36#include <asm/vio.h> 36#include <asm/vio.h>
37#include <asm/mmu.h> 37#include <asm/mmu.h>
38#include <asm/machdep.h>
38 39
40
41/*
42 * This isn't a module but we expose that to userspace
43 * via /proc so leave the definitions here
44 */
39#define MODULE_VERS "1.9" 45#define MODULE_VERS "1.9"
40#define MODULE_NAME "lparcfg" 46#define MODULE_NAME "lparcfg"
41 47
@@ -418,7 +424,8 @@ static void parse_em_data(struct seq_file *m)
418{ 424{
419 unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; 425 unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
420 426
421 if (plpar_hcall(H_GET_EM_PARMS, retbuf) == H_SUCCESS) 427 if (firmware_has_feature(FW_FEATURE_LPAR) &&
428 plpar_hcall(H_GET_EM_PARMS, retbuf) == H_SUCCESS)
422 seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]); 429 seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]);
423} 430}
424 431
@@ -677,7 +684,6 @@ static int lparcfg_open(struct inode *inode, struct file *file)
677} 684}
678 685
679static const struct file_operations lparcfg_fops = { 686static const struct file_operations lparcfg_fops = {
680 .owner = THIS_MODULE,
681 .read = seq_read, 687 .read = seq_read,
682 .write = lparcfg_write, 688 .write = lparcfg_write,
683 .open = lparcfg_open, 689 .open = lparcfg_open,
@@ -699,14 +705,4 @@ static int __init lparcfg_init(void)
699 } 705 }
700 return 0; 706 return 0;
701} 707}
702 708machine_device_initcall(pseries, lparcfg_init);
703static void __exit lparcfg_cleanup(void)
704{
705 remove_proc_subtree("powerpc/lparcfg", NULL);
706}
707
708module_init(lparcfg_init);
709module_exit(lparcfg_cleanup);
710MODULE_DESCRIPTION("Interface for LPAR configuration data");
711MODULE_AUTHOR("Dave Engebretsen");
712MODULE_LICENSE("GPL");
diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c
index 3396eb9d57a3..ac2767100df5 100644
--- a/drivers/tty/hvc/hvsi_lib.c
+++ b/drivers/tty/hvc/hvsi_lib.c
@@ -341,8 +341,8 @@ void hvsilib_establish(struct hvsi_priv *pv)
341 341
342 pr_devel("HVSI@%x: ... waiting handshake\n", pv->termno); 342 pr_devel("HVSI@%x: ... waiting handshake\n", pv->termno);
343 343
344 /* Try for up to 200s */ 344 /* Try for up to 400ms */
345 for (timeout = 0; timeout < 20; timeout++) { 345 for (timeout = 0; timeout < 40; timeout++) {
346 if (pv->established) 346 if (pv->established)
347 goto established; 347 goto established;
348 if (!hvsi_get_packet(pv)) 348 if (!hvsi_get_packet(pv))