Skip to content

Commit

Permalink
sparc: Don't do expensive hypervisor PCR write unless necessary.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
davem330 committed Jul 28, 2011
1 parent 15e3608 commit 314ff52
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arch/sparc/kernel/pcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ static void n2_pcr_write(u64 val)
{
unsigned long ret;

ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val);
if (ret != HV_EOK)
if (val & PCR_N2_HTRACE) {
ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val);
if (ret != HV_EOK)
write_pcr(val);
} else
write_pcr(val);
}

Expand Down

0 comments on commit 314ff52

Please sign in to comment.