Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp17425lqp; Fri, 12 Apr 2024 09:18:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkZT0CGSw07RWDxS6OJgGQrCQWQZh7SbgA1dI0xfisNKbkk0/hZhwpffmGe+X2bgioiikaVsvFXuVR2ZS3mmVMhadREXrNBxI/Vm3nwg== X-Google-Smtp-Source: AGHT+IGTfdo/Wb1/h0IRS26O2skLMWdzAM59O/YU2ipBwA8ZmhqdwROvuaTTpxxpiMgsPUn1OuPa X-Received: by 2002:a17:903:234d:b0:1e5:e761:5dca with SMTP id c13-20020a170903234d00b001e5e7615dcamr16893plh.0.1712938691973; Fri, 12 Apr 2024 09:18:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712938691; cv=pass; d=google.com; s=arc-20160816; b=NqXk6n2Yrz9DTt6PMn5JEy2ZHuf77IZPyG3EVYUnPcvl1Z6rJoSiXphWetHrRn65+A xKzsH3PhVBamlzn7CIqnn9mtUEL1TkVrSuRJqBHVxaorKR5EYbUhDAJgv74qPjPdsSaO L9aQL0tfKB+WopCexBSkb2cpkOOMwmbkYGJN93hs3rAM1r28FHfs0cW4P7ka47pb4QX2 gC0x1gjv7nZQH/4LyTDu2al53IL2GGxuKIRMPWSz1/W/hK4stFXbgdV/O5N1+RkL8WqZ 9hQhPH+TEIbUr/FqGWCAtv6GlIhYTwa77NvLNOHAMgQVs3D2gH41v33EdeoEEGERHuC+ MCFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=wK6EEOwuJwzdw4XVq+m0hfvfJ4IXQvspRfGf3iykrzs=; fh=22aR/NFsCqnOGZIQzPDG1h79gcfY6gTV1vkpxQGj2A0=; b=VqwRAypJOwPcdS8LjmJqrZqE9G5s3kgZoxTgeWYFgo9d6ruE2+6acuEH2NbAK3WcdO WLGgFyhNAHgCevgU3GOReWSzK2SMTmLK6glWS66+8DWQ7LL5kmBCTmTo79aDEwTl6c+f b7z8YqVzQHwth3CwtmgGkB065KZrjxYbXQfbvUhlftuSRS/M1KaiyNmXvYpMMyLI1NE9 u/wWW3pIHNviTEHaQhzJR+JOAJaDUXk7QKmeVF9yxe/tdf2sR3B5liYxO93dHDSomyPc ofNVzOsM5EcZqbtzMrbYh6lqPit9RWcFv/foISaiOQA9haN/tttpFjplroLuBmUowAFp p0XQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-143042-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143042-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h10-20020a170902f54a00b001defe4aec44si3514418plf.483.2024.04.12.09.18.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 09:18:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143042-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-143042-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143042-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A4DDA281B3B for ; Fri, 12 Apr 2024 16:18:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B308514A08F; Fri, 12 Apr 2024 16:17:16 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0010A149C45; Fri, 12 Apr 2024 16:17:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712938634; cv=none; b=X6GMOhZLDRbVjSqISF5NEYzCeSUlJbLvIsD/KbaSV/TGtEdNvFWixaaHwmRBhkvpbWLWrkzs+WgQ5DSUq8ZIe6w7/5YqWJaSXzu01ekPphQuaW8YW9a1GKB0N7CJW+OGEFfAYSmxNsJp4xMlSX3yOsQYOI4SFUA+ETtr2yd8cYQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712938634; c=relaxed/simple; bh=dW+2BZaj364sSRfrZyTnSrnttUIokw9I3D8CxcxmKgo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fGVZ1KRsCACl42XRkpKyieHGqryCepOfsXe16TgQsVEIAPLSDYutwg0fpNU6THHl6TSnbW8GG+1RBl1Z5VUPBsFE/EKLW/EYRwdPBaKVwBlJOMQ5vT3vP3nfUy7tqsyU5SCsdrq+o6li0pzqte0eEuoOLEVVlAvzxX3HIIG8PCA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VGM9L3mXkz6JB3F; Sat, 13 Apr 2024 00:15:18 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 754A91408FE; Sat, 13 Apr 2024 00:17:04 +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_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 17:17:03 +0100 From: Jonathan Cameron To: Mark Rutland , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Will Deacon , , , CC: , Shaokun Zhang , Yicong Yang , Jiucheng Xu , Khuong Dinh , 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 v2 12/30] perf/riscv: Assign parents for event_source devices Date: Fri, 12 Apr 2024 17:10:39 +0100 Message-ID: <20240412161057.14099-13-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240412161057.14099-1-Jonathan.Cameron@huawei.com> References: <20240412161057.14099-1-Jonathan.Cameron@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) 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 --- 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 fa0bccf4edf2..04487ad7fba0 100644 --- a/drivers/perf/riscv_pmu_legacy.c +++ b/drivers/perf/riscv_pmu_legacy.c @@ -136,6 +136,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 8cbe6e5f9c39..5c9c98fd796a 100644 --- a/drivers/perf/riscv_pmu_sbi.c +++ b/drivers/perf/riscv_pmu_sbi.c @@ -1081,6 +1081,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.39.2