]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.11-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Oct 2013 02:32:34 +0000 (19:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Oct 2013 02:32:34 +0000 (19:32 -0700)
added patches:
drm-radeon-add-missing-hdmi-callbacks-for-rv6xx.patch
drm-radeon-avoid-uvd-corruption-on-agp-cards-using-gpu-gart.patch
drm-radeon-cik-fix-encoding-of-number-of-banks-in-tiling-configuration-info.patch
drm-radeon-cik-fix-overflow-in-vram-fetch.patch
drm-radeon-cik-fix-printing-of-client-name-on-vm-protection-fault.patch
drm-radeon-disable-tests-benchmarks-if-accel-is-disabled.patch
drm-radeon-don-t-set-default-clocks-for-si-when-dpm-is-disabled.patch
drm-radeon-fix-hdmi-audio-on-dce3.0-3.1-asics.patch
drm-radeon-make-r100_cp_ring_info-and-radeon_ring_gfx-safe-v2.patch

queue-3.11/drm-radeon-add-missing-hdmi-callbacks-for-rv6xx.patch [new file with mode: 0644]
queue-3.11/drm-radeon-avoid-uvd-corruption-on-agp-cards-using-gpu-gart.patch [new file with mode: 0644]
queue-3.11/drm-radeon-cik-fix-encoding-of-number-of-banks-in-tiling-configuration-info.patch [new file with mode: 0644]
queue-3.11/drm-radeon-cik-fix-overflow-in-vram-fetch.patch [new file with mode: 0644]
queue-3.11/drm-radeon-cik-fix-printing-of-client-name-on-vm-protection-fault.patch [new file with mode: 0644]
queue-3.11/drm-radeon-disable-tests-benchmarks-if-accel-is-disabled.patch [new file with mode: 0644]
queue-3.11/drm-radeon-don-t-set-default-clocks-for-si-when-dpm-is-disabled.patch [new file with mode: 0644]
queue-3.11/drm-radeon-fix-hdmi-audio-on-dce3.0-3.1-asics.patch [new file with mode: 0644]
queue-3.11/drm-radeon-make-r100_cp_ring_info-and-radeon_ring_gfx-safe-v2.patch [new file with mode: 0644]
queue-3.11/series

diff --git a/queue-3.11/drm-radeon-add-missing-hdmi-callbacks-for-rv6xx.patch b/queue-3.11/drm-radeon-add-missing-hdmi-callbacks-for-rv6xx.patch
new file mode 100644 (file)
index 0000000..ef2a60d
--- /dev/null
@@ -0,0 +1,36 @@
+From 99d79aa2f3b7729e7290e8bda5d0dd8b0240ec62 Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Mon, 23 Sep 2013 15:47:08 -0400
+Subject: drm/radeon: add missing hdmi callbacks for rv6xx
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+commit 99d79aa2f3b7729e7290e8bda5d0dd8b0240ec62 upstream.
+
+When dpm was merged, I added a new asic struct for
+rv6xx, but it never got properly updated when the
+hdmi callbacks were added due to the two patch sets
+being developed in parallel.
+
+Fixes:
+https://bugs.freedesktop.org/show_bug.cgi?id=69729
+
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/radeon_asic.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/gpu/drm/radeon/radeon_asic.c
++++ b/drivers/gpu/drm/radeon/radeon_asic.c
+@@ -926,6 +926,8 @@ static struct radeon_asic r520_asic = {
+               .wait_for_vblank = &avivo_wait_for_vblank,
+               .set_backlight_level = &atombios_set_backlight_level,
+               .get_backlight_level = &atombios_get_backlight_level,
++              .hdmi_enable = &r600_hdmi_enable,
++              .hdmi_setmode = &r600_hdmi_setmode,
+       },
+       .copy = {
+               .blit = &r100_copy_blit,
diff --git a/queue-3.11/drm-radeon-avoid-uvd-corruption-on-agp-cards-using-gpu-gart.patch b/queue-3.11/drm-radeon-avoid-uvd-corruption-on-agp-cards-using-gpu-gart.patch
new file mode 100644 (file)
index 0000000..8a37b8e
--- /dev/null
@@ -0,0 +1,33 @@
+From 4ca5a6cba53e13b8fd153b0762b4128fab6a3cfb Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Sun, 15 Sep 2013 23:23:07 -0400
+Subject: drm/radeon: avoid UVD corruption on AGP cards using GPU gart
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+commit 4ca5a6cba53e13b8fd153b0762b4128fab6a3cfb upstream.
+
+If the user has forced the driver to use the internal GPU gart
+rather than AGP on an AGP card, force the buffers to vram
+as well.
+
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/radeon_cs.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/radeon/radeon_cs.c
++++ b/drivers/gpu/drm/radeon/radeon_cs.c
+@@ -84,7 +84,7 @@ static int radeon_cs_parser_relocs(struc
+                  VRAM, also but everything into VRAM on AGP cards to avoid
+                  image corruptions */
+               if (p->ring == R600_RING_TYPE_UVD_INDEX &&
+-                  (i == 0 || p->rdev->flags & RADEON_IS_AGP)) {
++                  (i == 0 || drm_pci_device_is_agp(p->rdev->ddev))) {
+                       /* TODO: is this still needed for NI+ ? */
+                       p->relocs[i].lobj.domain =
+                               RADEON_GEM_DOMAIN_VRAM;
diff --git a/queue-3.11/drm-radeon-cik-fix-encoding-of-number-of-banks-in-tiling-configuration-info.patch b/queue-3.11/drm-radeon-cik-fix-encoding-of-number-of-banks-in-tiling-configuration-info.patch
new file mode 100644 (file)
index 0000000..aea1ba4
--- /dev/null
@@ -0,0 +1,35 @@
+From a537314e0b539e22934d3cffeb0b1f476e56491c Mon Sep 17 00:00:00 2001
+From: Michel Dänzer <michel.daenzer@amd.com>
+Date: Wed, 18 Sep 2013 15:39:41 +0200
+Subject: drm/radeon/cik: Fix encoding of number of banks in tiling configuration info
+
+From: Michel Dänzer <michel.daenzer@amd.com>
+
+commit a537314e0b539e22934d3cffeb0b1f476e56491c upstream.
+
+There are multiple valid values, not just 0 or 1.  Required
+to properly support 2D tiling in the userspace drivers.
+
+Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/cik.c |    6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/cik.c
++++ b/drivers/gpu/drm/radeon/cik.c
+@@ -2008,10 +2008,8 @@ static void cik_gpu_init(struct radeon_d
+               rdev->config.cik.tile_config |= (3 << 0);
+               break;
+       }
+-      if ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT)
+-              rdev->config.cik.tile_config |= 1 << 4;
+-      else
+-              rdev->config.cik.tile_config |= 0 << 4;
++      rdev->config.cik.tile_config |=
++              ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4;
+       rdev->config.cik.tile_config |=
+               ((gb_addr_config & PIPE_INTERLEAVE_SIZE_MASK) >> PIPE_INTERLEAVE_SIZE_SHIFT) << 8;
+       rdev->config.cik.tile_config |=
diff --git a/queue-3.11/drm-radeon-cik-fix-overflow-in-vram-fetch.patch b/queue-3.11/drm-radeon-cik-fix-overflow-in-vram-fetch.patch
new file mode 100644 (file)
index 0000000..4df648d
--- /dev/null
@@ -0,0 +1,32 @@
+From 13c5bfdad758bddc199850c22246ddf26adcec1f Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Tue, 24 Sep 2013 10:56:55 -0400
+Subject: drm/radeon/cik: fix overflow in vram fetch
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+commit 13c5bfdad758bddc199850c22246ddf26adcec1f upstream.
+
+Missing ULL when calculating the amount of vram
+leads to an overflow when the amount of vram is >= 4G.
+
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/cik.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/cik.c
++++ b/drivers/gpu/drm/radeon/cik.c
+@@ -4225,8 +4225,8 @@ static int cik_mc_init(struct radeon_dev
+       rdev->mc.aper_base = pci_resource_start(rdev->pdev, 0);
+       rdev->mc.aper_size = pci_resource_len(rdev->pdev, 0);
+       /* size in MB on si */
+-      rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
+-      rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
++      rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL;
++      rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL;
+       rdev->mc.visible_vram_size = rdev->mc.aper_size;
+       si_vram_gtt_location(rdev, &rdev->mc);
+       radeon_update_bandwidth_info(rdev);
diff --git a/queue-3.11/drm-radeon-cik-fix-printing-of-client-name-on-vm-protection-fault.patch b/queue-3.11/drm-radeon-cik-fix-printing-of-client-name-on-vm-protection-fault.patch
new file mode 100644 (file)
index 0000000..80e224a
--- /dev/null
@@ -0,0 +1,38 @@
+From 328a50c7b09d313ab9278f972950da414d348eb1 Mon Sep 17 00:00:00 2001
+From: Michel Dänzer <michel.daenzer@amd.com>
+Date: Wed, 18 Sep 2013 15:39:40 +0200
+Subject: drm/radeon/cik: Fix printing of client name on VM protection fault
+
+From: Michel Dänzer <michel.daenzer@amd.com>
+
+commit 328a50c7b09d313ab9278f972950da414d348eb1 upstream.
+
+The string is encoded from the MSB to the LSB of the register.
+
+Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/cik.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/cik.c
++++ b/drivers/gpu/drm/radeon/cik.c
+@@ -4506,12 +4506,13 @@ static void cik_vm_decode_fault(struct r
+       u32 mc_id = (status & MEMORY_CLIENT_ID_MASK) >> MEMORY_CLIENT_ID_SHIFT;
+       u32 vmid = (status & FAULT_VMID_MASK) >> FAULT_VMID_SHIFT;
+       u32 protections = (status & PROTECTIONS_MASK) >> PROTECTIONS_SHIFT;
+-      char *block = (char *)&mc_client;
++      char block[5] = { mc_client >> 24, (mc_client >> 16) & 0xff,
++              (mc_client >> 8) & 0xff, mc_client & 0xff, 0 };
+-      printk("VM fault (0x%02x, vmid %d) at page %u, %s from %s (%d)\n",
++      printk("VM fault (0x%02x, vmid %d) at page %u, %s from '%s' (0x%08x) (%d)\n",
+              protections, vmid, addr,
+              (status & MEMORY_CLIENT_RW_MASK) ? "write" : "read",
+-             block, mc_id);
++             block, mc_client, mc_id);
+ }
+ /**
diff --git a/queue-3.11/drm-radeon-disable-tests-benchmarks-if-accel-is-disabled.patch b/queue-3.11/drm-radeon-disable-tests-benchmarks-if-accel-is-disabled.patch
new file mode 100644 (file)
index 0000000..a6f5f76
--- /dev/null
@@ -0,0 +1,49 @@
+From 4a1132a023eb48cf10522d84c5908d43b612c041 Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Mon, 23 Sep 2013 10:38:26 -0400
+Subject: drm/radeon: disable tests/benchmarks if accel is disabled
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+commit 4a1132a023eb48cf10522d84c5908d43b612c041 upstream.
+
+The tests are only usable if the acceleration engines have
+been successfully initialized.
+
+Based on an initial patch from: Alex Ivanov <gnidorah@p0n4ik.tk>
+
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/radeon_device.c |   15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/radeon_device.c
++++ b/drivers/gpu/drm/radeon/radeon_device.c
+@@ -1297,13 +1297,22 @@ int radeon_device_init(struct radeon_dev
+                       return r;
+       }
+       if ((radeon_testing & 1)) {
+-              radeon_test_moves(rdev);
++              if (rdev->accel_working)
++                      radeon_test_moves(rdev);
++              else
++                      DRM_INFO("radeon: acceleration disabled, skipping move tests\n");
+       }
+       if ((radeon_testing & 2)) {
+-              radeon_test_syncing(rdev);
++              if (rdev->accel_working)
++                      radeon_test_syncing(rdev);
++              else
++                      DRM_INFO("radeon: acceleration disabled, skipping sync tests\n");
+       }
+       if (radeon_benchmarking) {
+-              radeon_benchmark(rdev, radeon_benchmarking);
++              if (rdev->accel_working)
++                      radeon_benchmark(rdev, radeon_benchmarking);
++              else
++                      DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n");
+       }
+       return 0;
+ }
diff --git a/queue-3.11/drm-radeon-don-t-set-default-clocks-for-si-when-dpm-is-disabled.patch b/queue-3.11/drm-radeon-don-t-set-default-clocks-for-si-when-dpm-is-disabled.patch
new file mode 100644 (file)
index 0000000..f89cd32
--- /dev/null
@@ -0,0 +1,63 @@
+From 360991867d83e10827d907ef67206986a98953b3 Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Sat, 21 Sep 2013 14:37:49 -0400
+Subject: drm/radeon: don't set default clocks for SI when DPM is disabled
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+commit 360991867d83e10827d907ef67206986a98953b3 upstream.
+
+This is a partial revert of c6cf7777a32da874fabec4fd1c2a579f0ba4e4dd.
+
+We need to take into account the clk voltage dependencies of the
+board.  Not doing so can lead to stability issues on certain
+boards if the clks exceed the levels in the dep tables.
+
+DPM already takes that into account, so for optimal performance,
+use DPM.
+
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/radeon_pm.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/radeon_pm.c
++++ b/drivers/gpu/drm/radeon/radeon_pm.c
+@@ -919,7 +919,7 @@ static void radeon_pm_resume_old(struct
+ {
+       /* set up the default clocks if the MC ucode is loaded */
+       if ((rdev->family >= CHIP_BARTS) &&
+-          (rdev->family <= CHIP_HAINAN) &&
++          (rdev->family <= CHIP_CAYMAN) &&
+           rdev->mc_fw) {
+               if (rdev->pm.default_vddc)
+                       radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
+@@ -963,7 +963,7 @@ static void radeon_pm_resume_dpm(struct
+       if (ret) {
+               DRM_ERROR("radeon: dpm resume failed\n");
+               if ((rdev->family >= CHIP_BARTS) &&
+-                  (rdev->family <= CHIP_HAINAN) &&
++                  (rdev->family <= CHIP_CAYMAN) &&
+                   rdev->mc_fw) {
+                       if (rdev->pm.default_vddc)
+                               radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
+@@ -1014,7 +1014,7 @@ static int radeon_pm_init_old(struct rad
+               radeon_pm_init_profile(rdev);
+               /* set up the default clocks if the MC ucode is loaded */
+               if ((rdev->family >= CHIP_BARTS) &&
+-                  (rdev->family <= CHIP_HAINAN) &&
++                  (rdev->family <= CHIP_CAYMAN) &&
+                   rdev->mc_fw) {
+                       if (rdev->pm.default_vddc)
+                               radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
+@@ -1099,7 +1099,7 @@ static int radeon_pm_init_dpm(struct rad
+       if (ret) {
+               rdev->pm.dpm_enabled = false;
+               if ((rdev->family >= CHIP_BARTS) &&
+-                  (rdev->family <= CHIP_HAINAN) &&
++                  (rdev->family <= CHIP_CAYMAN) &&
+                   rdev->mc_fw) {
+                       if (rdev->pm.default_vddc)
+                               radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
diff --git a/queue-3.11/drm-radeon-fix-hdmi-audio-on-dce3.0-3.1-asics.patch b/queue-3.11/drm-radeon-fix-hdmi-audio-on-dce3.0-3.1-asics.patch
new file mode 100644 (file)
index 0000000..7f2885c
--- /dev/null
@@ -0,0 +1,61 @@
+From 58d327da9721f7a0f6e46c8dfa5cc5546fd7078a Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Wed, 25 Sep 2013 12:04:37 -0400
+Subject: drm/radeon: fix hdmi audio on DCE3.0/3.1 asics
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+commit 58d327da9721f7a0f6e46c8dfa5cc5546fd7078a upstream.
+
+These asics seem to use a mix of the DCE2.x and
+DCE3.2 audio interfaces despite what the register spec
+says.
+
+Fixes:
+https://bugs.freedesktop.org/show_bug.cgi?id=69729
+https://bugs.freedesktop.org/show_bug.cgi?id=69671
+
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/r600_hdmi.c |   20 +++++++++++++++-----
+ 1 file changed, 15 insertions(+), 5 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/r600_hdmi.c
++++ b/drivers/gpu/drm/radeon/r600_hdmi.c
+@@ -257,10 +257,7 @@ void r600_audio_set_dto(struct drm_encod
+        * number (coefficient of two integer numbers.  DCCG_AUDIO_DTOx_PHASE
+        * is the numerator, DCCG_AUDIO_DTOx_MODULE is the denominator
+        */
+-      if (ASIC_IS_DCE3(rdev)) {
+-              /* according to the reg specs, this should DCE3.2 only, but in
+-               * practice it seems to cover DCE3.0 as well.
+-               */
++      if (ASIC_IS_DCE32(rdev)) {
+               if (dig->dig_encoder == 0) {
+                       dto_cntl = RREG32(DCCG_AUDIO_DTO0_CNTL) & ~DCCG_AUDIO_DTO_WALLCLOCK_RATIO_MASK;
+                       dto_cntl |= DCCG_AUDIO_DTO_WALLCLOCK_RATIO(wallclock_ratio);
+@@ -276,8 +273,21 @@ void r600_audio_set_dto(struct drm_encod
+                       WREG32(DCCG_AUDIO_DTO1_MODULE, dto_modulo);
+                       WREG32(DCCG_AUDIO_DTO_SELECT, 1); /* select DTO1 */
+               }
++      } else if (ASIC_IS_DCE3(rdev)) {
++              /* according to the reg specs, this should DCE3.2 only, but in
++               * practice it seems to cover DCE3.0/3.1 as well.
++               */
++              if (dig->dig_encoder == 0) {
++                      WREG32(DCCG_AUDIO_DTO0_PHASE, base_rate * 100);
++                      WREG32(DCCG_AUDIO_DTO0_MODULE, clock * 100);
++                      WREG32(DCCG_AUDIO_DTO_SELECT, 0); /* select DTO0 */
++              } else {
++                      WREG32(DCCG_AUDIO_DTO1_PHASE, base_rate * 100);
++                      WREG32(DCCG_AUDIO_DTO1_MODULE, clock * 100);
++                      WREG32(DCCG_AUDIO_DTO_SELECT, 1); /* select DTO1 */
++              }
+       } else {
+-              /* according to the reg specs, this should be DCE2.0 and DCE3.0 */
++              /* according to the reg specs, this should be DCE2.0 and DCE3.0/3.1 */
+               WREG32(AUDIO_DTO, AUDIO_DTO_PHASE(base_rate / 10) |
+                      AUDIO_DTO_MODULE(clock / 10));
+       }
diff --git a/queue-3.11/drm-radeon-make-r100_cp_ring_info-and-radeon_ring_gfx-safe-v2.patch b/queue-3.11/drm-radeon-make-r100_cp_ring_info-and-radeon_ring_gfx-safe-v2.patch
new file mode 100644 (file)
index 0000000..07f6805
--- /dev/null
@@ -0,0 +1,59 @@
+From 0eb3448aa6b31fbf24c31756aba7940cac5ad6b8 Mon Sep 17 00:00:00 2001
+From: Alex Ivanov <gnidorah@p0n4ik.tk>
+Date: Fri, 20 Sep 2013 17:36:06 +0400
+Subject: drm/radeon: Make r100_cp_ring_info() and radeon_ring_gfx() safe (v2)
+
+From: Alex Ivanov <gnidorah@p0n4ik.tk>
+
+commit 0eb3448aa6b31fbf24c31756aba7940cac5ad6b8 upstream.
+
+Prevent NULL pointer dereference in case when radeon_ring_fini() did it's job.
+
+Reading of r100_cp_ring_info and radeon_ring_gfx debugfs entries will lead to a KP if ring buffer was deallocated, e.g. on failed ring test.
+Seen on PA-RISC machine having "radeon: ring test failed (scratch(0x8504)=0xCAFEDEAD)" issue.
+
+v2: agd5f: add some parens around ring->ready check
+
+Signed-off-by: Alex Ivanov <gnidorah@p0n4ik.tk>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/radeon/r100.c        |    8 +++++---
+ drivers/gpu/drm/radeon/radeon_ring.c |    8 +++++---
+ 2 files changed, 10 insertions(+), 6 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/r100.c
++++ b/drivers/gpu/drm/radeon/r100.c
+@@ -2926,9 +2926,11 @@ static int r100_debugfs_cp_ring_info(str
+       seq_printf(m, "CP_RB_RPTR 0x%08x\n", rdp);
+       seq_printf(m, "%u free dwords in ring\n", ring->ring_free_dw);
+       seq_printf(m, "%u dwords in ring\n", count);
+-      for (j = 0; j <= count; j++) {
+-              i = (rdp + j) & ring->ptr_mask;
+-              seq_printf(m, "r[%04d]=0x%08x\n", i, ring->ring[i]);
++      if (ring->ready) {
++              for (j = 0; j <= count; j++) {
++                      i = (rdp + j) & ring->ptr_mask;
++                      seq_printf(m, "r[%04d]=0x%08x\n", i, ring->ring[i]);
++              }
+       }
+       return 0;
+ }
+--- a/drivers/gpu/drm/radeon/radeon_ring.c
++++ b/drivers/gpu/drm/radeon/radeon_ring.c
+@@ -846,9 +846,11 @@ static int radeon_debugfs_ring_info(stru
+        * packet that is the root issue
+        */
+       i = (ring->rptr + ring->ptr_mask + 1 - 32) & ring->ptr_mask;
+-      for (j = 0; j <= (count + 32); j++) {
+-              seq_printf(m, "r[%5d]=0x%08x\n", i, ring->ring[i]);
+-              i = (i + 1) & ring->ptr_mask;
++      if (ring->ready) {
++              for (j = 0; j <= (count + 32); j++) {
++                      seq_printf(m, "r[%5d]=0x%08x\n", i, ring->ring[i]);
++                      i = (i + 1) & ring->ptr_mask;
++              }
+       }
+       return 0;
+ }
index f3dfb9783bcc7ae8b8fc96aa1b1a01ca87b60587..f5db774142ba547093a8d65083fbd04206db2df8 100644 (file)
@@ -43,3 +43,12 @@ dm-snapshot-fix-performance-degradation-due-to-small-hash-size.patch
 dm-mpath-disable-write-same-if-it-fails.patch
 drm-i915-preserve-pipe-a-quirk-in-i9xx_set_pipeconf.patch
 drm-i915-dp-increase-i2c-over-aux-retry-interval-on-aux-defer.patch
+drm-radeon-cik-fix-printing-of-client-name-on-vm-protection-fault.patch
+drm-radeon-cik-fix-encoding-of-number-of-banks-in-tiling-configuration-info.patch
+drm-radeon-cik-fix-overflow-in-vram-fetch.patch
+drm-radeon-avoid-uvd-corruption-on-agp-cards-using-gpu-gart.patch
+drm-radeon-make-r100_cp_ring_info-and-radeon_ring_gfx-safe-v2.patch
+drm-radeon-don-t-set-default-clocks-for-si-when-dpm-is-disabled.patch
+drm-radeon-disable-tests-benchmarks-if-accel-is-disabled.patch
+drm-radeon-add-missing-hdmi-callbacks-for-rv6xx.patch
+drm-radeon-fix-hdmi-audio-on-dce3.0-3.1-asics.patch