Commit fc8a898c authored by Michael Ellerman's avatar Michael Ellerman
Browse files

Merge branch 'fixes' into next

Merge our fixes branch to bring in some changes that conflict with
upcoming next content.
parents 544f823e 2ea31e2e
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -163,7 +163,6 @@ config PPC
	select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
	select ARCH_WANT_LD_ORPHAN_WARN
	select ARCH_WANTS_MODULES_DATA_IN_VMALLOC	if PPC_BOOK3S_32 || PPC_8xx
	select ARCH_WANTS_NO_INSTR
	select ARCH_WEAK_RELEASE_ACQUIRE
	select BINFMT_ELF
	select BUILDTIME_TABLE_SORT
+4 −0
Original line number Diff line number Diff line
@@ -210,6 +210,10 @@ ld_version()
	gsub(".*version ", "");
	gsub("-.*", "");
	split($1,a, ".");
	if( length(a[3]) == "8" )
		# a[3] is probably a date of format yyyymmdd used for release snapshots. We
		# can assume it to be zero as it does not signify a new version as such.
		a[3] = 0;
	print a[1]*100000000 + a[2]*1000000 + a[3]*10000;
	exit
    }'
+2 −0
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@ static inline void tlb_flush(struct mmu_gather *tlb)
{
	if (radix_enabled())
		radix__tlb_flush(tlb);

	return hash__tlb_flush(tlb);
}

#ifdef CONFIG_SMP
+30 −13
Original line number Diff line number Diff line
@@ -175,6 +175,15 @@ static inline notrace unsigned long irq_soft_mask_or_return(unsigned long mask)
	return flags;
}

static inline notrace unsigned long irq_soft_mask_andc_return(unsigned long mask)
{
	unsigned long flags = irq_soft_mask_return();

	irq_soft_mask_set(flags & ~mask);

	return flags;
}

static inline unsigned long arch_local_save_flags(void)
{
	return irq_soft_mask_return();
@@ -194,7 +203,7 @@ static inline void arch_local_irq_enable(void)

static inline unsigned long arch_local_irq_save(void)
{
	return irq_soft_mask_set_return(IRQS_DISABLED);
	return irq_soft_mask_or_return(IRQS_DISABLED);
}

static inline bool arch_irqs_disabled_flags(unsigned long flags)
@@ -333,10 +342,11 @@ bool power_pmu_wants_prompt_pmi(void);
 * is a different soft-masked interrupt pending that requires hard
 * masking.
 */
static inline bool should_hard_irq_enable(void)
static inline bool should_hard_irq_enable(struct pt_regs *regs)
{
	if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG)) {
		WARN_ON(irq_soft_mask_return() == IRQS_ENABLED);
		WARN_ON(irq_soft_mask_return() != IRQS_ALL_DISABLED);
		WARN_ON(!(get_paca()->irq_happened & PACA_IRQ_HARD_DIS));
		WARN_ON(mfmsr() & MSR_EE);
	}

@@ -349,8 +359,17 @@ static inline bool should_hard_irq_enable(void)
	 *
	 * TODO: Add test for 64e
	 */
	if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) && !power_pmu_wants_prompt_pmi())
	if (IS_ENABLED(CONFIG_PPC_BOOK3S_64)) {
		if (!power_pmu_wants_prompt_pmi())
			return false;
		/*
		 * If PMIs are disabled then IRQs should be disabled as well,
		 * so we shouldn't see this condition, check for it just in
		 * case because we are about to enable PMIs.
		 */
		if (WARN_ON_ONCE(regs->softe & IRQS_PMI_DISABLED))
			return false;
	}

	if (get_paca()->irq_happened & PACA_IRQ_MUST_HARD_MASK)
		return false;
@@ -360,18 +379,16 @@ static inline bool should_hard_irq_enable(void)

/*
 * Do the hard enabling, only call this if should_hard_irq_enable is true.
 * This allows PMI interrupts to profile irq handlers.
 */
static inline void do_hard_irq_enable(void)
{
	if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG)) {
		WARN_ON(irq_soft_mask_return() == IRQS_ENABLED);
		WARN_ON(get_paca()->irq_happened & PACA_IRQ_MUST_HARD_MASK);
		WARN_ON(mfmsr() & MSR_EE);
	}
	/*
	 * This allows PMI interrupts (and watchdog soft-NMIs) through.
	 * There is no other reason to enable this way.
	 * Asynch interrupts come in with IRQS_ALL_DISABLED,
	 * PACA_IRQ_HARD_DIS, and MSR[EE]=0.
	 */
	if (IS_ENABLED(CONFIG_PPC_BOOK3S_64))
		irq_soft_mask_andc_return(IRQS_PMI_DISABLED);
	get_paca()->irq_happened &= ~PACA_IRQ_HARD_DIS;
	__hard_irq_enable();
}
@@ -454,7 +471,7 @@ static inline bool arch_irq_disabled_regs(struct pt_regs *regs)
	return !(regs->msr & MSR_EE);
}

static __always_inline bool should_hard_irq_enable(void)
static __always_inline bool should_hard_irq_enable(struct pt_regs *regs)
{
	return false;
}
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ struct imc_pmu {
 * are inited.
 */
struct imc_pmu_ref {
	struct mutex lock;
	spinlock_t lock;
	unsigned int id;
	int refc;
};
Loading