mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
coresight: take care of tmc etr wrap around & offset calculation
Ensure that buffer pointer points to the right location while trying to read TMC in ETR circular buffer mode when we wrap around. TMC in ETR circular buffer mode tracks the physical address in the RWP register (in contrast to pure offsets). Hence subtract it from the base physical address to get the offset. Change-Id: Ice1170dcd63928dd8304c421800848e036386b88 Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
This commit is contained in:
parent
fcfcf7f75b
commit
5afc00b736
1 changed files with 3 additions and 1 deletions
|
@ -505,7 +505,7 @@ static void __tmc_etr_dump(struct tmc_drvdata *drvdata)
|
|||
rwphi = tmc_readl(drvdata, TMC_RWPHI);
|
||||
|
||||
if (BVAL(tmc_readl(drvdata, TMC_STS), 0))
|
||||
drvdata->buf = drvdata->vaddr + rwp;
|
||||
drvdata->buf = drvdata->vaddr + rwp - drvdata->paddr;
|
||||
else
|
||||
drvdata->buf = drvdata->vaddr;
|
||||
}
|
||||
|
@ -751,6 +751,8 @@ static ssize_t tmc_read(struct file *file, char __user *data, size_t len,
|
|||
if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) {
|
||||
if (bufp == (char *)(drvdata->vaddr + drvdata->size))
|
||||
bufp = drvdata->vaddr;
|
||||
else if (bufp > (char *)(drvdata->vaddr + drvdata->size))
|
||||
bufp -= drvdata->size;
|
||||
if ((bufp + len) > (char *)(drvdata->vaddr + drvdata->size))
|
||||
len = (char *)(drvdata->vaddr + drvdata->size) - bufp;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue