System freezes with with linux+mesa using Vega(gfx9) APU's and patches to fix

Description:

Using the packages available in Arch core and extra repos, for the last few months, several users including myself have experienced unrecoverable system freezes on the following hardware: AMD Ryzen APU's, Radeon Vega raven series 'gfx9' graphics.

Additional info:

Reportedly both the Mesa and Linux upstream have been working on this issue. There is an ongoing forum thread* with tested solutions involving patches applied to both 'mesa' and 'linux' packages. Either patched package will eliminate the system freezing installed individually. ie: either patched mesa or patched linux.

I'm proposing the following patches applied to our linux package due to the large amount of the hardware involved along with the successful testing reports in the forum thread*.

Our community member 'logs' has provided the last two versions of our linux package with the following patches applied. Users including myself have had successful testing using 'logs' patched package combo consisting of 'linux' and 'linux-headers'.

(*) https://bbs.archlinux.org/viewtopic.php?id=301798

Link to user logs latest patched 'linux' and 'linux-headers' including a package patch file:

https://bbs.archlinux.org/viewtopic.php?pid=2228208#p2228208

And a copy of the current linux package patch file:

diff --git a/PKGBUILD b/PKGBUILD
index db548cc..5e2908a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
 
 pkgbase=linux
 pkgver=6.13.4.arch1
-pkgrel=1
+pkgrel=1.1
 pkgdesc='Linux'
 url='https://github.com/archlinux/linux'
 arch=(x86_64)
@@ -17,13 +17,6 @@ makedepends=(
   python
   tar
   xz
-
-  # htmldocs
-  graphviz
-  imagemagick
-  python-sphinx
-  python-yaml
-  texlive-latexextra
 )
 options=(
   !debug
@@ -34,6 +27,8 @@ _srctag=v${pkgver%.*}-${pkgver##*.}
 source=(
   https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/${_srcname}.tar.{xz,sign}
   $url/releases/download/$_srctag/linux-$_srctag.patch.zst{,.sig}
+  drm-amdgpu-gfx9-manually-control-gfxoff-for-cs-on-rv.patch::https://lore.kernel.org/stable/20250219132559.3940753-1-alexander.deucher@amd.com/raw
+  drm-amdgpu-bump-version-for-rv-pco-compute-fix.patch::https://lore.kernel.org/stable/20250219132559.3940753-2-alexander.deucher@amd.com/raw
   config  # the main kernel config file
 )
 validpgpkeys=(
@@ -46,11 +41,15 @@ sha256sums=('b80e0bc8efbc31e9ce5a84d1084dcccfa40e01bea8cc25afd06648b93d61339e'
             'SKIP'
             '9396ecd603c0129ca8457731db5fef117f75b63aec7a6782d5acbe8e4cd64787'
             'SKIP'
+            '4086b15d66f2f8d8ebafff193c0a5116b9eabcda6b4e7bbeefa8773fe4c56f80'
+            '7091cc80581c1d62aa9cfd717d0605a7049c4a801ee5ec20c0cd5439994cfb21'
             '9a195bc4d8b492b0f44da392689746f605ca946e4f396bbc25fdbffb383899c1')
 b2sums=('2fe8e972e7de458fba6fbb18a08a01f17b49e4a2d31aa1368e50895a2698c6e1aaaf5137d0c0018860de3fe598e4ba425d6126ade7387ba227f690137111a66d'
         'SKIP'
         'da2f63697300bd07a28ab201aa879974eb50870cfcb6d0593c4ca33434ee0ccaa778be9a165f998f2f3e41e4f9f81d811255e6f056c9d15f8259da60d6680e2b'
         'SKIP'
+        '80efc0c7b53fad68c28ef20aae314285ecbad959566abc57281fb59d654c7d326eb361d25e5acd0225a7715310e9300d6df62c7baa348b7116f5f1df53198a14'
+        'bb1caf4dac5ec2a901d8ad80757adab3731a1e9b50a7b7c5540c58f24deb4601cbba1870b9cd5e406625ed7fcbb8331e94d5cced5a36bb3092280d99d7420318'
         'eedd98ed226561af9b279b931d5251974ed98cf21fa0974a855dd0365a16d6702f190dc60eca9bb337534110d94d070e7c7bc5cd61ba774ab38d441b567cce6c')
 
 export KBUILD_BUILD_HOST=archlinux
@@ -87,7 +86,6 @@ build() {
   cd $_srcname
   make all
   make -C tools/bpf/bpftool vmlinux.h feature-clang-bpf-co-re=1
-  make htmldocs
 }
 
 _package() {
@@ -214,29 +212,9 @@ _package-headers() {
   ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
 }
 
-_package-docs() {
-  pkgdesc="Documentation for the $pkgdesc kernel"
-
-  cd $_srcname
-  local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
-
-  echo "Installing documentation..."
-  local src dst
-  while read -rd '' src; do
-    dst="${src#Documentation/}"
-    dst="$builddir/Documentation/${dst#output/}"
-    install -Dm644 "$src" "$dst"
-  done < <(find Documentation -name '.*' -prune -o ! -type d -print0)
-
-  echo "Adding symlink..."
-  mkdir -p "$pkgdir/usr/share/doc"
-  ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase"
-}
-
 pkgname=(
   "$pkgbase"
   "$pkgbase-headers"
-  "$pkgbase-docs"
 )
 for _p in "${pkgname[@]}"; do
   eval "package_$_p() {

Steps to reproduce:

  1. Setup Arch on hardware with AMD Ryzen APU, Radeon Vega raven 'gfx9' series with either xserver or wayland, 'linux', 'mesa' and a WM or DE.

  2. Run system and wait a random amount of time from minutes to days for an unrecoverable system freeze to occur.

  3. A hard reset via power button is normally the only option to recover. ie: switching tty, REISUB, etc does not normally work.

Edited by jeff
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information