All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: gregkh@linuxfoundation.org
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH 05/16] coresight: cti: disclaim device only when it's claimed
Date: Wed, 16 Sep 2020 13:17:26 -0600	[thread overview]
Message-ID: <20200916191737.4001561-6-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <20200916191737.4001561-1-mathieu.poirier@linaro.org>

From: Tingwei Zhang <tingwei@codeaurora.org>

Coresight_claim_device() is called in cti_starting_cpu() only
when CTI is enabled while coresight_disclaim_device() is called
uncontionally in cti_dying_cpu(). This triggered below WARNING.
Only call disclaim device when CTI device is enabled to fix it.

[   75.989643] WARNING: CPU: 1 PID: 14 at
kernel/drivers/hwtracing/coresight/coresight.c:209
coresight_disclaim_device_unlocked+0x10/0x24
[   75.989697] CPU: 1 PID: 14 Comm: migration/1 Not tainted
5.9.0-rc1-gff1304be0a05-dirty #21
[   75.989709] Hardware name: Thundercomm Dragonboard 845c (DT)
[   75.989737] pstate: 80c00085 (Nzcv daIf +PAN +UAO BTYPE=--)
[   75.989758] pc : coresight_disclaim_device_unlocked+0x10/0x24
[   75.989775] lr : coresight_disclaim_device+0x24/0x38
[   75.989783] sp : ffff800011cd3c90
.
[   75.990018] Call trace:
[   75.990041]  coresight_disclaim_device_unlocked+0x10/0x24
[   75.990066]  cti_dying_cpu+0x34/0x4c
[   75.990101]  cpuhp_invoke_callback+0x84/0x1e0
[   75.990121]  take_cpu_down+0x90/0xe0
[   75.990154]  multi_cpu_stop+0x134/0x160
[   75.990171]  cpu_stopper_thread+0xb0/0x13c
[   75.990196]  smpboot_thread_fn+0x1c4/0x270
[   75.990222]  kthread+0x128/0x154
[   75.990251]  ret_from_fork+0x10/0x18

Fixes: e9b880581d55 ("coresight: cti: Add CPU Hotplug handling to CTI driver")
Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 drivers/hwtracing/coresight/coresight-cti.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-cti.c b/drivers/hwtracing/coresight/coresight-cti.c
index 3ccc703dc940..d6fea6efec71 100644
--- a/drivers/hwtracing/coresight/coresight-cti.c
+++ b/drivers/hwtracing/coresight/coresight-cti.c
@@ -742,7 +742,8 @@ static int cti_dying_cpu(unsigned int cpu)
 
 	spin_lock(&drvdata->spinlock);
 	drvdata->config.hw_powered = false;
-	coresight_disclaim_device(drvdata->base);
+	if (drvdata->config.hw_enabled)
+		coresight_disclaim_device(drvdata->base);
 	spin_unlock(&drvdata->spinlock);
 	return 0;
 }
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 05/16] coresight: cti: disclaim device only when it's claimed
Date: Wed, 16 Sep 2020 13:17:26 -0600	[thread overview]
Message-ID: <20200916191737.4001561-6-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <20200916191737.4001561-1-mathieu.poirier@linaro.org>

From: Tingwei Zhang <tingwei@codeaurora.org>

Coresight_claim_device() is called in cti_starting_cpu() only
when CTI is enabled while coresight_disclaim_device() is called
uncontionally in cti_dying_cpu(). This triggered below WARNING.
Only call disclaim device when CTI device is enabled to fix it.

