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

Commit df96afe6 authored by Tingwei Zhang's avatar Tingwei Zhang Committed by Gerrit - the friendly Code Review server
Browse files

coresight: tmc: set buffer size to 32MB on SW USB mode



We are using memory as buffer for SW USB mode. Too small
buffer could cause packet drop issue. Always set ETR
buffer to 32MB on SW USB mode to resolve this issue.

Change-Id: I222152f15c5cc61141b9a9eb18c1b2bb19714174
Signed-off-by: default avatarTingwei Zhang <tingwei@codeaurora.org>
parent f277fa98
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@ struct etr_perf_buffer {
/* Lower limit for ETR hardware buffer */
#define TMC_ETR_PERF_MIN_BUF_SIZE	SZ_1M

/* SW USB reserved memory size */
#define TMC_ETR_SW_USB_BUF_SIZE SZ_32M

/*
 * The TMC ETR SG has a page size of 4K. The SG table contains pointers
 * to 4KB buffers. However, the OS may use a PAGE_SIZE different from
@@ -1088,6 +1091,10 @@ 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)
		return tmc_alloc_etr_buf(drvdata, TMC_ETR_SW_USB_BUF_SIZE,
				 0, cpu_to_node(0), NULL);
	else
		return tmc_alloc_etr_buf(drvdata, drvdata->size,
				 0, cpu_to_node(0), NULL);
}