[PATCH v2] powerpc/boot: regenerate zImage linker script when options change

2016-11-26 Thread Nicholas Piggin
Changing config options (e.g., endianness) does not always seem to
regenerate zImage.lds properly. Adapt the standard kernel linker script
build command and use that.

Signed-off-by: Nicholas Piggin 
---
Changes since v1:
- Using cmd_cpp_lds_S command name was causing it to actually use the
  generic kbuild linker script command, which among other things did
  not undefine powerpc, causing the linker script to break for 32-bit.
  Use a new name.

 arch/powerpc/boot/Makefile | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 0442516..06c19a7 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -175,9 +175,12 @@ $(addprefix $(obj)/,$(libfdt) $(libfdtheader)): $(obj)/%: 
$(srctree)/scripts/dtc
 $(obj)/empty.c:
$(Q)touch $@
 
-$(obj)/zImage.lds: $(obj)/%: $(srctree)/$(src)/%.S
-   $(CROSS32CC) $(cpp_flags) -E -Wp,-MD,$(depfile) -P -Upowerpc \
-   -D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $<
+quiet_cmd_zImage_lds_S = LDS $@
+   cmd_zImage_lds_S = $(CROSS32CC) $(cpp_flags) -E -Wp,-MD,$(depfile) -P \
+   -Upowerpc -D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $<
+
+$(obj)/zImage.lds: $(obj)/%: $(srctree)/$(src)/%.S FORCE
+   $(call if_changed_dep,zImage_lds_S)
 
 $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S
$(Q)cp $< $@
-- 
2.10.2



[PATCH v2] powerpc/64be: option to use ELFv2 ABI for big endian kernels

2016-11-26 Thread Nicholas Piggin
Provide an option to use ELFv2 ABI for big endian builds. The
toolchain check can't be done at configure-time, so the way this
option is provided can result in unbuildable kernel on older
toolchains. Being experimental expert option there isn't a need
to add a lot of fallback logic to make this build.

Signed-off-by: Nicholas Piggin 
---
Changes since v1:
- Fix kconfig so it (hopefully) works as expected with all combinations
  of EXPERT and endianness.
- Rebased to new "powerpc: allow compilation on cross-endian toolchain"

 arch/powerpc/Kconfig| 17 +
 arch/powerpc/Makefile   | 15 ++-
 arch/powerpc/boot/Makefile  |  2 ++
 drivers/crypto/vmx/Makefile |  6 +-
 drivers/crypto/vmx/aesp8-ppc.pl |  2 +-
 drivers/crypto/vmx/ppc-xlate.pl | 11 +++
 6 files changed, 42 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 65fba4c..1f0500b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -146,6 +146,7 @@ config PPC
select HAVE_ARCH_AUDITSYSCALL
select ARCH_SUPPORTS_ATOMIC_RMW
select DCACHE_WORD_ACCESS if PPC64 && CPU_LITTLE_ENDIAN
+   select BUILD_ELF_V2 if PPC64 && CPU_LITTLE_ENDIAN
select NO_BOOTMEM
select HAVE_GENERIC_RCU_GUP
select HAVE_PERF_EVENTS_NMI if PPC64
@@ -455,6 +456,22 @@ config KEXEC
  interface is strongly in flux, so no good recommendation can be
  made.
 
+if PPC64 && CPU_BIG_ENDIAN
+config BUILD_ELF_V2
+   bool "Build big-endian kernel using ELFv2 ABI (EXPERIMENTAL)"
+   depends on PPC64 && CPU_BIG_ENDIAN && EXPERT
+   default n
+   help
+ This builds the kernel image using the ELFv2 ABI, which has a
+ reduced stack overhead and faster function calls. This does not
+ affect the userspace ABIs.
+
+ ELFv2 is the standard ABI for little-endian. For big-endian this is
+ an experimental option that is not well tested (kernel and
+ toolchain). This requires gcc 4.9 or newer and binutils 2.24 or
+ newer.
+endif
+
 config RELOCATABLE