[   75.989643] WARNING: CPU: 1 PID: 14 at
kernel/drivers/hwtracing/coresight/coresight.c:209
coresight_disclaim_device_unlocked+0x10/0x24
[   75.989697] CPU: 1 PID: 14 Comm: migration/1 Not tainted
5.9.0-rc1-gff1304be0a05-dirty #21
[   75.989709] Hardware name: Thundercomm Dragonboard 845c (DT)
[   75.989737] pstate: 80c00085 (Nzcv daIf +PAN +UAO BTYPE=--)
[   75.989758] pc : coresight_disclaim_device_unlocked+0x10/0x24
[   75.989775] lr : coresight_disclaim_device+0x24/0x38
[   75.989783] sp : ffff800011cd3c90
.
[   75.990018] Call trace:
[   75.990041]  coresight_disclaim_device_unlocked+0x10/0x24
[   75.990066]  cti_dying_cpu+0x34/0x4c
[   75.990101]  cpuhp_invoke_callback+0x84/0x1e0
[   75.990121]  take_cpu_down+0x90/0xe0
[   75.990154]  multi_cpu_stop+0x134/0x160
[   75.990171]  cpu_stopper_thread+0xb0/0x13c
[   75.990196]  smpboot_thread_fn+0x1c4/0x270
[   75.990222]  kthread+0x128/0x154
[   75.990251]  ret_from_fork+0x10/0x18

Fixes: e9b880581d55 ("coresight: cti: Add CPU Hotplug handling to CTI driver")
Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 drivers/hwtracing/coresight/coresight-cti.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-cti.c b/drivers/hwtracing/coresight/coresight-cti.c
index 3ccc703dc940..d6fea6efec71 100644
--- a/drivers/hwtracing/coresight/coresight-cti.c
+++ b/drivers/hwtracing/coresight/coresight-cti.c
@@ -742,7 +742,8 @@ static int cti_dying_cpu(unsigned int cpu)
 
 	spin_lock(&drvdata->spinlock);
 	drvdata->config.hw_powered = false;
-	coresight_disclaim_device(drvdata->base);
+	if (drvdata->config.hw_enabled)
+		coresight_disclaim_device(drvdata->base);
 	spin_unlock(&drvdata->spinlock);
 	return 0;
 }
-- 
2.25.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:[~2020-09-16 19:21 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 19:17 [PATCH 00/16] coresight: next v5.9-rc5 Mathieu Poirier
2020-09-16 19:17 ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 01/16] coresight: etm4x: Fix etm4_count race by moving cpuhp callbacks to init Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 02/16] coresight: stm: Support marked packet Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 03/16] coresight: fix offset by one error in counting ports Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 04/16] coresight: etm4x: Add Support for HiSilicon ETM device Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` Mathieu Poirier [this message]
2020-09-16 19:17   ` [PATCH 05/16] coresight: cti: disclaim device only when it's claimed Mathieu Poirier
2020-09-16 19:17 ` [PATCH 06/16] coresight: cti: remove pm_runtime_get_sync() from CPU hotplug Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 07/16] coresight: etm4x: Ensure default perf settings filter user/kernel Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 08/16] coresight: etm4x: Fix issues within reset interface of sysfs Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 09/16] coresight: cti: Write regsiters directly in cti_enable_hw() Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 10/16] coresight: etm4x: Handle unreachable sink in perf mode Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 11/16] coresight: etm4x: Fix issues on trcseqevr access Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 12/16] MAINTAINERS: Add CoreSight mailing list Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 13/16] coresight: etm: perf: Sink selection using sysfs is deprecated Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 14/16] coresight: Make sysfs functional on topologies with per core sink Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 15/16] coresight: etm4x: Fix mis-usage of nr_resource in sysfs interface Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-16 19:17 ` [PATCH 16/16] coresight: etm4x: Fix number of resources check for ETM 4.3 and above Mathieu Poirier
2020-09-16 19:17   ` Mathieu Poirier
2020-09-17  9:08 ` [PATCH 00/16] coresight: next v5.9-rc5 Greg KH
2020-09-17  9:08   ` Greg KH
2020-09-17 14:35   ` Mathieu Poirier
2020-09-17 14:35     ` Mathieu Poirier

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=20200916191737.4001561-6-mathieu.poirier@linaro.org \
    --to=mathieu.poirier@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.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.