Skip to content

Commit bdb575f

Browse files
committed
Merge tag 'drm-fixes-2021-09-17' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Slightly busier than usual rc2, but mostly scattered amdgpu fixes, some i915 and etnaviv resolves an MMU/runtime PM blowup. amdgpu: - UBSAN fix - Powerplay table update fix - Fix use after free in BO moves - Debugfs init fixes - vblank workqueue fixes for headless devices - FPU fixes - sysfs_emit fixes - SMU updates for cyan skillfish - Backlight fixes when DMCU is not initialized - DP MST fixes - HDCP compliance fix - Link training fix - Runtime pm fix - Panel orientation fixes - Display GPUVM fix for yellow carp - Add missing license amdkfd: - Drop PCI atomics requirement if proper firmware is available - Suspend/resume fixes for IOMMUv2 cases radeon: - AGP fix i915: - Propagate DP link training error returns - Use max link params for eDP 1.3 and earlier - Build warning fixes - Gem selftest fixes - Ensure wakeref is held before hardware access etnaviv: - MMU context vs runtime PM fix" * tag 'drm-fixes-2021-09-17' of git://anongit.freedesktop.org/drm/drm: (44 commits) drm/amdgpu/display: add a proper license to dc_link_dp.c drm/amd/display: Fix white screen page fault for gpuvm amd/display: enable panel orientation quirks drm/amdgpu: Demote TMZ unsupported log message from warning to info drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count drm/amd/pm: fix runpm hang when amdgpu loaded prior to sound driver drm/radeon: pass drm dev radeon_agp_head_init directly drm/amdgpu: move iommu_resume before ip init/resume drm/amdgpu: add amdgpu_amdkfd_resume_iommu drm/amdkfd: separate kfd_iommu_resume from kfd_resume drm/amd/display: Link training retry fix for abort case drm/amd/display: Fix unstable HPCP compliance on Chrome Barcelo drm/amd/display: dsc mst 2 4K displays go dark with 2 lane HBR3 drm/amd/display: Get backlight from PWM if DMCU is not initialized drm/amdkfd: make needs_pcie_atomics FW-version dependent drm/amdgpu: add manual sclk/vddc setting support for cyan skilfish(v3) drm/amdgpu: add some pptable funcs for cyan skilfish(v3) drm/amdgpu: update SMU driver interface for cyan skilfish(v3) drm/amdgpu: update SMU PPSMC for cyan skilfish drm/amdgpu: fix sysfs_emit/sysfs_emit_at warnings(v2) ...
2 parents fc0c054 + 109f7ea commit bdb575f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+945
-218
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ enum amd_hw_ip_block_type {
758758
MAX_HWIP
759759
};
760760

761-
#define HWIP_MAX_INSTANCE 8
761+
#define HWIP_MAX_INSTANCE 10
762762

763763
struct amd_powerplay {
764764
void *pp_handle;

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,16 @@ void amdgpu_amdkfd_suspend(struct amdgpu_device *adev, bool run_pm)
192192
kgd2kfd_suspend(adev->kfd.dev, run_pm);
193193
}
194194

195+
int amdgpu_amdkfd_resume_iommu(struct amdgpu_device *adev)
196+
{
197+
int r = 0;
198+
199+
if (adev->kfd.dev)
200+
r = kgd2kfd_resume_iommu(adev->kfd.dev);
201+
202+
return r;
203+
}
204+
195205
int amdgpu_amdkfd_resume(struct amdgpu_device *adev, bool run_pm)
196206
{
197207
int r = 0;

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ int amdgpu_amdkfd_init(void);
137137
void amdgpu_amdkfd_fini(void);
138138

139139
void amdgpu_amdkfd_suspend(struct amdgpu_device *adev, bool run_pm);
140+
int amdgpu_amdkfd_resume_iommu(struct amdgpu_device *adev);
140141
int amdgpu_amdkfd_resume(struct amdgpu_device *adev, bool run_pm);
141142
void amdgpu_amdkfd_interrupt(struct amdgpu_device *adev,
142143
const void *ih_ring_entry);
@@ -327,6 +328,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
327328
const struct kgd2kfd_shared_resources *gpu_resources);
328329
void kgd2kfd_device_exit(struct kfd_dev *kfd);
329330
void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm);
331+
int kgd2kfd_resume_iommu(struct kfd_dev *kfd);
330332
int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm);
331333
int kgd2kfd_pre_reset(struct kfd_dev *kfd);
332334
int kgd2kfd_post_reset(struct kfd_dev *kfd);
@@ -365,6 +367,11 @@ static inline void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm)
365367
{
366368
}
367369

