summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMikko Perttunen <mperttunen@nvidia.com>2026-06-09 17:09:19 +0900
committerThierry Reding <treding@nvidia.com>2026-07-16 20:29:11 +0200
commiteb896850964d3dfce291b4fdff9c2d42d85e564b (patch)
treea3ff5b4c1fd41926784eeb2fc2d9bd9a787eea54 /drivers
parent254290869fd234b85119c48dbb98efa5fcd41a31 (diff)
downloadlinux-next-eb896850964d3dfce291b4fdff9c2d42d85e564b.tar.gz
linux-next-eb896850964d3dfce291b4fdff9c2d42d85e564b.zip
gpu: host1x: Fix offset calculation in trace_write_gather
When a gather longer than 2*TRACE_MAX_LENGTH (256) words is traced through host1x_cdma_push_gather, the reported BO offset drifts from the third iteration onward. Fix the calculation by properly calculating the value on each loop rather than accumulating. In reality, gathers tend to be pretty short so this is unlikely to ever have been observed. Fixes: b40d02bf96e0 ("gpu: host1x: Use struct host1x_bo pointers in traces") Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patch.msgid.link/20260609-b4-host1x-small-fixes-a-v1-3-7c1131c0b3ad@nvidia.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/host1x/hw/channel_hw.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c
index 2df6a16d484e..9dda73199889 100644
--- a/drivers/gpu/host1x/hw/channel_hw.c
+++ b/drivers/gpu/host1x/hw/channel_hw.c
@@ -36,10 +36,9 @@ static void trace_write_gather(struct host1x_cdma *cdma, struct host1x_bo *bo,
for (i = 0; i < words; i += TRACE_MAX_LENGTH) {
u32 num_words = min(words - i, TRACE_MAX_LENGTH);
- offset += i * sizeof(u32);
-
trace_host1x_cdma_push_gather(dev_name(dev), bo,
- num_words, offset,
+ num_words,
+ offset + i * sizeof(u32),
mem);
}