From: mathieu.poirier@linaro.org (Mathieu Poirier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/27] stm class: Support devices that override software assigned masters
Date: Tue, 3 May 2016 11:33:37 -0600 [thread overview]
Message-ID: <1462296841-12327-4-git-send-email-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <1462296841-12327-1-git-send-email-mathieu.poirier@linaro.org>
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Some STM devices adjust software assigned master numbers depending on
the trace source and its runtime state and whatnot. This patch adds
a sysfs attribute to inform the trace-side software that master numbers
assigned to software sources will not match those in the STP stream,
so that, for example, master/channel allocation policy can be adjusted
accordingly.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
Documentation/ABI/testing/sysfs-class-stm | 10 ++++++++++
drivers/hwtracing/stm/core.c | 15 +++++++++++++++
include/linux/stm.h | 3 +++
3 files changed, 28 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-class-stm b/Documentation/ABI/testing/sysfs-class-stm
index c9aa4f3fc9a7..77ed3da0f68e 100644
--- a/Documentation/ABI/testing/sysfs-class-stm
+++ b/Documentation/ABI/testing/sysfs-class-stm
@@ -12,3 +12,13 @@ KernelVersion: 4.3
Contact: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Description:
Shows the number of channels per master on this STM device.
+
+What: /sys/class/stm/<stm>/hw_override
+Date: March 2016
+KernelVersion: 4.7
+Contact: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Description:
+ Reads as 0 if master numbers in the STP stream produced by
+ this stm device will match the master numbers assigned by
+ the software or 1 if the stm hardware overrides software
+ assigned masters.
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index 2591442e2c5b..ff31108b066f 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -67,9 +67,24 @@ static ssize_t channels_show(struct device *dev,
static DEVICE_ATTR_RO(channels);
+static ssize_t hw_override_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct stm_device *stm = to_stm_device(dev);
+ int ret;
+
+ ret = sprintf(buf, "%u\n", stm->data->hw_override);
+
+ return ret;
+}
+
+static DEVICE_ATTR_RO(hw_override);
+
static struct attribute *stm_attrs[] = {
&dev_attr_masters.attr,
&dev_attr_channels.attr,
+ &dev_attr_hw_override.attr,
NULL,
};
diff --git a/include/linux/stm.h b/include/linux/stm.h
index 1a79ed8e43da..8369d8a8cabd 100644
--- a/include/linux/stm.h
+++ b/include/linux/stm.h
@@ -50,6 +50,8 @@ struct stm_device;
* @sw_end: last STP master available to software
* @sw_nchannels: number of STP channels per master
* @sw_mmiosz: size of one channel's IO space, for mmap, optional
+ * @hw_override: masters in the STP stream will not match the ones
+ * assigned by software, but are up to the STM hardware
* @packet: callback that sends an STP packet
* @mmio_addr: mmap callback, optional
* @link: called when a new stm_source gets linked to us, optional
@@ -85,6 +87,7 @@ struct stm_data {
unsigned int sw_end;
unsigned int sw_nchannels;
unsigned int sw_mmiosz;
+ unsigned int hw_override;
ssize_t (*packet)(struct stm_data *, unsigned int,
unsigned int, unsigned int,
unsigned int, unsigned int,
--
2.5.0
next prev parent reply other threads:[~2016-05-03 17:33 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-03 17:33 [PATCH 00/27] coresight: next v4.6-rc6 Mathieu Poirier
2016-05-03 17:33 ` [PATCH 01/27] coresight: no need to do the forced type conversion Mathieu Poirier
2016-05-03 21:58 ` Greg KH
2016-05-03 17:33 ` [PATCH 02/27] coresight: etm4x: modify q_support type Mathieu Poirier
2016-05-03 17:33 ` Mathieu Poirier [this message]
2016-05-03 17:33 ` [PATCH 04/27] coresight: adding path for STM device Mathieu Poirier
2016-05-03 17:33 ` [PATCH 05/27] coresight: stm: Bindings for System Trace Macrocell Mathieu Poirier
2016-05-03 17:33 ` [PATCH 06/27] coresight: stm: adding driver for CoreSight STM component Mathieu Poirier
2016-05-03 17:33 ` [PATCH 07/27] coresight: etb10: fixing the right amount of words to read Mathieu Poirier
2016-05-03 17:33 ` [PATCH 08/27] coresight: etm4x: add tracer ID for A72 Maia processor Mathieu Poirier
2016-05-03 17:33 ` [PATCH 09/27] coresight: tmc: adding sysFS management entries Mathieu Poirier
2016-05-03 17:33 ` [PATCH 10/27] coresight: tmc: modifying naming convention Mathieu Poirier
2016-05-03 17:33 ` [PATCH 11/27] coresight: tmc: waiting for TMCReady bit before programming Mathieu Poirier
2016-05-03 17:33 ` [PATCH 12/27] coresight: tmc: re-implementing tmc_read_prepare/unprepare() functions Mathieu Poirier
2016-05-03 17:33 ` [PATCH 13/27] coresight: tmc: clearly define number of transfers per burst Mathieu Poirier
2016-05-03 17:33 ` [PATCH 14/27] coresight: tmc: introducing new header file Mathieu Poirier
2016-05-03 17:33 ` [PATCH 15/27] coresight: tmc: cleaning up " Mathieu Poirier
2016-05-03 17:33 ` [PATCH 16/27] coresight: tmc: splitting driver in ETB/ETF and ETR components Mathieu Poirier
2016-05-03 17:33 ` [PATCH 17/27] coresight: tmc: making prepare/unprepare functions generic Mathieu Poirier
2016-05-03 17:33 ` [PATCH 18/27] coresight: tmc: allocating memory when needed Mathieu Poirier
2016-05-03 17:33 ` [PATCH 19/27] coresight: tmc: getting rid of multiple read access Mathieu Poirier
2016-05-03 17:33 ` [PATCH 20/27] coresight: tmc: adding mode of operation for link/sinks Mathieu Poirier
2016-05-03 17:33 ` [PATCH 21/27] coresight: tmc: dump system memory content only when needed Mathieu Poirier
2016-05-03 17:33 ` [PATCH 22/27] coresight: tmc: make sysFS and Perf mode mutually exclusive Mathieu Poirier
2016-05-03 17:33 ` [PATCH 23/27] coresight: tmc: keep track of memory width Mathieu Poirier
2016-05-03 17:33 ` [PATCH 24/27] coresight: moving struct cs_buffers to header file Mathieu Poirier
2016-05-03 17:33 ` [PATCH 25/27] coresight: tmc: implementing TMC-ETF AUX space API Mathieu Poirier
2016-05-03 17:34 ` [PATCH 26/27] coresight: configuring ETF in FIFO mode when acting as link Mathieu Poirier
2016-05-03 17:34 ` [PATCH 27/27] coresight: etb10: adjust read pointer only when needed Mathieu Poirier
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=1462296841-12327-4-git-send-email-mathieu.poirier@linaro.org \
--to=mathieu.poirier@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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).