Commit 9c2f0338 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'drm-fixes-2024-02-03' of git://anongit.freedesktop.org/drm/drm

Pul drm fixes from Dave Airlie:
 "Regular weekly fixes, mostly amdgpu and xe. One nouveau fix is a
  better fix for the deadlock and also helps with a sync race we were
  seeing.

  dma-buf:
   - heaps CMA page accounting fix

  virtio-gpu:
   - fix segment size

  xe:
   - A crash fix
   - A fix for an assert due to missing mem_acces ref
   - Only allow a single user-fence per exec / bind.
   - Some sparse warning fixes
   - Two fixes for compilation failures on various odd combinations of
     gcc / arch pointed out on LKML.
   - Fix a fragile partial allocation pointed out on LKML.
   - A sysfs ABI documentation warning fix

  amdgpu:
   - Fix reboot issue seen on some 7000 series dGPUs
   - Fix client init order for KFD
   - Misc display fixes
   - USB-C fix
   - DCN 3.5 fixes
   - Fix issues with GPU scheduler and GPU reset
   - GPU firmware loading fix
   - Misc fixes
   - GC 11.5 fix
   - VCN 4.0.5 fix
   - IH overflow fix

  amdkfd:
   - SVM fixes
   - Trap handler fix
   - Fix device permission lookup
   - Properly reserve BO before validating it

  nouveau:
   - fence/irq lock deadlock fix (second attempt)
   - gsp command size fix

* tag 'drm-fixes-2024-02-03' of git://anongit.freedesktop.org/drm/drm: (35 commits)
  nouveau: offload fence uevents work to workqueue
  nouveau/gsp: use correct size for registry rpc.
  drm/amdgpu/pm: Use inline function for IP version check
  drm/hwmon: Fix abi doc warnings
  drm/xe: Make all GuC ABI shift values unsigned
  drm/xe/vm: Subclass userptr vmas
  drm/xe: Use LRC prefix rather than CTX prefix in lrc desc defines
  drm/xe: Don't use __user error pointers
  drm/xe: Annotate mcr_[un]lock()
  drm/xe: Only allow 1 ufence per exec / bind IOCTL
  drm/xe: Grab mem_access when disabling C6 on skip_guc_pc platforms
  drm/xe: Fix crash in trace_dma_fence_init()
  drm/amdgpu: Reset IH OVERFLOW_CLEAR bit
  drm/amdgpu: remove asymmetrical irq disabling in vcn 4.0.5 suspend
  drm/amdgpu: drm/amdgpu: remove golden setting for gfx 11.5.0
  drm/amdkfd: reserve the BO before validating it
  drm/amdgpu: Fix missing error code in 'gmc_v6/7/8/9_0_hw_init()'
  drm/amd/display: Fix buffer overflow in 'get_host_router_total_dp_tunnel_bw()'
  drm/amd/display: Add NULL check for kzalloc in 'amdgpu_dm_atomic_commit_tail()'
  drm/amd: Don't init MEC2 firmware when it fails to load
  ...
parents eab5c86d 39126abc
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
What:		/sys/devices/.../hwmon/hwmon<i>/in0_input
What:		/sys/bus/pci/drivers/i915/.../hwmon/hwmon<i>/in0_input
Date:		February 2023
KernelVersion:	6.2
Contact:	intel-gfx@lists.freedesktop.org
@@ -6,7 +6,7 @@ Description: RO. Current Voltage in millivolt.

		Only supported for particular Intel i915 graphics platforms.

What:		/sys/devices/.../hwmon/hwmon<i>/power1_max
What:		/sys/bus/pci/drivers/i915/.../hwmon/hwmon<i>/power1_max
Date:		February 2023
KernelVersion:	6.2
Contact:	intel-gfx@lists.freedesktop.org
@@ -20,7 +20,7 @@ Description: RW. Card reactive sustained (PL1/Tau) power limit in microwatts.

		Only supported for particular Intel i915 graphics platforms.

What:		/sys/devices/.../hwmon/hwmon<i>/power1_rated_max
What:		/sys/bus/pci/drivers/i915/.../hwmon/hwmon<i>/power1_rated_max
Date:		February 2023
KernelVersion:	6.2
Contact:	intel-gfx@lists.freedesktop.org
@@ -28,7 +28,7 @@ Description: RO. Card default power limit (default TDP setting).

		Only supported for particular Intel i915 graphics platforms.

