Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1168243rwd; Tue, 16 May 2023 12:52:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ajYoOI2xwEbkjCEP59W5KQ5PS85x4m7KbQ1VqUpkyEvzzM/kGw+sBqA9bW8ju6r+7BHD9 X-Received: by 2002:a05:6a21:9981:b0:103:f088:105e with SMTP id ve1-20020a056a21998100b00103f088105emr25428967pzb.16.1684266762439; Tue, 16 May 2023 12:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684266762; cv=none; d=google.com; s=arc-20160816; b=IFMgQJ/fskQ9xy/L0lYzfp7r2G21x5Nad8CvxXnPj2jWChWV7UD8xbS5wDc70+WlBR U2gq6wNuDiNhUYOq8EX5/HmvQdQy1zu+lZkHdIKYRv5Jmmgy5cpAOJ24728wnEQ7MyLt qFIr7uihRINVCPrxa0sZPd78jCR6GTbq8QxKYPBVbrs4vOaMD/Gbl+qY7UIIRyq7ONRe H56nxu1csTz04W0fXwNMnYHfbeHIFfzqQL9WmMCbyjPsuLN8+5v6SUNRS5lXFiTC//Ef 7G/bD6fuX4GdkobE81AxJWUHUVP7iGWbvFCzjljJJfpQNi39aItBEqwuz7oGbkBHM54Q GCLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=5C9ZU+G1mm2xEzzm+aoyxyjjXt1P0f2gzrLPjqOs+BI=; b=VcTCd0szmaPmW7yUVI3RyZ5jLeoxWLJ/7yidyTkOJEQQniCEk2w3IubHH3ovzFHi+x XMQS2Pz8QrU7Ddzg1sRE9QTIUz5i7hpNksvNnxM4ACL7TkqJazVTo1WwYSLVAqk6B68e KXnW/xEz1/p/b/00TRkM2Pyy4ogwPAtxik/V3KLhGxjyKkXKyEuTn6rfdKECS5gpSba7 9VyVO9/nATnZrhDrYXHiW3g7JZFdGiX17xeUK7NiDz9Jqm6GuS3pNyCwfdy1fiw8XwJx 88CT4w9pyCgdpV8PljkROPE7ZhDrPovOvAsr3TYJK5HCcmoVpV+EQle+3GKZssxwYlno Tmng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="U/uowP+R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q9-20020a632a09000000b005245a7cb22esi18781804pgq.674.2023.05.16.12.52.30; Tue, 16 May 2023 12:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="U/uowP+R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229666AbjEPTT7 (ORCPT + 99 others); Tue, 16 May 2023 15:19:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjEPTT6 (ORCPT ); Tue, 16 May 2023 15:19:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC90C7AB8; Tue, 16 May 2023 12:19:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8200263E45; Tue, 16 May 2023 19:19:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E817C433D2; Tue, 16 May 2023 19:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684264796; bh=H7hBEmw3Z3LoaI9KQBlQHHYtNoDMB9M+8qVjdKRbuio=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=U/uowP+R8HvoDRhWN0BTTHjsMrX84zavErJ+nQDYb5WuMFFdx1/01SDuAHkd3wL7t DZY5xi8YMVkjIgc0P5XxFfhbAfiz1jskUTDhxLpHhDa3iAvjAlL/sZtmQTq7Wf8TrY LpDYD8HaleZTv8PnLbpmPO1+6O03QIrc2lqhvK7teXFay3M6gcteNGlDO2cHNRj2A8 X1gnUzBEhLpc7UZ1xxG4/htMeZvk1v10OSf4y1fqtayKfXKu0w2FpCCGmK37gYqDnM OdwweI7apqpeLjLLN7aOKD9xVDCzela8Qt9HMVKmoNHk2uN4veFEH3YrKX825PowL7 ZweX7MQH+sqBw== Date: Tue, 16 May 2023 14:19:55 -0500 From: Bjorn Helgaas To: Shuai Xue Cc: 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 Subject: Re: [PATCH v4 3/4] drivers/perf: add DesignWare PCIe PMU driver Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230516130110.59632-4-xueshuai@linux.alibaba.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 16, 2023 at 09:01:09PM +0800, Shuai Xue wrote: > ... > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include Typically in alpha order. > +#define DWC_PCIE_VSEC_RAS_DES_ID 0x02 > + > +#define DWC_PCIE_EVENT_CNT_CTL 0x8 Add a blank line here. > +/* > + * Event Counter Data Select includes two parts: > +#define DWC_PCIE_EVENT_CNT_DATA 0xC > +#define DWC_PCIE_DURATION_4US 0xff ... Pick upper-case hex or lower-case hex and use consistently. > +#define DWC_PCIE_LANE_EVENT_MAX_PERIOD (GENMASK_ULL(31, 0)) > +#define DWC_PCIE_TIME_BASED_EVENT_MAX_PERIOD (GENMASK_ULL(63, 0)) Unnecessary outer "()". > +struct dwc_pcie_pmu { > + struct pci_dev *pdev; /* Root Port device */ > + u32 ras_des; /* RAS DES capability offset */ u16 is enough to address all of config space.