Commit a0c5fd46 authored by Felix Kuehling's avatar Felix Kuehling Committed by Alex Deucher

drm/amdkfd: Use real device for messages

kfd_chardev() doesn't provide much useful information in dev_... messages
on multi-GPU systems because there is only one KFD device, which doesn't
correspond to any particular GPU. Use the actual GPU device to indicate
the GPU that caused a message.
Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8f7519b2
...@@ -104,11 +104,6 @@ void kfd_chardev_exit(void) ...@@ -104,11 +104,6 @@ void kfd_chardev_exit(void)
kfd_device = NULL; kfd_device = NULL;
} }
struct device *kfd_chardev(void)
{
return kfd_device;
}
static int kfd_open(struct inode *inode, struct file *filep) static int kfd_open(struct inode *inode, struct file *filep)
{ {
......
...@@ -58,14 +58,14 @@ int kfd_interrupt_init(struct kfd_dev *kfd) ...@@ -58,14 +58,14 @@ int kfd_interrupt_init(struct kfd_dev *kfd)
KFD_IH_NUM_ENTRIES * kfd->device_info.ih_ring_entry_size, KFD_IH_NUM_ENTRIES * kfd->device_info.ih_ring_entry_size,
GFP_KERNEL); GFP_KERNEL);
if (r) { if (r) {
dev_err(kfd_chardev(), "Failed to allocate IH fifo\n"); dev_err(kfd->adev->dev, "Failed to allocate IH fifo\n");
return r; return r;
} }
kfd->ih_wq = alloc_workqueue("KFD IH", WQ_HIGHPRI, 1); kfd->ih_wq = alloc_workqueue("KFD IH", WQ_HIGHPRI, 1);
if (unlikely(!kfd->ih_wq)) { if (unlikely(!kfd->ih_wq)) {
kfifo_free(&kfd->ih_fifo); kfifo_free(&kfd->ih_fifo);
dev_err(kfd_chardev(), "Failed to allocate KFD IH workqueue\n"); dev_err(kfd->adev->dev, "Failed to allocate KFD IH workqueue\n");
return -ENOMEM; return -ENOMEM;
} }
spin_lock_init(&kfd->interrupt_lock); spin_lock_init(&kfd->interrupt_lock);
...@@ -117,7 +117,7 @@ bool enqueue_ih_ring_entry(struct kfd_dev *kfd, const void *ih_ring_entry) ...@@ -117,7 +117,7 @@ bool enqueue_ih_ring_entry(struct kfd_dev *kfd, const void *ih_ring_entry)
count = kfifo_in(&kfd->ih_fifo, ih_ring_entry, count = kfifo_in(&kfd->ih_fifo, ih_ring_entry,
kfd->device_info.ih_ring_entry_size); kfd->device_info.ih_ring_entry_size);
if (count != kfd->device_info.ih_ring_entry_size) { if (count != kfd->device_info.ih_ring_entry_size) {
dev_dbg_ratelimited(kfd_chardev(), dev_dbg_ratelimited(kfd->adev->dev,
"Interrupt ring overflow, dropping interrupt %d\n", "Interrupt ring overflow, dropping interrupt %d\n",
count); count);
return false; return false;
...@@ -148,7 +148,7 @@ static void interrupt_wq(struct work_struct *work) ...@@ -148,7 +148,7 @@ static void interrupt_wq(struct work_struct *work)
uint32_t ih_ring_entry[KFD_MAX_RING_ENTRY_SIZE]; uint32_t ih_ring_entry[KFD_MAX_RING_ENTRY_SIZE];
if (dev->device_info.ih_ring_entry_size > sizeof(ih_ring_entry)) { if (dev->device_info.ih_ring_entry_size > sizeof(ih_ring_entry)) {
dev_err_once(kfd_chardev(), "Ring entry too small\n"); dev_err_once(dev->adev->dev, "Ring entry too small\n");
return; return;
} }
......
...@@ -355,7 +355,6 @@ enum kfd_mempool { ...@@ -355,7 +355,6 @@ enum kfd_mempool {
/* Character device interface */ /* Character device interface */
int kfd_chardev_init(void); int kfd_chardev_init(void);
void kfd_chardev_exit(void); void kfd_chardev_exit(void);
struct device *kfd_chardev(void);
/** /**
* enum kfd_unmap_queues_filter - Enum for queue filters. * enum kfd_unmap_queues_filter - Enum for queue filters.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment