linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: saiprakash.ranjan@codeaurora.org, mathieu.poirier@linaro.org,
	mike.leach@linaro.org
Cc: swboyd@chromium.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] coresight: dynamic-replicator: Fix handling of multiple connections
Date: Mon, 27 Apr 2020 10:20:32 +0100	[thread overview]
Message-ID: <cf5852e9-c3c1-3d31-46f0-0370719947ab@arm.com> (raw)
In-Reply-To: <20200426143725.18116-1-saiprakash.ranjan@codeaurora.org>

On 04/26/2020 03:37 PM, Sai Prakash Ranjan wrote:
> Since commit 30af4fb619e5 ("coresight: dynamic-replicator:
> Handle multiple connections"), we do not make sure that
> the other port is disabled when the dynamic replicator is
> enabled. This is seen to cause the CPU hardlockup atleast
> on SC7180 SoC with the following topology when enabling ETM
> with ETR as the sink via sysfs. Since there is no trace id
> logic in coresight yet to make use of multiple sinks in
> parallel for different trace sessions, disable the other
> port when one port is turned on.
> 
>         etm0_out
> 	  |
>     apss_funnel_in0
>            |
>    apss_merge_funnel_in
>            |
>        funnel1_in4
> 	  |
>     merge_funnel_in1
> 	  |
>      swao_funnel_in
>            |
>          etf_in
> 	  |
>    swao_replicator_in
>            |
>     replicator_in
> 	  |
>          etr_in
> 
>    Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 0
>    CPU: 7 PID: 0 Comm: swapper/7 Tainted: G S  B             5.4.25 #100
>    Hardware name: Qualcomm Technologies, Inc. SC7180 IDP (DT)
>    Call trace:
>     dump_backtrace+0x0/0x188
>     show_stack+0x20/0x2c
>     dump_stack+0xdc/0x144
>     panic+0x168/0x370
>     arch_seccomp_spec_mitigate+0x0/0x14
>     watchdog_timer_fn+0x68/0x290
>     __hrtimer_run_queues+0x264/0x498
>     hrtimer_interrupt+0xf0/0x22c
>     arch_timer_handler_phys+0x40/0x50
>     handle_percpu_devid_irq+0x8c/0x158
>     __handle_domain_irq+0x84/0xc4
>     gic_handle_irq+0x100/0x1c4
>     el1_irq+0xbc/0x180
>     arch_cpu_idle+0x3c/0x5c
>     default_idle_call+0x1c/0x38
>     do_idle+0x100/0x280
>     cpu_startup_entry+0x24/0x28
>     secondary_start_kernel+0x15c/0x170
>    SMP: stopping secondary CPUs
> 
> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> Tested-by: Stephen Boyd <swboyd@chromium.org>
> ---
> Changes since RFC:
>   * Reworded commit text and included the topology on SC7180.


> ---
>   .../hwtracing/coresight/coresight-replicator.c    | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
> index e7dc1c31d20d..f4eaa38f8f43 100644
> --- a/drivers/hwtracing/coresight/coresight-replicator.c
> +++ b/drivers/hwtracing/coresight/coresight-replicator.c
> @@ -66,14 +66,16 @@ static int dynamic_replicator_enable(struct replicator_drvdata *drvdata,
>   				     int inport, int outport)
>   {
>   	int rc = 0;
> -	u32 reg;
> +	u32 reg0, reg1;
>   
>   	switch (outport) {
>   	case 0:
> -		reg = REPLICATOR_IDFILTER0;
> +		reg0 = REPLICATOR_IDFILTER0;
> +		reg1 = REPLICATOR_IDFILTER1;
>   		break;
>   	case 1:
> -		reg = REPLICATOR_IDFILTER1;
> +		reg0 = REPLICATOR_IDFILTER1;
> +		reg1 = REPLICATOR_IDFILTER0;
>   		break;
>   	default:
>   		WARN_ON(1);
> @@ -87,8 +89,11 @@ static int dynamic_replicator_enable(struct replicator_drvdata *drvdata,
>   		rc = coresight_claim_device_unlocked(drvdata->base);
>   
>   	/* Ensure that the outport is enabled. */
> -	if (!rc)
> -		writel_relaxed(0x00, drvdata->base + reg);
> +	if (!rc) {
> +		writel_relaxed(0x00, drvdata->base + reg0);
> +		writel_relaxed(0xff, drvdata->base + reg1);
> +	}
> +

This is not sufficient. You must prevent another session trying to
enable the other port of the replicator as this could silently fail
the "on-going" session. Not ideal. Fail the attempt to enable a port
if the other port is active. You could track this in software and
fail early.

Suzuki

  reply	other threads:[~2020-04-27  9:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-26 14:37 [PATCH] coresight: dynamic-replicator: Fix handling of multiple connections Sai Prakash Ranjan
2020-04-27  9:20 ` Suzuki K Poulose [this message]
2020-04-27  9:45   ` Mike Leach
2020-04-27 13:53     ` Suzuki K Poulose
2020-04-28 12:23       ` Sai Prakash Ranjan
2020-04-29 11:47         ` Sai Prakash Ranjan
2020-04-29 13:49           ` Suzuki K Poulose
2020-04-29 13:59             ` Sai Prakash Ranjan
2020-04-29 14:27               ` Mike Leach
2020-04-29 14:48                 ` Sai Prakash Ranjan
2020-04-29 16:58                   ` Mike Leach
2020-04-29 17:11                     ` Sai Prakash Ranjan
2020-05-06  7:35                       ` Sai Prakash Ranjan
2020-05-08  8:53                         ` Sai Prakash Ranjan
2020-05-11 11:14                           ` Mike Leach
2020-05-11 14:16                             ` Sai Prakash Ranjan
2020-05-11 14:30                               ` Suzuki K Poulose
2020-05-11 14:41                                 ` Sai Prakash Ranjan
2020-05-12 11:49                                   ` Mike Leach
2020-05-12 17:45                                     ` Mathieu Poirier
2020-05-12 17:46                                     ` Sai Prakash Ranjan
2020-05-12 21:52                                       ` Mike Leach
2020-05-13  1:49                                         ` Stephen Boyd
2020-05-13 15:45                                           ` Sai Prakash Ranjan
2020-05-13 15:33                                         ` Sai Prakash Ranjan
2020-05-16 10:04                                           ` Sai Prakash Ranjan
2020-05-19  9:04                                             ` Sai Prakash Ranjan
2020-05-11 14:34                               ` Sai Prakash Ranjan

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=cf5852e9-c3c1-3d31-46f0-0370719947ab@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=saiprakash.ranjan@codeaurora.org \
    --cc=swboyd@chromium.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).