coresight: add dsb sy barrier to stm data writes
Add dsb sy barrier to stm data writes to avoid getting into a situation where many writes are outstanding due to stm logging. This helps avoid a cpu errata condition that gets triggerred with heavy stm logging. Change-Id: I7664fa3ccfcd8ac05514eb5e4db9441db9d809a2 Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
This commit is contained in:
parent
f1a9f6d4cc
commit
52c3a5df57
|
@ -143,6 +143,7 @@ Optional properties:
|
|||
- qcom,round-robin : indicates if per core etms are allowed round-robin access
|
||||
by the funnel
|
||||
- qcom,write-64bit : only 64bit data writes supported by stm
|
||||
- qcom,data-barrier : barrier required for every stm data write to channel space
|
||||
- <supply-name>-supply: phandle to the regulator device tree node. The required
|
||||
<supply-name> is "vdd" for SD card and "vdd-io" for SD
|
||||
I/O supply. Used for tpiu component
|
||||
|
|
|
@ -36,10 +36,6 @@
|
|||
#define stm_writel(drvdata, val, off) __raw_writel((val), drvdata->base + off)
|
||||
#define stm_readl(drvdata, off) __raw_readl(drvdata->base + off)
|
||||
|
||||
#define stm_data_writeb(val, addr) __raw_writeb_no_log(val, addr)
|
||||
#define stm_data_writew(val, addr) __raw_writew_no_log(val, addr)
|
||||
#define stm_data_writel(val, addr) __raw_writel_no_log(val, addr)
|
||||
|
||||
#define STM_LOCK(drvdata) \
|
||||
do { \
|
||||
mb(); \
|
||||
|
@ -141,10 +137,35 @@ struct stm_drvdata {
|
|||
bool enable;
|
||||
DECLARE_BITMAP(entities, OST_ENTITY_MAX);
|
||||
bool write_64bit;
|
||||
bool data_barrier;
|
||||
};
|
||||
|
||||
static struct stm_drvdata *stmdrvdata;
|
||||
|
||||
static inline void stm_data_writeb(uint8_t val, void *addr)
|
||||
{
|
||||
__raw_writeb_no_log(val, addr);
|
||||
if (stmdrvdata->data_barrier)
|
||||
/* Helps avoid large number of outstanding writes */
|
||||
mb();
|
||||
}
|
||||
|
||||
static inline void stm_data_writew(uint16_t val, void *addr)
|
||||
{
|
||||
__raw_writew_no_log(val, addr);
|
||||
if (stmdrvdata->data_barrier)
|
||||
/* Helps avoid large number of outstanding writes */
|
||||
mb();
|
||||
}
|
||||
|
||||
static inline void stm_data_writel(uint32_t val, void *addr)
|
||||
{
|
||||
__raw_writel_no_log(val, addr);
|
||||
if (stmdrvdata->data_barrier)
|
||||
/* Helps avoid large number of outstanding writes */
|
||||
mb();
|
||||
}
|
||||
|
||||
static int stm_hwevent_isenable(struct stm_drvdata *drvdata)
|
||||
{
|
||||
int ret = 0;
|
||||
|
@ -868,9 +889,12 @@ static int stm_probe(struct platform_device *pdev)
|
|||
|
||||
bitmap_fill(drvdata->entities, OST_ENTITY_MAX);
|
||||
|
||||
if (pdev->dev.of_node)
|
||||
if (pdev->dev.of_node) {
|
||||
drvdata->write_64bit = of_property_read_bool(pdev->dev.of_node,
|
||||
"qcom,write-64bit");
|
||||
drvdata->data_barrier = of_property_read_bool(pdev->dev.of_node,
|
||||
"qcom,data-barrier");
|
||||
}
|
||||
|
||||
desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
|
||||
if (!desc)
|
||||
|
|
Loading…
Reference in New Issue