From: Stephen Rothwell Date: Mon, 5 Dec 2011 02:54:18 +0000 (+1100) Subject: Merge remote-tracking branch 'tip/auto-latest' X-Git-Tag: next-20111205~21 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a3c30f160944ba7f914e6e132cc2c7a654815c5a;p=karo-tx-linux.git Merge remote-tracking branch 'tip/auto-latest' Conflicts: arch/mips/kernel/perf_event_mipsxx.c --- a3c30f160944ba7f914e6e132cc2c7a654815c5a diff --cc arch/arm/kernel/perf_event.c index 172101ac97de,ff17b17b668e..a4f192cc51b2 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c @@@ -336,17 -343,11 +336,17 @@@ validate_group(struct perf_event *event { struct perf_event *sibling, *leader = event->group_leader; struct pmu_hw_events fake_pmu; + DECLARE_BITMAP(fake_used_mask, ARMPMU_MAX_HWEVENTS); - memset(&fake_pmu, 0, sizeof(fake_pmu)); + /* + * Initialise the fake PMU. We only need to populate the + * used_mask for the purposes of validation. + */ + memset(fake_used_mask, 0, sizeof(fake_used_mask)); + fake_pmu.used_mask = fake_used_mask; if (!validate_event(&fake_pmu, leader)) - return -ENOSPC; + return -EINVAL; list_for_each_entry(sibling, &leader->sibling_list, group_entry) { if (!validate_event(&fake_pmu, sibling)) diff --cc arch/mips/kernel/perf_event_mipsxx.c index bda4bc9e6988,315fc0b250f8..e3b897acfbc0 --- a/arch/mips/kernel/perf_event_mipsxx.c +++ b/arch/mips/kernel/perf_event_mipsxx.c @@@ -710,16 -731,16 +710,16 @@@ static int validate_group(struct perf_e memset(&fake_cpuc, 0, sizeof(fake_cpuc)); - if (!validate_event(&fake_cpuc, leader)) + if (mipsxx_pmu_alloc_counter(&fake_cpuc, &leader->hw) < 0) - return -ENOSPC; + return -EINVAL; list_for_each_entry(sibling, &leader->sibling_list, group_entry) { - if (!validate_event(&fake_cpuc, sibling)) + if (mipsxx_pmu_alloc_counter(&fake_cpuc, &sibling->hw) < 0) - return -ENOSPC; + return -EINVAL; } - if (!validate_event(&fake_cpuc, event)) + if (mipsxx_pmu_alloc_counter(&fake_cpuc, &event->hw) < 0) - return -ENOSPC; + return -EINVAL; return 0; }