[PATCH 19/83] hsa/radeon: Enable/Disable KFD interrupt module
From: Oded Gabbay
Date: Thu Jul 10 2014 - 18:10:47 EST
This patch add calls to initialize and finalize the KFD interrupt
module.
The calls are done per device initialize/finalize inside the kgd-->kfd
interface.
Signed-off-by: Oded Gabbay <oded.gabbay@xxxxxxx>
---
drivers/gpu/hsa/radeon/cik_regs.h | 1 +
drivers/gpu/hsa/radeon/kfd_device.c | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/hsa/radeon/cik_regs.h b/drivers/gpu/hsa/radeon/cik_regs.h
index 9c3ce97..813cdc4 100644
--- a/drivers/gpu/hsa/radeon/cik_regs.h
+++ b/drivers/gpu/hsa/radeon/cik_regs.h
@@ -73,6 +73,7 @@
#define CP_PQ_WPTR_POLL_CNTL 0xC20C
#define WPTR_POLL_EN (1 << 31)
+#define CPC_INT_CNTL 0xC2D0
#define CP_ME1_PIPE0_INT_CNTL 0xC214
#define CP_ME1_PIPE1_INT_CNTL 0xC218
#define CP_ME1_PIPE2_INT_CNTL 0xC21C
diff --git a/drivers/gpu/hsa/radeon/kfd_device.c b/drivers/gpu/hsa/radeon/kfd_device.c
index b2d2861..b627e57 100644
--- a/drivers/gpu/hsa/radeon/kfd_device.c
+++ b/drivers/gpu/hsa/radeon/kfd_device.c
@@ -127,6 +127,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
radeon_kfd_doorbell_init(kfd);
+ if (radeon_kfd_interrupt_init(kfd))
+ return false;
+
if (!device_iommu_pasid_init(kfd))
return false;
@@ -155,10 +158,13 @@ void kgd2kfd_device_exit(struct kfd_dev *kfd)
BUG_ON(err != 0);
- if (kfd->init_complete) {
+ if (kfd->init_complete)
kfd->device_info->scheduler_class->stop(kfd->scheduler);
- kfd->device_info->scheduler_class->destroy(kfd->scheduler);
+ radeon_kfd_interrupt_exit(kfd);
+
+ if (kfd->init_complete) {
+ kfd->device_info->scheduler_class->destroy(kfd->scheduler);
amd_iommu_free_device(kfd->pdev);
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/