All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: robh+dt@kernel.org
Cc: iommu@lists.linux-foundation.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, will@kernel.org,
	robin.murphy@arm.com, joro@8bytes.org, mark.rutland@arm.com,
	jkchen@linux.alibaba.com, leo.yan@linaro.org,
	uchida.jun@socionext.com,
	Jean-Philippe Brucker <jean-philippe@linaro.org>
Subject: [PATCH v2 2/3] perf/smmuv3: Add devicetree support
Date: Wed, 17 Nov 2021 14:48:44 +0000	[thread overview]
Message-ID: <20211117144844.241072-3-jean-philippe@linaro.org> (raw)
In-Reply-To: <20211117144844.241072-1-jean-philippe@linaro.org>

Add device-tree support to the SMMUv3 PMCG driver.

Signed-off-by: Jay Chen <jkchen@linux.alibaba.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/perf/arm_smmuv3_pmu.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
index 226348822ab3..19697617153a 100644
--- a/drivers/perf/arm_smmuv3_pmu.c
+++ b/drivers/perf/arm_smmuv3_pmu.c
@@ -47,6 +47,7 @@
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/msi.h>
+#include <linux/of.h>
 #include <linux/perf_event.h>
 #include <linux/platform_device.h>
 #include <linux/smp.h>
@@ -834,7 +835,8 @@ static int smmu_pmu_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	smmu_pmu_get_acpi_options(smmu_pmu);
+	if (!dev->of_node)
+		smmu_pmu_get_acpi_options(smmu_pmu);
 
 	/* Pick one CPU to be the preferred one to use */
 	smmu_pmu->on_cpu = raw_smp_processor_id();
@@ -884,9 +886,16 @@ static void smmu_pmu_shutdown(struct platform_device *pdev)
 	smmu_pmu_disable(&smmu_pmu->pmu);
 }
 
+static const struct of_device_id smmu_pmu_of_match[] = {
+	{ .compatible = "arm,smmu-v3-pmcg" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, smmu_pmu_of_match);
+
 static struct platform_driver smmu_pmu_driver = {
 	.driver = {
 		.name = "arm-smmu-v3-pmcg",
+		.of_match_table = of_match_ptr(smmu_pmu_of_match),
 		.suppress_bind_attrs = true,
 	},
 	.probe = smmu_pmu_probe,
-- 
2.33.1


WARNING: multiple messages have this Message-ID (diff)
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: robh+dt@kernel.org
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
	Jean-Philippe Brucker <jean-philippe@linaro.org>,
	robin.murphy@arm.com, iommu@lists.linux-foundation.org,
	uchida.jun@socionext.com, leo.yan@linaro.org, will@kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] perf/smmuv3: Add devicetree support
Date: Wed, 17 Nov 2021 14:48:44 +0000	[thread overview]
Message-ID: <20211117144844.241072-3-jean-philippe@linaro.org> (raw)
In-Reply-To: <20211117144844.241072-1-jean-philippe@linaro.org>

Add device-tree support to the SMMUv3 PMCG driver.

Signed-off-by: Jay Chen <jkchen@linux.alibaba.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/perf/arm_smmuv3_pmu.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
index 226348822ab3..19697617153a 100644
--- a/drivers/perf/arm_smmuv3_pmu.c
+++ b/drivers/perf/arm_smmuv3_pmu.c
@@ -47,6 +47,7 @@
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/msi.h>
+#include <linux/of.h>
 #include <linux/perf_event.h>
 #include <linux/platform_device.h>
 #include <linux/smp.h>
@@ -834,7 +835,8 @@ static int smmu_pmu_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	smmu_pmu_get_acpi_options(smmu_pmu);
+	if (!dev->of_node)
+		smmu_pmu_get_acpi_options(smmu_pmu);
 
 	/* Pick one CPU to be the preferred one to use */
 	smmu_pmu->on_cpu = raw_smp_processor_id();
@@ -884,9 +886,16 @@ static void smmu_pmu_shutdown(struct platform_device *pdev)
 	smmu_pmu_disable(&smmu_pmu->pmu);
 }
 
+static const struct of_device_id smmu_pmu_of_match[] = {
+	{ .compatible = "arm,smmu-v3-pmcg" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, smmu_pmu_of_match);
+
 static struct platform_driver smmu_pmu_driver = {
 	.driver = {
 		.name = "arm-smmu-v3-pmcg",
+		.of_match_table = of_match_ptr(smmu_pmu_of_match),
 		.suppress_bind_attrs = true,
 	},
 	.probe = smmu_pmu_probe,
-- 
2.33.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: robh+dt@kernel.org
Cc: iommu@lists.linux-foundation.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, will@kernel.org,
	robin.murphy@arm.com, joro@8bytes.org, mark.rutland@arm.com,
	jkchen@linux.alibaba.com, leo.yan@linaro.org,
	uchida.jun@socionext.com,
	Jean-Philippe Brucker <jean-philippe@linaro.org>
Subject: [PATCH v2 2/3] perf/smmuv3: Add devicetree support
Date: Wed, 17 Nov 2021 14:48:44 +0000	[thread overview]
Message-ID: <20211117144844.241072-3-jean-philippe@linaro.org> (raw)
In-Reply-To: <20211117144844.241072-1-jean-philippe@linaro.org>

Add device-tree support to the SMMUv3 PMCG driver.

Signed-off-by: Jay Chen <jkchen@linux.alibaba.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/perf/arm_smmuv3_pmu.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
index 226348822ab3..19697617153a 100644
--- a/drivers/perf/arm_smmuv3_pmu.c
+++ b/drivers/perf/arm_smmuv3_pmu.c
@@ -47,6 +47,7 @@
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/msi.h>
+#include <linux/of.h>
 #include <linux/perf_event.h>
 #include <linux/platform_device.h>
 #include <linux/smp.h>
@@ -834,7 +835,8 @@ static int smmu_pmu_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	smmu_pmu_get_acpi_options(smmu_pmu);
+	if (!dev->of_node)
+		smmu_pmu_get_acpi_options(smmu_pmu);
 
 	/* Pick one CPU to be the preferred one to use */
 	smmu_pmu->on_cpu = raw_smp_processor_id();
@@ -884,9 +886,16 @@ static void smmu_pmu_shutdown(struct platform_device *pdev)
 	smmu_pmu_disable(&smmu_pmu->pmu);
 }
 
+static const struct of_device_id smmu_pmu_of_match[] = {
+	{ .compatible = "arm,smmu-v3-pmcg" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, smmu_pmu_of_match);
+
 static struct platform_driver smmu_pmu_driver = {
 	.driver = {
 		.name = "arm-smmu-v3-pmcg",
+		.of_match_table = of_match_ptr(smmu_pmu_of_match),
 		.suppress_bind_attrs = true,
 	},
 	.probe = smmu_pmu_probe,
-- 
2.33.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-11-17 14:52 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 14:48 [PATCH v2 0/3] perf/smmuv3: Support devicetree Jean-Philippe Brucker
2021-11-17 14:48 ` Jean-Philippe Brucker
2021-11-17 14:48 ` Jean-Philippe Brucker
2021-11-17 14:48 ` [PATCH v2 1/3] dt-bindings: Add Arm SMMUv3 PMCG binding Jean-Philippe Brucker
2021-11-17 14:48   ` Jean-Philippe Brucker
2021-11-17 14:48   ` Jean-Philippe Brucker
2021-11-17 14:48 ` Jean-Philippe Brucker [this message]
2021-11-17 14:48   ` [PATCH v2 2/3] perf/smmuv3: Add devicetree support Jean-Philippe Brucker
2021-11-17 14:48   ` Jean-Philippe Brucker
2021-11-17 14:48 ` [PATCH v2 3/3] perf/smmuv3: Synthesize IIDR from CoreSight ID registers Jean-Philippe Brucker
2021-11-17 14:48   ` Jean-Philippe Brucker
2021-11-17 14:48   ` Jean-Philippe Brucker
2021-12-07  9:14   ` John Garry
2021-12-07  9:14     ` John Garry
2021-12-07  9:14     ` John Garry via iommu
2021-12-07 12:04     ` Robin Murphy
2021-12-07 12:04       ` Robin Murphy
2021-12-07 12:04       ` Robin Murphy
2021-12-07 12:28       ` John Garry
2021-12-07 12:28         ` John Garry
2021-12-07 12:28         ` John Garry via iommu
2021-12-07 12:48         ` Robin Murphy
2021-12-07 12:48           ` Robin Murphy
2021-12-07 12:48           ` Robin Murphy
2021-12-07 13:20           ` Leo Yan
2021-12-07 13:20             ` Leo Yan
2021-12-07 13:20             ` Leo Yan
2021-12-07 13:46             ` Robin Murphy
2021-12-07 13:46               ` Robin Murphy
2021-12-07 13:46               ` Robin Murphy
2021-12-07 13:59               ` Leo Yan
2021-12-07 13:59                 ` Leo Yan
2021-12-07 13:59                 ` Leo Yan
2021-12-07 14:00                 ` John Garry
2021-12-07 14:00                   ` John Garry
2021-12-07 14:00                   ` John Garry via iommu
2021-12-07 14:04                   ` Leo Yan
2021-12-07 14:04                     ` Leo Yan
2021-12-07 14:04                     ` Leo Yan
2021-12-14 14:04 ` [PATCH v2 0/3] perf/smmuv3: Support devicetree Will Deacon
2021-12-14 14:04   ` Will Deacon
2021-12-14 14:04   ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211117144844.241072-3-jean-philippe@linaro.org \
    --to=jean-philippe@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jkchen@linux.alibaba.com \
    --cc=joro@8bytes.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=uchida.jun@socionext.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.