Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp32029rdb; Thu, 16 Nov 2023 11:03:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKSm9dosILohu6QG16nvQ0ufHZSJdaGSRmzy0pa0IKWAE5j5jQ1R8LVnemcHz6DgfLV5Xo X-Received: by 2002:a05:6870:538f:b0:1f0:656b:5b99 with SMTP id h15-20020a056870538f00b001f0656b5b99mr17942778oan.11.1700161424474; Thu, 16 Nov 2023 11:03:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700161424; cv=pass; d=google.com; s=arc-20160816; b=AeFRpsJatSYL/q5MQmbohGYYJ3GZjfxoXtzZeV5+LwV32cLEYpRDAzzXcrOj4oilqU gXQm0JsCXkXkjyBSu1n0+1cPZjmCJ1aYr2mZg9TRNZI3T6Y6Kbf34CDrxJCgFvnFBmzW 9l8jBq4AN/A0uSIKfI01xOR1pW/o3taNEG3k7IODXPzNBy7OabKozpo3tAcisVBcifM/ JlAQzeJ7bfnYAHEnlhg71AWt8m0onJ476sbaAzkJkXI3MiUBwJWH8w9Gqt4i5Q3uNl6D SXlYfyNJPvxp03tCrPn9uxMwmgFTcSfA77feGo+yFS6rgKpOKu/jmh/TEN70MgEB3RUQ tX9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=CR1vBSoWjSkjZiPQcGzLRNEIK4dqKDVbimxtF8tHx+g=; fh=u2yxT1A3PLEfowgSDzMd0nzgfQfacobe7FWqkJS7TEM=; b=x6x6ubJTY8nH7Jf+1NDXnIL6tuaJMdmhds6Mv6pz/TB6wTBRstS7gFfEdjozCxbb71 +y4T3v7kvbbVOipOsn7ePn0AlshZu+WRnV05pIHlkGzu1pxsNLpLNUN/oELG/LT6yNFV Y5MfSjf3VnHee3WZmHMu99BwuYoZbQv1IKzyedeDI7Zxk82u4SlqaqGAwAfYb1SMnYNK 608vJ9XyDkd/xTXkoEgzxh5iduuHwT2PXQsUDAMilsTjkZ+rosDVEe5OHb93Af8ooxWp Dmo00w6xl+1C0m6GaWSG8909veEHzKgnKk5zWTeFsd3DNDYQm7f0qFyIk2RNky/IXTk8 7Hdw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=nnN3una7; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id nq6-20020a056871378600b001d7001d6cd4si4426213oac.95.2023.11.16.11.03.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 11:03:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=nnN3una7; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B7AF281DC62B; Thu, 16 Nov 2023 11:03:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345486AbjKPTDI (ORCPT + 99 others); Thu, 16 Nov 2023 14:03:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345464AbjKPTDE (ORCPT ); Thu, 16 Nov 2023 14:03:04 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2103.outbound.protection.outlook.com [40.107.237.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25D47182; Thu, 16 Nov 2023 11:03:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CaSIzXQTXiSD8AyJjrv+kX+n+CzzInWnjZ8tjLI2hjrMcsXta978XLc4n3eZPKKl5lTzUOTe7ICUX61cyCQr6wyYeo7UqWxafsvK4gwhd90z/7fzWTaKZiLloFppqCK4ovQQzS+XjSubzm9cEV9jY3t2UDGU3+1QviEFglYB7johWpKTvH3Fb0r5nH4hyqROfwM95ZTu5VYqs96NO9hjxcBpcKNyW/tZ0/evMC1oAcx2vRECHZPh8WtISkOAZvSW/2OU2zkMQmFRF9lcxT4wbWS3x9k//4PqNGmq0xzWNJfkZyCODUT9dZUASHECfS/JPAcsJVz1iqT8slVggiR6/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CR1vBSoWjSkjZiPQcGzLRNEIK4dqKDVbimxtF8tHx+g=; b=h/uWprszvIMfzKG6Q1ltRPVvz3++klqPzPSd7u+9BsX2TII9KWbKVcjhvKrZQgwJ5Awq10lQegPv96BtKIZA1n1P/sxKAW+iiEnZ/Bw2UEVPwrnuxHfojc5i731or2XIFCP8f/zV+emhkNU/hhrEv0hOnxhoXXfhBujyvxamIKUaAJ8VLE8GIYUyWWyxxUz670WaKFDYfUsq4amwy7Bslz+R4YUoxK3lEtVGyHbJokLFr4HoLSNuLVxRSrD16aTP/H4+kQPm3Meu53+x323apsnDUJBEpSdPv6T16DUoahUiR0cr2fc+un2Wur6jw5WPw21CSrKMNO/Z9v5jrg/Xew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CR1vBSoWjSkjZiPQcGzLRNEIK4dqKDVbimxtF8tHx+g=; b=nnN3una78BBDoGcy0SBqe7miVPIVolf0AYwhANuuERi7wxyeqcldCDD7n6bTXvCCAIuCIgfWxfrSqO4HxxDQHSfsWsA2aSZDO8WtqYs9BF88xSuMHfkxm+jPCMx//p9iC7vw1U20KwFZur0Q1qxTopKEZvUbs8hZVJkzlpEByCw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) by PH7PR01MB7872.prod.exchangelabs.com (2603:10b6:510:1df::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.21; Thu, 16 Nov 2023 19:02:56 +0000 Received: from DM5PR0102MB3590.prod.exchangelabs.com ([fe80::49fa:8dc0:6fd1:72e6]) by DM5PR0102MB3590.prod.exchangelabs.com ([fe80::49fa:8dc0:6fd1:72e6%4]) with mapi id 15.20.7002.021; Thu, 16 Nov 2023 19:02:55 +0000 Date: Thu, 16 Nov 2023 11:02:20 -0800 (PST) From: Ilkka Koskinen To: Shuai Xue cc: Ilkka Koskinen , kaishen@linux.alibaba.com, helgaas@kernel.org, yangyicong@huawei.com, will@kernel.org, Jonathan.Cameron@huawei.com, baolin.wang@linux.alibaba.com, robin.murphy@arm.com, chengyou@linux.alibaba.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 Subject: Re: [PATCH v10 4/5] drivers/perf: add DesignWare PCIe PMU driver In-Reply-To: <7e383d7f-8df5-4d49-a45e-3dbe23b2c925@linux.alibaba.com> Message-ID: References: <20231104133216.42056-1-xueshuai@linux.alibaba.com> <20231104133216.42056-5-xueshuai@linux.alibaba.com> <32626689-c8b1-9bd-b00-5285c633bfbc@os.amperecomputing.com> <7e383d7f-8df5-4d49-a45e-3dbe23b2c925@linux.alibaba.com> Content-Type: multipart/mixed; boundary="1372433909-1814920884-1700161374=:2081" X-ClientProxiedBy: CH2PR05CA0027.namprd05.prod.outlook.com (2603:10b6:610::40) To DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR0102MB3590:EE_|PH7PR01MB7872:EE_ X-MS-Office365-Filtering-Correlation-Id: f5a0560b-e0c5-4d4a-bdaa-08dbe6d6a42d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ngZme1KbaVFhYuCLGAkHGiWe5GvKsDPTd8+TRphDFT33amBUVU/jsu9leky0H8H/kmYzMpaQm9Q90QxINGX6FzWNylmlhDHwQNnRsLJb39aLT6gYmANBzGARmyr6VemVmG1ZprqLDb9UBiPBC0w3/dh/iKWucCZ0lNFSr/+kJnhDVtLeUEWPddDPG4qQHFg7HNWuyKjQqwQ+LsMpeudyB2qtXFO5oObJz8yLY0huksW4w0KO6LWYYnXWm26ncK3XmO0fRnO5nkZExpwx6o/qulXbcUYyVojhXceGMxae7q9i8Fh8eOYlNj5IHXLxtY/jhUwHtyss8xg4a/n6U9RO/OqTFD/Zdn4Hw3bPCXOlmVsoTZIwH5kINuTOt90lWhEAHqKEKCkLNVAAzKJvohOrkJ2gWpqhjM/CkOqfsYzgU8NznD6iJ3xo3IM1TFIiJS/2HWkmBLATdyuoyaw4fWPHeWMU8fwSBifoBC42zbaLAHMZXpdlgEcekJQnrkez9fS7SPa+tMRmZw1Fo8okhJsbn2EQt4kcFl1y+XmKntKWs5ZEW//RGjzeBnruSz6uVN6MPHfYEUW+DhvxEn/GAsyPgHxEV+GzHtfkj860JbKy6Nxzyh9CX0DzLrBq20Akt90q X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR0102MB3590.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(376002)(366004)(136003)(39850400004)(346002)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(2906002)(38100700002)(31686004)(31696002)(86362001)(7416002)(5660300002)(4326008)(8936002)(41300700001)(8676002)(2616005)(6916009)(6512007)(316002)(26005)(66556008)(66476007)(66946007)(52116002)(53546011)(33964004)(6666004)(478600001)(38350700005)(6506007)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OGZZVlpjSCsyVDZjSllSQzhNNXROemdXKzQ3RDVVSFRBNFUvRG5lYXZxRno0?= =?utf-8?B?dUVkMyt3NWI1cHZLaGlyaEVLc0l5UG1zOVdudmxTa2NGc1RvNzR6QnlXV0Yx?= =?utf-8?B?Nzc0VkxXczBoRFFGZ1BrOGZ4KzllcWhQMnJudi83Sk5NRTZaaHRNc0d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0hnMHRtcElSd3RKcmtMaFhTaHBj?= =?utf-8?B?ci9qZTVtVmVCTlU4Tkl5LzUrVnhJVTB0TldkdStWQkloU2I4dmZpbHA0bzdq?= =?utf-8?B?MjMxVWcvSVIrZ2VYQ1Q5NnUrWlU2Ylh6M1dZZ1VWTzlmalJwT1FHdkN1aWhR?= =?utf-8?B?VkpVcEJkZ09FWUowQllHZ0xNWlBvRHRtQ2M0emhTeUUwR01FOHh6UTdVNnVl?= =?utf-8?Q?XdPlcxZKu0sZIuWZg6YZP2o=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5a0560b-e0c5-4d4a-bdaa-08dbe6d6a42d X-MS-Exchange-CrossTenant-AuthSource: DM5PR0102MB3590.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2023 19:02:55.7152 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LTaRF6bupbLnDSqrcSAORZm9wS9L+F3uBYiq3u+uGSQqHVNEFG0gCTIFrC6Pslld0jAqxQ/k+62rEJL1VLPVTWsyHKnWFXBfU4MFO9zKLK+gJ5VpnJXo1rJGzqSVXDGp X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR01MB7872 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 16 Nov 2023 11:03:33 -0800 (PST) --1372433909-1814920884-1700161374=:2081 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 16 Nov 2023, Shuai Xue wrote: > On 2023/11/16 11:50, Ilkka Koskinen wrote: >>> +static int dwc_pcie_pmu_probe(struct platform_device *plat_dev) >>> +{ >>> +    struct pci_dev *pdev = plat_dev->dev.platform_data; >>> +    struct dwc_pcie_pmu *pcie_pmu; >>> +    char *name; >>> +    u32 bdf, val; >>> +    u16 vsec; >>> +    int ret; >>> + >>> +    vsec = pci_find_vsec_capability(pdev, PCI_VENDOR_ID_ALIBABA, >>> +                    DWC_PCIE_VSEC_RAS_DES_ID); >> >> You nicely changed to use vendor list in this version but here the driver still tries to find Alibaba specific capability. > > Sorry, I missed here. > >> I guess, you could search again using the vendor list. The other option would be to make dwc_pcie_match_des_cap() to return the vendor id, pass it to dwc_pcie_register_dev(), which would add it to device's platform data with >> the pointer to the pci device. > > The dwc_pcie_pmu_probe() is called by device which has DWC_PCIE_VSEC_RAS_DES_ID cap. > So I guess I can use pdev->vendor directly here, e.g? > > pci_find_vsec_capability(pdev, pdev->vendor, DWC_PCIE_VSEC_RAS_DES_ID); Oh, right. That seems correct. Cheers, Ilkka > > Best Regards, > Shuai > --1372433909-1814920884-1700161374=:2081--