Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965617AbdGTOQw (ORCPT ); Thu, 20 Jul 2017 10:16:52 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:10326 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933668AbdGTOQu (ORCPT ); Thu, 20 Jul 2017 10:16:50 -0400 Subject: Re: [PATCH v3 2/6] perf: hisi: Add support for HiSilicon SoC uncore PMU driver To: Jonathan Cameron References: <1500364799-90518-1-git-send-email-zhangshaokun@hisilicon.com> <1500364799-90518-3-git-send-email-zhangshaokun@hisilicon.com> <20170719171912.000031dd@huawei.com> <20170720214904.0000601b@huawei.com> CC: , , , , , From: Zhangshaokun Message-ID: <24ddb22b-2668-b14b-0483-5d17236d847c@hisilicon.com> Date: Thu, 20 Jul 2017 22:16:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20170720214904.0000601b@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.74.221.148] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.5970BB2E.01ED,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e1bad35a4e8033811587a1756d9f4871 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3154 Lines: 94 Hi Jonathan On 2017/7/20 21:49, Jonathan Cameron wrote: > On Thu, 20 Jul 2017 21:03:19 +0800 > Zhangshaokun wrote: > >> Hi Jonathan >> >> On 2017/7/19 17:19, Jonathan Cameron wrote: >>> On Tue, 18 Jul 2017 15:59:55 +0800 >>> Shaokun Zhang wrote: >>> >>>> This patch adds support HiSilicon SoC uncore PMU driver framework and >>>> interfaces. >>>> >>>> Signed-off-by: Shaokun Zhang >>>> Signed-off-by: Anurup M >>> A couple of minor things inline. >>> > >>>> +/* Generic pmu struct for different pmu types */ >>>> +struct hisi_pmu { >>>> + const char *name; >>>> + struct pmu pmu; >>>> + const struct hisi_uncore_ops *ops; >>>> + struct hisi_pmu_hwevents pmu_events; >>>> + cpumask_t cpus; >>>> + struct device *dev; >>>> + struct hlist_node node; >>>> + u32 scl_id; >>>> + u32 ccl_id; >>>> + /* Hardware information for different pmu types */ >>>> + void __iomem *base; >>>> + union { >>>> + u32 ddrc_chn_id; >>>> + u32 l3c_tag_id; >>>> + u32 hha_uid; >>>> + }; >>>> + int num_counters; >>>> + int num_events; >>>> + int counter_bits; >>>> +}; >>>> + >>>> +int hisi_uncore_pmu_counter_valid(struct hisi_pmu *hisi_pmu, int idx); >>>> +int hisi_uncore_pmu_get_event_idx(struct perf_event *event); >>>> +void hisi_uncore_pmu_clear_event_idx(struct hisi_pmu *hisi_pmu, int idx); >>> The above is only used in hisi_uncore_pmu.c so doesn't need to be here >>> and can be static. >>> >> >> These functions would be called in L3C/HHA/DDR PMU driver. We want to give a >> uncore perf framework in hisi_uncore_pmu.c for hisilicon uncore PMUs. >> > For all but the one function above that is true. I couldn't find this one being > used anywhere in those drivers. > My apologies, it is what your said, thanks. > >> Thanks. >> Shaokun >> >>>> +void hisi_uncore_pmu_read(struct perf_event *event); >>>> +int hisi_uncore_pmu_add(struct perf_event *event, int flags); >>>> +void hisi_uncore_pmu_del(struct perf_event *event, int flags); >>>> +void hisi_uncore_pmu_start(struct perf_event *event, int flags); >>>> +void hisi_uncore_pmu_stop(struct perf_event *event, int flags); >>>> +void hisi_uncore_pmu_set_event_period(struct perf_event *event); >>>> +u64 hisi_uncore_pmu_event_update(struct perf_event *event); >>>> +int hisi_uncore_pmu_event_init(struct perf_event *event); >>>> +int hisi_uncore_pmu_setup(struct hisi_pmu *hisi_pmu, const char *pmu_name); >>>> +void hisi_uncore_pmu_enable(struct pmu *pmu); >>>> +void hisi_uncore_pmu_disable(struct pmu *pmu); >>>> +struct hisi_pmu *hisi_pmu_alloc(struct device *dev, u32 num_cntrs); >>>> +ssize_t hisi_event_sysfs_show(struct device *dev, >>>> + struct device_attribute *attr, char *buf); >>>> +ssize_t hisi_format_sysfs_show(struct device *dev, >>>> + struct device_attribute *attr, char *buf); >>>> +ssize_t hisi_cpumask_sysfs_show(struct device *dev, >>>> + struct device_attribute *attr, char *buf); >>>> +void hisi_read_scl_and_ccl_id(u32 *scl_id, u32 *ccl_id); >>>> +#endif /* __HISI_UNCORE_PMU_H__ */ >>> >>> >>> . >>> >> > > > > . >