/* Re-enable interrupts on a event after they were throttled because they were coming too fast.  */
static void power_pmu_unthrottle(struct perf_event *event)
/* Re-enable interrupts on a event after they were throttled because they were coming too fast.  */
static void power_pmu_unthrottle(struct perf_event *event)
{
	s64 val, left;
	unsigned long flags;
	if (!event->hw.idx || !event->hw.sample_period)
		return;
	local_irq_save(flags);
	perf_disable();
	power_pmu_read(event);
	left = event->hw.sample_period;
	event->hw.last_period = left;
	val = 0;
	if (left < 0x80000000L)
		val = 0x80000000L - left;
	write_pmc(event->hw.idx, val);
	atomic64_set(&event->hw.prev_count, val);
	atomic64_set(&event->hw.period_left, left);
	perf_event_update_userpage(event);
	perf_enable();
	local_irq_restore(flags);
}