Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ef3ab5a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight: add dsb sy barrier to stm data writes"

parents 4c8ea7a3 fb661ef5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+29 −5
Original line number Diff line number Diff line
@@ -37,10 +37,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();								\
@@ -145,10 +141,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;
@@ -893,9 +914,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)