Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1371159rbb; Mon, 26 Feb 2024 07:18:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW7OmIGvO2dM3oHQB69HJHbymy9KhLBAMCjqfL7oCmVxl9uN3xptm0NVmzhZHbiglVyaZ8+JonltTYTxjTwMYXrLAd21KYXQYcBi/DxeQ== X-Google-Smtp-Source: AGHT+IHpJD3YBYnGqynFljN+WFZADuTJhIy/TJpSd26y8wnlk8DNWup+PnJaRQ/jOQeCB35XifGt X-Received: by 2002:a17:907:9486:b0:a42:e819:e663 with SMTP id dm6-20020a170907948600b00a42e819e663mr6529403ejc.27.1708960685932; Mon, 26 Feb 2024 07:18:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708960685; cv=pass; d=google.com; s=arc-20160816; b=V/b17Fczjed6xyM843Fu1cF4T7ePyglV13kiYGg45PIFFSc7T6ysnGpoo4kGZnwDqh uAGgE0kdreQhz6yWzSIXZHgI8TTA1vAZXWk0t/JfzuiZtgxwSocMe9f2yP9jwVgVTSxV nHrbQJW46f98Zg5+Ma8sviKbsgIQnIZMeRPOpyFJ9f6wZ3/xPYdToEANG2XCXENaghy1 IGY7mTl+Bc8w1hTxWq9ytBlhSvY7rxGZDCdIGOIQL/hNCOt0lpMMjIpo8VRun0++kPSQ 4ALC3M2K62iSZE6I8zv932YPXy4AzsBWeVasNmQU/a1v8rtePlmxG/V4L6nPRrdsMVe8 W+aA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=syoXEFoQ4EfbNa1TaVkH1tFnaJfOi1a1yzCmzBjia5Q=; fh=CSJaGuChrpWdJ0Q6/VaYsWAN0wo7uO/W+ZOtSBE/1do=; b=v8eWrP6I+Q/BSfjpst9cROzsq4EGFOowFQR6S8vNtbf0RO8MBu5aDTdmow4+HyGSzG 089p7OCerHkl6q7H8AvhDpTvKDm4xulrJq0RLtrEBlnE2gdhmMbMj2DPVyPgDbukuStZ qsi1Mh8Ak8qZ63YefNURuFsub5dtTf036iwQdUoZLTWSpyfIEqYrLT4WKL6UWhBMyirv f4N0MXLzf6ChaO4Osqc7PAE9CEWXI1N57YRm3JOuDNyBkxN+/fcxTCckTXVJC+HwVptY jP7Ff8oUHiux+JdSTm5aO3rpifHTjgOH2vFfIJ57b5FUjDrQgW3Ksd2J/yw+oRDmVkJy o7ow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-81767-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bu15-20020a170906a14f00b00a3f707a45f0si2056983ejb.783.2024.02.26.07.18.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 07:18:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81767-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-81767-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A75F41F3061E for ; Mon, 26 Feb 2024 15:18:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 482E4130E4A; Mon, 26 Feb 2024 15:11:18 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D56C130E34 for ; Mon, 26 Feb 2024 15:11:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708960277; cv=none; b=QpLpnkIJEriGkUgT5UsgtyKqBsUcA82hJUnOBxLC52xE4d4iPP/D4bCdREbN/We7wC3S7iyFSwphChi4dcD8K3EvuO1Ts2v35xsf7LvgNJmkBLYj+PIUlRV/GYG1JqFhvW+UeMLRDZPlT/RWvGYThvIHlBE/gp+UWoX4BjNGN2c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708960277; c=relaxed/simple; bh=Ln0cX2n+IvK9NohheK8A2fdeto9nWPwvxS5WtezTlKw=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nI5WIZ06p7GZk3P/ZaV5N5CEyU/HXW7GWgMTrlOBtDdCO2y9rTgIi/lFndq+UzK3lGBDaQ6XVdVLDleaGL/4acKQ/zq01Xn5MZlIzde7kUTejFTZ4p8ckSUtUhXbTwqUuMR5dAfICiwPsTWIvsFtVXw8wpU0ymCps3QGleV0zOk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Tk3qJ6YCkz6J9qf; Mon, 26 Feb 2024 23:06:36 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id C74521419FA; Mon, 26 Feb 2024 23:11:10 +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_256_GCM_SHA384) id 15.1.2507.35; Mon, 26 Feb 2024 15:11:10 +0000 Date: Mon, 26 Feb 2024 15:11:09 +0000 From: Jonathan Cameron To: Yicong Yang CC: , , , , , , , , Subject: Re: [PATCH v2 1/8] drivers/perf: hisi_pcie: Rename hisi_pcie_pmu_{config,clear}_filter() Message-ID: <20240226151109.00003b31@Huawei.com> In-Reply-To: <20240223103359.18669-2-yangyicong@huawei.com> References: <20240223103359.18669-1-yangyicong@huawei.com> <20240223103359.18669-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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) To lhrpeml500005.china.huawei.com (7.191.163.240) On Fri, 23 Feb 2024 18:33:52 +0800 Yicong Yang wrote: > From: Yicong Yang > > hisi_pcie_pmu_{config,clear}_filter() are config/clear HISI_PCIE_EVENT_CTRL > register which contains not only the filter but also the event code. The > function names are bit misleading. Rename it to > hisi_pcie_pmu_{config,clear}_event_ctrl() to reflects their functions > more accurately. > > Signed-off-by: Yicong Yang Definitely an improvement on readability. As discussed offline I'm not sure the 'clear' part is strictly right either, but in some sense that's a separate issue. Reviewed-by: Jonathan Cameron > --- > drivers/perf/hisilicon/hisi_pcie_pmu.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/perf/hisilicon/hisi_pcie_pmu.c b/drivers/perf/hisilicon/hisi_pcie_pmu.c > index b90ba8aca3fa..9760ddde46fd 100644 > --- a/drivers/perf/hisilicon/hisi_pcie_pmu.c > +++ b/drivers/perf/hisilicon/hisi_pcie_pmu.c > @@ -216,7 +216,7 @@ 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 void hisi_pcie_pmu_config_event_ctrl(struct perf_event *event) > { > struct hisi_pcie_pmu *pcie_pmu = to_pcie_pmu(event->pmu); > struct hw_perf_event *hwc = &event->hw; > @@ -259,7 +259,7 @@ static void hisi_pcie_pmu_config_filter(struct perf_event *event) > hisi_pcie_pmu_writeq(pcie_pmu, HISI_PCIE_EVENT_CTRL, hwc->idx, reg); > } > > -static void hisi_pcie_pmu_clear_filter(struct perf_event *event) > +static void hisi_pcie_pmu_clear_event_ctrl(struct perf_event *event) > { > struct hisi_pcie_pmu *pcie_pmu = to_pcie_pmu(event->pmu); > struct hw_perf_event *hwc = &event->hw; > @@ -505,7 +505,7 @@ static void hisi_pcie_pmu_start(struct perf_event *event, int flags) > WARN_ON_ONCE(!(hwc->state & PERF_HES_UPTODATE)); > hwc->state = 0; > > - hisi_pcie_pmu_config_filter(event); > + hisi_pcie_pmu_config_event_ctrl(event); > hisi_pcie_pmu_enable_counter(pcie_pmu, hwc); > hisi_pcie_pmu_enable_int(pcie_pmu, hwc); > hisi_pcie_pmu_set_period(event); > @@ -526,7 +526,7 @@ static void hisi_pcie_pmu_stop(struct perf_event *event, int flags) > hisi_pcie_pmu_event_update(event); > hisi_pcie_pmu_disable_int(pcie_pmu, hwc); > hisi_pcie_pmu_disable_counter(pcie_pmu, hwc); > - hisi_pcie_pmu_clear_filter(event); > + hisi_pcie_pmu_clear_event_ctrl(event); > WARN_ON_ONCE(hwc->state & PERF_HES_STOPPED); > hwc->state |= PERF_HES_STOPPED; >