Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2849122rdg; Mon, 16 Oct 2023 17:48:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHy/tY/RuECXYmLhTRDcy+igLslhkApmSwomBFPk7Fggs2QanfzirdLAbnD0wrqo0Bnaz0n X-Received: by 2002:a05:6830:1d6e:b0:6b9:6419:1cde with SMTP id l14-20020a0568301d6e00b006b964191cdemr914508oti.22.1697503714880; Mon, 16 Oct 2023 17:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697503714; cv=none; d=google.com; s=arc-20160816; b=oOFk+K9x2VYEPqRI9MCOx5MFJyJeot1R3atYFPLhcJCQlEKZltX5HgU4+bOZYs7A7v lqg82tzDD+IQ+d72vJMXG5ye2F6uRGID4HyxFdKrPBDzJ6oq42CQQzJZh42ggxGwch/E b9V3RDmHEHjXXgdpeMQTvyTfRklLmN5bJApPpIS5S9kmV6FpN2uRR5cTlOphuebtOkNJ TVVhfmf+AgjVBx4xc7SSRuLuQ5pjKKf3PUIVt7Fn3BF5U2DELFrTjZiDIktEYQcm0gbG T614iIjpklaO4VGKumSFz5asEErrfudMjRhDxJ8juzyCic9ih/9KZ7SdKyBNgs3t5tQf V0yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Q5s7SngcH9sE2kWmupbOuVLLH6Y/QWWioIG3llhbEPM=; fh=Ssk5R1bk63Q0yo2Z4p1Fa+rPGXs+nj5SqQVk5e670dc=; b=Hz/z/fhXVAfRUz1qrvhk+EOBK5mHWB7G5cNE61RHkM/BFk++7JFGRjKfZDx/mfCZB9 K76Fkrol0aLXNP6mng25OI1U8UEJLgBzAZX1VLAeyI4wYbPIylAj7y3GyJSTtjdnJLmG TEV+eM27/wr5AmkyGGYgH4tyDENK8Uq6eg4rkrL4Qb2m+x24GJ1XzCRV8rbxP7BC4D2O nV4yhhpn6WQl/RWJVSsJ4pVvUKN0CmfgoHMz26ayHfcjghKDIypXcv41Bm19PtzWD3nZ u7BqJPiOZp+RvnSijIBt1WPPK8lqwYPlNXpv360lh2NX1SQgE6/94scA65Fy4Dz2mZu6 nZPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id s194-20020a6377cb000000b005ac44f928e4si563332pgc.152.2023.10.16.17.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 17:48:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 835B280203E1; Mon, 16 Oct 2023 17:48:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233956AbjJQAs1 (ORCPT + 99 others); Mon, 16 Oct 2023 20:48:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233549AbjJQAs0 (ORCPT ); Mon, 16 Oct 2023 20:48:26 -0400 Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7785492; Mon, 16 Oct 2023 17:48:23 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0VuKn2PK_1697503699; Received: from 30.240.113.74(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VuKn2PK_1697503699) by smtp.aliyun-inc.com; Tue, 17 Oct 2023 08:48:20 +0800 Message-ID: <83e7bb45-7776-4cfa-a3ed-050faaa1e72c@linux.alibaba.com> Date: Tue, 17 Oct 2023 08:48:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 3/4] drivers/perf: add DesignWare PCIe PMU driver Content-Language: en-US To: Bjorn Helgaas Cc: chengyou@linux.alibaba.com, kaishen@linux.alibaba.com, yangyicong@huawei.com, will@kernel.org, Jonathan.Cameron@huawei.com, baolin.wang@linux.alibaba.com, robin.murphy@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, rdunlap@infradead.org, mark.rutland@arm.com, zhuo.song@linux.alibaba.com, renyu.zj@linux.alibaba.com References: <20231016143805.GA1207929@bhelgaas> From: Shuai Xue In-Reply-To: <20231016143805.GA1207929@bhelgaas> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 16 Oct 2023 17:48:32 -0700 (PDT) On 2023/10/16 22:38, Bjorn Helgaas wrote: > On Mon, Oct 16, 2023 at 11:00:13AM +0800, Shuai Xue wrote: >> On 2023/10/14 00:30, Bjorn Helgaas wrote: >>> On Fri, Oct 13, 2023 at 11:46:44AM +0800, Shuai Xue wrote: >>>> On 2023/10/13 00:25, Bjorn Helgaas wrote: >>>>> On Thu, Oct 12, 2023 at 11:28:55AM +0800, Shuai Xue wrote: >>>>>> This commit adds the PCIe Performance Monitoring Unit (PMU) >>>>>> driver support for T-Head Yitian SoC chip. Yitian is based on >>>>>> the Synopsys PCI Express Core controller IP which provides >>>>>> statistics feature. The PMU is not a PCIe Root Complex >>>>>> integrated End Point(RCiEP) device but only register counters >>>>>> provided by each PCIe Root Port. > >> @@ -447,10 +447,10 @@ static int dwc_pcie_pmu_event_add(struct perf_event *event, int flags) >> u32 ctrl; >> >> /* Only one counter and it is in use */ >> - if (pcie_pmu->event) >> + if (pcie_pmu->event[type]) >> return -ENOSPC; >> >> - pcie_pmu->event = event; >> + pcie_pmu->event[type] = event; > > OK, makes good sense (probably update the comment also, e.g., "one > counter of each type"). Yes, will do that. > >> } >>> If so, I might word this as: >>> >>> Each Root Port contains one counter that can be used for either: >>> >>> - Time-Based Analysis (RX/TX data throughput and time spent in >>> each low-power LTSSM state) or >>> >>> - Event counting (error and non-error events for a specified lane) >>> >>> There is no interrupt for counter overflow. >> >> Based on above, I change the word to: >> >> To facilitate collection of statistics the controller provides the >> following two features for each Root Port: >> >> - one 64-bit counter for Time Based Analysis (RX/TX data throughput and >> time spent in each low-power LTSSM state) and >> - one 32-bit counter for Event counting (error and non-error events for >> a specified lane) >> >> Note: There is no interrupt for counter overflow. > > Beautiful, that's very clear. > Thank you for quick feedback. I will send a new version latter. Best Regards. Shuai