What:		/sys/devices/.../hwmon/hwmon<i>/power1_max_interval
What:		/sys/bus/pci/drivers/i915/.../hwmon/hwmon<i>/power1_max_interval
Date:		February 2023
KernelVersion:	6.2
Contact:	intel-gfx@lists.freedesktop.org
@@ -37,7 +37,7 @@ Description: RW. Sustained power limit interval (Tau in PL1/Tau) in

		Only supported for particular Intel i915 graphics platforms.

What:		/sys/devices/.../hwmon/hwmon<i>/power1_crit
What:		/sys/bus/pci/drivers/i915/.../hwmon/hwmon<i>/power1_crit
Date:		February 2023
KernelVersion:	6.2
Contact:	intel-gfx@lists.freedesktop.org
@@ -50,7 +50,7 @@ Description: RW. Card reactive critical (I1) power limit in microwatts.

		Only supported for particular Intel i915 graphics platforms.

What:		/sys/devices/.../hwmon/hwmon<i>/curr1_crit
What:		/sys/bus/pci/drivers/i915/.../hwmon/hwmon<i>/curr1_crit
Date:		February 2023
KernelVersion:	6.2
Contact:	intel-gfx@lists.freedesktop.org
@@ -63,7 +63,7 @@ Description: RW. Card reactive critical (I1) power limit in milliamperes.

		Only supported for particular Intel i915 graphics platforms.

What:		/sys/devices/.../hwmon/hwmon<i>/energy1_input
What:		/sys/bus/pci/drivers/i915/.../hwmon/hwmon<i>/energy1_input
Date:		February 2023
KernelVersion:	6.2
Contact:	intel-gfx@lists.freedesktop.org
+7 −7
Original line number Diff line number Diff line
What:		/sys/devices/.../hwmon/hwmon<i>/power1_max
What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/power1_max
Date:		September 2023
KernelVersion:	6.5
Contact:	intel-xe@lists.freedesktop.org
@@ -12,7 +12,7 @@ Description: RW. Card reactive sustained (PL1) power limit in microwatts.

		Only supported for particular Intel xe graphics platforms.

What:		/sys/devices/.../hwmon/hwmon<i>/power1_rated_max
What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/power1_rated_max
Date:		September 2023
KernelVersion:	6.5
Contact:	intel-xe@lists.freedesktop.org
@@ -20,7 +20,7 @@ Description: RO. Card default power limit (default TDP setting).

		Only supported for particular Intel xe graphics platforms.

What:		/sys/devices/.../hwmon/hwmon<i>/power1_crit
What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/power1_crit
Date:		September 2023
KernelVersion:	6.5
Contact:	intel-xe@lists.freedesktop.org
@@ -33,7 +33,7 @@ Description: RW. Card reactive critical (I1) power limit in microwatts.

		Only supported for particular Intel xe graphics platforms.

What:		/sys/devices/.../hwmon/hwmon<i>/curr1_crit
What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/curr1_crit
Date:		September 2023
KernelVersion:	6.5
Contact:	intel-xe@lists.freedesktop.org
@@ -44,7 +44,7 @@ Description: RW. Card reactive critical (I1) power limit in milliamperes.
		the operating frequency if the power averaged over a window
		exceeds this limit.

What:		/sys/devices/.../hwmon/hwmon<i>/in0_input
What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/in0_input
Date:		September 2023
KernelVersion:	6.5
Contact:	intel-xe@lists.freedesktop.org
@@ -52,7 +52,7 @@ Description: RO. Current Voltage in millivolt.

		Only supported for particular Intel xe graphics platforms.

What:		/sys/devices/.../hwmon/hwmon<i>/energy1_input
What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/energy1_input
Date:		September 2023
KernelVersion:	6.5
Contact:	intel-xe@lists.freedesktop.org
@@ -60,7 +60,7 @@ Description: RO. Energy input of device in microjoules.

		Only supported for particular Intel xe graphics platforms.

