linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
To: benh@kernel.crashing.org, mpe@ellerman.id.au, anton@samba.org,
	paulus@samba.org
Cc: linuxppc-dev@lists.ozlabs.org,
	Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Subject: [RFC PATCH 6/9] powerpc: modify __SOFTEN_TEST to support tri-state soft_enabled flag
Date: Mon, 25 Jul 2016 20:22:19 +0530	[thread overview]
Message-ID: <1469458342-26233-7-git-send-email-maddy@linux.vnet.ibm.com> (raw)
In-Reply-To: <1469458342-26233-1-git-send-email-maddy@linux.vnet.ibm.com>

Foundation patch to support checking of new flag for "paca->soft_enabled".
Modify the condition checking for the "soft_enabled" from "equal" to
"greater than or equal to".

Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/exception-64s.h | 2 +-
 arch/powerpc/include/asm/hw_irq.h        | 4 ++--
 arch/powerpc/include/asm/irqflags.h      | 2 +-
 arch/powerpc/kernel/entry_64.S           | 4 ++--
 arch/powerpc/kernel/irq.c                | 4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index e24e63d216c4..44d3f539d8a5 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -408,7 +408,7 @@ label##_relon_hv:						\
 	lbz	r10,PACASOFTIRQEN(r13);					\
 	cmpwi	r10,LAZY_INTERRUPT_DISABLED;				\
 	li	r10,SOFTEN_VALUE_##vec;					\
-	beq	masked_##h##interrupt
+	bge	masked_##h##interrupt
 #define _SOFTEN_TEST(h, vec)	__SOFTEN_TEST(h, vec)
 
 #define SOFTEN_TEST_PR(vec)						\
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 2b87930e0e82..b7c7f1c6706f 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -94,7 +94,7 @@ static inline unsigned long arch_local_irq_save(void)
 
 static inline bool arch_irqs_disabled_flags(unsigned long flags)
 {
-	return flags == LAZY_INTERRUPT_DISABLED;
+	return flags >= LAZY_INTERRUPT_DISABLED;
 }
 
 static inline bool arch_irqs_disabled(void)
@@ -139,7 +139,7 @@ static inline void may_hard_irq_enable(void)
 
 static inline bool arch_irq_disabled_regs(struct pt_regs *regs)
 {
-	return (regs->softe == LAZY_INTERRUPT_DISABLED);
+	return (regs->softe >= LAZY_INTERRUPT_DISABLED);
 }
 
 extern bool prep_irq_for_idle(void);
diff --git a/arch/powerpc/include/asm/irqflags.h b/arch/powerpc/include/asm/irqflags.h
index 6091e46f2455..235055fabf65 100644
--- a/arch/powerpc/include/asm/irqflags.h
+++ b/arch/powerpc/include/asm/irqflags.h
@@ -52,7 +52,7 @@
 	li	__rA,LAZY_INTERRUPT_DISABLED;	\
 	ori	__rB,__rB,PACA_IRQ_HARD_DIS;	\
 	stb	__rB,PACAIRQHAPPENED(r13);	\
-	beq	44f;				\
+	bge	44f;				\
 	stb	__rA,PACASOFTIRQEN(r13);	\
 	TRACE_DISABLE_INTS;			\
 44:
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index cade169a7517..7ab6bfff653e 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -766,7 +766,7 @@ restore:
 	ld	r5,SOFTE(r1)
 	lbz	r6,PACASOFTIRQEN(r13)
 	cmpwi	cr0,r5,LAZY_INTERRUPT_DISABLED
-	beq	restore_irq_off
+	bge	restore_irq_off
 
 	/* We are enabling, were we already enabled ? Yes, just return */
 	cmpwi	cr0,r6,LAZY_INTERRUPT_ENABLED
@@ -1012,7 +1012,7 @@ _GLOBAL(enter_rtas)
 	 * check it with the asm equivalent of WARN_ON
 	 */
 	lbz	r0,PACASOFTIRQEN(r13)
