From: leo.yan@linaro.org (Leo Yan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 5/6] coresight: Add and delete sink callback for panic kdump list
Date: Thu, 21 Dec 2017 16:20:14 +0800 [thread overview]
Message-ID: <1513844415-11427-6-git-send-email-leo.yan@linaro.org> (raw)
In-Reply-To: <1513844415-11427-1-git-send-email-leo.yan@linaro.org>
If the sink device has panic kdump callback, this means the sink device
wants to save tracing data for panic happening.
This commit adds node into panic kdump list when the sink device is
enabled, and delete node when the sink device is disabled.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
drivers/hwtracing/coresight/coresight.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c
index 389c4ba..56798b1 100644
--- a/drivers/hwtracing/coresight/coresight.c
+++ b/drivers/hwtracing/coresight/coresight.c
@@ -146,6 +146,14 @@ static int coresight_enable_sink(struct coresight_device *csdev, u32 mode)
if (ret)
return ret;
}
+
+ /* Add into panic kdump list */
+ if (sink_ops(csdev)->panic_cb) {
+ ret = coresight_kdump_add(csdev, 0);
+ if (ret)
+ return ret;
+ }
+
csdev->enable = true;
}
@@ -157,6 +165,10 @@ static int coresight_enable_sink(struct coresight_device *csdev, u32 mode)
static void coresight_disable_sink(struct coresight_device *csdev)
{
if (atomic_dec_return(csdev->refcnt) == 0) {
+ /* Delete from panic kdump list */
+ if (sink_ops(csdev)->panic_cb)
+ coresight_kdump_del(csdev);
+
if (sink_ops(csdev)->disable) {
sink_ops(csdev)->disable(csdev);
csdev->enable = false;
--
2.7.4
next prev parent reply other threads:[~2017-12-21 8:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-21 8:20 [PATCH v3 0/6] Coresight: support panic kdump Leo Yan
2017-12-21 8:20 ` [PATCH v3 1/6] doc: Add Coresight documentation directory Leo Yan
2017-12-21 8:20 ` [PATCH v3 2/6] doc: Add documentation for Coresight panic kdump Leo Yan
2017-12-21 8:20 ` [PATCH v3 3/6] coresight: Support panic kdump functionality Leo Yan
2018-01-09 18:41 ` Mathieu Poirier
2018-01-10 5:19 ` Leo Yan
2018-01-10 15:43 ` Mathieu Poirier
2017-12-21 8:20 ` [PATCH v3 4/6] coresight: tmc: Hook callback for panic kdump Leo Yan
2017-12-21 8:20 ` Leo Yan [this message]
2017-12-21 8:20 ` [PATCH v3 6/6] coresight: etm4x: Support " Leo Yan
2018-01-09 20:21 ` Mathieu Poirier
2018-01-10 5:33 ` Leo Yan
2018-01-10 15:46 ` 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=1513844415-11427-6-git-send-email-leo.yan@linaro.org \
--to=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).