Thread (17 messages) 17 messages, 4 authors, 2016-02-17

[PATCH V3 6/6] coresight-stm: adding driver for CoreSight STM component

From: Michael Williams <hidden>
Date: 2016-02-17 12:08:49
Also in: linux-api, lkml

Hi Chunyan,

Chunyan Zhang wrote on 2016-02-17:
Hi Michael,

One question below need to be clarified.

On Fri, Feb 12, 2016 at 10:55 PM, Michael Williams
[off-list ref] wrote:
quoted
Mathieu Poirier [mailto:mathieu.poirier at linaro.org] wrote:
quoted
On 6 February 2016 at 04:04, Chunyan Zhang [off-list ref] wrote:
quoted
From: Pratik Patel <redacted>

This driver adds support for the STM CoreSight IP block, allowing any
system compoment (HW or SW) to log and aggregate messages via a
single entity.

The CoreSight STM exposes an application defined number of channels
called stimulus port.  Configuration is done using entries in sysfs
and channels made available to userspace via configfs.

Signed-off-by: Pratik Patel <redacted>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Chunyan Zhang <redacted>
---
 .../ABI/testing/sysfs-bus-coresight-devices-stm    |  53 ++
 Documentation/trace/coresight.txt                  |  37 +-
 drivers/hwtracing/coresight/Kconfig                |  11 +
 drivers/hwtracing/coresight/Makefile               |   1 +
 drivers/hwtracing/coresight/coresight-stm.c        | 928 +++++++++++++++++++++
 include/linux/coresight-stm.h                      |   6 +
 include/uapi/linux/coresight-stm.h                 |  12 +
 7 files changed, 1046 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-stm
 create mode 100644 drivers/hwtracing/coresight/coresight-stm.c
 create mode 100644 include/linux/coresight-stm.h
 create mode 100644 include/uapi/linux/coresight-stm.h
[...]
quoted
quoted
quoted
+static int stm_send(void *addr, const void *data, u32 size, u8 max)
+{
+       u32 len = size;
+       u8 paload[8];
+
+       if (stm_addr_unaligned(data, max)) {
+               memcpy(paload, data, size);
+               data = paload;
+       }
+
+       /* now we are 64bit/32bit aligned */
+#ifdef CONFIG_64BIT
+       if (size == 8)
+               writeq_relaxed(*(u64 *)data, addr);
+#endif
We probably don't need an #ifdef here.  Checking the size of the
transfer against the fundamental data size will result in the same
outcome, i.e preventing 64 bit transfers on a 32 bit architecture.  An
error (understandable by the caller) should probably be returned in
this case.
In theory this is correct, but if the code is unreachable for non-32-bit architectures,
why include it at all?

                            ^^^^^^^
I guess you mean the code is unreachable for "non-64-bit" architectures?
Yes; apologies for my mistake!

[snip]

Mike

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help