The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Mike Leach <mike.leach@linaro.org>
Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, suzuki.poulose@arm.com,
	james.clark@linaro.org
Subject: Re: [PATCH 1/1] coresight: fix issue where coresight component has no claimtags
Date: Wed, 22 Oct 2025 15:04:09 +0100	[thread overview]
Message-ID: <20251022140409.GR281971@e132581.arm.com> (raw)
In-Reply-To: <CAJ9a7Vi+Oq3Zma0Cs+w8m0kRE0pG6ax3=26EQK=u7d=vQfNFQw@mail.gmail.com>

Hi Mike,

On Wed, Oct 22, 2025 at 01:35:46PM +0100, Mike Leach wrote:

[...]

> > - We can add a new flag ("bool claim_impl" in the struct csdev_access),
> >   by default the field will be zero.
> >
> 
> I considered a bool - but the correct place for this would be
> coresight_device - where we keep all the information about the
> hardware features.

Maybe coresight_device is suitable. But this might require to update
furthermore for claim function arguments (e.g., need to pass "csdev"
rather than "csdev_access").

> > - The drivers support claim tags call coresight_clear_self_claim_tag()
> >   in probe (see __catu_probe() as an example), we can call a new
> >   function coresight_init_claim_tag() to replace it, this function sets
> >   "claim_impl" properly and clear the tag if supported.
> >
> 
> I considered moving this initialisation to the common coresight code
> where we create the coresight_device.

Seems to me, this is dangerous. If a module is not CoreSight compliant
and claim registers are absent, when access we will get unknown values
or even cause serious result (external abort or bus lockup).

[...]

> > > +/*
> > > + * Coresight specification defines a maximum of 8 claim tag bits.
> > > + * The precise number is implementation defined, and may be obtained by
> > > + * reading the CLAIMSET register.
> > > + */
> > > +#define CORESIGHT_CLAIM_BITS_MAX_MASK        GENMASK(7, 0)
> > > +#define CORESIGHT_CLAIM_SELF_HOSTED_BIT      BIT(1)
> >
> > Now we only care about the self-host bit. Can reuse existed macros ?
> >
> 
> I feel that drivers should be written to match the specification - the
> macros above are a correct mask value per specification and the
> correct bitfield comparison for the MSBit of the protocol.
> 
> The ones below are a protocol masks field, and a specific protocol
> value that is used in value rather than bit comparisons in the
> claimtag code. I felt it clearer to differentiate between the uses
> when reading the code.

How about change CORESIGHT_CLAIM_EXTERNAL and
CORESIGHT_CLAIM_SELF_HOSTED to MSBit ?

Thanks,
Leo

  reply	other threads:[~2025-10-22 14:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 23:45 [PATCH 0/1] coresight: fix issue with insufficient claim tags Mike Leach
2025-10-21 23:45 ` [PATCH 1/1] coresight: fix issue where coresight component has no claimtags Mike Leach
2025-10-22  9:29   ` Leo Yan
2025-10-22 12:35     ` Mike Leach
2025-10-22 14:04       ` Leo Yan [this message]
2025-10-23 10:18         ` Mike Leach
2025-10-23 11:03           ` Mike Leach

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=20251022140409.GR281971@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=coresight@lists.linaro.org \
    --cc=james.clark@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@linaro.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