coresight: etb10: fixing the right amount of words to read
authorMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 3 May 2016 17:33:41 +0000 (11:33 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 May 2016 21:59:30 +0000 (14:59 -0700)
This patch rectifies the amount of words to read when the internal
buffer is deemed bigger than the amount of space available in the
perf ring buffer.

The amount to read is set to the amount of space in the perf ring
buffer rather than being subtracted by it.

Reported-by: Suzuki K Poulose <Suzuki.Poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-etb10.c

index 2461d5c8c15737e0e0701c1d6c26716e8c194fa7..b0d402dbfeae371e95274fbc5e768a3c92876e0e 100644 (file)
@@ -440,7 +440,7 @@ static void etb_update_buffer(struct coresight_device *csdev,
                u32 mask = ~(ETB_FRAME_SIZE_WORDS - 1);
 
                /* The new read pointer must be frame size aligned */
-               to_read -= handle->size & mask;
+               to_read = handle->size & mask;
                /*
                 * Move the RAM read pointer up, keeping in mind that
                 * everything is in frame size units.