Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp308364rwd; Thu, 1 Jun 2023 00:00:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6zxG1Nu/ngYYIz+h9QfS/6qTSUIfePPkHFNEgaQEf8N1j2ZKRHzNazJX24WMZR2ZRtTRKo X-Received: by 2002:a17:90a:5201:b0:253:3eb5:3ade with SMTP id v1-20020a17090a520100b002533eb53ademr1074687pjh.8.1685602835305; Thu, 01 Jun 2023 00:00:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685602835; cv=none; d=google.com; s=arc-20160816; b=MVQlCe9/OwrsOBueQiFfFygIzQcpGkL+xgjnTVU2rZ45KR7lEUpt9+k+fU484DlA8D 9OfwdZnD8SR3ObsM1n/BOPUO2q2kmmsDijyD2E4kVxvyUy4NhnddK6UyFyPOaVrlddMv W4kGP9Dvm2NQGrZT1psUDg6JgDbpD/iFzJasbJSyRGNYDWqwVo3ySuyZa0X3n+2UjSYI 2nFKa78IpSaX0v7ZUCWn8jTOAuCSbkKLpwaNCOLlxhx98iZczCA65xFSM3fw6W2CVSIJ 2/r7t0krhodJTXfjk5zOka3rWc8BbVnHL9P0hUwO0OLMMA1fYZj0/efBhoT5wkYB9rl8 Av2Q== 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 :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=CcIEno6ZYc+2ORGad9jIwl3b4NteSpx/KddAm85nHcc=; b=LIdwKTFR6Wl9L6t6qTgmn8RA7G0sptXzMWeYv4Y/3ON9McbRwfIZhwXQddYO6vBi5j K40rbZ7VC8GLrLf9TUS7nCcP35Sb8nGH5b/PkhoJdVROTh+C6dD4ARK4cBE6gqL2BJKB O5fKsMmS+ACrE297JRY+5X1UQpOMe4q+8kgZt+uFkMeWvbwjU0tQa22BfX5h2ROx7OKW fVkhKp1IQ5symvolQiJET5tgRF4HPYFQx+e8ZSeCHUoWofbK/dZPhNiWakXeHyujhab9 0gxglZDKkf2puxudQDt7QLOBWOBP/5m3Zih+2enZ38abFY4As/4FeR9pYFn5DVyaOvWO XUtA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o29-20020a637e5d000000b0051358b5c88bsi2354885pgn.452.2023.06.01.00.00.22; Thu, 01 Jun 2023 00:00:35 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231817AbjFAGyE (ORCPT + 99 others); Thu, 1 Jun 2023 02:54:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231800AbjFAGx7 (ORCPT ); Thu, 1 Jun 2023 02:53:59 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D39AAE7; Wed, 31 May 2023 23:53:57 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QWxZ33l7VzqTfv; Thu, 1 Jun 2023 14:49:15 +0800 (CST) Received: from [10.67.102.169] (10.67.102.169) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 1 Jun 2023 14:53:55 +0800 Subject: Re: [PATCH v2 2/3] drivers/perf: hisi: Add support for HiSilicon UC PMU driver To: Jonathan Cameron , Junhao He CC: , , , , , , , , , Linuxarm References: <20230531104625.18296-1-hejunhao3@huawei.com> <20230531104625.18296-3-hejunhao3@huawei.com> <20230531165908.000022b0@Huawei.com> From: Yicong Yang Message-ID: <17ff38e8-7965-8bba-5a4a-a28d219ea637@huawei.com> Date: Thu, 1 Jun 2023 14:53:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20230531165908.000022b0@Huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.169] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 2023/5/31 23:59, Jonathan Cameron wrote: > On Wed, 31 May 2023 18:46:24 +0800 > Junhao He wrote: > > Hi Junhao, > > A few small comments inline. > >> On HiSilicon Hip09 platform, there is a UC (unified cache) module >> on each chip SCCL (Super CPU Cluster). UC is a cache that provides >> coherence between NUMA and UMA domains. It is located between L2 >> and Memory System. While PA uncore PMU model is the same as other >> Hip09 PMU modules and many PMU events are supported. > > I don't follow what this sentence means. Normally you'd have > While A, B is different.. > > >> Let's support >> the PMU driver using the HiSilicon uncore PMU framework. >> >> * rd_req_en : rd_req_en is the abbreviation of read request tracetag enable >> and allows user to count only read operations. >> details are listed in the hisi-pmu document. > Details are .. Also no need for the ine break > and allows user to count only read operations. Details are listed > in the hisi-pmu document at .... > >> >> * srcid_en & srcid: allows user to filter statistics that come from > > Allows > for consistency with the uring_channel description that follows. > >> specific CPU/ICL by configuration source ID. >> >> * uring_channel: Allows users to filter statistical information based on >> the specified tx request uring channel. >> uring_channel only supported events: [0x47 ~ 0x59]. >> >> Signed-off-by: Junhao He > > >> diff --git a/drivers/perf/hisilicon/hisi_uncore_uc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_uc_pmu.c >> new file mode 100644 >> index 000000000000..d27f28584fd7 >> --- /dev/null >> +++ b/drivers/perf/hisilicon/hisi_uncore_uc_pmu.c >> @@ -0,0 +1,577 @@ > ... > > > > >> +static int hisi_uc_pmu_init_data(struct platform_device *pdev, >> + struct hisi_pmu *uc_pmu) >> +{ >> + /* >> + * Use SCCL (Super CPU Cluster) ID and CCL (CPU Cluster) ID to >> + * identify the topology information of UC PMU devices in the chip. >> + */ > >>From patch description, I'd assume there is only one of these > per sccl so why do we care about the cluster level or the sub-id? > Perhaps that description is missleading? > >> + if (device_property_read_u32(&pdev->dev, "hisilicon,scl-id", >> + &uc_pmu->sccl_id)) { >> + dev_err(&pdev->dev, "Can not read uc sccl-id!\n"); >> + return -EINVAL; >> + } >> + >> + if (device_property_read_u32(&pdev->dev, "hisilicon,ccl-id", >> + &uc_pmu->ccl_id)) { >> + dev_err(&pdev->dev, "Can not read uc ccl-id!\n"); >> + return -EINVAL; >> + } >> + >> + if (device_property_read_u32(&pdev->dev, "hisilicon,sub-id", >> + &uc_pmu->sub_id)) { >> + dev_err(&pdev->dev, "Can not read sub-id!\n"); >> + return -EINVAL; >> + } >> + >> + uc_pmu->base = devm_platform_ioremap_resource(pdev, 0); >> + if (IS_ERR(uc_pmu->base)) { >> + dev_err(&pdev->dev, "ioremap failed for uc_pmu resource\n"); >> + return PTR_ERR(uc_pmu->base); >> + } >> + >> + uc_pmu->identifier = readl(uc_pmu->base + HISI_UC_VERSION_REG); >> + >> + return 0; >> +} > > >> +static struct platform_driver hisi_uc_pmu_driver = { >> + .driver = { >> + .name = "hisi_uc_pmu", >> + .acpi_match_table = hisi_uc_pmu_acpi_match, >> + /* >> + * We have not worked out a safe bind/unbind process, >> + * so this is not supported yet. > > If you can reference more info on this that would be great. > Perhaps a thread talking about why? > We handle like this from this patch, https://lore.kernel.org/linux-arm-kernel/1594975763-32966-1-git-send-email-liuqi115@huawei.com/ >> + */ >> + .suppress_bind_attrs = true, >> + }, >> + .probe = hisi_uc_pmu_probe, >> +}; > . >