Skip to content

Commit b8155fe

Browse files
committed
Merge tag 'powerpc-4.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - cxl: Fix PSL timebase synchronization detection from Frederic Barrat - Fix oops when destroying hw_breakpoint event from Ravi Bangoria - Avoid lbarx on e5500 from Scott Wood * tag 'powerpc-4.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/fsl-book3e: Avoid lbarx on e5500 powerpc/hw_breakpoint: Fix oops when destroying hw_breakpoint event cxl: Fix PSL timebase synchronization detection
2 parents 7addb7f + 37c5e94 commit b8155fe

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

arch/powerpc/kernel/hw_breakpoint.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ void arch_unregister_hw_breakpoint(struct perf_event *bp)
109109
* If the breakpoint is unregistered between a hw_breakpoint_handler()
110110
* and the single_step_dabr_instruction(), then cleanup the breakpoint
111111
* restoration variables to prevent dangling pointers.
112+
* FIXME, this should not be using bp->ctx at all! Sayeth peterz.
112113
*/
113-
if (bp->ctx && bp->ctx->task)
114+
if (bp->ctx && bp->ctx->task && bp->ctx->task != ((void *)-1L))
114115
bp->ctx->task->thread.last_hit_ubp = NULL;
115116
}
116117

arch/powerpc/mm/hugetlbpage-book3e.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include <linux/mm.h>
99
#include <linux/hugetlb.h>
1010

11+
#include <asm/mmu.h>
12+
1113
#ifdef CONFIG_PPC_FSL_BOOK3E
1214
#ifdef CONFIG_PPC64
1315
static inline int tlb1_next(void)
@@ -60,6 +62,14 @@ static inline void book3e_tlb_lock(void)
6062
unsigned long tmp;
6163
int token = smp_processor_id() + 1;
6264

65+
/*
66+
* Besides being unnecessary in the absence of SMT, this
67+
* check prevents trying to do lbarx/stbcx. on e5500 which
68+
* doesn't implement either feature.
69+
*/
70+
if (!cpu_has_feature(CPU_FTR_SMT))
71+
return;
72+
6373
asm volatile("1: lbarx %0, 0, %1;"
6474
"cmpwi %0, 0;"
6575
"bne 2f;"
@@ -80,6 +90,9 @@ static inline void book3e_tlb_unlock(void)
8090
{
8191
struct paca_struct *paca = get_paca();
8292

93+
if (!cpu_has_feature(CPU_FTR_SMT))
94+
return;
95+
8396
isync();
8497
paca->tcd_ptr->lock = 0;
8598
}

drivers/misc/cxl/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static int cxl_setup_psl_timebase(struct cxl *adapter, struct pci_dev *dev)
415415
delta = mftb() - psl_tb;
416416
if (delta < 0)
417417
delta = -delta;
418-
} while (cputime_to_usecs(delta) > 16);
418+
} while (tb_to_ns(delta) > 16000);
419419

420420
return 0;
421421
}

0 commit comments

Comments
 (0)