bool "Build a relocatable kernel"
depends on (PPC64 && !COMPILE_TEST) || (FLATMEM && (44x || FSL_BOOKE))
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index a389ee0..9fbc1c8 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -73,10 +73,14 @@ MULTIPLEWORD:= -mmultiple
 endif
 
 ifdef CONFIG_PPC64
-cflags-$(CONFIG_CPU_BIG_ENDIAN)+= $(call cc-option,-mabi=elfv1)
-cflags-$(CONFIG_CPU_BIG_ENDIAN)+= $(call 
cc-option,-mcall-aixdesc)
-aflags-$(CONFIG_CPU_BIG_ENDIAN)+= $(call cc-option,-mabi=elfv1)
-aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2
+ifdef CONFIG_BUILD_ELF_V2
+cflags-y   += $(call cc-option,-mabi=elfv2,$(call 
cc-option,-mcall-aixdesc))
+aflags-y   += $(call cc-option,-mabi=elfv2)
+else
+cflags-y   += $(call cc-option,-mabi=elfv1)
+cflags-y   += $(call cc-option,-mcall-aixdesc)
+aflags-y   += $(call cc-option,-mabi=elfv1)
+endif
 endif
 
 cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian
@@ -116,7 +120,7 @@ endif
 endif
 
 CFLAGS-$(CONFIG_PPC64) := $(call cc-option,-mtraceback=no)
-ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
+ifdef CONFIG_BUILD_ELF_V2
 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call 
cc-option,-mcall-aixdesc))
 AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2)
 else
@@ -124,6 +128,7 @@ CFLAGS-$(CONFIG_PPC64)  += $(call cc-option,-mabi=elfv1)
 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcall-aixdesc)
 AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1)
 endif
+
 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,$(call 
cc-option,-mminimal-toc))
 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions)
 CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 7c46cf3..0442516 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -31,8 +31,10 @@ BOOTCFLAGS:= -Wall -Wundef -Wstrict-prototypes 
-Wno-trigraphs \
 # PPC64_BOOT_WRAPPER is little-endian specific.
 ifdef CONFIG_PPC64_BOOT_WRAPPER
 BOOTCFLAGS += -m64
+ifdef CONFIG_BUILD_ELF_V2
 BOOTCFLAGS += $(call cc-option,-mabi=elfv2)
 endif
+endif
 
 ifdef CONFIG_CPU_BIG_ENDIAN
 BOOTCFLAGS += -mbig-endian
diff --git a/drivers/crypto/vmx/Makefile b/drivers/crypto/vmx/Makefile
index de6e241..b47da00 100644
--- a/drivers/crypto/vmx/Makefile
+++ b/drivers/crypto/vmx/Makefile
@@ -1,11 +1,15 @@
 obj-$(CONFIG_CRYPTO_DEV_VMX_ENCRYPT) += vmx-crypto.o
 vmx-crypto-objs := vmx.o aesp8-ppc.o ghashp8-ppc.o aes.o aes_cbc.o aes_ctr.o 
aes_xts.o ghash.o
 
-ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
+ifdef CONFIG_CPU_LITTLE_ENDIAN
 TARGET := 

Re: [PATCH 2/3] powerpc: allow compilation on cross-endian toolchain

2016-11-26 Thread Nicholas Piggin
On Sat, 26 Nov 2016 18:30:15 +1100
Michael Ellerman  wrote:

> Nicholas Piggin  writes:
> > On Thu, 24 Nov 2016 00:02:08 +1100
> > diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> > index 617dece..8828807 100644
> > --- a/arch/powerpc/Makefile
> > +++ b/arch/powerpc/Makefile
> > @@ -73,13 +73,18 @@ MULTIPLEWORD:= -mmultiple
> >  endif
> >  
> >  cflags-$(CONFIG_CPU_BIG_ENDIAN)+= $(call 
> > cc-option,-mbig-endian)
> > +cflags-$(CONFIG_CPU_BIG_ENDIAN)+= $(call cc-option,-mabi=elfv1)
> > +cflags-$(CONFIG_CPU_BIG_ENDIAN)+= $(call 
> > cc-option,-mcall-aixdesc)  
> 
> This blew up the world:
> 
>   
> http://kisskb.ellerman.id.au/kisskb/head/1ba4cb3d67e181bdc9a911d7be81f64e3d7597d2/
> 
>   Successful: 24% 63/258
> 
> I suspect you need to make -mcall-aixdesc 64-bit only.

