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 78CD2388862; Sat, 12 Sep 2026 16:13:59 +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=1789229642; cv=none; b=YuSUbw4xo/2v7Gy0OfbFZQTnj/Egn+dueQ9hPA3yUJ/q/XiAtCBTFZw2jj3x3GNKWuFQ6cEezdDT8L1Uo9wqqi42thH0KfJpmUeWwy5YjJxOTmC6eSCTbao50IqFgxnWkl10sUCHMLYM2OUo+2NuSICdoTcVDRxzQTkJx+sJkzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789229642; c=relaxed/simple; bh=v4cu1NH3Z5QalcWFX9VsoCsqSUl6UMasdnqk+3rvvX8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LBLtBl4pHrPVcgAZQuZPvTBkWiy/gHdBmsVW8Xcg5WGIdr2Atdod2JaE33xOmCqPWRh9+j8+Pt8/r2IHIXVMFvUK03orY4/uENEHyW+dE6454kst2zxupA4huegkQ81EhN79xrIW807K8F8k07rXZZjFOD0VORbLz63239x/98A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QTSa6wn6; 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="QTSa6wn6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17B7F1F000FF; Sat, 12 Sep 2026 16:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789229639; bh=sXjXkySgw9eepTxBdtc256uiEpd95GLUFIzSPjjEvc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QTSa6wn6312vllb8MjqlPzfN7k3TUJ4K81UYv+I1yZArL77d8Mpe+AP0DYbXOE5Gg cRbnfpcCswx0GaLZqwSAQnQVsy1QetGbQKwnGhFpw2/i24UrSwnLyu52+sKdUzezwv z/yB02OzaGn31jwbnXl5jRqI8nP6423/2BjC/w1c= 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.1 0630/1191] gpu: host1x: Fix offset calculation in trace_write_gather Date: Sat, 12 Sep 2026 08:55:58 +0200 Message-ID: <20260912065602.403886558@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065548.086904252@linuxfoundation.org> References: <20260912065548.086904252@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.1-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 732abe0750ff9..3de6f84ee07f0 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