Commit f3caa226 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'amd-drm-fixes-5.16-2021-11-24' of...

Merge tag 'amd-drm-fixes-5.16-2021-11-24' of https://gitlab.freedesktop.org/agd5f/linux

 into drm-fixes

amd-drm-fixes-5.16-2021-11-24:

amdgpu:
- SRIOV fixes
- dma-buf double free fix
- Display fixes for GPU resets
- Fix DSC powergating regression
- GPU TSC fixes
- Interrupt handler overflow fixes
- Endian fix in IP discovery table handling
- Aldebaran ASPM fix
- Fix overclocking regression on older asics
- Backlight/ACPI fix

amdkfd:
- SVM fixes
- VMA removal race fix

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211124212056.6327-1-alexander.deucher@amd.com
parents 13605725 692cd92e
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -646,12 +646,6 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct kgd_mem *mem,
	if (IS_ERR(gobj))
		return PTR_ERR(gobj);

	/* Import takes an extra reference on the dmabuf. Drop it now to
	 * avoid leaking it. We only need the one reference in
	 * kgd_mem->dmabuf.
	 */
	dma_buf_put(mem->dmabuf);

	*bo = gem_to_amdgpu_bo(gobj);
	(*bo)->flags |= AMDGPU_GEM_CREATE_PREEMPTIBLE;
	(*bo)->parent = amdgpu_bo_ref(mem->bo);
+12 −0
Original line number Diff line number Diff line
@@ -1569,6 +1569,18 @@ void amdgpu_atombios_scratch_regs_engine_hung(struct amdgpu_device *adev,
	WREG32(adev->bios_scratch_reg_offset + 3, tmp);
}

void amdgpu_atombios_scratch_regs_set_backlight_level(struct amdgpu_device *adev,
						      u32 backlight_level)
{
	u32 tmp = RREG32(adev->bios_scratch_reg_offset + 2);

	tmp &= ~ATOM_S2_CURRENT_BL_LEVEL_MASK;
	tmp |= (backlight_level << ATOM_S2_CURRENT_BL_LEVEL_SHIFT) &
		ATOM_S2_CURRENT_BL_LEVEL_MASK;

	WREG32(adev->bios_scratch_reg_offset + 2, tmp);
}

bool amdgpu_atombios_scratch_need_asic_init(struct amdgpu_device *adev)
{
	u32 tmp = RREG32(adev->bios_scratch_reg_offset + 7);
+2 −0
Original line number Diff line number Diff line
@@ -185,6 +185,8 @@ bool amdgpu_atombios_has_gpu_virtualization_table(struct amdgpu_device *adev);
void amdgpu_atombios_scratch_regs_lock(struct amdgpu_device *adev, bool lock);
void amdgpu_atombios_scratch_regs_engine_hung(struct amdgpu_device *adev,
					      bool hung);
void amdgpu_atombios_scratch_regs_set_backlight_level(struct amdgpu_device *adev,
						      u32 backlight_level);
bool amdgpu_atombios_scratch_need_asic_init(struct amdgpu_device *adev);

void amdgpu_atombios_copy_swap(u8 *dst, u8 *src, u8 num_bytes, bool to_le);
+3 −4
Original line number Diff line number Diff line
@@ -4316,7 +4316,6 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,

	amdgpu_irq_gpu_reset_resume_helper(adev);
	r = amdgpu_ib_ring_tests(adev);
	amdgpu_amdkfd_post_reset(adev);

error:
	if (!r && adev->virt.gim_feature & AMDGIM_FEATURE_GIM_FLR_VRAMLOST) {
@@ -5089,7 +5088,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,

	tmp_vram_lost_counter = atomic_read(&((adev)->vram_lost_counter));
	/* Actual ASIC resets if needed.*/
	/* TODO Implement XGMI hive reset logic for SRIOV */
	/* Host driver will handle XGMI hive reset for SRIOV */
	if (amdgpu_sriov_vf(adev)) {
		r = amdgpu_device_reset_sriov(adev, job ? false : true);
		if (r)
@@ -5149,8 +5148,8 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,

skip_sched_resume:
	list_for_each_entry(tmp_adev, device_list_handle, reset_list) {
		/* unlock kfd: SRIOV would do it separately */
		if (!need_emergency_restart && !amdgpu_sriov_vf(tmp_adev))
		/* unlock kfd */
		if (!need_emergency_restart)
	                amdgpu_amdkfd_post_reset(tmp_adev);

		/* kfd_post_reset will do nothing if kfd device is not initialized,
+6 −6
Original line number Diff line number Diff line
@@ -248,8 +248,8 @@ static int amdgpu_discovery_init(struct amdgpu_device *adev)

	offset = offsetof(struct binary_header, binary_checksum) +
		sizeof(bhdr->binary_checksum);
	size = bhdr->binary_size - offset;
	checksum = bhdr->binary_checksum;
	size = le16_to_cpu(bhdr->binary_size) - offset;
	checksum = le16_to_cpu(bhdr->binary_checksum);

	if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
					      size, checksum)) {
@@ -270,7 +270,7 @@ static int amdgpu_discovery_init(struct amdgpu_device *adev)
	}

	if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
					      ihdr->size, checksum)) {
					      le16_to_cpu(ihdr->size), checksum)) {
		DRM_ERROR("invalid ip discovery data table checksum\n");
		r = -EINVAL;
		goto out;
@@ -282,7 +282,7 @@ static int amdgpu_discovery_init(struct amdgpu_device *adev)
	ghdr = (struct gpu_info_header *)(adev->mman.discovery_bin + offset);

	if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
				              ghdr->size, checksum)) {
				              le32_to_cpu(ghdr->size), checksum)) {
		DRM_ERROR("invalid gc data table checksum\n");
		r = -EINVAL;
		goto out;
@@ -489,10 +489,10 @@ void amdgpu_discovery_harvest_ip(struct amdgpu_device *adev)
			le16_to_cpu(bhdr->table_list[HARVEST_INFO].offset));

	for (i = 0; i < 32; i++) {
		if (le32_to_cpu(harvest_info->list[i].hw_id) == 0)
		if (le16_to_cpu(harvest_info->list[i].hw_id) == 0)
			break;

		switch (le32_to_cpu(harvest_info->list[i].hw_id)) {
		switch (le16_to_cpu(harvest_info->list[i].hw_id)) {
		case VCN_HWID:
			vcn_harvest_count++;
			if (harvest_info->list[i].number_instance == 0)
Loading