Skip to content

Commit d23bc38

Browse files
Mao JinlongSuzuki K Poulose
authored andcommitted
coresight: tmc: fix failure to disable/enable ETF after reading
ETF may fail to re-enable after reading, and driver->reading will not be set to false, this will cause failure to enable/disable to ETF. This change set driver->reading to false even if re-enabling fail. Fixes: 669c461 ("coresight: tmc: Don't enable TMC when it's not ready.") Co-developed-by: Yuanfang Zhang <[email protected]> Signed-off-by: Yuanfang Zhang <[email protected]> Signed-off-by: Mao Jinlong <[email protected]> [ Added a comment to explain why we ignore the error ] Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5161890 commit d23bc38

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/hwtracing/coresight/coresight-tmc-etf.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,6 @@ int tmc_read_unprepare_etb(struct tmc_drvdata *drvdata)
756756
char *buf = NULL;
757757
enum tmc_mode mode;
758758
unsigned long flags;
759-
int rc = 0;
760759

761760
/* config types are set a boot time and never change */
762761
if (WARN_ON_ONCE(drvdata->config_type != TMC_CONFIG_TYPE_ETB &&
@@ -782,11 +781,11 @@ int tmc_read_unprepare_etb(struct tmc_drvdata *drvdata)
782781
* can't be NULL.
783782
*/
784783
memset(drvdata->buf, 0, drvdata->size);
785-
rc = __tmc_etb_enable_hw(drvdata);
786-
if (rc) {
787-
raw_spin_unlock_irqrestore(&drvdata->spinlock, flags);
788-
return rc;
789-
}
784+
/*
785+
* Ignore failures to enable the TMC to make sure, we don't
786+
* leave the TMC in a "reading" state.
787+
*/
788+
__tmc_etb_enable_hw(drvdata);
790789
} else {
791790
/*
792791
* The ETB/ETF is not tracing and the buffer was just read.

0 commit comments

Comments
 (0)