From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C1C8C4828F for ; Thu, 8 Feb 2024 12:07:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P9GFfVIA+ujpbZM4dInaYDxaChjpa86CKd91E/MaTUA=; b=NPTYUZ3v8pE5rb zaR6DQ4HrIVVFZnqMZDMuBs9og/OkChKRDR0s3UUHsVe5lBlSnZDT8f5EXqbR6gohPgkZw+EBq4Ke TDtB8IoH6luuWojczV4XpAK4LITplplORqSb9R1vYtYYdVHK/r3xvS5MNOMng+urmUymTUTm/XOv1 5tQqJzSu8j91h7nKuQ6BpA+GFaG7CPOXj/WJafXVYfWbgDYCHYfMrqhuyFlCtBpwvhH+BVho/TgZh DUSGOQuih6TfwBMPfudb9Rt8oCfNN8tsZ2kyXKqooy3Bl4Z2PNcmiK6h9xzM4yJP4XXnVUpVnUrFd b0tA6Qv6IFQKsJcAUPmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY3BN-0000000DfVg-0bll; Thu, 08 Feb 2024 12:07:09 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY3BK-0000000DfSQ-0y6C for linux-arm-kernel@lists.infradead.org; Thu, 08 Feb 2024 12:07:07 +0000 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TVwcH4Sntz6K99r; Thu, 8 Feb 2024 20:03:27 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id BB65C1400D9; Thu, 8 Feb 2024 20:06:44 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 8 Feb 2024 12:06:44 +0000 Date: Thu, 8 Feb 2024 12:06:43 +0000 From: Jonathan Cameron To: Yicong Yang CC: , , , , , , , , Subject: Re: [PATCH 1/7] drivers/perf: hisi_pcie: Introduce hisi_pcie_pmu_get_filter() Message-ID: <20240208120643.000042fa@Huawei.com> In-Reply-To: <20240204074527.47110-2-yangyicong@huawei.com> References: <20240204074527.47110-1-yangyicong@huawei.com> <20240204074527.47110-2-yangyicong@huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500001.china.huawei.com (7.191.163.213) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240208_040706_428027_BECA4FF7 X-CRM114-Status: GOOD ( 13.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, 4 Feb 2024 15:45:21 +0800 Yicong Yang wrote: > From: Yicong Yang > > Factor out retrieving of the register value for the > corresponding event from hisi_pcie_config_filter() into a > new function hisi_pcie_pmu_get_filter() allowing future reuse. > > Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron > --- > drivers/perf/hisilicon/hisi_pcie_pmu.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/perf/hisilicon/hisi_pcie_pmu.c b/drivers/perf/hisilicon/hisi_pcie_pmu.c > index b90ba8aca3fa..11a819cd07f2 100644 > --- a/drivers/perf/hisilicon/hisi_pcie_pmu.c > +++ b/drivers/perf/hisilicon/hisi_pcie_pmu.c > @@ -216,10 +216,8 @@ static void hisi_pcie_pmu_writeq(struct hisi_pcie_pmu *pcie_pmu, u32 reg_offset, > writeq_relaxed(val, pcie_pmu->base + offset); > } > > -static void hisi_pcie_pmu_config_filter(struct perf_event *event) > +static u64 hisi_pcie_pmu_get_filter(struct perf_event *event) > { > - struct hisi_pcie_pmu *pcie_pmu = to_pcie_pmu(event->pmu); > - struct hw_perf_event *hwc = &event->hw; > u64 port, trig_len, thr_len, len_mode; > u64 reg = HISI_PCIE_INIT_SET; > > @@ -256,6 +254,15 @@ static void hisi_pcie_pmu_config_filter(struct perf_event *event) > else > reg |= FIELD_PREP(HISI_PCIE_LEN_M, HISI_PCIE_LEN_M_DEFAULT); > > + return reg; > +} > + > +static void hisi_pcie_pmu_config_filter(struct perf_event *event) > +{ > + struct hisi_pcie_pmu *pcie_pmu = to_pcie_pmu(event->pmu); > + struct hw_perf_event *hwc = &event->hw; > + u64 reg = hisi_pcie_pmu_get_filter(event); > + > hisi_pcie_pmu_writeq(pcie_pmu, HISI_PCIE_EVENT_CTRL, hwc->idx, reg); > } > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel