Skip to content

Commit d9d0452

Browse files
committed
Merge tag 'powerpc-4.9-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "Four fixes, the first for code we merged this cycle and three that are also going to stable: - On 64-bit Book3E we were not placing the .text section where we said we would in the asm. - We broke building the boot wrapper on some 32-bit toolchains. - Lazy icache flushing was broken on pre-POWER5 machines. - One of the error paths in our EEH code would lead to a deadlock. Thanks to: Andrew Donnellan, Ben Hutchings, Benjamin Herrenschmidt, Nicholas Piggin" * tag 'powerpc-4.9-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/64: Fix placement of .text to be immediately following .head.text powerpc/eeh: Fix deadlock when PE frozen state can't be cleared powerpc/mm: Fix lazy icache flush on pre-POWER5 powerpc/boot: Fix build failure in 32-bit boot wrapper
2 parents ef3263e + dadc4a1 commit d9d0452

6 files changed

Lines changed: 18 additions & 6 deletions

File tree

arch/powerpc/boot/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ src-wlib-y := string.S crt0.S crtsavres.S stdio.c decompress.c main.c \
100100
ns16550.c serial.c simple_alloc.c div64.S util.S \
101101
elf_util.c $(zlib-y) devtree.c stdlib.c \
102102
oflib.c ofconsole.c cuboot.c mpsc.c cpm-serial.c \
103-
uartlite.c mpc52xx-psc.c opal.c opal-calls.S
103+
uartlite.c mpc52xx-psc.c opal.c
104+
src-wlib-$(CONFIG_PPC64_BOOT_WRAPPER) += opal-calls.S
104105
src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c
105106
src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
106107
src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c fsl-soc.c

arch/powerpc/boot/opal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <libfdt.h>
1414
#include "../include/asm/opal-api.h"
1515

16-
#ifdef __powerpc64__
16+
#ifdef CONFIG_PPC64_BOOT_WRAPPER
1717

1818
/* Global OPAL struct used by opal-call.S */
1919
struct opal {

arch/powerpc/kernel/eeh_driver.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,10 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus,
671671

672672
/* Clear frozen state */
673673
rc = eeh_clear_pe_frozen_state(pe, false);
674-
if (rc)
674+
if (rc) {
675+
pci_unlock_rescan_remove();
675676
return rc;
677+
}
676678

677679
/* Give the system 5 seconds to finish running the user-space
678680
* hotplug shutdown scripts, e.g. ifdown for ethernet. Yes,

arch/powerpc/kernel/vmlinux.lds.S

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,17 @@ SECTIONS
9494
* detected, and will result in a crash at boot due to offsets being
9595
* wrong.
9696
*/
97+
#ifdef CONFIG_PPC64
98+
/*
99+
* BLOCK(0) overrides the default output section alignment because
100+
* this needs to start right after .head.text in order for fixed
101+
* section placement to work.
102+
*/
103+
.text BLOCK(0) : AT(ADDR(.text) - LOAD_OFFSET) {
104+
#else
97105
.text : AT(ADDR(.text) - LOAD_OFFSET) {
98106
ALIGN_FUNCTION();
107+
#endif
99108
/* careful! __ftr_alt_* sections need to be close to .text */
100109
*(.text .fixup __ftr_alt_* .ref.text)
101110
SCHED_TEXT

arch/powerpc/mm/hash64_4k.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int __hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
5555
*/
5656
rflags = htab_convert_pte_flags(new_pte);
5757

58-
if (!cpu_has_feature(CPU_FTR_NOEXECUTE) &&
58+
if (cpu_has_feature(CPU_FTR_NOEXECUTE) &&
5959
!cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
6060
rflags = hash_page_do_lazy_icache(rflags, __pte(old_pte), trap);
6161

arch/powerpc/mm/hash64_64k.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ int __hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
8787
subpg_pte = new_pte & ~subpg_prot;
8888
rflags = htab_convert_pte_flags(subpg_pte);
8989

90-
if (!cpu_has_feature(CPU_FTR_NOEXECUTE) &&
90+
if (cpu_has_feature(CPU_FTR_NOEXECUTE) &&
9191
!cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) {
9292

9393
/*
@@ -258,7 +258,7 @@ int __hash_page_64K(unsigned long ea, unsigned long access,
258258

259259
rflags = htab_convert_pte_flags(new_pte);
260260

261-
if (!cpu_has_feature(CPU_FTR_NOEXECUTE) &&
261+
if (cpu_has_feature(CPU_FTR_NOEXECUTE) &&
262262
!cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
263263
rflags = hash_page_do_lazy_icache(rflags, __pte(old_pte), trap);
264264

0 commit comments

Comments
 (0)