public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: James Clark <james.clark@linaro.org>
To: Leo Yan <leo.yan@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	Yeoreum Yun <yeoreum.yun@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Will Deacon <will@kernel.org>, Yabin Cui <yabinc@google.com>,
	Keita Morisaki <keyz@google.com>,
	Yuanfang Zhang <quic_yuanfang@quicinc.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Tamas Petz <tamas.petz@arm.com>,
	Thomas Gleixner <tglx@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Mike Leach <mike.leach@arm.com>
Subject: Re: [PATCH v10 16/20] coresight: Add PM callbacks for sink device
Date: Fri, 10 Apr 2026 10:11:00 +0100	[thread overview]
Message-ID: <140ce684-b172-4e1f-ae98-4edd88d4ca8b@linaro.org> (raw)
In-Reply-To: <20260409144949.GT356832@e132581.arm.com>



On 09/04/2026 3:49 pm, Leo Yan wrote:
> On Thu, Apr 09, 2026 at 03:30:56PM +0100, James Clark wrote:
> 
> [...]
> 
>>>>> @@ -1759,16 +1760,36 @@ static int coresight_pm_check(struct
>>>>> coresight_path *path)
>>>>>        if (source_has_cb)
>>>>>            return 1;
>>>>> +    sink_has_cb = coresight_ops(sink)->pm_save_disable &&
>>>>> +              coresight_ops(sink)->pm_restore_enable;
>>>>> +    /*
>>>>> +     * It is not permitted that the source has no callbacks
>>>>> while the sink
>>>>> +     * does, as the sink cannot be disabled without disabling
>>>>> the source,
>>>>> +     * which may lead to lockups. Alternatively, the ETM driver should
>>>>> +     * enable self-hosted PM mode at probe (see etm4_probe()).
>>>>> +     */
>>>>> +    if (sink_has_cb) {
>>>>> +        pr_warn_once("coresight PM failed: source has no PM
>>>>> callbacks; "
>>>>> +                 "cannot safely control sink\n");
>>>>
>>>> This prints out on my Orion board on a fresh boot because of how
>>>> pm_save_enable is setup there. Do we really need the configuration
>>>> of pm_save_enable for ETE/TRBE if we know that it always needs
>>>> saving?
> 
> Yeah, I can remove this check and always bind CPU PM ops for ETE.
> 
>>>> It also stops warning if I rmmod and modprobe the module after
>>>> booting. Seems like pm_save_enable is different depending on how the
>>>> module is loaded which doesn't seem right.
>>>
>>> Thats because the warning is pr_warn_*once*()
>>
>> I don't think so, I tested it with a printf instead of a warn once and also
>> tested modprobeing straight after a reboot.
> 
> I am a bit surprised that Orion6 hits the CPU idle flow, as I observed
> that idle states are not enabled on my board:
> 
>    # ls /sys/devices/system/cpu/cpu*/cpuidle
>    ls: cannot access '/sys/devices/system/cpu/cpu*/cpuidle': No such file or directory
> 

/sys/devices/system/cpu/cpu0/cpuidle:
total 0
drwxr-xr-x 9 root 0 Apr 10 10:08 ..
drwxr-xr-x 2 root 0 Apr 10 10:10 state2
drwxr-xr-x 2 root 0 Apr 10 10:10 state1
drwxr-xr-x 2 root 0 Apr 10 10:10 state0
drwxr-xr-x 2 root 0 Apr 10 10:10 driver
drwxr-xr-x 6 root 0 Apr 10 10:10 .


> If you hit only once CPU idle notifier, it is good to add a
> dump_stack() in coresight_cpu_pm_notify and print the "cmd" argument,
> so we can know the calling coming from where.  I am a bit suspect it
> might be a glitch in CPUIdle layer.
> 
> Thanks,
> Leo


cmd: 2


[    7.878456]  coresight_cpu_pm_notify+0x148/0x4b0
[    7.878462]  notifier_call_chain+0x8c/0x1e0
[    7.878467]  raw_notifier_call_chain+0x24/0x38
[    7.878469]  cpu_pm_exit+0x34/0x68
[    7.878472]  acpi_processor_ffh_lpi_enter+0x40/0x78
[    7.878476]  acpi_idle_lpi_enter+0x54/0x78
[    7.878481]  cpuidle_enter_state+0xb4/0x250
[    7.878483]  cpuidle_enter+0x44/0x68
[    7.878487]  do_idle+0x1e0/0x278
[    7.878492]  cpu_startup_entry+0x40/0x50
[    7.878495]  rest_init+0xec/0xf8
[    7.878497]  start_kernel+0x348/0x400
[    7.878503]  __primary_switched+0x88/0x98



  -> zcat /proc/config.gz | grep IDLE
CONFIG_CONTEXT_TRACKING_IDLE=y
CONFIG_NO_HZ_IDLE=y
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y
# CONFIG_CPU_IDLE_GOV_LADDER is not set
CONFIG_CPU_IDLE_GOV_MENU=y
# CONFIG_CPU_IDLE_GOV_TEO is not set
CONFIG_DT_IDLE_STATES=y
CONFIG_DT_IDLE_GENPD=y
CONFIG_ARM_PSCI_CPUIDLE=y
CONFIG_ARM_PSCI_CPUIDLE_DOMAIN=y
CONFIG_ACPI_PROCESSOR_IDLE=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_IDLE_POLL_SETUP=y
# CONFIG_IDLE_PAGE_TRACKING is not set
# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set




  reply	other threads:[~2026-04-10  9:11 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-05 15:02 [PATCH v10 00/20] CoreSight: Refactor power management for CoreSight path Leo Yan
2026-04-05 15:02 ` [PATCH v10 01/20] coresight: Extract device init into coresight_init_device() Leo Yan
2026-04-05 15:02 ` [PATCH v10 02/20] coresight: Populate CPU ID into coresight_device Leo Yan
2026-04-05 15:02 ` [PATCH v10 03/20] coresight: Remove .cpu_id() callback from source ops Leo Yan
2026-04-05 15:02 ` [PATCH v10 04/20] coresight: Take hotplug lock in enable_source_store() for Sysfs mode Leo Yan
2026-04-05 15:02 ` [PATCH v10 05/20] coresight: etm4x: Set per-CPU path on local CPU Leo Yan
2026-04-05 15:02 ` [PATCH v10 06/20] coresight: etm3x: " Leo Yan
2026-04-05 15:02 ` [PATCH v10 07/20] coresight: Register CPU PM notifier in core layer Leo Yan
2026-04-05 15:02 ` [PATCH v10 08/20] coresight: etm4x: Hook CPU PM callbacks Leo Yan
2026-04-05 15:02 ` [PATCH v10 09/20] coresight: etm4x: Remove redundant checks in PM save and restore Leo Yan
2026-04-05 15:02 ` [PATCH v10 10/20] coresight: syscfg: Use IRQ-safe spinlock to protect active variables Leo Yan
2026-04-05 15:02 ` [PATCH v10 11/20] coresight: Move source helper disabling to coresight_disable_path() Leo Yan
2026-04-05 15:02 ` [PATCH v10 12/20] coresight: Control path with range Leo Yan
2026-04-05 15:02 ` [PATCH v10 13/20] coresight: Use helpers to fetch first and last nodes Leo Yan
2026-04-05 15:02 ` [PATCH v10 14/20] coresight: Introduce coresight_enable_source() helper Leo Yan
2026-04-05 15:02 ` [PATCH v10 15/20] coresight: Control path during CPU idle Leo Yan
2026-04-05 15:02 ` [PATCH v10 16/20] coresight: Add PM callbacks for sink device Leo Yan
2026-04-09 10:52   ` James Clark
2026-04-09 12:54     ` James Clark
2026-04-09 13:14     ` Suzuki K Poulose
2026-04-09 14:30       ` James Clark
2026-04-09 14:31         ` James Clark
2026-04-09 14:49         ` Leo Yan
2026-04-10  9:11           ` James Clark [this message]
2026-04-09 15:44     ` Leo Yan
2026-04-10  8:55       ` James Clark
2026-04-05 15:02 ` [PATCH v10 17/20] coresight: trbe: Save and restore state across CPU low power state Leo Yan
2026-04-09 10:52   ` James Clark
2026-04-09 15:54     ` Leo Yan
2026-04-10  8:45       ` James Clark
2026-04-05 15:02 ` [PATCH v10 18/20] coresight: sysfs: Increment refcount only for system tracers Leo Yan
2026-04-05 15:02 ` [PATCH v10 19/20] coresight: Move CPU hotplug callbacks to core layer Leo Yan
2026-04-05 15:02 ` [PATCH v10 20/20] coresight: sysfs: Validate CPU online status for per-CPU sources Leo Yan

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=140ce684-b172-4e1f-ae98-4edd88d4ca8b@linaro.org \
    --to=james.clark@linaro.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=keyz@google.com \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=mike.leach@arm.com \
    --cc=peterz@infradead.org \
    --cc=quic_yuanfang@quicinc.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tamas.petz@arm.com \
    --cc=tglx@kernel.org \
    --cc=will@kernel.org \
    --cc=yabinc@google.com \
    --cc=yeoreum.yun@arm.com \
    /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