From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 499182DE702; Sat, 12 Sep 2026 10:05:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789207501; cv=none; b=Muy7fx/GRho2xOw9CTsQ8ws54l8AL2CFpW6YRS43Ss5cao5WijjaVe9ONMI+oqypS3Xs1mL1TKKHi99+gzAuZOXmi0MIGWPew8A3R2GfFbCzBWcSP8bR2VxGRGNX0AURcRN7qkLL9pqevn3ecqpMoSw/slF1TgZyb/JeDFtEKyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789207501; c=relaxed/simple; bh=24D741UZjY+7+9u86wHZMDn0KVeOEnTrpBE1kIMmcjc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qt+3f6Pj7rG1tkUtG4zRmTRV0uuszKWaH6h0CCNrhnXuAOBX+w3/eKVlBW6kYMxqM7Ndr/ADDV+FmtCG5mrdIFKqB4sLmall+X2M+Termi21kLVqKshKC4jIENw/qvxH9b4LL7M1xZYwktPMYNgxw/SxO/Ae3S699/C1MbArUno= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bi9qrwhG; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bi9qrwhG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F00C21F000FF; Sat, 12 Sep 2026 10:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789207500; bh=5/rmhH4Gn7GbbIg5ML/iCM1PvtuhCoFh1x4gSOVPCOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bi9qrwhGRDQ8CGgtpUhuJSbaYTZmM6FDSDHXMo0rbnmVCWq27GI/18tcf2NQdbuV0 7q17i2jZuxfZjMw9mtb8yUIfIfG18QDRtcJtixVLRQ0M9L0Bfm4Jh/2RTNtfA4FSKg vSwK7MkBCFvtM1vjKYAYneABxXUn5JjcoHq3v8S8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikko Perttunen , Thierry Reding , Sasha Levin Subject: [PATCH 6.18 0426/1518] gpu: host1x: Fix offset calculation in trace_write_gather Date: Sat, 12 Sep 2026 08:43:15 +0200 Message-ID: <20260912065633.087468542@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikko Perttunen [ Upstream commit eb896850964d3dfce291b4fdff9c2d42d85e564b ] 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 Signed-off-by: Thierry Reding Link: https://patch.msgid.link/20260609-b4-host1x-small-fixes-a-v1-3-7c1131c0b3ad@nvidia.com Signed-off-by: Sasha Levin --- drivers/gpu/host1x/hw/channel_hw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c index d44b8de890be0..46b6494768b4d 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); } -- 2.53.0