Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Songwei Chai" <songwei.chai@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v17 06/10] qcom-tgu: Add TGU decode support
Date: Fri, 13 Nov 2026 02:59:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-212113@kernel.org> (raw)
In-Reply-To: <20261113024935.3173715-7-songwei.chai@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] qcom-tgu: transposed step_index and operation_index in
  tgu_dataset_rw()
--

commit be12a60019509b692fe89759e5c9e8345578b9d2
Author: Songwei Chai <songwei.chai@oss.qualcomm.com>

qcom-tgu: Add TGU decode support

This commit adds sysfs attributes and register programming for the
per-step condition decode registers on the Qualcomm TGU.

> diff --git a/drivers/hwtracing/qcom/tgu.c b/drivers/hwtracing/qcom/tgu.c
> index c00e95e68214c..72b98a96d7f20 100644
> --- a/drivers/hwtracing/qcom/tgu.c
> +++ b/drivers/hwtracing/qcom/tgu.c
> @@ -18,8 +18,8 @@
>  
>  struct tgu_attribute {
>  	struct device_attribute attr;
> +	enum operation_index operation_index;
>  	u8 step_index;
> -	u8 priority;
>  	u8 reg_num;
>  };

[Severity: High]
Does placing operation_index before step_index in struct tgu_attribute
transpose the two fields in every attribute initialized by
tgu_dataset_rw()?

tgu_dataset_rw() uses positional initialization and still passes
step_index before the priority/operation argument:

drivers/hwtracing/qcom/tgu.c:
    #define tgu_dataset_rw(name, step_index, priority, reg_num)              \
    	(&((struct tgu_attribute[]){ {                                   \
    		__ATTR(name, 0644, tgu_dataset_show, tgu_dataset_store), \
    		step_index,                                              \
    		priority,                                                \
    		reg_num,                                                 \
    	} })[0].attr.attr)

As a result, operation_index receives step_index (0..7) and step_index
receives the priority or TGU_CONDITION_DECODE (4).  In
tgu_node_visible(), tgu_dataset_show(), and tgu_dataset_store(), this
hides attributes for steps 5..7, maps step[0:3]_condition_decode to
drvdata->priority at step 4, and transposes step and priority indices.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261113024935.3173715-1-songwei.chai@oss.qualcomm.com?part=6

  reply	other threads:[~2026-11-13  2:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13  2:49 [PATCH v17 00/10] Provide support for Trigger Generation Unit Songwei Chai
2026-11-13  2:49 ` [PATCH v17 01/10] dt-bindings: arm: Add support for Qualcomm TGU trace Songwei Chai
2026-11-13  2:49 ` [PATCH v17 02/10] coresight: Move CS_LOCK/CS_UNLOCK to linux/coresight.h Songwei Chai
2026-11-13  2:49 ` [PATCH v17 03/10] qcom-tgu: Add TGU driver Songwei Chai
2026-11-13  2:49 ` [PATCH v17 04/10] coresight: Move CORESIGHT_DEVID to linux/coresight.h Songwei Chai
2026-11-13  2:49 ` [PATCH v17 05/10] qcom-tgu: Add signal priority support Songwei Chai
2026-11-13  2:49 ` [PATCH v17 06/10] qcom-tgu: Add TGU decode support Songwei Chai
2026-11-13  2:59   ` sashiko-bot [this message]
2026-11-13  2:49 ` [PATCH v17 07/10] qcom-tgu: Add support to configure next action Songwei Chai
2026-11-13  2:59   ` sashiko-bot
2026-11-13  2:49 ` [PATCH v17 08/10] coresight: Add CORESIGHT_DEVID2 to linux/coresight.h Songwei Chai
2026-11-13  2:49 ` [PATCH v17 09/10] qcom-tgu: Add timer/counter functionality for TGU Songwei Chai
2026-11-13  3:01   ` sashiko-bot
2026-11-13  2:49 ` [PATCH v17 10/10] qcom-tgu: Add reset node to initialize Songwei Chai

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=sashiko-outbox-212113@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=songwei.chai@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