Yes, I forgot 32-bit will pick those up. 3rd time's a charm, this compiles
64 bit be/le and 32-bit now.

--

Subject: [PATCH] powerpc: allow compilation on cross-endian toolchain

GCC can compile with either endian, but the ABI version always
defaults to the default endian. Alan Modra says:

  you need both -mbig and -mabi=elfv1 to make a powerpc64le gcc
  generate powerpc64 code

The opposite is true for powerpc64 when generating -mlittle it
requires -mabi=elfv2 to generate v2 ABI. This change adds ABI
annotations together with endianness. The kernel with ELFv2 ABI
also uses -mcall-aixdesc, but boot/ does not.

Signed-off-by: Nicholas Piggin 
---
 arch/powerpc/Makefile  | 11 ++-
 arch/powerpc/boot/Makefile |  4 +++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 617dece..a60c9c6 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -72,8 +72,15 @@ GNUTARGET:= powerpc
 MULTIPLEWORD   := -mmultiple
 endif
 
-cflags-$(CONFIG_CPU_BIG_ENDIAN)+= $(call 
cc-option,-mbig-endian)
+ifdef CONFIG_PPC64
+cflags-$(CONFIG_CPU_BIG_ENDIAN)+= $(call cc-option,-mabi=elfv1)
+cflags-$(CONFIG_CPU_BIG_ENDIAN)+= $(call 
cc-option,-mcall-aixdesc)
+aflags-$(CONFIG_CPU_BIG_ENDIAN)+= $(call cc-option,-mabi=elfv1)
+aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2
+endif
+
 cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian
+cflags-$(CONFIG_CPU_BIG_ENDIAN)+= $(call 
cc-option,-mbig-endian)
 ifneq ($(cc-name),clang)
   cflags-$(CONFIG_CPU_LITTLE_ENDIAN)   += -mno-strict-align
 endif
@@ -113,7 +120,9 @@ ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call 
cc-option,-mcall-aixdesc))
 AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2)
 else
+CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1)
 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcall-aixdesc)
+AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1)
 endif
 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,$(call 
cc-option,-mminimal-toc))
 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index eae2dc8..7c46cf3 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -28,14 +28,16 @@ BOOTCFLAGS:= -Wall -Wundef -Wstrict-prototypes 
-Wno-trigraphs \
 -isystem $(shell $(CROSS32CC) -print-file-name=include) \
 -D$(compress-y)
 
+# PPC64_BOOT_WRAPPER is little-endian specific.
 ifdef CONFIG_PPC64_BOOT_WRAPPER
 BOOTCFLAGS += -m64
+BOOTCFLAGS += $(call cc-option,-mabi=elfv2)
 endif
+
 ifdef CONFIG_CPU_BIG_ENDIAN
 BOOTCFLAGS += -mbig-endian
 else
 BOOTCFLAGS += -mlittle-endian
-BOOTCFLAGS += $(call cc-option,-mabi=elfv2)
 endif
 
 BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
-- 
2.10.2



[PATCH 17/22] KVM/PPC/Book3S HV: Convert to hotplug state machine

2016-11-26 Thread Sebastian Andrzej Siewior
From: Anna-Maria Gleixner 

Install the callbacks via the state machine.

Cc: Alexander Graf 
Cc: Paolo Bonzini 
Cc: "Radim Krčmář" 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Michael Ellerman 
Cc: kvm-...@vger.kernel.org
Cc: k...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Anna-Maria Gleixner 
Signed-off-by: Sebastian Andrzej Siewior 
---
 arch/powerpc/kvm/book3s_hv.c | 48 ++--
 include/linux/cpuhotplug.h   |  1 +
 2 files changed, 12 insertions(+), 37 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 3686471be32b..39ef1f4a7b02 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -2254,12 +2254,12 @@ static void post_guest_process(struct kvmppc_vcore *vc, 
bool is_master)
  * enter the guest. Only do this if it is the primary thread of the
  * core (not if a subcore) that is entering the guest.
  */
