Skip to content

Commit 10b4b67

Browse files
committed
Merge tag 'drm-fixes-2022-05-13' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Pretty quiet week on the fixes front, 4 amdgpu and one i915 fix. I think there might be a few misc fbdev ones outstanding, but I'll see if they are necessary and pass them on if so. amdgpu: - Disable ASPM for VI boards on ADL platforms - S0ix DCN3.1 display fix - Resume regression fix - Stable pstate fix i915: - fix for kernel memory corruption when running a lot of OpenCL tests in parallel" * tag 'drm-fixes-2022-05-13' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu/ctx: only reset stable pstate if the user changed it (v2) Revert "drm/amd/pm: keep the BACO feature enabled for suspend" drm/i915: Fix race in __i915_vma_remove_closed drm/amd/display: undo clearing of z10 related function pointers drm/amdgpu: vi: disable ASPM on Intel Alder Lake based systems
2 parents f3f19f9 + 5005e98 commit 10b4b67

File tree

5 files changed

+29
-17
lines changed

5 files changed

+29
-17
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ static int amdgpu_ctx_set_stable_pstate(struct amdgpu_ctx *ctx,
296296
{
297297
struct amdgpu_device *adev = ctx->adev;
298298
enum amd_dpm_forced_level level;
299+
u32 current_stable_pstate;
299300
int r;
300301

301302
mutex_lock(&adev->pm.stable_pstate_ctx_lock);
@@ -304,6 +305,10 @@ static int amdgpu_ctx_set_stable_pstate(struct amdgpu_ctx *ctx,
304305
goto done;
305306
}
306307

308+
r = amdgpu_ctx_get_stable_pstate(ctx, &current_stable_pstate);
309+
if (r || (stable_pstate == current_stable_pstate))
310+
goto done;
311+
307312
switch (stable_pstate) {
308313
case AMDGPU_CTX_STABLE_PSTATE_NONE:
309314
level = AMD_DPM_FORCED_LEVEL_AUTO;

drivers/gpu/drm/amd/amdgpu/vi.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@
8181
#include "mxgpu_vi.h"
8282
#include "amdgpu_dm.h"
8383

84+
#if IS_ENABLED(CONFIG_X86)
85+
#include <asm/intel-family.h>
86+
#endif
87+
8488
#define ixPCIE_LC_L1_PM_SUBSTATE 0x100100C6
8589
#define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK 0x00000001L
8690
#define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK 0x00000002L
@@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct amdgpu_device *adev)
11341138
WREG32_PCIE(ixPCIE_LC_CNTL, data);
11351139
}
11361140

1141+
static bool aspm_support_quirk_check(void)
1142+
{
1143+
#if IS_ENABLED(CONFIG_X86)
1144+
struct cpuinfo_x86 *c = &cpu_data(0);
1145+
1146+
return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
1147+
#else
1148+
return true;
1149+
#endif
1150+
}
1151+
11371152
static void vi_program_aspm(struct amdgpu_device *adev)
11381153
{
11391154
u32 data, data1, orig;
11401155
bool bL1SS = false;
11411156
bool bClkReqSupport = true;
11421157

1143-
if (!amdgpu_device_should_use_aspm(adev))
1158+
if (!amdgpu_device_should_use_aspm(adev) || !aspm_support_quirk_check())
11441159
return;
11451160

11461161
if (adev->flags & AMD_IS_APU ||

drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,4 @@ void dcn31_hw_sequencer_construct(struct dc *dc)
153153
dc->hwss.init_hw = dcn20_fpga_init_hw;
154154
dc->hwseq->funcs.init_pipes = NULL;
155155
}
156-
if (dc->debug.disable_z10) {
157-
/*hw not support z10 or sw disable it*/
158-
dc->hwss.z10_restore = NULL;
159-
dc->hwss.z10_save_init = NULL;
160-
}
161156
}

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,14 +1351,8 @@ static int smu_disable_dpms(struct smu_context *smu)
13511351
{
13521352
struct amdgpu_device *adev = smu->adev;
13531353
int ret = 0;
1354-
/*
1355-
* TODO: (adev->in_suspend && !adev->in_s0ix) is added to pair
1356-
* the workaround which always reset the asic in suspend.
1357-
* It's likely that workaround will be dropped in the future.
1358-
* Then the change here should be dropped together.
1359-
*/
13601354
bool use_baco = !smu->is_apu &&
1361-
(((amdgpu_in_reset(adev) || (adev->in_suspend && !adev->in_s0ix)) &&
1355+
((amdgpu_in_reset(adev) &&
13621356
(amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)) ||
13631357
((adev->in_runpm || adev->in_s4) && amdgpu_asic_supports_baco(adev)));
13641358

drivers/gpu/drm/i915/i915_vma.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,17 +1605,17 @@ void i915_vma_close(struct i915_vma *vma)
16051605

16061606
static void __i915_vma_remove_closed(struct i915_vma *vma)
16071607
{
1608-
struct intel_gt *gt = vma->vm->gt;
1609-
1610-
spin_lock_irq(&gt->closed_lock);
16111608
list_del_init(&vma->closed_link);
1612-
spin_unlock_irq(&gt->closed_lock);
16131609
}
16141610

16151611
void i915_vma_reopen(struct i915_vma *vma)
16161612
{
1613+
struct intel_gt *gt = vma->vm->gt;
1614+
1615+
spin_lock_irq(&gt->closed_lock);
16171616
if (i915_vma_is_closed(vma))
16181617
__i915_vma_remove_closed(vma);
1618+
spin_unlock_irq(&gt->closed_lock);
16191619
}
16201620

16211621
void i915_vma_release(struct kref *ref)
@@ -1641,6 +1641,7 @@ static void force_unbind(struct i915_vma *vma)
16411641
static void release_references(struct i915_vma *vma)
16421642
{
16431643
struct drm_i915_gem_object *obj = vma->obj;
1644+
struct intel_gt *gt = vma->vm->gt;
16441645

16451646
GEM_BUG_ON(i915_vma_is_active(vma));
16461647

@@ -1650,7 +1651,9 @@ static void release_references(struct i915_vma *vma)
16501651
rb_erase(&vma->obj_node, &obj->vma.tree);
16511652
spin_unlock(&obj->vma.lock);
16521653

1654+
spin_lock_irq(&gt->closed_lock);
16531655
__i915_vma_remove_closed(vma);
1656+
spin_unlock_irq(&gt->closed_lock);
16541657

16551658
__i915_vma_put(vma);
16561659
}

0 commit comments

Comments
 (0)