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 A0EC547986A for ; Wed, 29 Jul 2026 12:48:53 +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=1785329334; cv=none; b=QMZF796qW0HK3B16py2UB7wvB77KXyRZqH+6Cc/PV8zV436cj3MW1/bKDK98Msv8jefWAnAyS+AhzW4otyvolLzd35EtRmwHYNyykOIbEtz9h+JijoRN5WIAOsMickLPOudNivSNN9gAIak3tcKQlt7ksC7VJdsE0FRzEMoTK10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785329334; c=relaxed/simple; bh=2j4KUc2XLScde4eCXc0nqKVZgRa3LJWAv3FNJGoESXA=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=MM7M0WUCwMYJ1hDDwKuFfCasqduHPPUDbWxi+QEQESGpReyK011u9fgmb7/5EQGKwBsfZ1R5Gq+jbntYhMtzgiXbtkz7HGFK1iFEWBBPyAajjaCbGVphNDoGUalSwMyird6IRa96d45eC17vp3qcqNoiBygjYqRi9ukgrAGmTgg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1CM+pt/f; 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="1CM+pt/f" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0831C1F000E9; Wed, 29 Jul 2026 12:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785329333; bh=5tpAGVGIAHfNn13nA/hmmHiTV/R2v8RbBZmjRZ1T9qg=; h=Subject:To:Cc:From:Date; b=1CM+pt/fhGRJUZ/BKsyebqKDpJ5oWyCuCh/2L1zpgeyMeHYFkcwcD5MOP/wr3Fync 5sXXCobCQYTh2o2WGY6O4r9Y1VfwWF8kWOehCxtrZuuA4xngiaEMajX7Krsll36hD+ tK4y0omYYlGocA8clwigoYd2QWvKrLGWH15vYvJA= Subject: FAILED: patch "[PATCH] drm/amd/display: fix __udivdi3 link error" failed to apply to 7.1-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-obtrusive-flavoring-edf8@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 7.1-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-7.1.y git checkout FETCH_HEAD git cherry-pick -x 54d4dee9f89e1dac1a6c2618de0bb2e3f35cc2f0 # git commit -s git send-email --to '' --in-reply-to '2026072928-obtrusive-flavoring-edf8@gregkh' --subject-prefix 'PATCH 7.1.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;