<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
With the <font size="2"><span style="font-size:11pt" class="ContentPasted0">scripts/package/builddeb</span></font> changes dropped, the patch is:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Victor Lu <victorchengchi.lu@amd.com><br>
<b>Sent:</b> Wednesday, July 19, 2023 10:52 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Skvortsov, Victor <Victor.Skvortsov@amd.com>; Zhou, Bob <Bob.Zhou@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Lu, Victor Cheng Chi (Victor) <VictorChengChi.Lu@amd.com><br>
<b>Subject:</b> [PATCH v2] drm/amdgpu: Fix infinite loop in gfxhub_v1_2_xcc_gart_enable (v2)</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">An instance of for_each_inst() was not changed to match its new<br>
behaviour and is causing a loop.<br>
<br>
v2: remove tmp_mask variable<br>
<br>
Fixes: 50c1d81d6365 ("drm/amdgpu: Modify for_each_inst macro")<br>
Signed-off-by: Victor Lu <victorchengchi.lu@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 5 +-<br>
scripts/package/builddeb | 60 ++++++++++++------------<br>
2 files changed, 31 insertions(+), 34 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c<br>
index 47f95ec218a3..dbdee1a0aefe 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c<br>
@@ -402,18 +402,15 @@ static void gfxhub_v1_2_xcc_program_invalidation(struct amdgpu_device *adev,<br>
static int gfxhub_v1_2_xcc_gart_enable(struct amdgpu_device *adev,<br>
uint32_t xcc_mask)<br>
{<br>
- uint32_t tmp_mask;<br>
int i;<br>
<br>
- tmp_mask = xcc_mask;<br>
/*<br>
* MC_VM_FB_LOCATION_BASE/TOP is NULL for VF, because they are<br>
* VF copy registers so vbios post doesn't program them, for<br>
* SRIOV driver need to program them<br>
*/<br>
if (amdgpu_sriov_vf(adev)) {<br>
- for_each_inst(i, tmp_mask) {<br>
- i = ffs(tmp_mask) - 1;<br>
+ for_each_inst(i, xcc_mask) {<br>
WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_BASE,<br>
adev->gmc.vram_start >> 24);<br>
WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_TOP,<br>
diff --git a/scripts/package/builddeb b/scripts/package/builddeb<br>
index 67cd420dcf89..c5508054bfc8 100755<br>
--- a/scripts/package/builddeb<br>
+++ b/scripts/package/builddeb<br>
@@ -164,23 +164,23 @@ if is_enabled CONFIG_MODULES; then<br>
mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/"<br>
rmdir "$tmpdir/lib/modules/$version"<br>
fi<br>
- if [ -n "$BUILD_DEBUG" ] ; then<br>
- for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do<br>
- module=lib/modules/$module<br>
- mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)<br>
- # only keep debug symbols in the debug file<br>
- $OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/usr/lib/debug/$module<br>
- # strip original module from debug symbols<br>
- $OBJCOPY --strip-debug $tmpdir/$module<br>
- # then add a link to those<br>
- $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module<br>
- done<br>
-<br>
- # resign stripped modules<br>
- if is_enabled CONFIG_MODULE_SIG_ALL; then<br>
- INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_sign<br>
- fi<br>
- fi<br>
+ #if [ -n "$BUILD_DEBUG" ] ; then<br>
+ # for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do<br>
+ # module=lib/modules/$module<br>
+ # mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)<br>
+ # # only keep debug symbols in the debug file<br>
+ # $OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/usr/lib/debug/$module<br>
+ # # strip original module from debug symbols<br>
+ # $OBJCOPY --strip-debug $tmpdir/$module<br>
+ # # then add a link to those<br>
+ # $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module<br>
+ # done<br>
+<br>
+ # # resign stripped modules<br>
+ # if is_enabled CONFIG_MODULE_SIG_ALL; then<br>
+ # INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_sign<br>
+ # fi<br>
+ #fi<br>
fi<br>
<br>
# Install the maintainer scripts<br>
@@ -220,18 +220,18 @@ fi<br>
<br>
create_package "$packagename" "$tmpdir"<br>
<br>
-if [ -n "$BUILD_DEBUG" ] ; then<br>
- # Build debug package<br>
- # Different tools want the image in different locations<br>
- # perf<br>
- mkdir -p $dbg_dir/usr/lib/debug/lib/modules/$version/<br>
- cp vmlinux $dbg_dir/usr/lib/debug/lib/modules/$version/<br>
- # systemtap<br>
- mkdir -p $dbg_dir/usr/lib/debug/boot/<br>
- ln -s ../lib/modules/$version/vmlinux $dbg_dir/usr/lib/debug/boot/vmlinux-$version<br>
- # kdump-tools<br>
- ln -s lib/modules/$version/vmlinux $dbg_dir/usr/lib/debug/vmlinux-$version<br>
- create_package "$dbg_packagename" "$dbg_dir"<br>
-fi<br>
+#if [ -n "$BUILD_DEBUG" ] ; then<br>
+# # Build debug package<br>
+# # Different tools want the image in different locations<br>
+# # perf<br>
+# mkdir -p $dbg_dir/usr/lib/debug/lib/modules/$version/<br>
+# cp vmlinux $dbg_dir/usr/lib/debug/lib/modules/$version/<br>
+# # systemtap<br>
+# mkdir -p $dbg_dir/usr/lib/debug/boot/<br>
+# ln -s ../lib/modules/$version/vmlinux $dbg_dir/usr/lib/debug/boot/vmlinux-$version<br>
+# # kdump-tools<br>
+# ln -s lib/modules/$version/vmlinux $dbg_dir/usr/lib/debug/vmlinux-$version<br>
+# create_package "$dbg_packagename" "$dbg_dir"<br>
+#fi<br>
<br>
exit 0<br>
-- <br>
2.34.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>