Commit 0c6b5c5b authored by Linus Torvalds's avatar Linus Torvalds

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
parents 6dec97dc d220980b
...@@ -979,6 +979,7 @@ config RELOCATABLE ...@@ -979,6 +979,7 @@ config RELOCATABLE
must live at a different physical address than the primary must live at a different physical address than the primary
kernel. kernel.
# This value must have zeroes in the bottom 60 bits otherwise lots will break
config PAGE_OFFSET config PAGE_OFFSET
hex hex
default "0xc000000000000000" default "0xc000000000000000"
......
...@@ -211,9 +211,19 @@ extern long long virt_phys_offset; ...@@ -211,9 +211,19 @@ extern long long virt_phys_offset;
#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET)) #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET))
#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET) #define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET)
#else #else
#ifdef CONFIG_PPC64
/*
* gcc miscompiles (unsigned long)(&static_var) - PAGE_OFFSET
* with -mcmodel=medium, so we use & and | instead of - and + on 64-bit.
*/
#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) | PAGE_OFFSET))
#define __pa(x) ((unsigned long)(x) & 0x0fffffffffffffffUL)
#else /* 32-bit, non book E */
#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START)) #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START))
#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START) #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START)
#endif #endif
#endif
/* /*
* Unfortunately the PLT is in the BSS in the PPC32 ELF ABI, * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI,
......
...@@ -35,7 +35,13 @@ ...@@ -35,7 +35,13 @@
#include <asm/vdso_datapage.h> #include <asm/vdso_datapage.h>
#include <asm/vio.h> #include <asm/vio.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/machdep.h>
/*
* This isn't a module but we expose that to userspace
* via /proc so leave the definitions here
*/
#define MODULE_VERS "1.9" #define MODULE_VERS "1.9"
#define MODULE_NAME "lparcfg" #define MODULE_NAME "lparcfg"
...@@ -418,7 +424,8 @@ static void parse_em_data(struct seq_file *m) ...@@ -418,7 +424,8 @@ static void parse_em_data(struct seq_file *m)
{ {
unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
if (plpar_hcall(H_GET_EM_PARMS, retbuf) == H_SUCCESS) if (firmware_has_feature(FW_FEATURE_LPAR) &&
plpar_hcall(H_GET_EM_PARMS, retbuf) == H_SUCCESS)
seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]); seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]);
} }
...@@ -677,7 +684,6 @@ static int lparcfg_open(struct inode *inode, struct file *file) ...@@ -677,7 +684,6 @@ static int lparcfg_open(struct inode *inode, struct file *file)
} }
static const struct file_operations lparcfg_fops = { static const struct file_operations lparcfg_fops = {
.owner = THIS_MODULE,
.read = seq_read, .read = seq_read,
.write = lparcfg_write, .write = lparcfg_write,
.open = lparcfg_open, .open = lparcfg_open,
...@@ -699,14 +705,4 @@ static int __init lparcfg_init(void) ...@@ -699,14 +705,4 @@ static int __init lparcfg_init(void)
} }
return 0; return 0;
} }
machine_device_initcall(pseries, lparcfg_init);
static void __exit lparcfg_cleanup(void)
{
remove_proc_subtree("powerpc/lparcfg", NULL);
}
module_init(lparcfg_init);
module_exit(lparcfg_cleanup);
MODULE_DESCRIPTION("Interface for LPAR configuration data");
MODULE_AUTHOR("Dave Engebretsen");
MODULE_LICENSE("GPL");
...@@ -341,8 +341,8 @@ void hvsilib_establish(struct hvsi_priv *pv) ...@@ -341,8 +341,8 @@ void hvsilib_establish(struct hvsi_priv *pv)
pr_devel("HVSI@%x: ... waiting handshake\n", pv->termno); pr_devel("HVSI@%x: ... waiting handshake\n", pv->termno);
/* Try for up to 200s */ /* Try for up to 400ms */
for (timeout = 0; timeout < 20; timeout++) { for (timeout = 0; timeout < 40; timeout++) {
if (pv->established) if (pv->established)
goto established; goto established;
if (!hvsi_get_packet(pv)) if (!hvsi_get_packet(pv))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment