Commit 43d3d587 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'drm-fixes-2021-01-08' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Daniel Vetter:
 "Looks like people are back from the break, usual small pile of fixes
  all over. Next week Dave should be back.

  The only thing pending I'm aware of is a "this shouldn't have become
  uapi" reverts for amdgpu, but they're already on the list and not that
  important really so can wait another week.

  Summary:

   - fix for ttm list corruption in radeon, reported by a few people

   - fixes for amdgpu, i915, msm

   - dma-buf use-after free fix"

* tag 'drm-fixes-2021-01-08' of git://anongit.freedesktop.org/drm/drm: (29 commits)
  drm/msm: Only enable A6xx LLCC code on A6xx
  drm/msm: Add modparam to allow vram carveout
  drm/msm: Call msm_init_vram before binding the gpu
  drm/msm/dp: postpone irq_hpd event during connection pending state
  drm/ttm: unexport ttm_pool_init/fini
  drm/radeon: stop re-init the TTM page pool
  dmabuf: fix use-after-free of dmabuf's file->f_inode
  Revert "drm/amd/display: Fix memory leaks in S3 resume"
  drm/amdgpu/display: drop DCN support for aarch64
  drm/amdgpu: enable ras eeprom support for sienna cichlid
  drm/amdgpu: fix no bad_pages issue after umc ue injection
  drm/amdgpu: fix potential memory leak during navi12 deinitialization
  drm/amd/display: Fix unused variable warning
  drm/amd/pm: improve the fine grain tuning function for RV/RV2/PCO
  drm/amd/pm: fix the failure when change power profile for renoir
  drm/amdgpu: fix a GPU hang issue when remove device
  drm/amdgpu: fix a memory protection fault when remove amdgpu device
  drm/amdgpu: switched to cached noretry setting for vangogh
  drm/amd/display: fix sysfs amdgpu_current_backlight_pwm NULL pointer issue
  drm/amd/pm: updated PM to I2C controller port on sienna cichlid
  ...
parents 2a190b22 29f95f20
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -76,10 +76,6 @@ static void dma_buf_release(struct dentry *dentry)

	dmabuf->ops->release(dmabuf);

	mutex_lock(&db_list.lock);
	list_del(&dmabuf->list_node);
	mutex_unlock(&db_list.lock);

	if (dmabuf->resv == (struct dma_resv *)&dmabuf[1])
		dma_resv_fini(dmabuf->resv);

@@ -88,6 +84,22 @@ static void dma_buf_release(struct dentry *dentry)
	kfree(dmabuf);
}

static int dma_buf_file_release(struct inode *inode, struct file *file)
{
	struct dma_buf *dmabuf;

	if (!is_dma_buf_file(file))
		return -EINVAL;

	dmabuf = file->private_data;

	mutex_lock(&db_list.lock);
	list_del(&dmabuf->list_node);
	mutex_unlock(&db_list.lock);

	return 0;
}

static const struct dentry_operations dma_buf_dentry_ops = {
	.d_dname = dmabuffs_dname,
	.d_release = dma_buf_release,
@@ -413,6 +425,7 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file)
}

static const struct file_operations dma_buf_fops = {
	.release	= dma_buf_file_release,
	.mmap		= dma_buf_mmap_internal,
	.llseek		= dma_buf_llseek,
	.poll		= dma_buf_poll,
+2 −2
Original line number Diff line number Diff line
@@ -2548,11 +2548,11 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
	if (adev->gmc.xgmi.num_physical_nodes > 1)
		amdgpu_xgmi_remove_device(adev);

	amdgpu_amdkfd_device_fini(adev);

	amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
	amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);

	amdgpu_amdkfd_device_fini(adev);

	/* need to disable SMC first */
	for (i = 0; i < adev->num_ip_blocks; i++) {
		if (!adev->ip_blocks[i].status.hw)
+17 −8
Original line number Diff line number Diff line
@@ -563,7 +563,7 @@ static int psp_asd_load(struct psp_context *psp)
	 * add workaround to bypass it for sriov now.
	 * TODO: add version check to make it common
	 */
	if (amdgpu_sriov_vf(psp->adev) || !psp->asd_fw)
	if (amdgpu_sriov_vf(psp->adev) || !psp->asd_ucode_size)
		return 0;

	cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
@@ -1315,8 +1315,12 @@ static int psp_hdcp_terminate(struct psp_context *psp)
	if (amdgpu_sriov_vf(psp->adev))
		return 0;

	if (!psp->hdcp_context.hdcp_initialized)
	if (!psp->hdcp_context.hdcp_initialized) {
		if (psp->hdcp_context.hdcp_shared_buf)
			goto out;
		else
			return 0;
	}

	ret = psp_hdcp_unload(psp);
	if (ret)
@@ -1324,6 +1328,7 @@ static int psp_hdcp_terminate(struct psp_context *psp)

	psp->hdcp_context.hdcp_initialized = false;

out:
	/* free hdcp shared memory */
	amdgpu_bo_free_kernel(&psp->hdcp_context.hdcp_shared_bo,
			      &psp->hdcp_context.hdcp_shared_mc_addr,
@@ -1462,8 +1467,12 @@ static int psp_dtm_terminate(struct psp_context *psp)
	if (amdgpu_sriov_vf(psp->adev))
		return 0;

	if (!psp->dtm_context.dtm_initialized)
	if (!psp->dtm_context.dtm_initialized) {
		if (psp->dtm_context.dtm_shared_buf)
			goto out;
		else
			return 0;
	}

	ret = psp_dtm_unload(psp);
	if (ret)
@@ -1471,6 +1480,7 @@ static int psp_dtm_terminate(struct psp_context *psp)

	psp->dtm_context.dtm_initialized = false;

out:
	/* free hdcp shared memory */
	amdgpu_bo_free_kernel(&psp->dtm_context.dtm_shared_bo,
			      &psp->dtm_context.dtm_shared_mc_addr,
@@ -2593,7 +2603,6 @@ static int parse_ta_bin_descriptor(struct psp_context *psp,
		psp->asd_feature_version   = le32_to_cpu(desc->fw_version);
		psp->asd_ucode_size        = le32_to_cpu(desc->size_bytes);
		psp->asd_start_addr 	   = ucode_start_addr;
		psp->asd_fw                = psp->ta_fw;
		break;
	case TA_FW_TYPE_PSP_XGMI:
		psp->ta_xgmi_ucode_version = le32_to_cpu(desc->fw_version);
+4 −4
Original line number Diff line number Diff line
@@ -1518,7 +1518,7 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev,
	struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
	struct ras_err_handler_data *data;
	int i = 0;
	int ret = 0;
	int ret = 0, status;

	if (!con || !con->eh_data || !bps || !count)
		return -EINVAL;
@@ -1543,12 +1543,12 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev,
			.size = AMDGPU_GPU_PAGE_SIZE,
			.flags = AMDGPU_RAS_RETIRE_PAGE_RESERVED,
		};
		ret = amdgpu_vram_mgr_query_page_status(
		status = amdgpu_vram_mgr_query_page_status(
				ttm_manager_type(&adev->mman.bdev, TTM_PL_VRAM),
				data->bps[i].retired_page);
		if (ret == -EBUSY)
		if (status == -EBUSY)
			(*bps)[i].flags = AMDGPU_RAS_RETIRE_PAGE_PENDING;
		else if (ret == -ENOENT)
		else if (status == -ENOENT)
			(*bps)[i].flags = AMDGPU_RAS_RETIRE_PAGE_FAULT;
	}

+7 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#define EEPROM_I2C_TARGET_ADDR_VEGA20		0xA0
#define EEPROM_I2C_TARGET_ADDR_ARCTURUS		0xA8
#define EEPROM_I2C_TARGET_ADDR_ARCTURUS_D342	0xA0
#define EEPROM_I2C_TARGET_ADDR_SIENNA_CICHLID   0xA0

/*
 * The 2 macros bellow represent the actual size in bytes that
@@ -62,7 +63,8 @@
static bool __is_ras_eeprom_supported(struct amdgpu_device *adev)
{
	if ((adev->asic_type == CHIP_VEGA20) ||
	    (adev->asic_type == CHIP_ARCTURUS))
	    (adev->asic_type == CHIP_ARCTURUS) ||
	    (adev->asic_type == CHIP_SIENNA_CICHLID))
		return true;

	return false;
@@ -100,6 +102,10 @@ static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev,
	case CHIP_ARCTURUS:
		return __get_eeprom_i2c_addr_arct(adev, i2c_addr);

	case CHIP_SIENNA_CICHLID:
		*i2c_addr = EEPROM_I2C_TARGET_ADDR_SIENNA_CICHLID;
		break;

	default:
		return false;
	}
Loading