Re: [PATCHv2 3/4] arm-cci: Add routines to enable/disable all counters

2015-11-05 Thread Suzuki K. Poulose
On 05/11/15 17:27, Mark Rutland wrote: Can we not get rid of the mask entirely? The combination of used_mask and each event's hwc->state tells us which counters are actually in use. The problem is that neither hwc->state nor the cci_pmu->hw_events->events is protected by pmu_lock, while enable/

Re: [PATCHv2 3/4] arm-cci: Add routines to enable/disable all counters

2015-11-05 Thread Mark Rutland
> >>+static void pmu_disable_counters_ctrl(struct cci_pmu *cci_pmu, unsigned > >>long *mask) > >>+{ > >>+ int i; > >>+ > >>+ for (i = 0; i < cci_pmu->num_cntrs; i++) { > >>+ clear_bit(i, mask); > >>+ if (pmu_get_counter_ctrl(cci_pmu, i)) { > >>+ set_bit(i,

Re: [PATCHv2 3/4] arm-cci: Add routines to enable/disable all counters

2015-11-05 Thread Suzuki K. Poulose
On 05/11/15 10:14, Suzuki K. Poulose wrote: On 04/11/15 18:28, Mark Rutland wrote: On Tue, Oct 20, 2015 at 02:05:25PM +0100, Suzuki K. Poulose wrote: Adds helper routines to manipulate the counter controls for all the counters on the CCI PMU. +static void pmu_disable_counters_ctrl(struct cci

Re: [PATCHv2 3/4] arm-cci: Add routines to enable/disable all counters

2015-11-05 Thread Suzuki K. Poulose
On 04/11/15 18:28, Mark Rutland wrote: On Tue, Oct 20, 2015 at 02:05:25PM +0100, Suzuki K. Poulose wrote: Adds helper routines to manipulate the counter controls for all the counters on the CCI PMU. pmu_disable_counters_ctrl: Iterates over the counters, checking the status of each counter and d

Re: [PATCHv2 3/4] arm-cci: Add routines to enable/disable all counters

2015-11-04 Thread Mark Rutland
On Tue, Oct 20, 2015 at 02:05:25PM +0100, Suzuki K. Poulose wrote: > Adds helper routines to manipulate the counter controls for > all the counters on the CCI PMU. > > pmu_disable_counters_ctrl: Iterates over the counters, > checking the status of each counter and disabling any enabled > counters.

[PATCHv2 3/4] arm-cci: Add routines to enable/disable all counters

2015-10-20 Thread Suzuki K. Poulose
Adds helper routines to manipulate the counter controls for all the counters on the CCI PMU. pmu_disable_counters_ctrl: Iterates over the counters, checking the status of each counter and disabling any enabled counters. For each such changed counter, the mask is updated so that one can restore the