diff options
author | Mathieu Poirier <mathieu.poirier@linaro.org> | 2016-05-03 13:34:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-03 17:59:30 -0400 |
commit | dc2c4ef141c5c14cb8d968ba16c74b4f3c373e2c (patch) | |
tree | eb3bf01e1441345ecdbf101b4197a6fd596687cc | |
parent | 2e499bbc1a929ac87dcb9832d11000fc055f8bc6 (diff) |
coresight: configuring ETF in FIFO mode when acting as link
When part of a path but not identified as a sink, the EFT has to
be configured as a link and placed in HW FIFO mode. As such when
enabling a path, call the right configuration function based on
the role the ETF if playing in this trace run.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/hwtracing/coresight/coresight.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index 0995df8f85bc..5443d03a1eec 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c | |||
@@ -265,15 +265,27 @@ static void coresight_disable_source(struct coresight_device *csdev) | |||
265 | 265 | ||
266 | void coresight_disable_path(struct list_head *path) | 266 | void coresight_disable_path(struct list_head *path) |
267 | { | 267 | { |
268 | u32 type; | ||
268 | struct coresight_node *nd; | 269 | struct coresight_node *nd; |
269 | struct coresight_device *csdev, *parent, *child; | 270 | struct coresight_device *csdev, *parent, *child; |
270 | 271 | ||
271 | list_for_each_entry(nd, path, link) { | 272 | list_for_each_entry(nd, path, link) { |
272 | csdev = nd->csdev; | 273 | csdev = nd->csdev; |
274 | type = csdev->type; | ||
273 | 275 | ||
274 | switch (csdev->type) { | 276 | /* |
277 | * ETF devices are tricky... They can be a link or a sink, | ||
278 | * depending on how they are configured. If an ETF has been | ||
279 | * "activated" it will be configured as a sink, otherwise | ||
280 | * go ahead with the link configuration. | ||
281 | */ | ||
282 | if (type == CORESIGHT_DEV_TYPE_LINKSINK) | ||
283 | type = (csdev == coresight_get_sink(path)) ? | ||
284 | CORESIGHT_DEV_TYPE_SINK : | ||
285 | CORESIGHT_DEV_TYPE_LINK; | ||
286 | |||
287 | switch (type) { | ||
275 | case CORESIGHT_DEV_TYPE_SINK: | 288 | case CORESIGHT_DEV_TYPE_SINK: |
276 | case CORESIGHT_DEV_TYPE_LINKSINK: | ||
277 | coresight_disable_sink(csdev); | 289 | coresight_disable_sink(csdev); |
278 | break; | 290 | break; |
279 | case CORESIGHT_DEV_TYPE_SOURCE: | 291 | case CORESIGHT_DEV_TYPE_SOURCE: |
@@ -294,15 +306,27 @@ int coresight_enable_path(struct list_head *path, u32 mode) | |||
294 | { | 306 | { |
295 | 307 | ||
296 | int ret = 0; | 308 | int ret = 0; |
309 | u32 type; | ||
297 | struct coresight_node *nd; | 310 | struct coresight_node *nd; |
298 | struct coresight_device *csdev, *parent, *child; | 311 | struct coresight_device *csdev, *parent, *child; |
299 | 312 | ||
300 | list_for_each_entry_reverse(nd, path, link) { | 313 | list_for_each_entry_reverse(nd, path, link) { |
301 | csdev = nd->csdev; | 314 | csdev = nd->csdev; |
315 | type = csdev->type; | ||
316 | |||
317 | /* | ||
318 | * ETF devices are tricky... They can be a link or a sink, | ||
319 | * depending on how they are configured. If an ETF has been | ||
320 | * "activated" it will be configured as a sink, otherwise | ||
321 | * go ahead with the link configuration. | ||
322 | */ | ||
323 | if (type == CORESIGHT_DEV_TYPE_LINKSINK) | ||
324 | type = (csdev == coresight_get_sink(path)) ? | ||
325 | CORESIGHT_DEV_TYPE_SINK : | ||
326 | CORESIGHT_DEV_TYPE_LINK; | ||
302 | 327 | ||
303 | switch (csdev->type) { | 328 | switch (type) { |
304 | case CORESIGHT_DEV_TYPE_SINK: | 329 | case CORESIGHT_DEV_TYPE_SINK: |
305 | case CORESIGHT_DEV_TYPE_LINKSINK: | ||
306 | ret = coresight_enable_sink(csdev, mode); | 330 | ret = coresight_enable_sink(csdev, mode); |
307 | if (ret) | 331 | if (ret) |
308 | goto err; | 332 | goto err; |