mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
coresight: Fix duplicate and abnormal stop issues of PCIE sw path
Compare with sysfs buffer size instead of drvdata size to avoid the duplicate data issue. Need to compare with the actual data size as the data size could be smaller than the PCIE block size. Change-Id: I45175b57a9154cbfb96946d424b8474a6a69213f Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
This commit is contained in:
parent
61ff6ffa57
commit
d4bb64720d
2 changed files with 4 additions and 3 deletions
|
|
@ -785,7 +785,7 @@ static void etr_pcie_write_work_fn(struct work_struct *work)
|
|||
req->snd_cmpl = 1;
|
||||
|
||||
bytes_to_write = mhi_dev_write_channel(req);
|
||||
if (bytes_to_write != PCIE_BLK_SIZE) {
|
||||
if (bytes_to_write != actual) {
|
||||
dev_err(&tmcdrvdata->csdev->dev, "Write error %d\n",
|
||||
bytes_to_write);
|
||||
|
||||
|
|
@ -795,7 +795,7 @@ static void etr_pcie_write_work_fn(struct work_struct *work)
|
|||
}
|
||||
|
||||
mutex_lock(&byte_cntr_data->byte_cntr_lock);
|
||||
if (byte_cntr_data->offset + actual >= tmcdrvdata->size)
|
||||
if (byte_cntr_data->offset + actual >= tmcdrvdata->sysfs_buf->size)
|
||||
byte_cntr_data->offset = 0;
|
||||
else
|
||||
byte_cntr_data->offset += actual;
|
||||
|
|
|
|||
|
|
@ -1171,7 +1171,8 @@ static void __tmc_etr_disable_hw(struct tmc_drvdata *drvdata)
|
|||
{
|
||||
CS_UNLOCK(drvdata->base);
|
||||
|
||||
tmc_flush_and_stop(drvdata);
|
||||
if (drvdata->out_mode != TMC_ETR_OUT_MODE_PCIE)
|
||||
tmc_flush_and_stop(drvdata);
|
||||
/*
|
||||
* When operating in sysFS mode the content of the buffer needs to be
|
||||
* read before the TMC is disabled.
|
||||
|
|
|
|||
Loading…
Reference in a new issue