Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5345ede4 authored by Qi Liu's avatar Qi Liu Committed by Greg Kroah-Hartman
Browse files

drivers/perf: Prevent forced unbinding of PMU drivers



[ Upstream commit f32ed8eb0e3f0d0ef4ddb854554d60ca5863a9f9 ]

Forcefully unbinding PMU drivers during perf sampling will lead to
a kernel panic, because the perf upper-layer framework call a NULL
pointer in this situation.

To solve this issue, "suppress_bind_attrs" should be set to true, so
that bind/unbind can be disabled via sysfs and prevent unbinding PMU
drivers during perf sampling.

Signed-off-by: default avatarQi Liu <liuqi115@huawei.com>
Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
Link: https://lore.kernel.org/r/1594975763-32966-1-git-send-email-liuqi115@huawei.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0821295b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1720,6 +1720,7 @@ static struct platform_driver cci_pmu_driver = {
	.driver = {
		   .name = DRIVER_NAME,
		   .of_match_table = arm_cci_pmu_matches,
		   .suppress_bind_attrs = true,
		  },
	.probe = cci_pmu_probe,
	.remove = cci_pmu_remove,
+1 −0
Original line number Diff line number Diff line
@@ -1545,6 +1545,7 @@ static struct platform_driver arm_ccn_driver = {
	.driver = {
		.name = "arm-ccn",
		.of_match_table = arm_ccn_match,
		.suppress_bind_attrs = true,
	},
	.probe = arm_ccn_probe,
	.remove = arm_ccn_remove,
+1 −0
Original line number Diff line number Diff line
@@ -759,6 +759,7 @@ static struct platform_driver dsu_pmu_driver = {
	.driver = {
		.name	= DRVNAME,
		.of_match_table = of_match_ptr(dsu_pmu_of_match),
		.suppress_bind_attrs = true,
	},
	.probe = dsu_pmu_device_probe,
	.remove = dsu_pmu_device_remove,
+1 −0
Original line number Diff line number Diff line
@@ -861,6 +861,7 @@ static void smmu_pmu_shutdown(struct platform_device *pdev)
static struct platform_driver smmu_pmu_driver = {
	.driver = {
		.name = "arm-smmu-v3-pmcg",
		.suppress_bind_attrs = true,
	},
	.probe = smmu_pmu_probe,
	.remove = smmu_pmu_remove,
+1 −0
Original line number Diff line number Diff line
@@ -1228,6 +1228,7 @@ static struct platform_driver arm_spe_pmu_driver = {
	.driver	= {
		.name		= DRVNAME,
		.of_match_table	= of_match_ptr(arm_spe_pmu_of_match),
		.suppress_bind_attrs = true,
	},
	.probe	= arm_spe_pmu_device_probe,
	.remove	= arm_spe_pmu_device_remove,
Loading