What:		/sys/devices/.../hwmon/hwmon<i>/power1_max_interval
What:		/sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/power1_max_interval
Date:		October 2023
KernelVersion:	6.6
Contact:	intel-xe@lists.freedesktop.org
+3 −4
Original line number Diff line number Diff line
@@ -168,10 +168,7 @@ static vm_fault_t cma_heap_vm_fault(struct vm_fault *vmf)
	if (vmf->pgoff > buffer->pagecount)
		return VM_FAULT_SIGBUS;

	vmf->page = buffer->pages[vmf->pgoff];
	get_page(vmf->page);

	return 0;
	return vmf_insert_pfn(vma, vmf->address, page_to_pfn(buffer->pages[vmf->pgoff]));
}

static const struct vm_operations_struct dma_heap_vm_ops = {
@@ -185,6 +182,8 @@ static int cma_heap_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
	if ((vma->vm_flags & (VM_SHARED | VM_MAYSHARE)) == 0)
		return -EINVAL;

	vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);

	vma->vm_ops = &dma_heap_vm_ops;
	vma->vm_private_data = buffer;

+21 −11
Original line number Diff line number Diff line
@@ -141,11 +141,31 @@ static void amdgpu_amdkfd_reset_work(struct work_struct *work)
static const struct drm_client_funcs kfd_client_funcs = {
	.unregister	= drm_client_release,
};

int amdgpu_amdkfd_drm_client_create(struct amdgpu_device *adev)
{
	int ret;

	if (!adev->kfd.init_complete)
		return 0;

	ret = drm_client_init(&adev->ddev, &adev->kfd.client, "kfd",
			      &kfd_client_funcs);
	if (ret) {
		dev_err(adev->dev, "Failed to init DRM client: %d\n",
			ret);
		return ret;
	}

	drm_client_register(&adev->kfd.client);

	return 0;
}

void amdgpu_amdkfd_device_init(struct amdgpu_device *adev)
{
	int i;
	int last_valid_bit;
	int ret;

	amdgpu_amdkfd_gpuvm_init_mem_limits();

@@ -164,12 +184,6 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev)
			.enable_mes = adev->enable_mes,
		};

		ret = drm_client_init(&adev->ddev, &adev->kfd.client, "kfd", &kfd_client_funcs);
		if (ret) {
			dev_err(adev->dev, "Failed to init DRM client: %d\n", ret);
			return;
		}

		/* this is going to have a few of the MSBs set that we need to
		 * clear
		 */
@@ -208,10 +222,6 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev)

		adev->kfd.init_complete = kgd2kfd_device_init(adev->kfd.dev,
							&gpu_resources);
		if (adev->kfd.init_complete)
			drm_client_register(&adev->kfd.client);
		else
			drm_client_release(&adev->kfd.client);

		amdgpu_amdkfd_total_mem_size += adev->gmc.real_vram_size;

+3 −1
Original line number Diff line number Diff line
@@ -182,6 +182,8 @@ int amdgpu_queue_mask_bit_to_set_resource_bit(struct amdgpu_device *adev,
struct amdgpu_amdkfd_fence *amdgpu_amdkfd_fence_create(u64 context,
				struct mm_struct *mm,
				struct svm_range_bo *svm_bo);

int amdgpu_amdkfd_drm_client_create(struct amdgpu_device *adev);
#if defined(CONFIG_DEBUG_FS)
int kfd_debugfs_kfd_mem_limits(struct seq_file *m, void *data);
#endif
@@ -301,7 +303,7 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gpu(struct amdgpu_device *adev,
					  struct kgd_mem *mem, void *drm_priv);
int amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu(
		struct amdgpu_device *adev, struct kgd_mem *mem, void *drm_priv);
void amdgpu_amdkfd_gpuvm_dmaunmap_mem(struct kgd_mem *mem, void *drm_priv);
int amdgpu_amdkfd_gpuvm_dmaunmap_mem(struct kgd_mem *mem, void *drm_priv);
int amdgpu_amdkfd_gpuvm_sync_memory(
		struct amdgpu_device *adev, struct kgd_mem *mem, bool intr);
int amdgpu_amdkfd_gpuvm_map_gtt_bo_to_kernel(struct kgd_mem *mem,
Loading