-1:	tdnei	r0,LAZY_INTERRUPT_DISABLED
+1:	tdeqi	r0,LAZY_INTERRUPT_ENABLED
 	EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,BUGFLAG_WARNING
 #endif
 	
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 9b9b6df8d83d..597c20d1814c 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -202,7 +202,7 @@ notrace void arch_local_irq_restore(unsigned long en)
 
 	/* Write the new soft-enabled value */
 	set_soft_enabled(en);
-	if (en == LAZY_INTERRUPT_DISABLED)
+	if (en >= LAZY_INTERRUPT_DISABLED)
 		return;
 	/*
 	 * From this point onward, we can take interrupts, preempt,
@@ -247,7 +247,7 @@ notrace void arch_local_irq_restore(unsigned long en)
 	}
 #endif /* CONFIG_TRACE_IRQFLAG */
 
-	set_soft_enabled(LAZY_INTERRUPT_DISABLED);
+	set_soft_enabled(en);
 
 	/*
 	 * Check if anything needs to be re-emitted. We haven't
-- 
2.7.4

  parent reply	other threads:[~2016-07-25 14:53 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-25 14:52 [RFC PATCH 0/9]powerpc: "paca->soft_enabled" based local atomic operation implementation Madhavan Srinivasan
2016-07-25 14:52 ` [RFC PATCH 1/9] Add #defs for paca->soft_enabled flags Madhavan Srinivasan
2016-07-26  5:27   ` Nicholas Piggin
2016-07-26  6:05     ` Madhavan Srinivasan
2016-07-26  6:13       ` Nicholas Piggin
2016-07-28 13:54       ` Nicholas Piggin
2016-07-25 14:52 ` [RFC PATCH 2/9] Cleanup to use LAZY_INTERRUPT_* macros for paca->soft_enabled update Madhavan Srinivasan
2016-07-25 14:52 ` [RFC PATCH 3/9] powerpc: move set_soft_enabled() Madhavan Srinivasan
2016-07-25 14:52 ` [RFC PATCH 4/9] powerpc: Use set_soft_enabled api to update paca->soft_enabled Madhavan Srinivasan
2016-07-25 14:52 ` [RFC PATCH 5/9] powerpc: reverse the soft_enable logic Madhavan Srinivasan
2016-07-26  5:31   ` Nicholas Piggin
2016-07-26  6:07     ` Madhavan Srinivasan
2016-07-25 14:52 ` Madhavan Srinivasan [this message]
2016-07-26  5:41   ` [RFC PATCH 6/9] powerpc: modify __SOFTEN_TEST to support tri-state soft_enabled flag Nicholas Piggin
2016-07-26  6:12     ` Madhavan Srinivasan
2016-07-25 14:52 ` [RFC PATCH 7/9] powerpc: Add support to mask perf interrupts Madhavan Srinivasan
2016-07-26  5:46   ` Nicholas Piggin
2016-07-26  6:25     ` Madhavan Srinivasan
2016-07-26  6:30       ` Nicholas Piggin
2016-07-26  6:46         ` Madhavan Srinivasan
2016-07-26  7:10           ` Nicholas Piggin
2016-07-26  7:22             ` Madhavan Srinivasan
2016-07-26  7:34               ` Nicholas Piggin
2016-07-25 14:52 ` [RFC PATCH 8/9] powerpc: Support to replay PMIs Madhavan Srinivasan
2016-07-26  5:50   ` Nicholas Piggin
2016-07-26  6:40     ` Madhavan Srinivasan
2016-07-25 14:52 ` [RFC PATCH 9/9] powerpc: rewrite local_t using soft_irq Madhavan Srinivasan
2016-07-26  5:53   ` Nicholas Piggin
2016-07-26  6:41     ` Madhavan Srinivasan
2016-07-26 12:21 ` [RFC PATCH 0/9]powerpc: "paca->soft_enabled" based local atomic operation implementation Benjamin Herrenschmidt
2016-07-26 13:42   ` Madhavan Srinivasan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469458342-26233-7-git-send-email-maddy@linux.vnet.ibm.com \
    --to=maddy@linux.vnet.ibm.com \
    --cc=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).