aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/hw_breakpoint.c3
-rw-r--r--arch/powerpc/mm/hugetlbpage-book3e.c13
-rw-r--r--drivers/misc/cxl/pci.c2
3 files changed, 16 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index 05e804cdecaa..aec9a1b1d25b 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -109,8 +109,9 @@ void arch_unregister_hw_breakpoint(struct perf_event *bp)
109 * If the breakpoint is unregistered between a hw_breakpoint_handler() 109 * If the breakpoint is unregistered between a hw_breakpoint_handler()
110 * and the single_step_dabr_instruction(), then cleanup the breakpoint 110 * and the single_step_dabr_instruction(), then cleanup the breakpoint
111 * restoration variables to prevent dangling pointers. 111 * restoration variables to prevent dangling pointers.
112 * FIXME, this should not be using bp->ctx at all! Sayeth peterz.
112 */ 113 */
113 if (bp->ctx && bp->ctx->task) 114 if (bp->ctx && bp->ctx->task && bp->ctx->task != ((void *)-1L))
114 bp->ctx->task->thread.last_hit_ubp = NULL; 115 bp->ctx->task->thread.last_hit_ubp = NULL;
115} 116}
116 117
diff --git a/arch/powerpc/mm/hugetlbpage-book3e.c b/arch/powerpc/mm/hugetlbpage-book3e.c
index 7e6d0880813f..83a8be791e06 100644
--- a/arch/powerpc/mm/hugetlbpage-book3e.c
+++ b/arch/powerpc/mm/hugetlbpage-book3e.c
@@ -8,6 +8,8 @@
8#include <linux/mm.h> 8#include <linux/mm.h>
9#include <linux/hugetlb.h> 9#include <linux/hugetlb.h>
10 10
11#include <asm/mmu.h>
12
11#ifdef CONFIG_PPC_FSL_BOOK3E 13#ifdef CONFIG_PPC_FSL_BOOK3E
12#ifdef CONFIG_PPC64 14#ifdef CONFIG_PPC64
13static inline int tlb1_next(void) 15static inline int tlb1_next(void)
@@ -60,6 +62,14 @@ static inline void book3e_tlb_lock(void)
60 unsigned long tmp; 62 unsigned long tmp;
61 int token = smp_processor_id() + 1; 63 int token = smp_processor_id() + 1;
62 64
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
63 asm volatile("1: lbarx %0, 0, %1;" 73 asm volatile("1: lbarx %0, 0, %1;"
64 "cmpwi %0, 0;" 74 "cmpwi %0, 0;"
65 "bne 2f;" 75 "bne 2f;"
@@ -80,6 +90,9 @@ static inline void book3e_tlb_unlock(void)
80{ 90{
81 struct paca_struct *paca = get_paca(); 91 struct paca_struct *paca = get_paca();
82 92
93 if (!cpu_has_feature(CPU_FTR_SMT))
94 return;
95
83 isync(); 96 isync();
84 paca->tcd_ptr->lock = 0; 97 paca->tcd_ptr->lock = 0;
85} 98}
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index 4c1903f781fc..0c6c17a1c59e 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -415,7 +415,7 @@ static int cxl_setup_psl_timebase(struct cxl *adapter, struct pci_dev *dev)
415 delta = mftb() - psl_tb; 415 delta = mftb() - psl_tb;
416 if (delta < 0) 416 if (delta < 0)
417 delta = -delta; 417 delta = -delta;
418 } while (cputime_to_usecs(delta) > 16); 418 } while (tb_to_ns(delta) > 16000);
419 419
420 return 0; 420 return 0;
421} 421}