Commit 2243f493 authored by Rajneesh Bhardwaj's avatar Rajneesh Bhardwaj Committed by Alex Deucher
Browse files

drm/amdkfd: Fix leftover errors and warnings



A bunch of errors and warnings are leftover KFD over the years, attempt
to fix the errors and most warnings reported by checkpatch tool. Still a
few warnings remain which may be false positives so ignore them for now.

Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarRajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d87f36a0
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@
#include <linux/ptrace.h>
#include <linux/dma-buf.h>
#include <linux/fdtable.h>
#include <asm/processor.h>
#include <linux/processor.h>
#include "kfd_priv.h"
#include "kfd_device_queue_manager.h"
#include "kfd_svm.h"
@@ -1133,7 +1133,8 @@ static int kfd_ioctl_free_memory_of_gpu(struct file *filep,
	return ret;
}

static bool kfd_flush_tlb_after_unmap(struct kfd_dev *dev) {
static bool kfd_flush_tlb_after_unmap(struct kfd_dev *dev)
{
	return KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 2) ||
		(KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 1) &&
		dev->adev->sdma.instance[0].fw_version >= 18) ||
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ static int kfd_debugfs_open(struct inode *inode, struct file *file)
}
static int kfd_debugfs_hang_hws_read(struct seq_file *m, void *data)
{
	seq_printf(m, "echo gpu_id > hang_hws\n");
	seq_puts(m, "echo gpu_id > hang_hws\n");
	return 0;
}

+3 −2
Original line number Diff line number Diff line
@@ -439,7 +439,8 @@ static int kfd_gws_init(struct kfd_dev *kfd)
	return ret;
}

static void kfd_smi_init(struct kfd_dev *dev) {
static void kfd_smi_init(struct kfd_dev *dev)
{
	INIT_LIST_HEAD(&dev->smi_clients);
	spin_lock_init(&dev->smi_lock);
}
+8 −9
Original line number Diff line number Diff line
@@ -2235,8 +2235,7 @@ int dqm_debugfs_hqds(struct seq_file *m, void *data)
	int r = 0;

	if (!dqm->sched_running) {
		seq_printf(m, " Device is stopped\n");

		seq_puts(m, " Device is stopped\n");
		return 0;
	}

+3 −5
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ union GRBM_GFX_INDEX_BITS {
 *
 * @initialize: Initializes the pipelines and memory module for that device.
 *
 * @start: Initializes the resources/modules the the device needs for queues
 * @start: Initializes the resources/modules the device needs for queues
 * execution. This function is called on device initialization and after the
 * system woke up after suspension.
 *
@@ -113,7 +113,7 @@ union GRBM_GFX_INDEX_BITS {
 *
 * @evict_process_queues: Evict all active queues of a process
 *
 * @restore_process_queues: Restore all evicted queues queues of a process
 * @restore_process_queues: Restore all evicted queues of a process
 *
 * @get_wave_state: Retrieves context save state and optionally copies the
 * control stack, if kept in the MQD, to the given userspace address.
@@ -303,9 +303,7 @@ static inline void dqm_unlock(struct device_queue_manager *dqm)

static inline int read_sdma_queue_counter(uint64_t __user *q_rptr, uint64_t *val)
{
        /*
         * SDMA activity counter is stored at queue's RPTR + 0x8 location.
         */
	/* SDMA activity counter is stored at queue's RPTR + 0x8 location. */
	return get_user(*val, q_rptr + 1);
}
#endif /* KFD_DEVICE_QUEUE_MANAGER_H_ */
Loading