The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Mao Jinlong <quic_jinlmao@quicinc.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@linaro.org>,
	James Clark <james.clark@arm.com>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v8 2/2] coresight: Add label sysfs node support
Date: Thu, 3 Jul 2025 15:19:05 +0100	[thread overview]
Message-ID: <20250703141905.GE1039028@e132581.arm.com> (raw)
In-Reply-To: <20250703130453.4265-3-quic_jinlmao@quicinc.com>

On Thu, Jul 03, 2025 at 09:04:53PM +0800, Mao Jinlong wrote:

[...]

> +static ssize_t label_show(struct device *dev,
> +		struct device_attribute *attr, char *buf)
> +{
> +
> +	const char *str;
> +	int ret = 0;

No need to init ret to 0.

> +	ret = fwnode_property_read_string(dev_fwnode(dev), "label", &str);
> +	if (ret == 0)
> +		return scnprintf(buf, PAGE_SIZE, "%s\n", str);
> +	else
> +		return ret;
> +}
> +static DEVICE_ATTR_RO(label);
> +
>  static struct attribute *coresight_sink_attrs[] = {
>  	&dev_attr_enable_sink.attr,
> +	&dev_attr_label.attr,
>  	NULL,
>  };
>  ATTRIBUTE_GROUPS(coresight_sink);
>  
>  static struct attribute *coresight_source_attrs[] = {
>  	&dev_attr_enable_source.attr,
> +	&dev_attr_label.attr,
>  	NULL,
>  };
>  ATTRIBUTE_GROUPS(coresight_source);
>  
> +static struct attribute *coresight_link_attrs[] = {
> +	&dev_attr_label.attr,
> +	NULL,
> +};
> +ATTRIBUTE_GROUPS(coresight_link);
> +
> +static struct attribute *coresight_helper_attrs[] = {
> +	&dev_attr_label.attr,
> +	NULL,
> +};
> +ATTRIBUTE_GROUPS(coresight_helper);
> +

This change adds a 'label' entry for source, link, helper, and sink
components, but the documentation has only updated for three components:
CTI, funnel, and TPDM.

Should we also update the documentation for all relevant components,
such as ETM, ETR, etc.?

Additionally, patch 01 is missing the update to the ETM yaml file for
the new property. I checked patch v4 [1], which includes a change to
etm.yaml, but this change was dropped since v5. I briefly read the
v4 discussion thread and didn't see any mention of removing the ETM
related change. Did you see any particular issue when add label for
ETM devices?

Overall, this series is fine for me. Just please ensure that all
relevant components are covered for completeness.

Thanks,
Leo

[1] https://patchwork.kernel.org/project/linux-arm-msm/cover/20240703122340.26864-1-quic_jinlmao@quicinc.com/

>  const struct device_type coresight_dev_type[] = {
>  	[CORESIGHT_DEV_TYPE_SINK] = {
>  		.name = "sink",
> @@ -390,6 +420,7 @@ const struct device_type coresight_dev_type[] = {
>  	},
>  	[CORESIGHT_DEV_TYPE_LINK] = {
>  		.name = "link",
> +		.groups = coresight_link_groups,
>  	},
>  	[CORESIGHT_DEV_TYPE_LINKSINK] = {
>  		.name = "linksink",
> @@ -401,6 +432,7 @@ const struct device_type coresight_dev_type[] = {
>  	},
>  	[CORESIGHT_DEV_TYPE_HELPER] = {
>  		.name = "helper",
> +		.groups = coresight_helper_groups,
>  	}
>  };
>  /* Ensure the enum matches the names and groups */
> -- 
> 2.17.1
> 
> _______________________________________________
> CoreSight mailing list -- coresight@lists.linaro.org
> To unsubscribe send an email to coresight-leave@lists.linaro.org

  reply	other threads:[~2025-07-03 14:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 13:04 [PATCH v8 0/2] coresight: Add label sysfs node support Mao Jinlong
2025-07-03 13:04 ` [PATCH v8 1/2] dt-bindings: arm: Add label in the coresight components Mao Jinlong
2025-07-03 15:43   ` Rob Herring
2025-07-03 13:04 ` [PATCH v8 2/2] coresight: Add label sysfs node support Mao Jinlong
2025-07-03 14:19   ` Leo Yan [this message]
2025-07-16  2:42     ` Jinlong Mao
2025-07-16 10:45       ` Mike Leach
2025-07-17  3:03         ` Jinlong Mao

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=20250703141905.GE1039028@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=coresight@lists.linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=james.clark@arm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --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=quic_jinlmao@quicinc.com \
    --cc=robh@kernel.org \
    --cc=suzuki.poulose@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