linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Sheetal Sahasrabudhe <sheetals@codeaurora.org>
Cc: linux-arm-kernel@lists.infradead.org, jamie.iles@picochip.com,
	jean.pihet@newoldbits.com, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] [ARM] perfevents: Add support for Scorpion performance monitors
Date: Tue, 08 Mar 2011 14:52:37 +0000	[thread overview]
Message-ID: <1299595957.6872.7.camel@e102144-lin.cambridge.arm.com> (raw)
In-Reply-To: <1299534463-25802-1-git-send-email-sheetals@codeaurora.org>


Hello Sheetal,


On Mon, 2011-03-07 at 21:47 +0000, Sheetal Sahasrabudhe wrote:
> This commit adds support for performance monitors provided by
> Qualcomm Scorpion and ScorpionMP processor to perfevents.
> 
> Signed-off-by: Sheetal Sahasrabudhe <sheetals@codeaurora.org>
> Reviewed-by: Jean Pihet <j-pihet@ti.com>
> Reviewed-by: Will Deacon <will.deacon@arm.com>
> ---
>  arch/arm/include/asm/perf_event.h |    2 +
>  arch/arm/kernel/perf_event.c      |   11 +
>  arch/arm/kernel/perf_event_msm.c  |  665 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 678 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/kernel/perf_event_msm.c
> 
[...]

> +static DEFINE_PER_CPU(u32, venum_orig_val);
> +static DEFINE_PER_CPU(u32, fp_orig_val);
> +
> +static void scorpion_pre_vlpm(void)
> +{
> +       u32 venum_new_val;
> +       u32 fp_new_val;
> +       /* CPACR Enable CP10 access*/
> +       asm volatile("mrc p15, 0, %0, c1, c0, 2" : "=r" (venum_orig_val));
> +       venum_new_val = venum_orig_val | 0x00100000;
> +       asm volatile("mcr p15, 0, %0, c1, c0, 2" : : "r" (venum_new_val));
> +       isb();
> +       /* Enable FPEXC */
> +       fp_orig_val = fmrx(FPEXC);
> +       fp_new_val = fp_orig_val | FPEXC_EN;
> +       fmxr(FPEXC, fp_new_val);
> +}
> +

When I looked at this originally, I thought it would be nice to have
some functions or macros for poking with the CPACR and planned to submit
that as a separate patch...

... well it turns out we already have this! Please can you update this
bit of code to use the {get,set}_copro_access functions in asm/system.h?
You can use the CPACC_SVC macro to generate the access mask too instead
of hardcoding the 0x00100000.

Cheers,

Will


  reply	other threads:[~2011-03-08 14:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-07 21:47 [PATCH v2 2/3] [ARM] perfevents: Add support for Scorpion performance monitors Sheetal Sahasrabudhe
2011-03-08 14:52 ` Will Deacon [this message]
2011-03-08 18:31   ` Sheetal Sahasrabudhe

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=1299595957.6872.7.camel@e102144-lin.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=jamie.iles@picochip.com \
    --cc=jean.pihet@newoldbits.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sheetals@codeaurora.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).