Commit ed2cfb2b authored by Suzuki K Poulose's avatar Suzuki K Poulose Committed by Greg Kroah-Hartman

dts: bindings: Restrict coresight tmc-etr scatter-gather mode

We are about to add the support for ETR builtin scatter-gather mode
for dealing with large amount of trace buffers. However, on some of
the platforms, using the ETR SG mode can lock up the system due to
the way the ETR is connected to the memory subsystem.

In SG mode, the ETR performs READ from the scatter-gather table to
fetch the next page and regular WRITE of trace data. If the READ
operation doesn't complete(due to the memory subsystem issues,
which we have seen on a couple of platforms) the trace WRITE
cannot proceed leading to issues. So, we by default do not
use the SG mode, unless it is known to be safe on the platform.
We define a DT property for the TMC node to specify whether we
have a proper SG mode.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: John Horley <john.horley@arm.com>
Cc: Robert Walker <robert.walker@arm.com>
Cc: devicetree@vger.kernel.org
Cc: frowand.list@gmail.com
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6f755e85
...@@ -86,6 +86,8 @@ its hardware characteristcs. ...@@ -86,6 +86,8 @@ its hardware characteristcs.
* arm,buffer-size: size of contiguous buffer space for TMC ETR * arm,buffer-size: size of contiguous buffer space for TMC ETR
(embedded trace router) (embedded trace router)
* arm,scatter-gather: boolean. Indicates that the TMC-ETR can safely
use the SG mode on this system.
Example: Example:
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/property.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
...@@ -296,6 +297,12 @@ const struct attribute_group *coresight_tmc_groups[] = { ...@@ -296,6 +297,12 @@ const struct attribute_group *coresight_tmc_groups[] = {
NULL, NULL,
}; };
static inline bool tmc_etr_can_use_sg(struct tmc_drvdata *drvdata)
{
return fwnode_property_present(drvdata->dev->fwnode,
"arm,scatter-gather");
}
/* Detect and initialise the capabilities of a TMC ETR */ /* Detect and initialise the capabilities of a TMC ETR */
static int tmc_etr_setup_caps(struct tmc_drvdata *drvdata, static int tmc_etr_setup_caps(struct tmc_drvdata *drvdata,
u32 devid, void *dev_caps) u32 devid, void *dev_caps)
...@@ -305,7 +312,7 @@ static int tmc_etr_setup_caps(struct tmc_drvdata *drvdata, ...@@ -305,7 +312,7 @@ static int tmc_etr_setup_caps(struct tmc_drvdata *drvdata,
/* Set the unadvertised capabilities */ /* Set the unadvertised capabilities */
tmc_etr_init_caps(drvdata, (u32)(unsigned long)dev_caps); tmc_etr_init_caps(drvdata, (u32)(unsigned long)dev_caps);
if (!(devid & TMC_DEVID_NOSCAT)) if (!(devid & TMC_DEVID_NOSCAT) && tmc_etr_can_use_sg(drvdata))
tmc_etr_set_cap(drvdata, TMC_ETR_SG); tmc_etr_set_cap(drvdata, TMC_ETR_SG);
/* Check if the AXI address width is available */ /* Check if the AXI address width is available */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment