From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3317A606A31F for ; Sun, 6 Dec 2026 04:43:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hUZCbMAB Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 915F010E082; Sun, 6 Dec 2026 04:43:28 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1DD7010E082 for ; Sun, 6 Dec 2026 04:43:22 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 4830860CA0; Sun, 6 Dec 2026 04:43:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6B441F00A07; Sun, 6 Dec 2026 04:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796532201; bh=mnwTz/AkZEEbO+r0he+r7wZYTYzXxBoi9ReL+ISS7wk=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=hUZCbMABh5GoHbZvPrZlhxDDQq6SX9hIZcsOsFvZC9e6Yz0z8ejAd6AuqoIhiroh5 /n6ocj6P7VMz/4TUSVA1mSawex1MZElI4DkQDnwo/SJ03rc4c2QDxaZqIOO2NpmEGt z3/vM7TK2O2fB85NmeyqlfN43vTY71L/ZLsMZIkFdSo0H+Iu8uFwUAlXy3mLbuNBkc OHzhTkbAa6LrtF/F/6y4PoMxQM/WaoakxPB59S0B2Dyjy0KDtU/xdfd3IbYqa9gO3C QZ7whLUt3BTq78wBe4rRfm2veSalWbKyAi/gS60m1eXehv+XOXl8ZZVOg5nQup1w5K 7Y2Sj+P5zzTFA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] drm/msm/dpu: avoid division by zero in plane bandwidth calc To: "Shirong Zhao" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261206042720.42-1-shxzhaosr@163.com> References: <20261206042720.42-1-shxzhaosr@163.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 06 Dec 2026 04:43:20 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/msm/dpu: fallback division by zero in _dpu_plane_calc_bw() on SC8280XP -- commit 6a9f48e9576cc98f921a8bdedc159b2c2b15f863 Author: Shirong Zhao drm/msm/dpu: avoid division by zero in plane bandwidth calc This commit adds a non-zero check on (vbp+vpw+vfp) in _dpu_plane_calc_bw() so that modes with zero vertical blanking fall back to dividing by hw_latency_lines. > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/= msm/disp/dpu1/dpu_plane.c > index 1a471cdf767b1..7a8032eced27b 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > @@ -146,7 +146,7 @@ static u64 _dpu_plane_calc_bw(const struct dpu_mdss_c= fg *catalog, > =20 > if ((vbp+vpw) > hw_latency_lines) > do_div(plane_prefill_bw, (vbp+vpw)); > - else if ((vbp+vpw+vfp) < hw_latency_lines) > + else if ((vbp+vpw+vfp) && (vbp+vpw+vfp) < hw_latency_lines) > do_div(plane_prefill_bw, (vbp+vpw+vfp)); > else > do_div(plane_prefill_bw, hw_latency_lines); [Severity: Medium] Can the else branch still divide by zero on sc8280xp when hw_latency_lines is 0? hw_latency_lines comes from catalog->perf->min_prefill_lines, which sc8280xp_perf_data in drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_0_sc8280xp.h leaves unset (0). On qcom,sc8280xp-dpu, a mode with zero vertical blanking reaches the else branch and calls do_div(plane_prefill_bw, 0), causing a divide-by-zero splat under UBSAN (or a panic with CONFIG_UBSAN_TRAP). Since plane_prefill_bw is just plane_bw * hw_latency_lines, setting plane_prefill_bw =3D plane_bw in the else branch avoids dividing by zero on all platforms; sc8280xp_perf_data should also set .min_prefill_lines. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261206042720.42-1= -shxzhaosr@163.com?part=3D1