-static inline void kvmppc_clear_host_core(int cpu)
+static inline int kvmppc_clear_host_core(unsigned int cpu)
 {
int core;
 
if (!kvmppc_host_rm_ops_hv || cpu_thread_in_core(cpu))
-   return;
+   return 0;
/*
 * Memory barrier can be omitted here as we will do a smp_wmb()
 * later in kvmppc_start_thread and we need ensure that state is
@@ -2267,6 +2267,7 @@ static inline void kvmppc_clear_host_core(int cpu)
 */
core = cpu >> threads_shift;
kvmppc_host_rm_ops_hv->rm_core[core].rm_state.in_host = 0;
+   return 0;
 }
 
 /*
@@ -2274,12 +2275,12 @@ static inline void kvmppc_clear_host_core(int cpu)
  * Only need to do this if it is the primary thread of the core that is
  * exiting.
  */
-static inline void kvmppc_set_host_core(int cpu)
+static inline int kvmppc_set_host_core(unsigned int cpu)
 {
int core;
 
if (!kvmppc_host_rm_ops_hv || cpu_thread_in_core(cpu))
-   return;
+   return 0;
 
/*
 * Memory barrier can be omitted here because we do a spin_unlock
@@ -2287,6 +2288,7 @@ static inline void kvmppc_set_host_core(int cpu)
 */
core = cpu >> threads_shift;
kvmppc_host_rm_ops_hv->rm_core[core].rm_state.in_host = 1;
+   return 0;
 }
 
 /*
@@ -3094,36 +3096,6 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu 
*vcpu)
 }
 
 #ifdef CONFIG_KVM_XICS
-static int kvmppc_cpu_notify(struct notifier_block *self, unsigned long action,
-   void *hcpu)
-{
-   unsigned long cpu = (long)hcpu;
-
-   switch (action) {
-   case CPU_UP_PREPARE:
-   case CPU_UP_PREPARE_FROZEN:
-   kvmppc_set_host_core(cpu);
-   break;
-
-#ifdef CONFIG_HOTPLUG_CPU
-   case CPU_DEAD:
-   case CPU_DEAD_FROZEN:
-   case CPU_UP_CANCELED:
-   case CPU_UP_CANCELED_FROZEN:
-   kvmppc_clear_host_core(cpu);
-   break;
-#endif
-   default:
-   break;
-   }
-
-   return NOTIFY_OK;
-}
-
-static struct notifier_block kvmppc_cpu_notifier = {
-   .notifier_call = kvmppc_cpu_notify,
-};
-
 /*
  * Allocate a per-core structure for managing state about which cores are
  * running in the host versus the guest and for exchanging data between
@@ -3185,15 +3157,17 @@ void kvmppc_alloc_host_rm_ops(void)
return;
}
 
-   register_cpu_notifier(_cpu_notifier);
-
+   cpuhp_setup_state_nocalls(CPUHP_KVM_PPC_BOOK3S_PREPARE,
+ "ppc/kvm_book3s:prepare",
+ kvmppc_set_host_core,
+ kvmppc_clear_host_core);
put_online_cpus();
 }
 
 void kvmppc_free_host_rm_ops(void)
 {
if (kvmppc_host_rm_ops_hv) {
-   unregister_cpu_notifier(_cpu_notifier);
+   cpuhp_remove_state_nocalls(CPUHP_KVM_PPC_BOOK3S_PREPARE);
kfree(kvmppc_host_rm_ops_hv->rm_core);
kfree(kvmppc_host_rm_ops_hv);
kvmppc_host_rm_ops_hv = NULL;
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 853f8176594d..71c6822dd5be 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -68,6 +68,7 @@ enum cpuhp_state {
CPUHP_MM_ZS_PREPARE,
CPUHP_MM_ZSWP_MEM_PREPARE,
CPUHP_MM_ZSWP_POOL_PREPARE,
+   CPUHP_KVM_PPC_BOOK3S_PREPARE,
CPUHP_TIMERS_DEAD,
CPUHP_NOTF_ERR_INJ_PREPARE,
CPUHP_MIPS_SOC_PREPARE,
-- 
2.10.2



Re: [PATCH] adb: properly mark continued kernel messages

2016-11-26 Thread Benjamin Herrenschmidt
On Sat, 2016-11-26 at 14:22 +0100, Andreas Schwab wrote:
>  {
> -   printk(KERN_INFO "adb: starting probe task...\n");
> +   pr_info("adb: starting probe task...\n");
> do_adb_reset_bus();
> -   printk(KERN_INFO "adb: finished probe task...\n");
> +   pr_info("adb: finished probe task...\n");
>  
> up(_probe_mutex

While at it, that should probably be pr_debug...

Cheers,
Ben.



Kernel build issues with upstream binutils

2016-11-26 Thread Anton Blanchard
Hi,

A recent binutils commit:

https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=1a9ccd70f9a75dc6b48d340059f28ef3550c107b

has broken kernel builds:

/home/anton/gcc.install/bin/ld: arch/powerpc/boot/zImage.pseries: Not enough 
room for program headers, try linking with -N
/home/anton/gcc.install/bin/ld: final link failed: Bad value

I guess we have an issue with our linker script.

Anton


Re: [GIT PULL] Please pull powerpc/linux.git powerpc-4.9-6 tag

2016-11-26 Thread Linus Torvalds
On Sat, Nov 26, 2016 at 12:11 AM, Michael Ellerman  wrote:
>
> powerpc fixes for 4.9 #6
>
> Fixes marked for stable:
>  - Set missing wakeup bit in LPCR on POWER9 (Benjamin Herrenschmidt)
>  - Fix the early OPAL console wrappers (Oliver O'Halloran)
>  - Fixup kernel read only mapping (Aneesh Kumar K.V)
>
> Fixes for code merged this cycle:
>  - Fix missing CRCs, add more asm-prototypes.h declarations (Nicholas Piggin)

Pulled, but I wanted to talk about your merge "summary".

Your merge summaries seem to be entirely automatically generated,
which makes them less than great. I can see all that stuff in the git
tree already, just formatting it differently isn't all that useful.

For something like this late-rc pull when there are only a couple of
commits, the end result actually ends up looking almost like a summary
and all I did was remove the names that don't add to the description
(and are in the git commits).

For some of the bigger pull requests, the summary is almost anything
but, and the only real value-add is the grouping by subject area.

I really prefer a _summary_. Something that is human-legible. So that
when people read the merge commit log, they get an overview of what
changed, not a list of the details.

Again, when there are four commits, a "list of the details" pretty
much works. So the reason I react to _this_ pull request is mainly
that I have way more time to react to it during the late rc series
than I do earlier in the cycle..

 Linus


Re: [PATCH v6 0/7] Radix pte update tlbflush optimizations.

2016-11-26 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V"  writes:

> Changes from V5:
> Switch to use pte bits to track page size.

I am now testing a new version that will limit this new pte bit usage
only on DD1.

>
> Aneesh Kumar K.V (7):
>   powerpc/mm: Rename hugetlb-radix.h to hugetlb.h
>   powerpc/mm/hugetlb: Handle hugepage size supported by hash config
>   powerpc/mm: Introduce _PAGE_GIGANTIC and _PAGE_LARGE software pte bits
>   powerpc/mm: Add radix__tlb_flush_pte
>   powerpc/mm: update radix__ptep_set_access_flag to not do full mm tlb
> flush
>   powerpc/mm: update radix__pte_update to not do full mm tlb flush
>   powerpc/mm: Batch tlb flush when invalidating pte entries
>
>  arch/powerpc/include/asm/book3s/32/pgtable.h   |  3 ++-
>  .../asm/book3s/64/{hugetlb-radix.h => hugetlb.h}   | 21 ++--
>  arch/powerpc/include/asm/book3s/64/pgtable.h   | 15 ++--
>  arch/powerpc/include/asm/book3s/64/radix.h | 28 
> ++
>  .../powerpc/include/asm/book3s/64/tlbflush-radix.h |  2 ++
>  arch/powerpc/include/asm/hugetlb.h |  2 +-
>  arch/powerpc/include/asm/nohash/32/pgtable.h   |  3 ++-
>  arch/powerpc/include/asm/nohash/64/pgtable.h   |  3 ++-
>  arch/powerpc/mm/pgtable-book3s64.c |  3 ++-
>  arch/powerpc/mm/pgtable.c  |  2 +-
>  arch/powerpc/mm/tlb-radix.c| 11 +
>  11 files changed, 67 insertions(+), 26 deletions(-)
>  rename arch/powerpc/include/asm/book3s/64/{hugetlb-radix.h => hugetlb.h} 
> (55%)
>
> -- 
> 2.10.2



[PATCH] adb: properly mark continued kernel messages

2016-11-26 Thread Andreas Schwab
Use pr_cont where appropriate, and switch to pr_foo throughout.

Signed-off-by: Andreas Schwab 
---
 drivers/macintosh/adb.c| 24 +---
 drivers/macintosh/adbhid.c | 56 +++---
 2 files changed, 39 insertions(+), 41 deletions(-)

diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 226179b975..bb6c759b66 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -206,18 +206,17 @@ static int adb_scan_bus(void)
}
 
/* Now fill in the handler_id field of the adb_handler entries. */
-   printk(KERN_DEBUG "adb devices:");
+   pr_debug("adb devices:\n");
for (i = 1; i < 16; i++) {
if (adb_handler[i].original_address == 0)
continue;
adb_request(, NULL, ADBREQ_SYNC | ADBREQ_REPLY, 1,
(i << 4) | 0xf);
adb_handler[i].handler_id = req.reply[2];
-   printk(" [%d]: %d %x", i, adb_handler[i].original_address,
-  adb_handler[i].handler_id);
+   pr_debug(" [%d]: %d %x\n", i, adb_handler[i].original_address,
+adb_handler[i].handler_id);
devmask |= 1 << i;
}
-   printk("\n");
return devmask;
 }
 
