Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Yingchao Deng <yingchao.deng@oss.qualcomm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@arm.com>,
	James Clark <james.clark@linaro.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	jinlong.mao@oss.qualcomm.com, quic_yingdeng@quicinc.com,
	tingwei.zhang@oss.qualcomm.com, jie.gan@oss.qualcomm.com
Subject: Re: [PATCH v9 3/4] coresight: cti: add Qualcomm extended CTI identification and quirks
Date: Thu, 28 May 2026 18:11:08 +0100	[thread overview]
Message-ID: <20260528171108.GI101133@e132581.arm.com> (raw)
In-Reply-To: <20260521-extended_cti-v9-3-d21f4f92c51e@oss.qualcomm.com>

On Thu, May 21, 2026 at 08:16:29PM +0800, Yingchao Deng wrote:

[...]

> Qualcomm implements an extended variant of the ARM CoreSight CTI with a
> different register layout and vendor-specific behavior. While the
> programming model remains largely compatible, the register offsets differ
> from the standard ARM CTI and require explicit handling.

I cannot apply this patch successfuly. Please rebase on the latest
coresight-next branch.

> @@ -726,6 +734,22 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id)
>  
>  	raw_spin_lock_init(&drvdata->spinlock);
>  
> +	devarch = readl_relaxed(drvdata->base + CORESIGHT_DEVARCH);
> +	if (CTI_DEVARCH_ARCHITECT(devarch) == ARCHITECT_QCOM) {
> +		drvdata->is_qcom_cti = true;
> +		/*
> +		 * QCOM CTI does not implement Claimtag functionality as
> +		 * per CoreSight specification, but its CLAIMSET register
> +		 * is incorrectly initialized to 0xF. This can mislead
> +		 * tools or drivers into thinking the component is claimed.
> +		 *
> +		 * Reset CLAIMSET to 0 to reflect that no claims are active.
> +		 */
> +		CS_UNLOCK(drvdata->base);
> +		writel_relaxed(0, drvdata->base + CORESIGHT_CLAIMSET);
> +		CS_LOCK(drvdata->base);

Sorry I missed this piece before.

Can you move this quirk into firmware? I don't think the CTI driver
should clear the external claim bit as this totally break the protocol
defined in PSCI. A clean way would clear the bits in firmware and then
CTI driver can use the CLAIM registers.

Or, another option is to create several helpers to bypass claim
operations for Qcom CTI:

  static void cti_clear_self_claim_tag(cti_drvdata *drvdata,
                                      struct csdev_access *csa)
  {
      if (drvdata->is_qcom_cti)
          return;

      coresight_clear_self_claim_tag(csa);
  }

  static int cti_claim_device(cti_drvdata *drvdata)
  {
      if (drvdata->is_qcom_cti)
          return 0;

      return coresight_claim_device(drvdata->csdev);
  }

  static void cti_unclaim_device_unlocked(cti_drvdata *drvdata)
  {
      if (drvdata->is_qcom_cti)
          return;

      return coresight_disclaim_device_unlocked(drvdata->csdev);
  }

Otherwise, this patch is fine for me.

Thanks,
Leo


  parent reply	other threads:[~2026-05-28 17:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 12:16 [PATCH v9 0/4] Add Qualcomm extended CTI support Yingchao Deng
2026-05-21 12:16 ` [PATCH v9 1/4] coresight: cti: Convert trigger usage fields to dynamic Yingchao Deng
2026-05-28 18:01   ` Leo Yan
2026-05-29  1:31     ` Yingchao Deng (Consultant)
2026-05-21 12:16 ` [PATCH v9 2/4] coresight: cti: use __reg_addr() helper for register access Yingchao Deng
2026-05-29 14:40   ` Leo Yan
2026-05-21 12:16 ` [PATCH v9 3/4] coresight: cti: add Qualcomm extended CTI identification and quirks Yingchao Deng
2026-05-22  2:38   ` Jie Gan
2026-05-28 17:11   ` Leo Yan [this message]
2026-05-29  1:42     ` Yingchao Deng (Consultant)
2026-05-21 12:16 ` [PATCH v9 4/4] coresight: cti: expose banked sysfs registers for Qualcomm extended CTI Yingchao Deng
2026-05-29 15:32   ` 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=20260528171108.GI101133@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=james.clark@linaro.org \
    --cc=jie.gan@oss.qualcomm.com \
    --cc=jinlong.mao@oss.qualcomm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@arm.com \
    --cc=quic_yingdeng@quicinc.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tingwei.zhang@oss.qualcomm.com \
    --cc=yingchao.deng@oss.qualcomm.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