Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6016885rwl; Tue, 4 Apr 2023 06:52:39 -0700 (PDT) X-Google-Smtp-Source: AKy350aM3pzKyEzdhpUN4b9ZpSJg4p0gUmQfMonF7muObV4JgxQonFrk24GsgJUyTKFG1iRAqNW/ X-Received: by 2002:a17:906:3ec9:b0:930:6e31:3c11 with SMTP id d9-20020a1709063ec900b009306e313c11mr2335164ejj.70.1680616359273; Tue, 04 Apr 2023 06:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680616359; cv=none; d=google.com; s=arc-20160816; b=ichiIDeHiA4qnAmsfWbjfvcMXSu4jMyS6DTypoAMgAak3meiX9rJUHm2rACe7N/k08 4EAggDNFlAk6ingDIZHjFxdptEcehLh++bMMjPKXhAriMvY+wnDB66X3xQcfdb04inel 6hY9LBscKJxZkAe2moyk0n62bNmV8eGBW6chG0VelsBpy8FqdNYICQKAcwCCYV0rhyWX 8+Z9nhRwRQAhM871PKBlp/AfGLdoKZhZkud9VVR1a3vo2KDaw12Buh+D5PSjLjFPj+2y ZivoC4h3rMW8TpJ5baVXfga02R4Gg39/tx/lNqG45S0czf9SyKGFDmbBNxVG1kmzPucI 42Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ptymtfZZNu+HNF0N23oJo2dV/nhaEqLB0KRNGirIXEU=; b=oukz3NOI8fxdu819LP25C/yjNceNXWTYIHR9XKtmPPOqYiM80nm0TehKDz7OEfcT+s aeMmPzKcme4xNMpicwnZC+EKY4oNKfbmAhHva4zGKBpIHiJJYmHgmuoW3caCpciE/t3S kU+PRpV6LXy+QpCGNnZ5Toi8sycgLqdZ8YXJaFKaCX5YcVUlBrm8kFDnSuQgAIdlSvf5 as+1YgXa7nL3DRk2KCc/OCH3P+wtNQzxn15P9yae4WFgiF+tkbEuWfgbI8yME0N5yZi0 k2p6dq8g6/LnS2dAynzfSzGCFxyIYZGolMwd/iRp4+sYoS4ico+czKvJGPuxMeZsml+v owRw== 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 kd5-20020a17090798c500b00939adedc8e7si9344687ejc.226.2023.04.04.06.52.14; Tue, 04 Apr 2023 06:52:39 -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 S235377AbjDDNtM (ORCPT + 99 others); Tue, 4 Apr 2023 09:49:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234852AbjDDNtB (ORCPT ); Tue, 4 Apr 2023 09:49:01 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB7F8AF; Tue, 4 Apr 2023 06:49:00 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4PrTcD1g5Dz67fB8; Tue, 4 Apr 2023 21:48:12 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 4 Apr 2023 14:48:57 +0100 From: Jonathan Cameron To: Mark Rutland , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Will Deacon , , , CC: , Dan Williams , Shaokun Zhang , Yicong Yang , Jiucheng Xu , Khuong Dinh , Robert Richter , Atish Patra , Anup Patel , Andy Gross , Bjorn Andersson , Frank Li , Shuai Xue , Vineet Gupta , Shawn Guo , Fenghua Yu , Dave Jiang , Wu Hao , Tom Rix , , Suzuki K Poulose , Liang Kan Subject: [PATCH 13/32] perf/riscv: Assign parents for event_source devices Date: Tue, 4 Apr 2023 14:42:06 +0100 Message-ID: <20230404134225.13408-14-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230404134225.13408-1-Jonathan.Cameron@huawei.com> References: <20230404134225.13408-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.122.247.231] X-ClientProxiedBy: lhrpeml500003.china.huawei.com (7.191.162.67) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 Currently all these devices appear directly under /sys/devices/ Only root busses should appear there, so instead assign the pmu->dev parents to be the appropriate platform devices. Link: https://lore.kernel.org/linux-cxl/ZCLI9A40PJsyqAmq@kroah.com/ Cc: Atish Patra CC: Anup Patel Signed-off-by: Jonathan Cameron --- Untested. This is minimal change, but could be made more elegant either by making one of the existing initialization functions take a struct device * or by embedding one in struct riscv_pmu --- drivers/perf/riscv_pmu_legacy.c | 1 + drivers/perf/riscv_pmu_sbi.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/perf/riscv_pmu_legacy.c b/drivers/perf/riscv_pmu_legacy.c index ca9e20bfc7ac..8c4a0d915dc7 100644 --- a/drivers/perf/riscv_pmu_legacy.c +++ b/drivers/perf/riscv_pmu_legacy.c @@ -102,6 +102,7 @@ static int pmu_legacy_device_probe(struct platform_device *pdev) pmu = riscv_pmu_alloc(); if (!pmu) return -ENOMEM; + pmu->pmu.parent = &pdev->dev; pmu_legacy_init(pmu); return 0; diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c index 70cb50fd41c2..f138fbc00a66 100644 --- a/drivers/perf/riscv_pmu_sbi.c +++ b/drivers/perf/riscv_pmu_sbi.c @@ -880,6 +880,7 @@ static int pmu_sbi_device_probe(struct platform_device *pdev) } pmu->pmu.attr_groups = riscv_pmu_attr_groups; + pmu->pmu.parent = &pdev->dev; pmu->cmask = cmask; pmu->ctr_start = pmu_sbi_ctr_start; pmu->ctr_stop = pmu_sbi_ctr_stop; -- 2.37.2