mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [v1] coresight: funnel: inport schedule by priority can not take work
@ 2026-10-25 13:13 Chao Xu
  2026-10-27  8:41 ` Leo Yan
  0 siblings, 1 reply; 4+ messages in thread
From: Chao Xu @ 2026-10-25 13:13 UTC (permalink / raw)
  To: suzuki.poulose, mike.leach, james.clark, leo.yan, alexander.shishkin
  Cc: coresight, linux-arm-kernel, linux-kernel, Chao Xu

Before enable funnel, priority must be set. Changing the port
priorities in real time is not supported. If the priority control
register is written when one or more of ports are enable, then
the write is silently rejected.

Signed-off-by: Chao Xu <xuchao066@163.com>
---
 drivers/hwtracing/coresight/coresight-funnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
index af40814ce560..17f985798d7f 100644
--- a/drivers/hwtracing/coresight/coresight-funnel.c
+++ b/drivers/hwtracing/coresight/coresight-funnel.c
@@ -66,8 +66,8 @@ static int dynamic_funnel_enable_hw(struct funnel_drvdata *drvdata, int port)
 	functl &= ~FUNNEL_HOLDTIME_MASK;
 	functl |= FUNNEL_HOLDTIME;
 	functl |= (1 << port);
-	writel_relaxed(functl, drvdata->base + FUNNEL_FUNCTL);
 	writel_relaxed(drvdata->priority, drvdata->base + FUNNEL_PRICTL);
+	writel_relaxed(functl, drvdata->base + FUNNEL_FUNCTL);
 done:
 	CS_LOCK(drvdata->base);
 	return rc;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [v1] coresight: funnel: inport schedule by priority can not take work
  2026-10-25 13:13 [PATCH] [v1] coresight: funnel: inport schedule by priority can not take work Chao Xu
@ 2026-10-27  8:41 ` Leo Yan
  2026-10-27 15:17   ` Chao Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Yan @ 2026-10-27  8:41 UTC (permalink / raw)
  To: Chao Xu
  Cc: suzuki.poulose, mike.leach, james.clark, alexander.shishkin,
	coresight, linux-arm-kernel, linux-kernel

Hi,

On Sun, Oct 25, 2026 at 09:13:07PM +0800, Chao Xu wrote:
> Before enable funnel, priority must be set. Changing the port
> priorities in real time is not supported.

> If the priority control register is written when one or more of ports
> are enable, then the write is silently rejected.

Could you cite the relevant documentation in commit log?

  The CoreSight SoC-600 TRM, section 9.11.2, PRIORITYCONTROL, a funnel
  rejects priority register writes whenever any port is enabled. The
  current sequence therefore prevent the configured priorities from
  taking effect.

  Write the priority register before enabling the first port.

> Signed-off-by: Chao Xu <xuchao066@163.com>
> ---
>  drivers/hwtracing/coresight/coresight-funnel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
> index af40814ce560..17f985798d7f 100644
> --- a/drivers/hwtracing/coresight/coresight-funnel.c
> +++ b/drivers/hwtracing/coresight/coresight-funnel.c
> @@ -66,8 +66,8 @@ static int dynamic_funnel_enable_hw(struct funnel_drvdata *drvdata, int port)
>  	functl &= ~FUNNEL_HOLDTIME_MASK;
>  	functl |= FUNNEL_HOLDTIME;
>  	functl |= (1 << port);
> -	writel_relaxed(functl, drvdata->base + FUNNEL_FUNCTL);
>  	writel_relaxed(drvdata->priority, drvdata->base + FUNNEL_PRICTL);
> +	writel_relaxed(functl, drvdata->base + FUNNEL_FUNCTL);

Please move the priority write into the first port branch:

  /* Claim the device only when we enable the first slave */
  if (!(functl & FUNNEL_ENSx_MASK)) {
          rc = coresight_claim_device_unlocked(csdev);
          if (rc)
                  goto done;

          /* Update priorities while all ports are disabled */
          writel_relaxed(drvdata->priority,
                         drvdata->base + FUNNEL_PRICTL);
  }

Thanks,
Leo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [v1] coresight: funnel: inport schedule by priority can not take work
  2026-10-27  8:41 ` Leo Yan