370+
static int __maybe_unused kgd2kfd_resume_iommu(struct kfd_dev *kfd)
371+
{
372+
return 0;
373+
}
374+
368375
static inline int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm)
369376
{
370377
return 0;

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,20 +1544,18 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
15441544
struct dentry *ent;
15451545
int r, i;
15461546

1547-
1548-
15491547
ent = debugfs_create_file("amdgpu_preempt_ib", 0600, root, adev,
15501548
&fops_ib_preempt);
1551-
if (!ent) {
1549+
if (IS_ERR(ent)) {
15521550
DRM_ERROR("unable to create amdgpu_preempt_ib debugsfs file\n");
1553-
return -EIO;
1551+
return PTR_ERR(ent);
15541552
}
15551553

15561554
ent = debugfs_create_file("amdgpu_force_sclk", 0200, root, adev,
15571555
&fops_sclk_set);
1558-
if (!ent) {
1556+
if (IS_ERR(ent)) {
15591557
DRM_ERROR("unable to create amdgpu_set_sclk debugsfs file\n");
1560-
return -EIO;
1558+
return PTR_ERR(ent);
15611559
}
15621560

15631561
/* Register debugfs entries for amdgpu_ttm */

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,6 +2394,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
23942394
if (r)
23952395
goto init_failed;
23962396

2397+
r = amdgpu_amdkfd_resume_iommu(adev);
2398+
if (r)
2399+
goto init_failed;
2400+
23972401
r = amdgpu_device_ip_hw_init_phase1(adev);
23982402
if (r)
23992403
goto init_failed;
@@ -3148,6 +3152,10 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
31483152
{
31493153
int r;
31503154

3155+
r = amdgpu_amdkfd_resume_iommu(adev);
3156+
if (r)
3157+
return r;
3158+
31513159
r = amdgpu_device_ip_resume_phase1(adev);
31523160
if (r)
31533161
return r;
@@ -4601,6 +4609,10 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
46014609
dev_warn(tmp_adev->dev, "asic atom init failed!");
46024610
} else {
46034611
dev_info(tmp_adev->dev, "GPU reset succeeded, trying to resume\n");
4612+
r = amdgpu_amdkfd_resume_iommu(tmp_adev);
4613+
if (r)
4614+
goto out;
4615+
46044616
r = amdgpu_device_ip_resume_phase1(tmp_adev);
46054617
if (r)
46064618
goto out;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
598598
break;
599599
default:
600600
adev->gmc.tmz_enabled = false;
601-
dev_warn(adev->dev,
601+
dev_info(adev->dev,
602602
"Trusted Memory Zone (TMZ) feature not supported\n");
603603
break;
604604
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ int amdgpu_ras_eeprom_read(struct amdgpu_ras_eeprom_control *control,
757757
return res;
758758
}
759759

760-
inline uint32_t amdgpu_ras_eeprom_max_record_count(void)
760+
uint32_t amdgpu_ras_eeprom_max_record_count(void)
761761
{
762762
return RAS_MAX_RECORD_COUNT;
763763
}

drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int amdgpu_ras_eeprom_read(struct amdgpu_ras_eeprom_control *control,
120120
int amdgpu_ras_eeprom_append(struct amdgpu_ras_eeprom_control *control,
121121
struct eeprom_table_record *records, const u32 num);
122122

123-
inline uint32_t amdgpu_ras_eeprom_max_record_count(void);
123+
uint32_t amdgpu_ras_eeprom_max_record_count(void);
124124

125125
void amdgpu_ras_debugfs_set_ret_size(struct amdgpu_ras_eeprom_control *control);
126126

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,
428428
ent = debugfs_create_file(name,
429429
S_IFREG | S_IRUGO, root,
430430
ring, &amdgpu_debugfs_ring_fops);
431-
if (!ent)
432-
return -ENOMEM;
431+
if (IS_ERR(ent))
432+
return PTR_ERR(ent);
433433

434434
i_size_write(ent->d_inode, ring->ring_size + 12);
435435
ring->ent = ent;

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,15 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict,
515515
goto out;
516516
}
517517

518+
if (bo->type == ttm_bo_type_device &&
519+
new_mem->mem_type == TTM_PL_VRAM &&
520+
old_mem->mem_type != TTM_PL_VRAM) {
521+
/* amdgpu_bo_fault_reserve_notify will re-set this if the CPU
522+
* accesses the BO after it's moved.
523+
*/
524+
abo->flags &= ~AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
525+
}
526+
518527
if (adev->mman.buffer_funcs_enabled) {
519528
if (((old_mem->mem_type == TTM_PL_SYSTEM &&
520529
new_mem->mem_type == TTM_PL_VRAM) ||
@@ -545,15 +554,6 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict,
545554
return r;
546555
}
547556

548-
if (bo->type == ttm_bo_type_device &&
549-
new_mem->mem_type == TTM_PL_VRAM &&
550-
old_mem->mem_type != TTM_PL_VRAM) {
551-
/* amdgpu_bo_fault_reserve_notify will re-set this if the CPU
552-
* accesses the BO after it's moved.
553-
*/
554-
abo->flags &= ~AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
555-
}
556-
557557
out:
558558
/* update statistics */
559559
atomic64_add(bo->base.size, &adev->num_bytes_moved);

0 commit comments

Comments
 (0)