mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suzuki K Poulose <Suzuki.Poulose@arm.com>
To: Leo Yan <leo.yan@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Mike Leach <mike.leach@linaro.org>,
	Chunyan Zhang <zhang.chunyan@linaro.org>
Subject: Re: [PATCH v1 2/4] coresight: add and remove panic callback for sink
Date: Mon, 5 Jun 2017 10:24:41 +0100	[thread overview]
Message-ID: <ed729e35-f5aa-cd03-410b-a6ad366b4170@arm.com> (raw)
In-Reply-To: <1496500976-18362-3-git-send-email-leo.yan@linaro.org>

On 03/06/17 15:42, Leo Yan wrote:
> If the sink device has panic callback function, add the panic callback
> node for coresight panic dump list when the sink device is enabled;
> also cleanup the node when the sink device is disabled.
>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
>  drivers/hwtracing/coresight/coresight.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c
> index 0c37356..5928886 100644
> --- a/drivers/hwtracing/coresight/coresight.c
> +++ b/drivers/hwtracing/coresight/coresight.c
> @@ -138,6 +138,13 @@ static int coresight_enable_sink(struct coresight_device *csdev, u32 mode)
>  			if (ret)
>  				return ret;
>  		}
> +
> +		/* Add kernel panic callback */
> +		if (sink_ops(csdev)->panic_cb) {
> +			ret = coresight_add_panic_cb(csdev);
> +			if (ret)
> +				return ret;
> +		}
>  		csdev->enable = true;
>  	}
>
> @@ -149,6 +156,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) {
> +		/* Remove kernel panic callback */
> +		if (sink_ops(csdev)->panic_cb)
> +			coresight_del_panic_cb(csdev);
> +
>  		if (sink_ops(csdev)->disable) {
>  			sink_ops(csdev)->disable(csdev);
>  			csdev->enable = false;
>

Just a thought, instead of adding/deleting every time the sink is enabled,
could we add/del the device once for-ever and let the panic_cb decide to dump
it based on whether the device was active or not ?

Suzuki

  reply	other threads:[~2017-06-05  9:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-03 14:42 [PATCH v1 0/4] coresight: support panic dump functionality Leo Yan
2017-06-03 14:42 ` [PATCH v1 1/4] " Leo Yan
2017-06-08 18:13   ` Mathieu Poirier
2017-06-03 14:42 ` [PATCH v1 2/4] coresight: add and remove panic callback for sink Leo Yan
2017-06-05  9:24   ` Suzuki K Poulose [this message]
2017-06-05 10:10     ` Leo Yan
2017-06-03 14:42 ` [PATCH v1 3/4] coresight: tmc: hook panic callback for ETB/ETF Leo Yan
2017-06-03 14:42 ` [PATCH v1 4/4] coresight: etb10: hook panic callback Leo Yan
2017-06-05  8:57 ` [PATCH v1 0/4] coresight: support panic dump functionality Suzuki K Poulose
2017-06-05  9:27   ` Leo Yan
2017-06-08 18:16   ` Mathieu Poirier
2017-06-08 18:23 ` 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=ed729e35-f5aa-cd03-410b-a6ad366b4170@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=will.deacon@arm.com \
    --cc=zhang.chunyan@linaro.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

all inboxes | Powered by JetHome®