Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932692AbdC3Js5 (ORCPT ); Thu, 30 Mar 2017 05:48:57 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33774 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752667AbdC3Jsz (ORCPT ); Thu, 30 Mar 2017 05:48:55 -0400 Subject: Re: [PATCH v6 07/11] drivers: perf: hisi: Add support for Hisilicon SoC event counters To: Mark Rutland References: <1489127311-112778-1-git-send-email-anurup.m@huawei.com> <20170321165252.GA29116@leverpostej> Cc: will.deacon@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, anurup.m@huawei.com, zhangshaokun@hisilicon.com, tanxiaojun@huawei.com, xuwei5@hisilicon.com, sanil.kumar@hisilicon.com, john.garry@huawei.com, gabriele.paoloni@huawei.com, shiju.jose@huawei.com, huangdaode@hisilicon.com, linuxarm@huawei.com, dikshit.n@huawei.com, shyju.pv@huawei.com From: Anurup M Message-ID: <58DCD47C.2010501@gmail.com> Date: Thu, 30 Mar 2017 15:18:44 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20170321165252.GA29116@leverpostej> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 957 Lines: 32 On Tuesday 21 March 2017 10:22 PM, Mark Rutland wrote: > +static int hisi_hw_perf_event_init(struct perf_event *event) > >+{ > >+ struct hw_perf_event *hwc = &event->hw; > >+ struct hisi_pmu *hisi_pmu = to_hisi_pmu(event->pmu); > >+ struct device *dev = hisi_pmu->dev; >> + >> >+ /* >> >+ * We must NOT create groups containing mixed PMUs, although >> >+ * software events are acceptable >> >+ */ >> >+ if (event->group_leader->pmu != event->pmu && >> >+ !is_software_event(event->group_leader)) >> >+ return -EINVAL; >> >+ >> >+ list_for_each_entry(sibling, &event->group_leader->sibling_list, >> >+ group_entry) >> >+ if (sibling->pmu != event->pmu && !is_software_event(sibling)) >> >+ return -EINVAL; > Please also check the number of counters. Sorry, I could not follow this comment correctly. Could you please explain ? I check the available counters and update used mask in pmu_add --> get_event_index Thanks, Anurup > [...] >