@@ -228,9 +227,9 @@ static int adb_scan_bus(void)
 static int
 adb_probe_task(void *x)
 {
-   printk(KERN_INFO "adb: starting probe task...\n");
+   pr_info("adb: starting probe task...\n");
do_adb_reset_bus();
-   printk(KERN_INFO "adb: finished probe task...\n");
+   pr_info("adb: finished probe task...\n");
 
up(_probe_mutex);
 
@@ -340,7 +339,7 @@ static int __init adb_init(void)
adb_controller->init())
adb_controller = NULL;
if (adb_controller == NULL) {
-   printk(KERN_WARNING "Warning: no ADB interface detected\n");
+   pr_warn("Warning: no ADB interface detected\n");
} else {
 #ifdef CONFIG_PPC
if (of_machine_is_compatible("AAPL,PowerBook1998") ||
@@ -483,8 +482,7 @@ adb_register(int default_id, int handler_id, struct adb_ids 
*ids,
(!handler_id || (handler_id == adb_handler[i].handler_id) 
|| 
try_handler_change(i, handler_id))) {
if (adb_handler[i].handler != 0) {
-   printk(KERN_ERR
-  "Two handlers for ADB device %d\n",
+   pr_err("Two handlers for ADB device %d\n",
   default_id);
continue;
}
@@ -538,10 +536,10 @@ adb_input(unsigned char *buf, int nb, int autopoll)

id = buf[0] >> 4;
if (dump_adb_input) {
-   printk(KERN_INFO "adb packet: ");
+   pr_info("adb packet: ");
for (i = 0; i < nb; ++i)
-   printk(" %x", buf[i]);
-   printk(", id = %d\n", id);
+   pr_cont(" %x", buf[i]);
+   pr_cont(", id = %d\n", id);
}
write_lock_irqsave(_handler_lock, flags);
handler = adb_handler[id].handler;
@@ -891,7 +889,7 @@ static void __init
 adbdev_init(void)
 {
if (register_chrdev(ADB_MAJOR, "adb", _fops)) {
-   printk(KERN_ERR "adb: unable to get major %d\n", ADB_MAJOR);
+   pr_err("adb: unable to get major %d\n", ADB_MAJOR);
return;
}
 
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index 09d72bb00d..3c37e54b0b 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -267,7 +267,7 @@ adbhid_keyboard_input(unsigned char *data, int nb, int 
apoll)
int id = (data[0] >> 4) & 0x0f;
 
if (!adbhid[id]) {
-   printk(KERN_ERR "ADB HID on ID %d not yet registered, packet 
%#02x, %#02x, %#02x, %#02x\n",
+   pr_err("ADB HID on ID %d not yet registered, packet %#02x, 
%#02x, %#02x, %#02x\n",
   id, data[0], data[1], data[2], data[3]);
return;
}
@@ -319,8 +319,8 @@ adbhid_input_keycode(int id, int scancode, int repeat)
ahid->flags &= ~FLAG_CAPSLOCK_TRANSLATE;
}
} else {
-   printk(KERN_INFO "Spurious caps lock event "
-"(scancode 0xff).\n");
+   pr_info("Spurious caps lock event "
+   "(scancode 0xff).\n");
}
}
}
@@ -396,8 +396,8 @@ adbhid_input_keycode(int id, int scancode, int repeat)
input_report_key(adbhid[id]->input, key, !up_flag);
input_sync(adbhid[id]->input);
} else
-   

[GIT PULL] Please pull powerpc/linux.git powerpc-4.9-6 tag

2016-11-26 Thread Michael Ellerman
Hi Linus,

Please pull some more powerpc fixes for 4.9:

The following changes since commit cac4a185405d4415eca269cae976438b44a37ae0:

  powerpc/mm: Fix missing update of HID register on secondary CPUs (2016-11-18 
23:16:58 +1100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git powerpc-4.9-6

for you to fetch changes up to 984d7a1ec67ce3a46324fa4bcb4c745bbc266cf2:

  powerpc/mm: Fixup kernel read only mapping (2016-11-25 14:18:25 +1100)


powerpc fixes for 4.9 #6

Fixes marked for stable:
 - Set missing wakeup bit in LPCR on POWER9 (Benjamin Herrenschmidt)
 - Fix the early OPAL console wrappers (Oliver O'Halloran)
 - Fixup kernel read only mapping (Aneesh Kumar K.V)

Fixes for code merged this cycle:
 - Fix missing CRCs, add more asm-prototypes.h declarations (Nicholas Piggin)


Aneesh Kumar K.V (1):
  powerpc/mm: Fixup kernel read only mapping

Benjamin Herrenschmidt (1):
  powerpc: Set missing wakeup bit in LPCR on POWER9

Nicholas Piggin (1):
  powerpc: Fix missing CRCs, add more asm-prototypes.h declarations

Oliver O'Halloran (1):
  powerpc/boot: Fix the early OPAL console wrappers

 arch/powerpc/boot/main.c  |  8 ++--
 arch/powerpc/boot/opal-calls.S| 13 +
 arch/powerpc/boot/opal.c  | 11 +++
 arch/powerpc/boot/ops.h   |  1 +
 arch/powerpc/include/asm/asm-prototypes.h | 12 
 arch/powerpc/include/asm/mmu.h| 14 ++
 arch/powerpc/include/asm/reg.h|  1 +
 arch/powerpc/kernel/cpu_setup_power.S |  8 
 arch/powerpc/mm/hash_utils_64.c   |  8 ++--
 9 files changed, 64 insertions(+), 12 deletions(-)


signature.asc
Description: PGP signature