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.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/litmus/nvidia_info.c b/litmus/nvidia_info.c
index 3d8c50882066..4b86a50d3bd1 100644
--- a/litmus/nvidia_info.c
+++ b/litmus/nvidia_info.c
@@ -265,6 +265,11 @@ int init_nvidia_info(void)
265 } 265 }
266} 266}
267 267
268void shutdown_nvidia_info(void)
269{
270 nvidia_mod = NULL;
271 mb();
272}
268 273
269/* works with pointers to static data inside the module too. */ 274/* works with pointers to static data inside the module too. */
270int is_nvidia_func(void* func_addr) 275int is_nvidia_func(void* func_addr)
@@ -319,14 +324,11 @@ u32 get_work_nv_device_num(const struct work_struct *t)
319} 324}
320 325
321 326
322
323#define MAX_NR_OWNERS 3
324
325typedef struct { 327typedef struct {
326 raw_spinlock_t lock; 328 raw_spinlock_t lock;
327 int nr_owners; 329 int nr_owners;
328 struct task_struct* max_prio_owner; 330 struct task_struct* max_prio_owner;
329 struct task_struct* owners[MAX_NR_OWNERS]; 331 struct task_struct* owners[NV_MAX_SIMULT_USERS];
330}nv_device_registry_t; 332}nv_device_registry_t;
331 333
332static nv_device_registry_t NV_DEVICE_REG[NV_DEVICE_NUM]; 334static nv_device_registry_t NV_DEVICE_REG[NV_DEVICE_NUM];
@@ -431,6 +433,7 @@ static int __reg_nv_device(int reg_device_id, struct task_struct *t)
431 return ret; // assume already registered. 433 return ret; // assume already registered.
432 } 434 }
433 435
436
434 raw_spin_lock_irqsave(&reg->lock, flags); 437 raw_spin_lock_irqsave(&reg->lock, flags);
435 438
436 if(reg->nr_owners < NV_MAX_SIMULT_USERS) { 439 if(reg->nr_owners < NV_MAX_SIMULT_USERS) {
@@ -461,7 +464,7 @@ static int __reg_nv_device(int reg_device_id, struct task_struct *t)
461 else 464 else
462 { 465 {
463 TRACE_CUR("%s: device %d is already in use!\n", __FUNCTION__, reg_device_id); 466 TRACE_CUR("%s: device %d is already in use!\n", __FUNCTION__, reg_device_id);
464 ret = -EBUSY; 467 //ret = -EBUSY;
465 } 468 }
466 469
467 raw_spin_unlock_irqrestore(&reg->lock, flags); 470 raw_spin_unlock_irqrestore(&reg->lock, flags);