From patchwork Mon May 21 11:15:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaokun Zhang X-Patchwork-Id: 10414705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D08FE6032C for ; Mon, 21 May 2018 11:17:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C080528821 for ; Mon, 21 May 2018 11:17:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B359628825; Mon, 21 May 2018 11:17:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1AAA528821 for ; Mon, 21 May 2018 11:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8XXwdMSVKPz7yAn3CzMfNBqecG3VHObNAS8q/cxEsfo=; b=uurw6Eytv/yFSy mizyfEhO1dlcTTz3QG5hPJ0huSt3nEXHhQoy0bJ2IhZ0kfKkbfbpYNyqVq9nM4RFxA2CZdNI4v6Je FU8SvutF/hkyGThxUzTE1yKnvPBR8eS6zC0Fwqoa1yoDDRwvBEcYWdcPIDwwi8x+BD2taIZYyHAgg T1djoiC4gRZ5JRNQhUty13B6d2zo2QzwznZYfbi86CqMTlts/rvOtEVksrruQ5Jqa1vC+gC9REnBR D46kOcktgxzpoqZS7i8FVp2pGytn3ql77EPGB3MfZgSMFz7qXRnzLOQXPD3IOjFwCTA74hMRDZCad rFd2GXU4SPmkkUaD/ojA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fKioS-0002kv-FL; Mon, 21 May 2018 11:17:12 +0000 Received: from [45.249.212.32] (helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fKioP-0002jJ-FG for linux-arm-kernel@lists.infradead.org; Mon, 21 May 2018 11:17:11 +0000 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 0A481BBE8CD; Mon, 21 May 2018 19:16:51 +0800 (CST) Received: from localhost.localdomain (10.67.212.132) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.382.0; Mon, 21 May 2018 19:16:42 +0800 From: Shaokun Zhang To: Subject: [PATCH] perf: hisi: fix uncore PMU index ID Date: Mon, 21 May 2018 19:15:17 +0800 Message-ID: <1526901317-52248-1-git-send-email-zhangshaokun@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.67.212.132] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180521_041709_687606_A29D3E97 X-CRM114-Status: GOOD ( 13.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Shaokun Zhang , Mark Rutland , Will Deacon , Huiqiang Wang Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP According to ACPI SPEC about _UID (Unique ID), The _UID must be unique across all devices with either a common _HID or _CID. For HiSilion uncore PMU, SCCL_ID and INDEX_ID are used to identify the uncore PMU for the same _HID. Therefore, _UID is not equal to INDEX_ID in multi-sccl scene for the same uncore PMU device. CCL_ID can be used as the INDEX_ID for the L3C PMU and IDX-ID is added in DSDT table for the HHA PMU. Fixes: 2940bc4("perf: hisi: Add support for HiSilicon SoC L3C PMU driver") Fixes: 2bab3cf("perf: hisi: Add support for HiSilicon SoC HHA PMU driver") Reported-by: Huiqiang Wang Signed-off-by: Shaokun Zhang Cc: Will Deacon Cc: Mark Rutland Cc: Huiqiang Wang --- drivers/perf/hisilicon/hisi_uncore_hha_pmu.c | 18 ++++++++---------- drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c | 11 ++--------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c index 443906e..dcd8e77 100644 --- a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c @@ -238,19 +238,10 @@ MODULE_DEVICE_TABLE(acpi, hisi_hha_pmu_acpi_match); static int hisi_hha_pmu_init_data(struct platform_device *pdev, struct hisi_pmu *hha_pmu) { - unsigned long long id; struct resource *res; - acpi_status status; - - status = acpi_evaluate_integer(ACPI_HANDLE(&pdev->dev), - "_UID", NULL, &id); - if (ACPI_FAILURE(status)) - return -EINVAL; - - hha_pmu->index_id = id; /* - * Use SCCL_ID and UID to identify the HHA PMU, while + * Use SCCL_ID and HHA index ID to identify the HHA PMU, while * SCCL_ID is in MPIDR[aff2]. */ if (device_property_read_u32(&pdev->dev, "hisilicon,scl-id", @@ -258,6 +249,13 @@ static int hisi_hha_pmu_init_data(struct platform_device *pdev, dev_err(&pdev->dev, "Can not read hha sccl-id!\n"); return -EINVAL; } + + if (device_property_read_u32(&pdev->dev, "hisilicon,idx-id", + &hha_pmu->index_id)) { + dev_err(&pdev->dev, "Can not read hha index-id!\n"); + return -EINVAL; + } + /* HHA PMUs only share the same SCCL */ hha_pmu->ccl_id = -1; diff --git a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c index 0bde5d9..133889c 100644 --- a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c @@ -237,16 +237,7 @@ MODULE_DEVICE_TABLE(acpi, hisi_l3c_pmu_acpi_match); static int hisi_l3c_pmu_init_data(struct platform_device *pdev, struct hisi_pmu *l3c_pmu) { - unsigned long long id; struct resource *res; - acpi_status status; - - status = acpi_evaluate_integer(ACPI_HANDLE(&pdev->dev), - "_UID", NULL, &id); - if (ACPI_FAILURE(status)) - return -EINVAL; - - l3c_pmu->index_id = id; /* * Use the SCCL_ID and CCL_ID to identify the L3C PMU, while @@ -264,6 +255,8 @@ static int hisi_l3c_pmu_init_data(struct platform_device *pdev, return -EINVAL; } + l3c_pmu->index_id = l3c_pmu->ccl_id; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); l3c_pmu->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(l3c_pmu->base)) {