[PATCH 2/2] ARM: pmu: reject duplicate PMU registrations

Jamie Iles jamie at jamieiles.com
Thu Jun 9 05:56:15 EDT 2011


On Wed, Jun 08, 2011 at 04:28:31PM +0100, Mark Rutland wrote:
> Currently, the PMU reservation framework allows for multiple PMUs of
> the same type to register themselves. This can lead to a bug with the
> sequence:
> 
> register_pmu(pmu1);
> reserve_pmu(pmu_type);
> register_pmu(pmu2);
> release_pmu(pmu1);
> 
> Here, pmu1 cannot be released, and pmu2 cannot be reserved.
> 
> This patch modifies register_pmu to reject registrations where a PMU is
> already present, preventing this problem. PMUs which can have multiple
> instances should not use the PMU reservation framework.
> 
> Signed-off-by: Mark Rutland <mark.rutland at arm.com>
> Acked-By Will Deacon <will.deacon at arm.com>
> Cc: Jamie Iles <jamie at jamieiles.com>

Acked-by: Jamie Iles <jamie at jamieiles.com>

Jamie



More information about the linux-arm-kernel mailing list