* [PATCH v3 3/5] dt/powerpc/sysdev: Use of_get_child_by_name to get a named child.
From: Srinivas KANDAGATLA @ 2012-09-17 8:57 UTC (permalink / raw)
To: benh; +Cc: robherring2, devicetree-discuss, linuxppc-dev,
srinivas.kandagatla
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
As follow-up to "dt: introduce of_get_child_by_name to get child node by
name." patch, This patch removes some of the code duplication in the
driver by replacing it with of_get_child_by_name instead.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
arch/powerpc/sysdev/qe_lib/qe.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index b043675..d094e51 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -568,10 +568,7 @@ struct qe_firmware_info *qe_get_firmware_info(void)
}
/* Find the 'firmware' child node */
- for_each_child_of_node(qe, fw) {
- if (strcmp(fw->name, "firmware") == 0)
- break;
- }
+ fw = of_get_child_by_name(qe, "firmware");
of_node_put(qe);
--
1.7.0.4
^ permalink raw reply related
* [v5][PATCH 1/3] powerpc/kprobe: introduce a new thread flag
From: Tiejun Chen @ 2012-09-17 9:54 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
We need to add a new thread flag, TIF_EMULATE_STACK_STORE,
for emulating stack store operation while exiting exception.
Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
arch/powerpc/include/asm/thread_info.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index e942203..8ceea14 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -104,6 +104,8 @@ static inline struct thread_info *current_thread_info(void)
#define TIF_NOTIFY_RESUME 13 /* callback before returning to user */
#define TIF_UPROBE 14 /* breakpointed or single-stepping */
#define TIF_SYSCALL_TRACEPOINT 15 /* syscall tracepoint instrumentation */
+#define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation
+ for stack store? */
/* as above, but as bit values */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -121,6 +123,7 @@ static inline struct thread_info *current_thread_info(void)
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
#define _TIF_UPROBE (1<<TIF_UPROBE)
#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
+#define _TIF_EMULATE_STACK_STORE (1<<TIF_EMULATE_STACK_STORE)
#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
_TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)
--
1.7.9.5
^ permalink raw reply related
* [v5][PATCH 2/3] powerpc/kprobe: complete kprobe and migrate exception frame
From: Tiejun Chen @ 2012-09-17 9:54 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <1347875671-15838-1-git-send-email-tiejun.chen@windriver.com>
We can't emulate stwu since that may corrupt current exception stack.
So we will have to do real store operation in the exception return code.
Firstly we'll allocate a trampoline exception frame below the kprobed
function stack and copy the current exception frame to the trampoline.
Then we can do this real store operation to implement 'stwu', and reroute
the trampoline frame to r1 to complete this exception migration.
Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
v5:
* Simplify copy operation
arch/powerpc/kernel/entry_32.S | 49 +++++++++++++++++++++++++++++++++++-----
arch/powerpc/kernel/entry_64.S | 37 ++++++++++++++++++++++++++++++
2 files changed, 80 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index ead5016..d27fe36 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -831,19 +831,58 @@ restore_user:
bnel- load_dbcr0
#endif
-#ifdef CONFIG_PREEMPT
b restore
/* N.B. the only way to get here is from the beq following ret_from_except. */
resume_kernel:
- /* check current_thread_info->preempt_count */
+ /* check current_thread_info, _TIF_EMULATE_STACK_STORE */
CURRENT_THREAD_INFO(r9, r1)
+ lwz r8,TI_FLAGS(r9)
+ andis. r8,r8,_TIF_EMULATE_STACK_STORE@h
+ beq+ 1f
+
+ addi r8,r1,INT_FRAME_SIZE /* Get the kprobed function entry */
+
+ lwz r3,GPR1(r1)
+ subi r3,r3,INT_FRAME_SIZE /* dst: Allocate a trampoline exception frame */
+ mr r4,r1 /* src: current exception frame */
+ li r5,INT_FRAME_SIZE /* size: INT_FRAME_SIZE */
+ li r6,0 /* start offset: 0 */
+ mr r1,r3 /* Reroute the trampoline frame to r1 */
+
+ /* Copy from the original to the trampoline. */
+ li r6,0
+ srwi r5,r5,2
+ mtctr r5
+2: lwzx r0,r6,r4
+ stwx r0,r6,r3
+ addi r6,r6,4
+ bdnz 2b
+
+ /* Do real store operation to complete stwu */
+ lwz r5,GPR1(r1)
+ stw r8,0(r5)
+
+ /* Clear _TIF_EMULATE_STACK_STORE flag */
+ lis r11,_TIF_EMULATE_STACK_STORE@h
+ addi r5,r9,TI_FLAGS
+0: lwarx r8,0,r5
+ andc r8,r8,r11
+#ifdef CONFIG_IBM405_ERR77
+ dcbt 0,r5
+#endif
+ stwcx. r8,0,r5
+ bne- 0b
+1:
+
+#ifdef CONFIG_PREEMPT
+ /* check current_thread_info->preempt_count */
lwz r0,TI_PREEMPT(r9)
cmpwi 0,r0,0 /* if non-zero, just restore regs and return */
bne restore
- lwz r0,TI_FLAGS(r9)
- andi. r0,r0,_TIF_NEED_RESCHED
+ andi. r8,r8,_TIF_NEED_RESCHED
beq+ restore
+ lwz r3,_MSR(r1)
andi. r0,r3,MSR_EE /* interrupts off? */
beq restore /* don't schedule if so */
#ifdef CONFIG_TRACE_IRQFLAGS
@@ -864,8 +903,6 @@ resume_kernel:
*/
bl trace_hardirqs_on
#endif
-#else
-resume_kernel:
#endif /* CONFIG_PREEMPT */
/* interrupts are hard-disabled at this point */
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index b40e0b4..bdd2dc1 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -593,6 +593,43 @@ _GLOBAL(ret_from_except_lite)
b .ret_from_except
resume_kernel:
+ /* check current_thread_info, _TIF_EMULATE_STACK_STORE */
+ CURRENT_THREAD_INFO(r9, r1)
+ ld r8,TI_FLAGS(r9)
+ andis. r8,r8,_TIF_EMULATE_STACK_STORE@h
+ beq+ 1f
+
+ addi r8,r1,INT_FRAME_SIZE /* Get the kprobed function entry */
+
+ lwz r3,GPR1(r1)
+ subi r3,r3,INT_FRAME_SIZE /* dst: Allocate a trampoline exception frame */
+ mr r4,r1 /* src: current exception frame */
+ li r5,INT_FRAME_SIZE /* size: INT_FRAME_SIZE */
+ li r6,0 /* start offset: 0 */
+ mr r1,r3 /* Reroute the trampoline frame to r1 */
+
+ /* Copy from the original to the trampoline. */
+ li r6,0
+ srwi r5,r5,3
+ mtctr r5
+2: ldx r0,r6,r4
+ stdx r0,r6,r3
+ addi r6,r6,8
+ bdnz 2b
+
+ /* Do real store operation to complete stwu */
+ lwz r5,GPR1(r1)
+ std r8,0(r5)
+
+ /* Clear _TIF_EMULATE_STACK_STORE flag */
+ lis r11,_TIF_EMULATE_STACK_STORE@h
+ addi r5,r9,TI_FLAGS
+ ldarx r4,0,r5
+ andc r4,r4,r11
+ stdcx. r4,0,r5
+ bne- 0b
+1:
+
#ifdef CONFIG_PREEMPT
/* Check if we need to preempt */
andi. r0,r4,_TIF_NEED_RESCHED
--
1.7.9.5
^ permalink raw reply related
* [v5][PATCH 3/3] powerpc/kprobe: don't emulate store when kprobe stwu r1
From: Tiejun Chen @ 2012-09-17 9:54 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <1347875671-15838-1-git-send-email-tiejun.chen@windriver.com>
We don't do the real store operation for kprobing 'stwu Rx,(y)R1'
since this may corrupt the exception frame, now we will do this
operation safely in exception return code after migrate current
exception frame below the kprobed function stack.
So we only update gpr[1] here and trigger a thread flag to mask
this.
Note we should make sure if we trigger kernel stack over flow.
Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
arch/powerpc/lib/sstep.c | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 9a52349..e15c521 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -566,7 +566,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
unsigned long int ea;
unsigned int cr, mb, me, sh;
int err;
- unsigned long old_ra;
+ unsigned long old_ra, val3;
long ival;
opcode = instr >> 26;
@@ -1486,11 +1486,43 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
goto ldst_done;
case 36: /* stw */
- case 37: /* stwu */
val = regs->gpr[rd];
err = write_mem(val, dform_ea(instr, regs), 4, regs);
goto ldst_done;
+ case 37: /* stwu */
+ val = regs->gpr[rd];
+ val3 = dform_ea(instr, regs);
+ /*
+ * For PPC32 we always use stwu to change stack point with r1. So
+ * this emulated store may corrupt the exception frame, now we
+ * have to provide the exception frame trampoline, which is pushed
+ * below the kprobed function stack. So we only update gpr[1] but
+ * don't emulate the real store operation. We will do real store
+ * operation safely in exception return code by checking this flag.
+ */
+ if ((ra == 1) && !(regs->msr & MSR_PR) \
+ && (val3 >= (regs->gpr[1] - STACK_INT_FRAME_SIZE))) {
+ /*
+ * Check if we will touch kernel sack overflow
+ */
+ if (val3 - STACK_INT_FRAME_SIZE <= current->thread.ksp_limit) {
+ printk(KERN_CRIT "Can't kprobe this since Kernel stack overflow.\n");
+ err = -EINVAL;
+ break;
+ }
+
+ /*
+ * Check if we already set since that means we'll
+ * lose the previous value.
+ */
+ WARN_ON(test_thread_flag(TIF_EMULATE_STACK_STORE));
+ set_thread_flag(TIF_EMULATE_STACK_STORE);
+ err = 0;
+ } else
+ err = write_mem(val, val3, 4, regs);
+ goto ldst_done;
+
case 38: /* stb */
case 39: /* stbu */
val = regs->gpr[rd];
--
1.7.9.5
^ permalink raw reply related
* RE: [v5][PATCH 2/3] powerpc/kprobe: complete kprobe and migrate exception frame
From: David Laight @ 2012-09-17 10:02 UTC (permalink / raw)
To: Tiejun Chen, benh; +Cc: linuxppc-dev
In-Reply-To: <1347875671-15838-2-git-send-email-tiejun.chen@windriver.com>
> /* N.B. the only way to get here is from the beq following =
ret_from_except. */
> resume_kernel:
> - /* check current_thread_info->preempt_count */
> + /* check current_thread_info, _TIF_EMULATE_STACK_STORE */
> CURRENT_THREAD_INFO(r9, r1)
> + lwz r8,TI_FLAGS(r9)
> + andis. r8,r8,_TIF_EMULATE_STACK_STORE@h
> + beq+ 1f
...
> +1:
Does this add a statically mispredicted branch to every
return to userspace ?
Or is there an earlier check for 'unlikely' conditions.
David
^ permalink raw reply
* Re: [v5][PATCH 2/3] powerpc/kprobe: complete kprobe and migrate exception frame
From: tiejun.chen @ 2012-09-17 10:19 UTC (permalink / raw)
To: David Laight; +Cc: linuxppc-dev
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B6FF1@saturn3.aculab.com>
On 09/17/2012 06:02 PM, David Laight wrote:
>> /* N.B. the only way to get here is from the beq following ret_from_except. */
>> resume_kernel:
>> - /* check current_thread_info->preempt_count */
>> + /* check current_thread_info, _TIF_EMULATE_STACK_STORE */
>> CURRENT_THREAD_INFO(r9, r1)
>> + lwz r8,TI_FLAGS(r9)
>> + andis. r8,r8,_TIF_EMULATE_STACK_STORE@h
>> + beq+ 1f
> ...
>> +1:
>
> Does this add a statically mispredicted branch to every
> return to userspace ?
Return usersapce? No, this is just follow 'resume_kernel'.
Note I add this 'unlikely' here since I assume often Kprobe is always disabled
by default and especially its also rare to kprobe 'stwu' in many kprobe cases.
Tiejun
^ permalink raw reply
* RE: [PATCH] edac/85xx: fix error handle of mpc85xx_mc_err_probe
From: Xie Shaohui-B21989 @ 2012-09-17 10:32 UTC (permalink / raw)
To: Shaun Ruffell
Cc: avorontsov@mvista.com, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org,
linux-edac@vger.kernel.org
In-Reply-To: <20120914182137.GD18672@digium.com>
> -----Original Message-----
> From: Shaun Ruffell [mailto:sruffell@digium.com]
> Sent: Saturday, September 15, 2012 2:22 AM
> To: Xie Shaohui-B21989
> Cc: linux-edac@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
> akpm@linux-foundation.org; avorontsov@mvista.com; linux-
> kernel@vger.kernel.org; grant.likely@secretlab.ca
> Subject: Re: [PATCH] edac/85xx: fix error handle of mpc85xx_mc_err_probe
>=20
> On Thu, Sep 13, 2012 at 06:55:29PM +0800, Shaohui Xie wrote:
> > Error handle in case of DDR ECC off is wrong, sysfs entries have not
> > been created, so edac_mc_free which frees a mci instance should not be
> called.
> > Also, free mci's memory in this case.
>=20
> Jus FYI: I ran into the same error in edac_mc_free() which I resolved in
> a slightly different way in some patches I sent previously. [1]
>=20
> [1] https://lkml.org/lkml/2012/9/14/475
[S.H] Thanks! I did not aware of this patch when one of my colleague asked =
me to have a look at the issue,
It could save me some time if I saw this patch earlier. :(
BTW: seems you are using a different kernel tree with mine.
Best Regards,=20
Shaohui Xie
^ permalink raw reply
* [RESEND PATCH v3 0/5] Introduce of_get_child_by_name.
From: Srinivas KANDAGATLA @ 2012-09-17 11:58 UTC (permalink / raw)
To: robherring2, bergner, devicetree-discuss
Cc: kgene.kim, srinivas.kandagatla, broonie, afleming, ben-linux,
linuxppc-dev
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
This patch series introduces of_get_child_by_name function to get a
child node by its name in a given parent node and also removes code
duplication in some of the existing driver code by using of_get_child_by_name.
Normally if a driver want to get a child node it would iterate all the nodes
of parent and compare its name and then get it.
This use case is becoming common as device trees are used more, so moving this
functionality to a libary function makes sense.
Having of_get_child_by_name libary function would avoid code duplication,
errors, proper reference counting and is more convenient.
Changes from v2:
- Fixed typo errors.
- Removed bogus patches which used "type" instead of "name"
- Fixed reference counting in follow-up patches.
Changes from v1:
-rename of_get_child to of_get_child_by_name.
-remove read lock in of_get_child_by_name.
-make use of of_get_child_by_name in the existing kernel code.
Srinivas Kandagatla (5):
dt: introduce of_get_child_by_name to get child node by name.
dt/powerpc/powernv: Use of_get_child_by_name to get a named child.
dt/powerpc/sysdev: Use of_get_child_by_name to get a named child.
dt/s3c64xx/spi: Use of_get_child_by_name to get a named child.
dt/tty/opal: Use of_get_child_by_name to get a named child.
arch/powerpc/platforms/powernv/opal.c | 6 +++---
arch/powerpc/sysdev/qe_lib/qe.c | 5 +----
drivers/of/base.c | 25 +++++++++++++++++++++++++
drivers/spi/spi-s3c64xx.c | 7 ++++---
drivers/tty/hvc/hvc_opal.c | 9 ++-------
include/linux/of.h | 2 ++
6 files changed, 37 insertions(+), 17 deletions(-)
^ permalink raw reply
* [RESEND PATCH v3 1/5] dt: introduce of_get_child_by_name to get child node by name.
From: Srinivas KANDAGATLA @ 2012-09-17 11:58 UTC (permalink / raw)
To: robherring2, bergner, devicetree-discuss
Cc: kgene.kim, srinivas.kandagatla, broonie, afleming, ben-linux,
linuxppc-dev
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
This patch introduces of_get_child_by_name function to get a child node
by its name in a given parent node.
Without this patch each driver code has to iterate the parent and do
a string compare, However having of_get_child_by_name libary function would
avoid code duplication, errors and is more convenient.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
drivers/of/base.c | 25 +++++++++++++++++++++++++
include/linux/of.h | 2 ++
2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index d4a1c9a..7391f8a 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -391,6 +391,31 @@ struct device_node *of_get_next_available_child(const struct device_node *node,
EXPORT_SYMBOL(of_get_next_available_child);
/**
+ * of_get_child_by_name - Find the child node by name for a given parent
+ * @node: parent node
+ * @name: child name to look for.
+ *
+ * This function looks for child node for given matching name
+ *
+ * Returns a node pointer if found, with refcount incremented, use
+ * of_node_put() on it when done.
+ * Returns NULL if node is not found.
+ */
+
+struct device_node *of_get_child_by_name(const struct device_node *node,
+ const char *name)
+{
+ struct device_node *child;
+
+ for_each_child_of_node(node, child)
+ if (child->name && (of_node_cmp(child->name, name) == 0)
+ && of_node_get(child))
+ break;
+ return child;
+}
+EXPORT_SYMBOL(of_get_child_by_name);
+
+/**
* of_find_node_by_path - Find a node matching a full OF path
* @path: The full path to match
*
diff --git a/include/linux/of.h b/include/linux/of.h
index 1b11632..7b8e3cd 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -192,6 +192,8 @@ extern struct device_node *of_get_next_child(const struct device_node *node,
struct device_node *prev);
extern struct device_node *of_get_next_available_child(
const struct device_node *node, struct device_node *prev);
+extern struct device_node *of_get_child_by_name(const struct device_node *node,
+ const char *name);
#define for_each_child_of_node(parent, child) \
for (child = of_get_next_child(parent, NULL); child != NULL; \
--
1.7.0.4
^ permalink raw reply related
* [RESEND PATCH v3 2/5] dt/powerpc/powernv: Use of_get_child_by_name to get a named child.
From: Srinivas KANDAGATLA @ 2012-09-17 11:58 UTC (permalink / raw)
To: benh
Cc: kgene.kim, srinivas.kandagatla, devicetree-discuss, broonie,
robherring2, ben-linux, linuxppc-dev
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
As follow-up to "dt: introduce of_get_child_by_name to get child node by
name." patch, This patch removes some of the code duplication in the
driver by replacing it with of_get_child_by_name instead.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
arch/powerpc/platforms/powernv/opal.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index aaa0dba..fc7ae70 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -294,9 +294,9 @@ static int __init opal_init(void)
consoles = of_node_get(opal_node);
/* Register serial ports */
- for_each_child_of_node(consoles, np) {
- if (strcmp(np->name, "serial"))
- continue;
+ np = of_get_child_by_name(consoles, "serial");
+ if (np) {
+ of_node_put(np);
of_platform_device_create(np, NULL, NULL);
}
of_node_put(consoles);
--
1.7.0.4
^ permalink raw reply related
* [RESEND PATCH v3 3/5] dt/powerpc/sysdev: Use of_get_child_by_name to get a named child.
From: Srinivas KANDAGATLA @ 2012-09-17 11:58 UTC (permalink / raw)
To: benh
Cc: kgene.kim, srinivas.kandagatla, devicetree-discuss, broonie,
robherring2, ben-linux, linuxppc-dev
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
As follow-up to "dt: introduce of_get_child_by_name to get child node by
name." patch, This patch removes some of the code duplication in the
driver by replacing it with of_get_child_by_name instead.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
arch/powerpc/sysdev/qe_lib/qe.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index b043675..d094e51 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -568,10 +568,7 @@ struct qe_firmware_info *qe_get_firmware_info(void)
}
/* Find the 'firmware' child node */
- for_each_child_of_node(qe, fw) {
- if (strcmp(fw->name, "firmware") == 0)
- break;
- }
+ fw = of_get_child_by_name(qe, "firmware");
of_node_put(qe);
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH 2/3] powerpc/esdhc: add property to disable the CMD23
From: Chris Ball @ 2012-09-17 12:36 UTC (permalink / raw)
To: Kumar Gala
Cc: linux-mmc@vger.kernel.org, Huang Changming-R66093,
linuxppc-dev@lists.ozlabs.org list, Anton Vorontsov
In-Reply-To: <4E15F856-D385-40C4-A5FD-5F298C70F402@kernel.crashing.org>
Hi,
On Thu, Sep 13 2012, Kumar Gala wrote:
>>> Can you list out which SoCs support it and which don't. Having this list
>>> will be useful in understanding which controller versions supported it.
>>>
>> P1020, p1021, p1022, p1024, p1015 and p4080 can't support it.
>> Mpc8536, p2020, and the other current DPAA silicon (e.g. p5020, p3041) support it.
>
> Based on this, why don't we use the HOSTVER register to detect instead of device tree:
I've got a mild preference for handling quirk assignment in the DT
rather than in driver code, so I'd prefer to just push the original
patch to mmc-next as-is. Does that sound okay?
(I think the argument that there isn't going to be any new hardware
with this problem is equally in favor of both methods.)
Thanks,
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply
* Re: [RESEND PATCH v3 1/5] dt: introduce of_get_child_by_name to get child node by name.
From: Rob Herring @ 2012-09-17 12:58 UTC (permalink / raw)
To: Srinivas KANDAGATLA
Cc: kgene.kim, devicetree-discuss, broonie, afleming, ben-linux,
bergner, linuxppc-dev
In-Reply-To: <1347883101-16679-1-git-send-email-srinivas.kandagatla@st.com>
On 09/17/2012 06:58 AM, Srinivas KANDAGATLA wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Please drop the period on the subject.
>
> This patch introduces of_get_child_by_name function to get a child node
> by its name in a given parent node.
>
> Without this patch each driver code has to iterate the parent and do
> a string compare, However having of_get_child_by_name libary function would
> avoid code duplication, errors and is more convenient.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
> ---
> drivers/of/base.c | 25 +++++++++++++++++++++++++
> include/linux/of.h | 2 ++
> 2 files changed, 27 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index d4a1c9a..7391f8a 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -391,6 +391,31 @@ struct device_node *of_get_next_available_child(const struct device_node *node,
> EXPORT_SYMBOL(of_get_next_available_child);
>
> /**
> + * of_get_child_by_name - Find the child node by name for a given parent
> + * @node: parent node
> + * @name: child name to look for.
> + *
> + * This function looks for child node for given matching name
> + *
> + * Returns a node pointer if found, with refcount incremented, use
> + * of_node_put() on it when done.
> + * Returns NULL if node is not found.
> + */
> +
Remove blank line.
> +struct device_node *of_get_child_by_name(const struct device_node *node,
> + const char *name)
> +{
> + struct device_node *child;
> +
> + for_each_child_of_node(node, child)
> + if (child->name && (of_node_cmp(child->name, name) == 0)
> + && of_node_get(child))
of_get_next_child has already called of_node_get, so you don't need to
call it here.
> + break;
> + return child;
> +}
> +EXPORT_SYMBOL(of_get_child_by_name);
> +
> +/**
> * of_find_node_by_path - Find a node matching a full OF path
> * @path: The full path to match
> *
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 1b11632..7b8e3cd 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -192,6 +192,8 @@ extern struct device_node *of_get_next_child(const struct device_node *node,
> struct device_node *prev);
> extern struct device_node *of_get_next_available_child(
> const struct device_node *node, struct device_node *prev);
> +extern struct device_node *of_get_child_by_name(const struct device_node *node,
> + const char *name);
>
> #define for_each_child_of_node(parent, child) \
> for (child = of_get_next_child(parent, NULL); child != NULL; \
>
^ permalink raw reply
* Re: [RESEND PATCH v3 1/5] dt: introduce of_get_child_by_name to get child node by name.
From: Rob Herring @ 2012-09-17 12:59 UTC (permalink / raw)
To: Srinivas KANDAGATLA
Cc: kgene.kim, devicetree-discuss, broonie, afleming, ben-linux,
bergner, linuxppc-dev
In-Reply-To: <1347883101-16679-1-git-send-email-srinivas.kandagatla@st.com>
On 09/17/2012 06:58 AM, Srinivas KANDAGATLA wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Please drop the period on the subject.
>
> This patch introduces of_get_child_by_name function to get a child node
> by its name in a given parent node.
>
> Without this patch each driver code has to iterate the parent and do
> a string compare, However having of_get_child_by_name libary function would
> avoid code duplication, errors and is more convenient.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
> ---
> drivers/of/base.c | 25 +++++++++++++++++++++++++
> include/linux/of.h | 2 ++
> 2 files changed, 27 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index d4a1c9a..7391f8a 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -391,6 +391,31 @@ struct device_node *of_get_next_available_child(const struct device_node *node,
> EXPORT_SYMBOL(of_get_next_available_child);
>
> /**
> + * of_get_child_by_name - Find the child node by name for a given parent
> + * @node: parent node
> + * @name: child name to look for.
> + *
> + * This function looks for child node for given matching name
> + *
> + * Returns a node pointer if found, with refcount incremented, use
> + * of_node_put() on it when done.
> + * Returns NULL if node is not found.
> + */
> +
Remove blank line.
> +struct device_node *of_get_child_by_name(const struct device_node *node,
> + const char *name)
> +{
> + struct device_node *child;
> +
> + for_each_child_of_node(node, child)
> + if (child->name && (of_node_cmp(child->name, name) == 0)
> + && of_node_get(child))
of_get_next_child has already called of_node_get, so you don't need to
call it here.
> + break;
> + return child;
> +}
> +EXPORT_SYMBOL(of_get_child_by_name);
> +
> +/**
> * of_find_node_by_path - Find a node matching a full OF path
> * @path: The full path to match
> *
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 1b11632..7b8e3cd 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -192,6 +192,8 @@ extern struct device_node *of_get_next_child(const struct device_node *node,
> struct device_node *prev);
> extern struct device_node *of_get_next_available_child(
> const struct device_node *node, struct device_node *prev);
> +extern struct device_node *of_get_child_by_name(const struct device_node *node,
> + const char *name);
>
> #define for_each_child_of_node(parent, child) \
> for (child = of_get_next_child(parent, NULL); child != NULL; \
>
^ permalink raw reply
* Re: [PATCH 2/3] powerpc/esdhc: add property to disable the CMD23
From: Kumar Gala @ 2012-09-17 13:12 UTC (permalink / raw)
To: Chris Ball
Cc: linux-mmc@vger.kernel.org, Huang Changming-R66093,
linuxppc-dev@lists.ozlabs.org list, Anton Vorontsov
In-Reply-To: <m3k3vsn7wf.fsf@pullcord.laptop.org>
On Sep 17, 2012, at 7:36 AM, Chris Ball wrote:
> Hi,
>=20
> On Thu, Sep 13 2012, Kumar Gala wrote:
>>>> Can you list out which SoCs support it and which don't. Having =
this list
>>>> will be useful in understanding which controller versions supported =
it.
>>>>=20
>>> P1020, p1021, p1022, p1024, p1015 and p4080 can't support it.
>>> Mpc8536, p2020, and the other current DPAA silicon (e.g. p5020, =
p3041) support it.
>>=20
>> Based on this, why don't we use the HOSTVER register to detect =
instead of device tree:
>=20
> I've got a mild preference for handling quirk assignment in the DT
> rather than in driver code, so I'd prefer to just push the original
> patch to mmc-next as-is. Does that sound okay?
Why? I only ask because I agree with Scott that this means you have to =
update your device tree to get proper functionality.
> (I think the argument that there isn't going to be any new hardware
> with this problem is equally in favor of both methods.)
- k=
^ permalink raw reply
* Re: [PATCH 2/3] powerpc/esdhc: add property to disable the CMD23
From: Chris Ball @ 2012-09-17 13:45 UTC (permalink / raw)
To: Kumar Gala
Cc: linux-mmc@vger.kernel.org, Huang Changming-R66093,
linuxppc-dev@lists.ozlabs.org list, Anton Vorontsov
In-Reply-To: <1166FFD6-342F-4BDA-BF23-794DAEA95CC9@kernel.crashing.org>
Hi,
On Mon, Sep 17 2012, Kumar Gala wrote:
>>>> P1020, p1021, p1022, p1024, p1015 and p4080 can't support it.
>>>> Mpc8536, p2020, and the other current DPAA silicon (e.g. p5020, p3041) support it.
>>>
>>> Based on this, why don't we use the HOSTVER register to detect instead of device tree:
>>
>> I've got a mild preference for handling quirk assignment in the DT
>> rather than in driver code, so I'd prefer to just push the original
>> patch to mmc-next as-is. Does that sound okay?
>
> Why? I only ask because I agree with Scott that this means you have to update your device tree to get proper functionality.
Thanks, I'd missed that. I withdraw my preference; I'll pick up
whichever method you all prefer.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply
* [PATCH 2/2] ppc/eeh: fix crash on converting OF node to edev
From: Gavin Shan @ 2012-09-17 14:34 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Gavin Shan, stable
In-Reply-To: <1347892468-25818-1-git-send-email-shangw@linux.vnet.ibm.com>
The kernel crash was reported by Alexy. He was testing some feature
with private kernel, in which Alexy added some code in pci_pm_reset()
to read the CSR after writting it. The bug could be reproduced on
Fiber Channel card (Fibre Channel: Emulex Corporation Saturn-X:
LightPulse Fibre Channel Host Adapter (rev 03)) by the following
commands.
# echo 1 > /sys/devices/pci0004:01/0004:01:00.0/reset
# rmmod lpfc
# modprobe lpfc
The history behind the test case is that those additional config
space reading operations in pci_pm_reset() would cause EEH error,
but we didn't detect EEH error until "modprobe lpfc". For the case,
all the PCI devices on PCI bus (0004:01) were removed and added after
PE reset. Then the EEH devices would be figured out again based on
the OF nodes. Unfortunately, there were some child OF nodes under
PCI device (0004:01:00.0), but they didn't have attached PCI_DN since
they're invisible from PCI domain. However, we were still trying to
convert OF node to EEH device without checking on the attached PCI_DN.
Eventually, it caused the kernel crash as follows:
Unable to handle kernel paging request for data at address 0x00000030
Faulting instruction address: 0xc00000000004d888
cpu 0x0: Vector: 300 (Data Access) at [c000000fc797b950]
pc: c00000000004d888: .eeh_add_device_tree_early+0x78/0x140
lr: c00000000004d880: .eeh_add_device_tree_early+0x70/0x140
sp: c000000fc797bbd0
msr: 8000000000009032
dar: 30
dsisr: 40000000
current = 0xc000000fc78d9f70
paca = 0xc00000000edb0000 softe: 0 irq_happened: 0x00
pid = 2951, comm = eehd
enter ? for help
[c000000fc797bc50] c00000000004d848 .eeh_add_device_tree_early+0x38/0x140
[c000000fc797bcd0] c00000000004d848 .eeh_add_device_tree_early+0x38/0x140
[c000000fc797bd50] c000000000051b54 .pcibios_add_pci_devices+0x34/0x190
[c000000fc797bde0] c00000000004fb10 .eeh_reset_device+0x100/0x160
[c000000fc797be70] c0000000000502dc .eeh_handle_event+0x19c/0x300
[c000000fc797bf00] c000000000050570 .eeh_event_handler+0x130/0x1a0
[c000000fc797bf90] c000000000020138 .kernel_thread+0x54/0x70
The patch changes of_node_to_eeh_dev() and just returns NULL if the
passed OF node doesn't have attached PCI_DN.
Cc: stable@vger.kernel.org
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/pci-bridge.h | 8 ++++++++
arch/powerpc/platforms/pseries/eeh.c | 2 +-
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index a059cb9..025a130 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -182,6 +182,14 @@ static inline int pci_device_from_OF_node(struct device_node *np,
#if defined(CONFIG_EEH)
static inline struct eeh_dev *of_node_to_eeh_dev(struct device_node *dn)
{
+ /*
+ * For those OF nodes whose parent isn't PCI bridge, they
+ * don't have PCI_DN actually. So we have to skip them for
+ * any EEH operations.
+ */
+ if (!dn || !PCI_DN(dn))
+ return NULL;
+
return PCI_DN(dn)->edev;
}
#else
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 43f6ed4..9a04322 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -728,7 +728,7 @@ static void eeh_add_device_early(struct device_node *dn)
{
struct pci_controller *phb;
- if (!dn || !of_node_to_eeh_dev(dn))
+ if (!of_node_to_eeh_dev(dn))
return;
phb = of_node_to_eeh_dev(dn)->phb;
--
1.7.5.4
^ permalink raw reply related
* [PATCH 1/2] ppc/eeh: lock module while handling EEH event
From: Gavin Shan @ 2012-09-17 14:34 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Gavin Shan, stable
The EEH core is talking with the PCI device driver to determine the
action (purely reset, or PCI device removal). During the period, the
driver might be unloaded and in turn causes kernel crash as follows:
EEH: Detected PCI bus error on PHB#4-PE#10000
EEH: This PCI device has failed 3 times in the last hour
lpfc 0004:01:00.0: 0:2710 PCI channel disable preparing for reset
Unable to handle kernel paging request for data at address 0x00000490
Faulting instruction address: 0xd00000000e682c90
cpu 0x1: Vector: 300 (Data Access) at [c000000fc75ffa20]
pc: d00000000e682c90: .lpfc_io_error_detected+0x30/0x240 [lpfc]
lr: d00000000e682c8c: .lpfc_io_error_detected+0x2c/0x240 [lpfc]
sp: c000000fc75ffca0
msr: 8000000000009032
dar: 490
dsisr: 40000000
current = 0xc000000fc79b88b0
paca = 0xc00000000edb0380 softe: 0 irq_happened: 0x00
pid = 3386, comm = eehd
enter ? for help
[c000000fc75ffca0] c000000fc75ffd30 (unreliable)
[c000000fc75ffd30] c00000000004fd3c .eeh_report_error+0x7c/0xf0
[c000000fc75ffdc0] c00000000004ee00 .eeh_pe_dev_traverse+0xa0/0x180
[c000000fc75ffe70] c00000000004ffd8 .eeh_handle_event+0x68/0x300
[c000000fc75fff00] c0000000000503a0 .eeh_event_handler+0x130/0x1a0
[c000000fc75fff90] c000000000020138 .kernel_thread+0x54/0x70
1:mon>
The patch increases the reference of the corresponding driver modules
while EEH core does the negotiation with PCI device driver so that the
corresponding driver modules can't be unloaded during the period and
we're safe to refer the callbacks.
Cc: stable@vger.kernel.org
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
arch/powerpc/platforms/pseries/eeh_driver.c | 91 ++++++++++++++++++++------
1 files changed, 70 insertions(+), 21 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
index 37c2cf7..a3fefb6 100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -25,6 +25,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
+#include <linux/module.h>
#include <linux/pci.h>
#include <asm/eeh.h>
#include <asm/eeh_event.h>
@@ -47,6 +48,41 @@ static inline const char *eeh_pcid_name(struct pci_dev *pdev)
return "";
}
+/**
+ * eeh_pcid_get - Get the PCI device driver
+ * @pdev: PCI device
+ *
+ * The function is used to retrieve the PCI device driver for
+ * the indicated PCI device. Besides, we will increase the reference
+ * of the PCI device driver to prevent that being unloaded on
+ * the fly. Otherwise, kernel crash would be seen.
+ */
+static inline struct pci_driver *eeh_pcid_get(struct pci_dev *pdev)
+{
+ if (!pdev || !pdev->driver)
+ return NULL;
+
+ if (!try_module_get(pdev->driver->driver.owner))
+ return NULL;
+
+ return pdev->driver;
+}
+
+/**
+ * eeh_pcid_put - Dereference on the PCI device driver
+ * @pdev: PCI device
+ *
+ * The function is called to do dereference on the PCI device
+ * driver of the indicated PCI device.
+ */
+static inline void eeh_pcid_put(struct pci_dev *pdev)
+{
+ if (!pdev || !pdev->driver)
+ return;
+
+ module_put(pdev->driver->driver.owner);
+}
+
#if 0
static void print_device_node_tree(struct pci_dn *pdn, int dent)
{
@@ -128,23 +164,24 @@ static void *eeh_report_error(void *data, void *userdata)
struct eeh_dev *edev = (struct eeh_dev *)data;
struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
enum pci_ers_result rc, *res = userdata;
- struct pci_driver *driver = dev->driver;
+ struct pci_driver *driver;
/* We might not have the associated PCI device,
* then we should continue for next one.
*/
if (!dev) return NULL;
-
dev->error_state = pci_channel_io_frozen;
- if (!driver)
- return NULL;
+ driver = eeh_pcid_get(dev);
+ if (!driver) return NULL;
eeh_disable_irq(dev);
if (!driver->err_handler ||
- !driver->err_handler->error_detected)
+ !driver->err_handler->error_detected) {
+ eeh_pcid_put(dev);
return NULL;
+ }
rc = driver->err_handler->error_detected(dev, pci_channel_io_frozen);
@@ -152,6 +189,7 @@ static void *eeh_report_error(void *data, void *userdata)
if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
if (*res == PCI_ERS_RESULT_NONE) *res = rc;
+ eeh_pcid_put(dev);
return NULL;
}
@@ -171,12 +209,14 @@ static void *eeh_report_mmio_enabled(void *data, void *userdata)
enum pci_ers_result rc, *res = userdata;
struct pci_driver *driver;
- if (!dev) return NULL;
+ driver = eeh_pcid_get(dev);
+ if (!driver) return NULL;
- if (!(driver = dev->driver) ||
- !driver->err_handler ||
- !driver->err_handler->mmio_enabled)
+ if (!driver->err_handler ||
+ !driver->err_handler->mmio_enabled) {
+ eeh_pcid_put(dev);
return NULL;
+ }
rc = driver->err_handler->mmio_enabled(dev);
@@ -184,6 +224,7 @@ static void *eeh_report_mmio_enabled(void *data, void *userdata)
if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
if (*res == PCI_ERS_RESULT_NONE) *res = rc;
+ eeh_pcid_put(dev);
return NULL;
}
@@ -204,16 +245,19 @@ static void *eeh_report_reset(void *data, void *userdata)
enum pci_ers_result rc, *res = userdata;
struct pci_driver *driver;
- if (!dev || !(driver = dev->driver))
- return NULL;
-
+ if (!dev) return NULL;
dev->error_state = pci_channel_io_normal;
+ driver = eeh_pcid_get(dev);
+ if (!driver) return NULL;
+
eeh_enable_irq(dev);
if (!driver->err_handler ||
- !driver->err_handler->slot_reset)
+ !driver->err_handler->slot_reset) {
+ eeh_pcid_put(dev);
return NULL;
+ }
rc = driver->err_handler->slot_reset(dev);
if ((*res == PCI_ERS_RESULT_NONE) ||
@@ -221,6 +265,7 @@ static void *eeh_report_reset(void *data, void *userdata)
if (*res == PCI_ERS_RESULT_DISCONNECT &&
rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
+ eeh_pcid_put(dev);
return NULL;
}
@@ -240,20 +285,22 @@ static void *eeh_report_resume(void *data, void *userdata)
struct pci_driver *driver;
if (!dev) return NULL;
-
dev->error_state = pci_channel_io_normal;
- if (!(driver = dev->driver))
- return NULL;
+ driver = eeh_pcid_get(dev);
+ if (!driver) return NULL;
eeh_enable_irq(dev);
if (!driver->err_handler ||
- !driver->err_handler->resume)
+ !driver->err_handler->resume) {
+ eeh_pcid_put(dev);
return NULL;
+ }
driver->err_handler->resume(dev);
+ eeh_pcid_put(dev);
return NULL;
}
@@ -272,20 +319,22 @@ static void *eeh_report_failure(void *data, void *userdata)
struct pci_driver *driver;
if (!dev) return NULL;
-
dev->error_state = pci_channel_io_perm_failure;
- if (!(driver = dev->driver))
- return NULL;
+ driver = eeh_pcid_get(dev);
+ if (!driver) return NULL;
eeh_disable_irq(dev);
if (!driver->err_handler ||
- !driver->err_handler->error_detected)
+ !driver->err_handler->error_detected) {
+ eeh_pcid_put(dev);
return NULL;
+ }
driver->err_handler->error_detected(dev, pci_channel_io_perm_failure);
+ eeh_pcid_put(dev);
return NULL;
}
--
1.7.5.4
^ permalink raw reply related
* [PATCH][v3]: powerpc/perf: Sample only if SIAR-Valid bit is set in P7+
From: Sukadev Bhattiprolu @ 2012-09-17 22:16 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev, Anton Blanchard, cel
>From 192fa874e5574d08d66d96155b6d9c536fce6e8a Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Date: Mon, 2 Jul 2012 08:06:14 -0700
Subject: [PATCH] powerpc/perf: Sample only if SIAR-Valid bit is set in P7+
On POWER7+ two new bits (mmcra[35] and mmcra[36]) indicate whether the
contents of SIAR and SDAR are valid.
For marked instructions on P7+, we must save the contents of SIAR and
SDAR registers only if these new bits are set.
This code/check for the SIAR-Valid bit is specific to P7+, so rather than
waste a CPU-feature bit use the PVR flag.
Note that Carl Love proposed a similar change for oprofile:
https://lkml.org/lkml/2012/6/22/309
Changelog[v3]:
- Commit 5c093efa6f2 added checks to use SIAR only for kernel samples.
Extend that to use SIAR only if SIAR-valid bit is set (in processors
that implement that bit).
Changelog[v2]:
- [Gabriel Paubert] Rename PV_POWER7P to PV_POWER7p.
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/perf_event_server.h | 1 +
arch/powerpc/include/asm/reg.h | 4 ++
arch/powerpc/perf/core-book3s.c | 39 ++++++++++++++++++++++----
arch/powerpc/perf/power7-pmu.c | 3 ++
4 files changed, 41 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/include/asm/perf_event_server.h b/arch/powerpc/include/asm/perf_event_server.h
index 078019b..9710be3 100644
--- a/arch/powerpc/include/asm/perf_event_server.h
+++ b/arch/powerpc/include/asm/perf_event_server.h
@@ -49,6 +49,7 @@ struct power_pmu {
#define PPMU_ALT_SIPR 2 /* uses alternate posn for SIPR/HV */
#define PPMU_NO_SIPR 4 /* no SIPR/HV in MMCRA at all */
#define PPMU_NO_CONT_SAMPLING 8 /* no continuous sampling */
+#define PPMU_SIAR_VALID 16 /* Processor has SIAR Valid bit */
/*
* Values for flags to get_alternatives()
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 12412b5..bcf5760 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -602,6 +602,10 @@
#define POWER6_MMCRA_SIPR 0x0000020000000000ULL
#define POWER6_MMCRA_THRM 0x00000020UL
#define POWER6_MMCRA_OTHER 0x0000000EUL
+
+#define POWER7P_MMCRA_SIAR_VALID 0x10000000 /* P7+ SIAR contents valid */
+#define POWER7P_MMCRA_SDAR_VALID 0x08000000 /* P7+ SDAR contents valid */
+
#define SPRN_PMC1 787
#define SPRN_PMC2 788
#define SPRN_PMC3 789
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 7cd2dbd..05b2f41 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -106,14 +106,20 @@ static inline unsigned long perf_ip_adjust(struct pt_regs *regs)
* If we're not doing instruction sampling, give them the SDAR
* (sampled data address). If we are doing instruction sampling, then
* only give them the SDAR if it corresponds to the instruction
- * pointed to by SIAR; this is indicated by the [POWER6_]MMCRA_SDSYNC
- * bit in MMCRA.
+ * pointed to by SIAR; this is indicated by the [POWER6_]MMCRA_SDSYNC or
+ * the [POWER7P_]MMCRA_SDAR_VALID bit in MMCRA.
*/
static inline void perf_get_data_addr(struct pt_regs *regs, u64 *addrp)
{
unsigned long mmcra = regs->dsisr;
- unsigned long sdsync = (ppmu->flags & PPMU_ALT_SIPR) ?
- POWER6_MMCRA_SDSYNC : MMCRA_SDSYNC;
+ unsigned long sdsync;
+
+ if (ppmu->flags & PPMU_SIAR_VALID)
+ sdsync = POWER7P_MMCRA_SDAR_VALID;
+ else if (ppmu->flags & PPMU_ALT_SIPR)
+ sdsync = POWER6_MMCRA_SDSYNC;
+ else
+ sdsync = MMCRA_SDSYNC;
if (!(mmcra & MMCRA_SAMPLE_ENABLE) || (mmcra & sdsync))
*addrp = mfspr(SPRN_SDAR);
@@ -1291,6 +1297,25 @@ struct pmu power_pmu = {
.event_idx = power_pmu_event_idx,
};
+
+/*
+ * On processors like P7+ that have the SIAR-Valid bit, marked instructions
+ * must be sampled only if the SIAR-valid bit is set.
+ *
+ * For unmarked instructions and for processors that don't have the SIAR-Valid
+ * bit, assume that SIAR is valid.
+ */
+static inline int siar_valid(struct pt_regs *regs)
+{
+ unsigned long mmcra = regs->dsisr;
+ int marked = mmcra & MMCRA_SAMPLE_ENABLE;
+
+ if ((ppmu->flags & PPMU_SIAR_VALID) && marked)
+ return mmcra & POWER7P_MMCRA_SIAR_VALID;
+
+ return 1;
+}
+
/*
* A counter has overflowed; update its count and record
* things if requested. Note that interrupts are hard-disabled
@@ -1324,7 +1349,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
left += period;
if (left <= 0)
left = period;
- record = 1;
+ record = siar_valid(regs);
event->hw.last_period = event->hw.sample_period;
}
if (left < 0x80000000LL)
@@ -1374,8 +1399,10 @@ unsigned long perf_instruction_pointer(struct pt_regs *regs)
{
unsigned long use_siar = regs->result;
- if (use_siar)
+ if (use_siar && siar_valid(regs))
return mfspr(SPRN_SIAR) + perf_ip_adjust(regs);
+ else if (use_siar)
+ return 0; // no valid instruction pointer
else
return regs->nip;
}
diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
index 1251e4d..970a634 100644
--- a/arch/powerpc/perf/power7-pmu.c
+++ b/arch/powerpc/perf/power7-pmu.c
@@ -373,6 +373,9 @@ static int __init init_power7_pmu(void)
strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power7"))
return -ENODEV;
+ if (__is_processor(PV_POWER7p))
+ power7_pmu.flags |= PPMU_SIAR_VALID;
+
return register_power_pmu(&power7_pmu);
}
--
1.7.1
^ permalink raw reply related
* RE: [PATCH 2/3] powerpc/esdhc: add property to disable the CMD23
From: Huang Changming-R66093 @ 2012-09-18 1:09 UTC (permalink / raw)
To: Kumar Gala, Chris Ball
Cc: linux-mmc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org list,
Anton Vorontsov
In-Reply-To: <1166FFD6-342F-4BDA-BF23-794DAEA95CC9@kernel.crashing.org>
> On Sep 17, 2012, at 7:36 AM, Chris Ball wrote:
>=20
> > Hi,
> >
> > On Thu, Sep 13 2012, Kumar Gala wrote:
> >>>> Can you list out which SoCs support it and which don't. Having
> >>>> this list will be useful in understanding which controller versions
> supported it.
> >>>>
> >>> P1020, p1021, p1022, p1024, p1015 and p4080 can't support it.
> >>> Mpc8536, p2020, and the other current DPAA silicon (e.g. p5020, p3041=
)
> support it.
> >>
> >> Based on this, why don't we use the HOSTVER register to detect instead
> of device tree:
> >
> > I've got a mild preference for handling quirk assignment in the DT
> > rather than in driver code, so I'd prefer to just push the original
> > patch to mmc-next as-is. Does that sound okay?
>=20
> Why? I only ask because I agree with Scott that this means you have to
> update your device tree to get proper functionality.
>=20
When the new silicon does not support CMD23,
if we don't update the device tree, then we must update the SDHC driver.
I prefer to add the property in device tree,
because we just add this property in new device tree, we don't need more ef=
fort to modify driver.
^ permalink raw reply
* Re: [RESEND PATCH v3 2/5] dt/powerpc/powernv: Use of_get_child_by_name to get a named child.
From: Michael Ellerman @ 2012-09-18 1:32 UTC (permalink / raw)
To: Srinivas KANDAGATLA
Cc: kgene.kim, devicetree-discuss, broonie, robherring2, ben-linux,
linuxppc-dev
In-Reply-To: <1347883109-16714-1-git-send-email-srinivas.kandagatla@st.com>
On Mon, 2012-09-17 at 12:58 +0100, Srinivas KANDAGATLA wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
>
> As follow-up to "dt: introduce of_get_child_by_name to get child node by
> name." patch, This patch removes some of the code duplication in the
> driver by replacing it with of_get_child_by_name instead.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
> ---
> arch/powerpc/platforms/powernv/opal.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
> index aaa0dba..fc7ae70 100644
> --- a/arch/powerpc/platforms/powernv/opal.c
> +++ b/arch/powerpc/platforms/powernv/opal.c
> @@ -294,9 +294,9 @@ static int __init opal_init(void)
> consoles = of_node_get(opal_node);
>
> /* Register serial ports */
> - for_each_child_of_node(consoles, np) {
> - if (strcmp(np->name, "serial"))
> - continue;
> + np = of_get_child_by_name(consoles, "serial");
> + if (np) {
> + of_node_put(np);
> of_platform_device_create(np, NULL, NULL);
You mustn't drop the reference until after you've finished with np, as
you have written it the node could be freed before you call
of_platform_device_create().
cheers
^ permalink raw reply
* [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM support
From: Jia Hongtao @ 2012-09-18 2:10 UTC (permalink / raw)
To: linuxppc-dev, galak; +Cc: B07421, b38951
Power supply for PCI inbound/outbound window registers is off when system
go to deep-sleep state. We save the values of registers before suspend
and restore to registers after resume.
Signed-off-by: Jiang Yutang <b14898@freescale.com>
Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
Changes for V4:
We just rebase the patch upon following patch:
powerpc/fsl-pci: Unify pci/pcie initialization code
arch/powerpc/include/asm/pci-bridge.h | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 121 +++++++++++++++++++++++++++++++++
2 files changed, 122 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index ac39e6a..823e000 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -89,9 +89,9 @@ struct pci_controller {
#ifdef CONFIG_PPC64
unsigned long buid;
+#endif /* CONFIG_PPC64 */
void *private_data;
-#endif /* CONFIG_PPC64 */
};
/* These are used for config access before all the PCI probing
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index e577cb5..8c15177 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -887,12 +887,133 @@ static int __devinit fsl_pci_probe(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_SUSPEND
+
+#define PCI_POW_PIW_OFFSET 0xc00
+#define PCI_POW_PIW_SIZE 0x200
+#define PCI_POW_NUMBER 5
+
+static int fsl_pci_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct pci_controller *hose;
+ struct pci_outbound_window_regs *pci_saved_pow;
+ struct pci_inbound_window_regs *pci_saved_piw, *temp_piw;
+ struct resource pci_rsrc;
+ unsigned int i;
+ struct fsl_pci_private_data *sus_info;
+
+ hose = pci_find_hose_for_OF_device(pdev->dev.of_node);
+ of_address_to_resource(pdev->dev.of_node, 0, &pci_rsrc);
+
+ sus_info = kmalloc(
+ sizeof(struct fsl_pci_private_data), GFP_KERNEL);
+ if (!sus_info)
+ return -ENOMEM;
+
+ hose->private_data = sus_info;
+
+ sus_info->pci_pow = ioremap(pci_rsrc.start + PCI_POW_PIW_OFFSET,
+ PCI_POW_PIW_SIZE);
+ if (!sus_info->pci_pow) {
+ dev_err(&pdev->dev, "pci outbound/inbound windows ioremap error!\n");
+ goto err1;
+ }
+
+ sus_info->pci_piw = (struct pci_inbound_window_regs *)
+ ((void *)sus_info->pci_pow + PCI_POW_PIW_SIZE) - 1;
+
+ if (of_device_is_compatible(pdev->dev.of_node, "fsl,qoriq-pcie-v2.2"))
+ sus_info->inbound_num = 4;
+ else
+ sus_info->inbound_num = 3;
+
+ sus_info->saved_regs = kmalloc(
+ sizeof(struct pci_outbound_window_regs) * PCI_POW_NUMBER +
+ sizeof(struct pci_inbound_window_regs) * sus_info->inbound_num,
+ GFP_KERNEL);
+ if (!sus_info->saved_regs)
+ goto err2;
+
+ pci_saved_pow = sus_info->saved_regs;
+ for (i = 0; i < PCI_POW_NUMBER; i++) {
+ pci_saved_pow[i].potar = in_be32(&sus_info->pci_pow[i].potar);
+ pci_saved_pow[i].potear = in_be32(&sus_info->pci_pow[i].potear);
+ pci_saved_pow[i].powbar = in_be32(&sus_info->pci_pow[i].powbar);
+ pci_saved_pow[i].powar = in_be32(&sus_info->pci_pow[i].powar);
+ }
+
+ pci_saved_piw = (struct pci_inbound_window_regs *)
+ (pci_saved_pow + PCI_POW_NUMBER);
+ temp_piw = sus_info->pci_piw;
+ for (i = 0; i < sus_info->inbound_num; i++, temp_piw--) {
+ pci_saved_piw[i].pitar = in_be32(&temp_piw->pitar);
+ pci_saved_piw[i].piwbar = in_be32(&temp_piw->piwbar);
+ pci_saved_piw[i].piwbear = in_be32(&temp_piw->piwbear);
+ pci_saved_piw[i].piwar = in_be32(&temp_piw->piwar);
+ }
+
+ return 0;
+
+err2:
+ iounmap(sus_info->pci_pow);
+
+err1:
+ kfree(sus_info);
+ return -ENOMEM;
+}
+
+static int fsl_pci_resume(struct platform_device *pdev)
+{
+ struct pci_controller *hose;
+ struct pci_outbound_window_regs *pci_saved_pow;
+ struct pci_inbound_window_regs *pci_saved_piw, *temp_piw;
+ unsigned int i;
+ struct fsl_pci_private_data *sus_info;
+
+ hose = pci_find_hose_for_OF_device(pdev->dev.of_node);
+ sus_info = (struct fsl_pci_private_data *)hose->private_data;
+
+ if (!sus_info->pci_pow || !sus_info->pci_piw || !sus_info->saved_regs)
+ return 0;
+
+ pci_saved_pow = sus_info->saved_regs;
+ for (i = 0; i < PCI_POW_NUMBER; i++) {
+ out_be32(&sus_info->pci_pow[i].potar, pci_saved_pow[i].potar);
+ out_be32(&sus_info->pci_pow[i].potear, pci_saved_pow[i].potear);
+ out_be32(&sus_info->pci_pow[i].powbar, pci_saved_pow[i].powbar);
+ out_be32(&sus_info->pci_pow[i].powar, pci_saved_pow[i].powar);
+ }
+
+ pci_saved_piw = (struct pci_inbound_window_regs *)
+ (pci_saved_pow + PCI_POW_NUMBER);
+ temp_piw = sus_info->pci_piw;
+ for (i = 0; i < sus_info->inbound_num; i++, temp_piw--) {
+ out_be32(&temp_piw->pitar, pci_saved_piw[i].pitar);
+ out_be32(&temp_piw->piwbar, pci_saved_piw[i].piwbar);
+ out_be32(&temp_piw->piwbear, pci_saved_piw[i].piwbear);
+ out_be32(&temp_piw->piwar, pci_saved_piw[i].piwar);
+ }
+ iounmap(sus_info->pci_pow);
+ kfree(sus_info->saved_regs);
+ sus_info->saved_regs = NULL;
+ kfree(sus_info);
+ sus_info = NULL;
+ hose->private_data = NULL;
+
+ return 0;
+}
+#endif
+
static struct platform_driver fsl_pci_driver = {
.driver = {
.name = "fsl-pci",
.of_match_table = pci_ids,
},
.probe = fsl_pci_probe,
+#ifdef CONFIG_SUSPEND
+ .suspend = fsl_pci_suspend,
+ .resume = fsl_pci_resume,
+#endif
};
static int __init fsl_pci_init(void)
--
1.7.5.1
^ permalink raw reply related
* Re: [PATCH 2/3] powerpc/esdhc: add property to disable the CMD23
From: Kumar Gala @ 2012-09-18 5:00 UTC (permalink / raw)
To: Huang Changming-R66093
Cc: linux-mmc@vger.kernel.org, Chris Ball,
linuxppc-dev@lists.ozlabs.org list, Anton Vorontsov
In-Reply-To: <110EED8CC96DFC488B7E717A2027A27C17DBCA@039-SN1MPN1-002.039d.mgd.msft.net>
On Sep 17, 2012, at 8:09 PM, Huang Changming-R66093 wrote:
>> On Sep 17, 2012, at 7:36 AM, Chris Ball wrote:
>>=20
>>> Hi,
>>>=20
>>> On Thu, Sep 13 2012, Kumar Gala wrote:
>>>>>> Can you list out which SoCs support it and which don't. Having
>>>>>> this list will be useful in understanding which controller =
versions
>> supported it.
>>>>>>=20
>>>>> P1020, p1021, p1022, p1024, p1015 and p4080 can't support it.
>>>>> Mpc8536, p2020, and the other current DPAA silicon (e.g. p5020, =
p3041)
>> support it.
>>>>=20
>>>> Based on this, why don't we use the HOSTVER register to detect =
instead
>> of device tree:
>>>=20
>>> I've got a mild preference for handling quirk assignment in the DT
>>> rather than in driver code, so I'd prefer to just push the original
>>> patch to mmc-next as-is. Does that sound okay?
>>=20
>> Why? I only ask because I agree with Scott that this means you have =
to
>> update your device tree to get proper functionality.
>>=20
> When the new silicon does not support CMD23,
> if we don't update the device tree, then we must update the SDHC =
driver.
> I prefer to add the property in device tree,
> because we just add this property in new device tree, we don't need =
more effort to modify driver.
>=20
Jerry,
I think doing it driver makes more sense because:
1. means older device tree's still work
2. odds that CMD23 not being supported in future devices is near 0%
(Now that we support AutoCMD23 [and thus CMD23] we aren't likely to =
stop supporting it in future)
3. If IP changes you are going to have to update driver anyways for new =
features
I really think we should NOT utilize device tree for this.
- k
^ permalink raw reply
* Re: [PATCH][V4] powerpc/fsl-pci: Add pci inbound/outbound PM support
From: Kumar Gala @ 2012-09-18 5:03 UTC (permalink / raw)
To: Jia Hongtao; +Cc: B07421, linuxppc-dev
In-Reply-To: <1347934234-18223-1-git-send-email-B38951@freescale.com>
On Sep 17, 2012, at 9:10 PM, Jia Hongtao wrote:
> Power supply for PCI inbound/outbound window registers is off when =
system
> go to deep-sleep state. We save the values of registers before suspend
> and restore to registers after resume.
>=20
> Signed-off-by: Jiang Yutang <b14898@freescale.com>
> Signed-off-by: Jia Hongtao <B38951@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> Changes for V4:
> We just rebase the patch upon following patch:
> powerpc/fsl-pci: Unify pci/pcie initialization code
>=20
> arch/powerpc/include/asm/pci-bridge.h | 2 +-
> arch/powerpc/sysdev/fsl_pci.c | 121 =
+++++++++++++++++++++++++++++++++
> 2 files changed, 122 insertions(+), 1 deletions(-)
Did you ever compare this to just re-parsing device tree method?
- k=
^ permalink raw reply
* Re: [v5][PATCH 2/3] powerpc/kprobe: complete kprobe and migrate exception frame
From: Benjamin Herrenschmidt @ 2012-09-18 5:05 UTC (permalink / raw)
To: Tiejun Chen; +Cc: linuxppc-dev
In-Reply-To: <1347875671-15838-2-git-send-email-tiejun.chen@windriver.com>
On Mon, 2012-09-17 at 17:54 +0800, Tiejun Chen wrote:
> -#ifdef CONFIG_PREEMPT
> b restore
>
> /* N.B. the only way to get here is from the beq following ret_from_except. */
> resume_kernel:
> - /* check current_thread_info->preempt_count */
> + /* check current_thread_info, _TIF_EMULATE_STACK_STORE */
> CURRENT_THREAD_INFO(r9, r1)
> + lwz r8,TI_FLAGS(r9)
> + andis. r8,r8,_TIF_EMULATE_STACK_STORE@h
> + beq+ 1f
> +
> + addi r8,r1,INT_FRAME_SIZE /* Get the kprobed function entry */
> +
> + lwz r3,GPR1(r1)
> + subi r3,r3,INT_FRAME_SIZE /* dst: Allocate a trampoline exception frame */
> + mr r4,r1 /* src: current exception frame */
> + li r5,INT_FRAME_SIZE /* size: INT_FRAME_SIZE */
> + li r6,0 /* start offset: 0 */
> + mr r1,r3 /* Reroute the trampoline frame to r1 */
> +
> + /* Copy from the original to the trampoline. */
> + li r6,0
You just did that li r6,0 2 lines above :-) I'll fix it up manually
while applying.
> + srwi r5,r5,2
> + mtctr r5
> +2: lwzx r0,r6,r4
> + stwx r0,r6,r3
> + addi r6,r6,4
> + bdnz 2b
> +
> + /* Do real store operation to complete stwu */
> + lwz r5,GPR1(r1)
> + stw r8,0(r5)
> +
> + /* Clear _TIF_EMULATE_STACK_STORE flag */
> + lis r11,_TIF_EMULATE_STACK_STORE@h
> + addi r5,r9,TI_FLAGS
> +0: lwarx r8,0,r5
> + andc r8,r8,r11
> +#ifdef CONFIG_IBM405_ERR77
> + dcbt 0,r5
> +#endif
> + stwcx. r8,0,r5
> + bne- 0b
> +1:
> +
> +#ifdef CONFIG_PREEMPT
> + /* check current_thread_info->preempt_count */
> lwz r0,TI_PREEMPT(r9)
> cmpwi 0,r0,0 /* if non-zero, just restore regs and return */
> bne restore
> - lwz r0,TI_FLAGS(r9)
> - andi. r0,r0,_TIF_NEED_RESCHED
> + andi. r8,r8,_TIF_NEED_RESCHED
> beq+ restore
> + lwz r3,_MSR(r1)
> andi. r0,r3,MSR_EE /* interrupts off? */
> beq restore /* don't schedule if so */
> #ifdef CONFIG_TRACE_IRQFLAGS
> @@ -864,8 +903,6 @@ resume_kernel:
> */
> bl trace_hardirqs_on
> #endif
> -#else
> -resume_kernel:
> #endif /* CONFIG_PREEMPT */
>
> /* interrupts are hard-disabled at this point */
> diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
> index b40e0b4..bdd2dc1 100644
> --- a/arch/powerpc/kernel/entry_64.S
> +++ b/arch/powerpc/kernel/entry_64.S
> @@ -593,6 +593,43 @@ _GLOBAL(ret_from_except_lite)
> b .ret_from_except
>
> resume_kernel:
> + /* check current_thread_info, _TIF_EMULATE_STACK_STORE */
> + CURRENT_THREAD_INFO(r9, r1)
> + ld r8,TI_FLAGS(r9)
> + andis. r8,r8,_TIF_EMULATE_STACK_STORE@h
> + beq+ 1f
> +
> + addi r8,r1,INT_FRAME_SIZE /* Get the kprobed function entry */
> +
> + lwz r3,GPR1(r1)
> + subi r3,r3,INT_FRAME_SIZE /* dst: Allocate a trampoline exception frame */
> + mr r4,r1 /* src: current exception frame */
> + li r5,INT_FRAME_SIZE /* size: INT_FRAME_SIZE */
> + li r6,0 /* start offset: 0 */
> + mr r1,r3 /* Reroute the trampoline frame to r1 */
> +
> + /* Copy from the original to the trampoline. */
> + li r6,0
> + srwi r5,r5,3
> + mtctr r5
> +2: ldx r0,r6,r4
> + stdx r0,r6,r3
> + addi r6,r6,8
> + bdnz 2b
> +
> + /* Do real store operation to complete stwu */
> + lwz r5,GPR1(r1)
> + std r8,0(r5)
> +
> + /* Clear _TIF_EMULATE_STACK_STORE flag */
> + lis r11,_TIF_EMULATE_STACK_STORE@h
> + addi r5,r9,TI_FLAGS
> + ldarx r4,0,r5
> + andc r4,r4,r11
> + stdcx. r4,0,r5
> + bne- 0b
> +1:
> +
> #ifdef CONFIG_PREEMPT
> /* Check if we need to preempt */
> andi. r0,r4,_TIF_NEED_RESCHED
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox