linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Tingwei Zhang <tingwei@codeaurora.org>
Cc: tsoni@codeaurora.org,
	Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	coresight@lists.linaro.org, Mao Jinlong <jinlmao@codeaurora.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] coresight: stm: support marked packet
Date: Tue, 21 Jul 2020 11:12:18 -0600	[thread overview]
Message-ID: <20200721171218.GA1217536@xps15> (raw)
In-Reply-To: <20200719062712.29133-1-tingwei@codeaurora.org>

Hi Tingwei,

On Sun, Jul 19, 2020 at 02:27:12PM +0800, Tingwei Zhang wrote:
> STP_PACKET_MARKED is not supported by STM currently.
> Add STM_FLAG_MARKED to support marked packet in STM.
> 
> Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org>
> ---
>  drivers/hwtracing/coresight/coresight-stm.c | 11 +++++++----
>  include/uapi/linux/coresight-stm.h          |  1 +
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c
> index b908ca104645..36fb1838b1d1 100644
> --- a/drivers/hwtracing/coresight/coresight-stm.c
> +++ b/drivers/hwtracing/coresight/coresight-stm.c
> @@ -412,6 +412,7 @@ static ssize_t notrace stm_generic_packet(struct stm_data *stm_data,
>  	void __iomem *ch_addr;
>  	struct stm_drvdata *drvdata = container_of(stm_data,
>  						   struct stm_drvdata, stm);
> +	unsigned int stm_flags;
>  
>  	if (!(drvdata && local_read(&drvdata->mode)))
>  		return -EACCES;
> @@ -421,8 +422,10 @@ static ssize_t notrace stm_generic_packet(struct stm_data *stm_data,
>  
>  	ch_addr = stm_channel_addr(drvdata, channel);
>  
> -	flags = (flags == STP_PACKET_TIMESTAMPED) ? STM_FLAG_TIMESTAMPED : 0;
> -	flags |= test_bit(channel, drvdata->chs.guaranteed) ?
> +	stm_flags = (flags & STP_PACKET_TIMESTAMPED) ?
> +			STM_FLAG_TIMESTAMPED : 0;
> +	stm_flags |= (flags & STP_PACKET_MARKED) ? STM_FLAG_MARKED : 0;

Looking at the STM programmer's manual there is a marked area for data packets
only.  Clearing the marked bit for non-data access ends up in a reserved area
and yet here it is set invariably.

Out of curiosity, what kind of use case are you using this for?

Thanks,
Mathieu  

> +	stm_flags |= test_bit(channel, drvdata->chs.guaranteed) ?
>  			   STM_FLAG_GUARANTEED : 0;
>  
>  	if (size > drvdata->write_bytes)
> @@ -432,7 +435,7 @@ static ssize_t notrace stm_generic_packet(struct stm_data *stm_data,
>  
>  	switch (packet) {
>  	case STP_PACKET_FLAG:
> -		ch_addr += stm_channel_off(STM_PKT_TYPE_FLAG, flags);
> +		ch_addr += stm_channel_off(STM_PKT_TYPE_FLAG, stm_flags);
>  
>  		/*
>  		 * The generic STM core sets a size of '0' on flag packets.
> @@ -444,7 +447,7 @@ static ssize_t notrace stm_generic_packet(struct stm_data *stm_data,
>  		break;
>  
>  	case STP_PACKET_DATA:
> -		ch_addr += stm_channel_off(STM_PKT_TYPE_DATA, flags);
> +		ch_addr += stm_channel_off(STM_PKT_TYPE_DATA, stm_flags);
>  		stm_send(ch_addr, payload, size,
>  				drvdata->write_bytes);
>  		break;
> diff --git a/include/uapi/linux/coresight-stm.h b/include/uapi/linux/coresight-stm.h
> index 8847dbf24151..7ff3709c01b8 100644
> --- a/include/uapi/linux/coresight-stm.h
> +++ b/include/uapi/linux/coresight-stm.h
> @@ -5,6 +5,7 @@
>  #include <linux/const.h>
>  
>  #define STM_FLAG_TIMESTAMPED   _BITUL(3)
> +#define STM_FLAG_MARKED        _BITUL(4)
>  #define STM_FLAG_GUARANTEED    _BITUL(7)
>  
>  /*
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-07-21 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19  6:27 [PATCH] coresight: stm: support marked packet Tingwei Zhang
2020-07-21 17:12 ` Mathieu Poirier [this message]
2020-07-21 23:35   ` tingwei

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=20200721171218.GA1217536@xps15 \
    --to=mathieu.poirier@linaro.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=jinlmao@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=saiprakash.ranjan@codeaurora.org \
    --cc=suzuki.poulose@arm.com \
    --cc=tingwei@codeaurora.org \
    --cc=tsoni@codeaurora.org \
    /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;
as well as URLs for NNTP newsgroup(s).