aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/nvidia_info.c
diff options
context:
space:
mode:
Diffstat (limited to 'litmus/nvidia_info.c')
-rw-r--r--litmus/nvidia_info.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/litmus/nvidia_info.c b/litmus/nvidia_info.c
index 0b39dcc84115..7883296a7a18 100644
--- a/litmus/nvidia_info.c
+++ b/litmus/nvidia_info.c
@@ -444,13 +444,13 @@ static int init_nv_device_reg(void)
444 mb(); 444 mb();
445 445
446 446
447 for(i = 0; i < NV_DEVICE_NUM; ++i) { 447 for(i = 0; i < num_online_gpus(); ++i) {
448 raw_spin_lock_init(&NV_DEVICE_REG[i].lock); 448 raw_spin_lock_init(&NV_DEVICE_REG[i].lock);
449 INIT_BINHEAP_HANDLE(&NV_DEVICE_REG[i].owners, gpu_owner_max_priority_order); 449 INIT_BINHEAP_HANDLE(&NV_DEVICE_REG[i].owners, gpu_owner_max_priority_order);
450 450
451#ifdef CONFIG_LITMUS_SOFTIRQD 451#ifdef CONFIG_LITMUS_SOFTIRQD
452 { 452 {
453 int default_cpu = litmus->map_gpu_to_cpu(i, NV_DEVICE_NUM); 453 int default_cpu = litmus->map_gpu_to_cpu(i);
454 454
455 NV_DEVICE_REG[i].callback.func = nvidia_klmirqd_cb; 455 NV_DEVICE_REG[i].callback.func = nvidia_klmirqd_cb;
456 NV_DEVICE_REG[i].callback.arg = (void*)(long long)(i); 456 NV_DEVICE_REG[i].callback.arg = (void*)(long long)(i);
@@ -478,7 +478,7 @@ static int shutdown_nv_device_reg(void)
478 int i; 478 int i;
479 nv_device_registry_t *reg; 479 nv_device_registry_t *reg;
480 480
481 for (i = 0; i < NV_DEVICE_NUM; ++i) { 481 for (i = 0; i < num_online_gpus(); ++i) {
482 482
483 TRACE("Shutting down GPU %d.\n", i); 483 TRACE("Shutting down GPU %d.\n", i);
484 484
@@ -829,7 +829,7 @@ int reg_nv_device(int reg_device_id, int reg_action, struct task_struct *t)
829{ 829{
830 int ret; 830 int ret;
831 831
832 if((reg_device_id < NV_DEVICE_NUM) && (reg_device_id >= 0)) 832 if((reg_device_id < num_online_gpus()) && (reg_device_id >= 0))
833 { 833 {
834 if(reg_action) 834 if(reg_action)
835 ret = __reg_nv_device(reg_device_id, t); 835 ret = __reg_nv_device(reg_device_id, t);