aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/pcr.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-07-27 23:46:25 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-27 23:46:25 -0400
commit314ff52727fe94dfbe07f3a9a489ab3ca8d8df5a (patch)
treedf8bbc25ebe7e6f0da73403c5e2b9def2c37f2df /arch/sparc/kernel/pcr.c
parent15e3608d7c273947dbf2eadbcaa66e51143928fb (diff)
sparc: Don't do expensive hypervisor PCR write unless necessary.
The hypervisor call is only necessary if hypervisor events are being requested. So if we're not tracking hypervisor events, simply do a direct register write. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/pcr.c')
-rw-r--r--arch/sparc/kernel/pcr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c
index 8ac23e660080..878c6824c732 100644
--- a/arch/sparc/kernel/pcr.c
+++ b/arch/sparc/kernel/pcr.c
@@ -80,8 +80,11 @@ static void n2_pcr_write(u64 val)
80{ 80{
81 unsigned long ret; 81 unsigned long ret;
82 82
83 ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val); 83 if (val & PCR_N2_HTRACE) {
84 if (ret != HV_EOK) 84 ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val);
85 if (ret != HV_EOK)
86 write_pcr(val);
87 } else
85 write_pcr(val); 88 write_pcr(val);
86} 89}
87 90