Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp642487pxb; Tue, 5 Apr 2022 17:02:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpUjgast18cmKkTtTyuN+UZKLqq17MP3n4a10OuNBUFIMqyeO6RKB/yRlohUyKUbNlLkNJ X-Received: by 2002:a17:90b:1b51:b0:1c6:f880:166d with SMTP id nv17-20020a17090b1b5100b001c6f880166dmr6727536pjb.185.1649203379561; Tue, 05 Apr 2022 17:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649203379; cv=none; d=google.com; s=arc-20160816; b=Si2A1a7zysFMa6QU9yG/T+Ivkl1BRjLOKyS3p25yKqwml0yt8yrVTEiAGm42GJkNbA DbyyfpjJ1Z8AbuYNzNeMYAtIHyFM4Mt78agiZJyxpelsaFe1O4qO5w0h+SLu3aY2b2uX h4UYeB2cIgHBY+/zm7gY8tocEvi8iaXh1b/f60NcN64UYvlX7Ndden1UcOiKP2s2g5Le PXfFIurj95J+7YbITwUTCEWTbtKDGDzaVoAqUe1MbYHUN4ag1Tjnu63GHxf5ul06vI0y VS4Rw0Nmn/V33flzvnSF77nB1YZ4d3FSg02U+sr1fraXePpVB45toD9QuP6vpapJS764 nP0g== 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:subject:user-agent:mime-version:date:message-id; bh=Zx+RTUqMIjucIb9+ZjN8iXC/uEMXo/hekAV8kdPxuUs=; b=047KtP1FrbrJsTeH6GYKaUfB2BfIMtQgjHQwd2YrWHAYTwK+G3nnHO674OmdQT9Ax2 Phbg2B0oBiTs6zNN7RykY3UtwkPt8391ZMuGGCrKZWenCj98AbiF/Xnj3TQ3D+JuxO0T PYg70ItLFAYQEb6FPBIAsJrH8unguMjs3BMVtuv7Z+xzVv/dNu3sq3oy/VkRe6fcrPxo zF+9ieQwtn2yEcQLMO8PPZzSv9dSb+8wNWIb8ObFyQjsN6h6iWip9MP3zwkiveMssKmf XwUCgbF6fDQ+qq2Eosv9Ap4nVrRzlA0JtEevoMt40CvQHqbIBjrVqmBH0bac9zFWWnib 7PFg== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r15-20020a63ec4f000000b003816043effasi14762874pgj.495.2022.04.05.17.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 17:02:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4F61E1E0146; Tue, 5 Apr 2022 16:47:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243029AbiDEJir (ORCPT + 99 others); Tue, 5 Apr 2022 05:38:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239764AbiDEIUu (ORCPT ); Tue, 5 Apr 2022 04:20:50 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14CB8B3C for ; Tue, 5 Apr 2022 01:18:48 -0700 (PDT) Received: from fraeml740-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4KXgV63YyFz67ydH; Tue, 5 Apr 2022 16:17:02 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml740-chm.china.huawei.com (10.206.15.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 5 Apr 2022 10:18:46 +0200 Received: from [10.47.91.157] (10.47.91.157) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 5 Apr 2022 09:18:45 +0100 Message-ID: Date: Tue, 5 Apr 2022 09:18:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v3 1/2] drivers/perf: hisi: Associate PMUs in SICL with CPUs online To: Qi Liu , "will@kernel.org" , "mark.rutland@arm.com" CC: Zhangshaokun , Linuxarm , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" References: <20220321070124.41338-1-liuqi115@huawei.com> <20220321070124.41338-2-liuqi115@huawei.com> From: John Garry In-Reply-To: <20220321070124.41338-2-liuqi115@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.91.157] X-ClientProxiedBy: lhreml747-chm.china.huawei.com (10.201.108.197) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/03/2022 07:01, Qi Liu wrote: > If a PMU is in SICL, we associate it with all CPUs online, rather /s/in SICL/in a SICL/ [and all other places, including the code change], or maybe it is better mention "IO super cluster" as well for people who would not know or remember. > than CPUs in the nearest SCCL. You are not really saying why. I would mention that we do it as it is not appropiate to associate with a CPU die, and you can also mention problems that associating with a SICL creates. Please also mention how changing FW definition is ok at this stage. > > Signed-off-by: Qi Liu > --- > drivers/perf/hisilicon/hisi_uncore_pa_pmu.c | 18 +++++++----------- > drivers/perf/hisilicon/hisi_uncore_pmu.c | 4 ++++ > drivers/perf/hisilicon/hisi_uncore_pmu.h | 1 + > 3 files changed, 12 insertions(+), 11 deletions(-) > > diff --git a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c > index bad99d149172..54c604c0d404 100644 > --- a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c > +++ b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c > @@ -258,13 +258,12 @@ static int hisi_pa_pmu_init_data(struct platform_device *pdev, > struct hisi_pmu *pa_pmu) > { > /* > - * Use the SCCL_ID and the index ID to identify the PA PMU, > - * while SCCL_ID is the nearst SCCL_ID from this SICL and > - * CPU core is chosen from this SCCL to manage this PMU. > + * As PA PMU is in SICL, use the SICL_ID and the index ID "a SICL" > + * to identify the PA PMU. > */ > if (device_property_read_u32(&pdev->dev, "hisilicon,scl-id", > - &pa_pmu->sccl_id)) { > - dev_err(&pdev->dev, "Cannot read sccl-id!\n"); > + &pa_pmu->sicl_id)) { > + dev_err(&pdev->dev, "Cannot read sicl-id!\n"); > return -EINVAL; > } > > @@ -275,6 +274,7 @@ static int hisi_pa_pmu_init_data(struct platform_device *pdev, > } > > pa_pmu->ccl_id = -1; > + pa_pmu->sccl_id = -1; > > pa_pmu->base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(pa_pmu->base)) { > @@ -399,13 +399,9 @@ static int hisi_pa_pmu_probe(struct platform_device *pdev) > ret = hisi_pa_pmu_dev_probe(pdev, pa_pmu); > if (ret) > return ret; > - /* > - * PA is attached in SICL and the CPU core is chosen to manage this > - * PMU which is the nearest SCCL, while its SCCL_ID is greater than > - * one with the SICL_ID. > - */ > + > name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sicl%u_pa%u", > - pa_pmu->sccl_id - 1, pa_pmu->index_id); > + pa_pmu->sicl_id, pa_pmu->index_id); > if (!name) > return -ENOMEM; > > diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c > index a738aeab5c04..31930166c34b 100644 > --- a/drivers/perf/hisilicon/hisi_uncore_pmu.c > +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c > @@ -458,6 +458,10 @@ static bool hisi_pmu_cpu_is_associated_pmu(struct hisi_pmu *hisi_pmu) > { > int sccl_id, ccl_id; > > + /* If SCCL_ID is -1, the PMU is in SICL and can be associated this PMU with any CPU */ too long, just have "The PMU is in a SICL and has no CPU affinity" > + if (hisi_pmu->sccl_id == -1) > + return true; > + > if (hisi_pmu->ccl_id == -1) { > /* If CCL_ID is -1, the PMU only shares the same SCCL */ > hisi_read_sccl_and_ccl_id(&sccl_id, NULL); > diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h b/drivers/perf/hisilicon/hisi_uncore_pmu.h > index 7f5841d6f592..96eeddad55ff 100644 > --- a/drivers/perf/hisilicon/hisi_uncore_pmu.h > +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.h > @@ -81,6 +81,7 @@ struct hisi_pmu { > struct device *dev; > struct hlist_node node; > int sccl_id; > + int sicl_id; > int ccl_id; > void __iomem *base; > /* the ID of the PMU modules */