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 5DC605FDA7 for ; Wed, 29 Jul 2026 12:48:48 +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=1785329329; cv=none; b=IuPLofHioABjdcotv6bBAzb9ECQP2/qr3lwogH0H7i8clumX1Lzz5AbmYsed8mvqAV1RbQTQ4kmonMHn7VYaagissgbc7QR4a/13gbotNcaP2iEo+me/TkA4dxtH44THa+2V6Jeg5Jf3xECLR6AP3vQALq+QW5MOdGj5fqimeE0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785329329; c=relaxed/simple; bh=fjxkXiPIrxK/d1iF6gfdTH+7rOGs9UHFsqP+TqWE7Q8=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=kbR8KJS81UoplWdJSEl/WdrxJ3hWtYTh08r4ZDYj7iRTI8/n7WlQBSsYBHm1ro2YDB45srjp7rO1eYxQ9oXLymLMqEc4kDKZ7i9Wm3cR5hW6l2mDEJ9AjnG57ILLv4opsI9i4vkJXfRSyvKvU4CLaid/Tda1biVxv/KsR1xSQGM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QJeeSssM; 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="QJeeSssM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 643CD1F000E9; Wed, 29 Jul 2026 12:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785329327; bh=pdOMB0zXII/gBfRdJZNIiIDuczNWrfsJ1njVyHMIkO8=; h=Subject:To:Cc:From:Date; b=QJeeSssM5mqZG2tqXVvj970ni3UPqEHW3OaKkiiu99Za3dXVXH2fuNo/M7Lg7cbVo danQCKT/j0MoSVFse9aGw63lx1QJF2da/4ThJBVV256QuMSRFdPpN0fZUe2SG2DQQx m49nAAIbFd1iYBJfltlVaysa35k6zQZGRtgkKJR8= Subject: FAILED: patch "[PATCH] drm/amd/display: fix __udivdi3 link error" failed to apply to 6.18-stable tree To: yanglinlin@kylinos.cn,alexander.deucher@amd.com,kernel-bot@kylinos.cn Cc: From: Date: Wed, 29 Jul 2026 14:48:28 +0200 Message-ID: <2026072928-lifting-revision-18b6@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x 54d4dee9f89e1dac1a6c2618de0bb2e3f35cc2f0 # git commit -s git send-email --to '' --in-reply-to '2026072928-lifting-revision-18b6@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From 54d4dee9f89e1dac1a6c2618de0bb2e3f35cc2f0 Mon Sep 17 00:00:00 2001 From: yanglinlin Date: Mon, 13 Jul 2026 11:12:28 +0800 Subject: [PATCH] drm/amd/display: fix __udivdi3 link error When compiling the AMDGPU display driver for 32-bit architectures, the linker reports undefined reference to `__udivdi3` in functions get_dp_dto_frequency_100hz() and dcn401_get_dp_dto_frequency_100hz(). This is because the code uses 64-bit division (/) on 32-bit systems, which GCC cannot handle directly and instead tries to call the missing __udivdi3 helper function. Replace the raw division with div_u64(), the kernel's standard 64-bit division helper, to avoid the link error. Signed-off-by: Linlin Yang Reported-by: k2ci Signed-off-by: Alex Deucher (cherry picked from commit 0421fc6ab3a8514e99156ff3c2cee13ee9af3fa7) Cc: stable@vger.kernel.org diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c index 7c293917e6fd..ecb8493ec523 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c @@ -1229,9 +1229,9 @@ static bool get_dp_dto_frequency_100hz( */ modulo_hz = REG_READ(MODULO[inst]); if (modulo_hz) { - temp = div_u64((uint64_t)clock_hz * dp_dto_ref_khz * 10, modulo_hz); - ASSERT(temp / 100 <= 0xFFFFFFFFUL); - *pixel_clk_100hz = (unsigned int)(temp / 100); + temp = clock_hz * dp_dto_ref_khz * 10; + ASSERT(temp <= UINT_MAX * modulo_hz * 100ULL); + *pixel_clk_100hz = div_u64(temp, modulo_hz * 100); } else *pixel_clk_100hz = 0; } else { @@ -1285,13 +1285,12 @@ static bool dcn401_get_dp_dto_frequency_100hz(const struct clock_source *clock_s * - target pix_clk_hz = (DPDTO INTEGER * DPDTO MODULO + DPDTO PHASE) */ temp = (unsigned long long)dp_dto_integer * modulo_hz + phase_hz; - - if (temp / 100 > 0xFFFFFFFFUL) { + if (temp > (UINT_MAX * 100ULL)) { /* pixel rate 100hz should never be this high, if it is, throw an assert and return 0 */ BREAK_TO_DEBUGGER(); *pixel_clk_100hz = 0; } else { - *pixel_clk_100hz = (unsigned int)(temp / 100); + *pixel_clk_100hz = div_u64(temp, 100); } return true;