From: Mark Rutland Date: Wed, 22 Jun 2011 14:32:48 +0000 (+0100) Subject: ARM: 6975/1: pmu: reject duplicate PMU registrations X-Git-Tag: v3.1-rc1~258^2~1^6~14 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae0c3751ab08d3fe039d48935e9ad2c46711b23b;p=pandora-kernel.git ARM: 6975/1: pmu: reject duplicate PMU registrations 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 Acked-by: Jamie Iles Acked-by: Will Deacon Signed-off-by: Russell King --- Reading git-diff-tree failed