* [PATCH] Oprofile: Loongson: Fixup of loongson2_exit()
@ 2010-05-06 17:03 Wu Zhangjin
2010-05-25 3:51 ` Wu Zhangjin
0 siblings, 1 reply; 3+ messages in thread
From: Wu Zhangjin @ 2010-05-06 17:03 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, Wu Zhangjin
When exiting from loongson2_exit(), we need to reset the counter
register too, this patch adds a function reset_counters() to do it, by
the way, this function will be shared by Perf.
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
---
arch/mips/oprofile/op_model_loongson2.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/arch/mips/oprofile/op_model_loongson2.c b/arch/mips/oprofile/op_model_loongson2.c
index fa3bf66..01f91a3 100644
--- a/arch/mips/oprofile/op_model_loongson2.c
+++ b/arch/mips/oprofile/op_model_loongson2.c
@@ -51,6 +51,12 @@ static char *oprofid = "LoongsonPerf";
static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id);
/* Compute all of the registers in preparation for enabling profiling. */
+static void reset_counters(void *arg)
+{
+ write_c0_perfctrl(0);
+ write_c0_perfcnt(0);
+}
+
static void loongson2_reg_setup(struct op_counter_config *cfg)
{
unsigned int ctrl = 0;
@@ -157,7 +163,7 @@ static int __init loongson2_init(void)
static void loongson2_exit(void)
{
- write_c0_perfctrl(0);
+ reset_counters(NULL);
free_irq(LOONGSON2_PERFCNT_IRQ, oprofid);
}
--
1.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Oprofile: Loongson: Fixup of loongson2_exit()
2010-05-06 17:03 [PATCH] Oprofile: Loongson: Fixup of loongson2_exit() Wu Zhangjin
@ 2010-05-25 3:51 ` Wu Zhangjin
2010-05-27 16:37 ` Ralf Baechle
0 siblings, 1 reply; 3+ messages in thread
From: Wu Zhangjin @ 2010-05-25 3:51 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips
Hi, Ralf
Seems you have accepted this patch but forgot to apply it, could you
please apply it, thanks ;)
Best Regards,
Wu Zhangjin
On Fri, 2010-05-07 at 01:03 +0800, Wu Zhangjin wrote:
> When exiting from loongson2_exit(), we need to reset the counter
> register too, this patch adds a function reset_counters() to do it, by
> the way, this function will be shared by Perf.
>
> Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
> ---
> arch/mips/oprofile/op_model_loongson2.c | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/arch/mips/oprofile/op_model_loongson2.c b/arch/mips/oprofile/op_model_loongson2.c
> index fa3bf66..01f91a3 100644
> --- a/arch/mips/oprofile/op_model_loongson2.c
> +++ b/arch/mips/oprofile/op_model_loongson2.c
> @@ -51,6 +51,12 @@ static char *oprofid = "LoongsonPerf";
> static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id);
> /* Compute all of the registers in preparation for enabling profiling. */
>
> +static void reset_counters(void *arg)
> +{
> + write_c0_perfctrl(0);
> + write_c0_perfcnt(0);
> +}
> +
> static void loongson2_reg_setup(struct op_counter_config *cfg)
> {
> unsigned int ctrl = 0;
> @@ -157,7 +163,7 @@ static int __init loongson2_init(void)
>
> static void loongson2_exit(void)
> {
> - write_c0_perfctrl(0);
> + reset_counters(NULL);
> free_irq(LOONGSON2_PERFCNT_IRQ, oprofid);
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Oprofile: Loongson: Fixup of loongson2_exit()
2010-05-25 3:51 ` Wu Zhangjin
@ 2010-05-27 16:37 ` Ralf Baechle
0 siblings, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2010-05-27 16:37 UTC (permalink / raw)
To: Wu Zhangjin; +Cc: linux-mips
On Tue, May 25, 2010 at 11:51:50AM +0800, Wu Zhangjin wrote:
> Seems you have accepted this patch but forgot to apply it, could you
> please apply it, thanks ;)
Ah, sorry. This one did conflict with the other patches resulting in
some fuzz when applying it so my patch-o-matic automatically dropped it.
It's in for real now.
Ralf
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-27 16:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-06 17:03 [PATCH] Oprofile: Loongson: Fixup of loongson2_exit() Wu Zhangjin
2010-05-25 3:51 ` Wu Zhangjin
2010-05-27 16:37 ` Ralf Baechle
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).