@ 2026-10-27 15:17   ` Chao Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Chao Xu @ 2026-10-27 15:17 UTC (permalink / raw)
  To: Leo Yan
  Cc: suzuki.poulose, mike.leach, james.clark, alexander.shishkin,
	coresight, linux-arm-kernel, linux-kernel

在 2026/10/27 16:41, Leo Yan 写道:

> Hi,
>
> On Sun, Oct 25, 2026 at 09:13:07PM +0800, Chao Xu wrote:
>> Before enable funnel, priority must be set. Changing the port
>> priorities in real time is not supported.
>> If the priority control register is written when one or more of ports
>> are enable, then the write is silently rejected.
> Could you cite the relevant documentation in commit log?
>
>    The CoreSight SoC-600 TRM, section 9.11.2, PRIORITYCONTROL, a funnel
>    rejects priority register writes whenever any port is enabled. The
>    current sequence therefore prevent the configured priorities from
>    taking effect.
>
>    Write the priority register before enabling the first port.
v2 patch add.
>
>> Signed-off-by: Chao Xu <xuchao066@163.com>
>> ---
>>   drivers/hwtracing/coresight/coresight-funnel.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
>> index af40814ce560..17f985798d7f 100644
>> --- a/drivers/hwtracing/coresight/coresight-funnel.c
>> +++ b/drivers/hwtracing/coresight/coresight-funnel.c
>> @@ -66,8 +66,8 @@ static int dynamic_funnel_enable_hw(struct funnel_drvdata *drvdata, int port)
>>   	functl &= ~FUNNEL_HOLDTIME_MASK;
>>   	functl |= FUNNEL_HOLDTIME;
>>   	functl |= (1 << port);
>> -	writel_relaxed(functl, drvdata->base + FUNNEL_FUNCTL);
>>   	writel_relaxed(drvdata->priority, drvdata->base + FUNNEL_PRICTL);
>> +	writel_relaxed(functl, drvdata->base + FUNNEL_FUNCTL);
> Please move the priority write into the first port branch:
>
>    /* Claim the device only when we enable the first slave */
>    if (!(functl & FUNNEL_ENSx_MASK)) {
>            rc = coresight_claim_device_unlocked(csdev);
>            if (rc)
>                    goto done;
>
>            /* Update priorities while all ports are disabled */
>            writel_relaxed(drvdata->priority,
>                           drvdata->base + FUNNEL_PRICTL);
>    }
here is more better then v1 patch, v2 patch will be sent.
>
> Thanks,
> Leo


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] [v1] coresight: funnel: inport schedule by priority can not take work
@ 2026-10-25  3:52 Chao Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Chao Xu @ 2026-10-25  3:52 UTC (permalink / raw)
  To: mathieu.poirier, suzuki.poulose, mike.leach, alexander.shishkin
  Cc: coresight, linux-arm-kernel, linux-kernel, Chao Xu

Before enable funnel, priority must be set. Changing the port
priorities in real time is not supported. If the priority control
register is written when one or more of ports are enable, then
the write is silently rejected.

Signed-off-by: Chao Xu <xuchao066@163.com>
---
 drivers/hwtracing/coresight/coresight-funnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
index af40814ce560..17f985798d7f 100644
--- a/drivers/hwtracing/coresight/coresight-funnel.c
+++ b/drivers/hwtracing/coresight/coresight-funnel.c
@@ -66,8 +66,8 @@ static int dynamic_funnel_enable_hw(struct funnel_drvdata *drvdata, int port)
 	functl &= ~FUNNEL_HOLDTIME_MASK;
 	functl |= FUNNEL_HOLDTIME;
 	functl |= (1 << port);
-	writel_relaxed(functl, drvdata->base + FUNNEL_FUNCTL);
 	writel_relaxed(drvdata->priority, drvdata->base + FUNNEL_PRICTL);
+	writel_relaxed(functl, drvdata->base + FUNNEL_FUNCTL);
 done:
 	CS_LOCK(drvdata->base);
 	return rc;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-27 15:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25 13:13 [PATCH] [v1] coresight: funnel: inport schedule by priority can not take work Chao Xu
2026-10-27  8:41 ` Leo Yan
2026-10-27 15:17   ` Chao Xu
  -- strict thread matches above, loose matches on Subject: below --
2026-10-25  3:52 Chao Xu

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®