From 969c6ceaf374ee88c81a5dfadd9e1c12ff6edf17 Mon Sep 17 00:00:00 2001 From: Mao Jinlong Date: Tue, 16 Jun 2020 16:23:29 +0800 Subject: [PATCH] tmc-etr: Correct condition for SW USB mode when setup sysfs buf Correct condition for SW USB mode when setup sysfs buf to fix the issue that the allocated buffer size is always 32M for memory mode with sw_usb is enabled. Change-Id: Id545ecfa21378f49ddeac4c3c3f4fe51f744e69b Signed-off-by: Mao Jinlong --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index e664292222c4..24b9f1e86f5d 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -1085,7 +1085,8 @@ ssize_t tmc_etr_get_sysfs_trace(struct tmc_drvdata *drvdata, static struct etr_buf * tmc_etr_setup_sysfs_buf(struct tmc_drvdata *drvdata) { - if (drvdata->byte_cntr->sw_usb) + if (drvdata->out_mode == TMC_ETR_OUT_MODE_USB + && drvdata->byte_cntr->sw_usb) return tmc_alloc_etr_buf(drvdata, TMC_ETR_SW_USB_BUF_SIZE, 0, cpu_to_node(0), NULL); else