aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-01-15 14:06:16 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2013-01-15 14:06:16 -0500
commit2f60844462d35e9a8f0103baf6aa34d9734b4ed1 (patch)
tree2d7337160c369f3ac2328935f649c4ff4b040e10
parent32849f80c0c4a0c8a1802525bdecc6cd4447d545 (diff)
Fix WARN_ON() and fix CUDA 5.0 (NV RM 310.x).
-rw-r--r--litmus/nvidia_info.c64
1 files changed, 16 insertions, 48 deletions
diff --git a/litmus/nvidia_info.c b/litmus/nvidia_info.c
index 5a63fb732e8b..ae4ad446408b 100644
--- a/litmus/nvidia_info.c
+++ b/litmus/nvidia_info.c
@@ -49,9 +49,6 @@ typedef struct
49 void *priv; /* private data */ 49 void *priv; /* private data */
50 void *os_state; /* os-specific device state */ 50 void *os_state; /* os-specific device state */
51 51
52#ifndef CONFIG_CUDA_5_0
53 int rmInitialized;
54#endif
55 int flags; 52 int flags;
56 53
57 /* PCI config info */ 54 /* PCI config info */
@@ -70,12 +67,17 @@ typedef struct
70 litmus_nv_aperture_t bars[3]; 67 litmus_nv_aperture_t bars[3];
71 litmus_nv_aperture_t *regs; 68 litmus_nv_aperture_t *regs;
72 litmus_nv_aperture_t *fb, ud; 69 litmus_nv_aperture_t *fb, ud;
70
71#ifndef CONFIG_CUDA_5_0
73 litmus_nv_aperture_t agp; 72 litmus_nv_aperture_t agp;
73#endif
74 74
75 NvU32 interrupt_line; 75 NvU32 interrupt_line;
76 76
77#ifndef CONFIG_CUDA_5_0
77 NvU32 agp_config; 78 NvU32 agp_config;
78 NvU32 agp_status; 79 NvU32 agp_status;
80#endif
79 81
80 NvU32 primary_vga; 82 NvU32 primary_vga;
81 83
@@ -101,8 +103,12 @@ typedef struct litmus_nv_linux_state_s {
101 litmus_nv_state_t nv_state; 103 litmus_nv_state_t nv_state;
102 atomic_t usage_count; 104 atomic_t usage_count;
103 105
104 struct pci_dev *dev; 106 struct pci_dev *dev;
107
108#ifndef CONFIG_CUDA_5_0
105 void *agp_bridge; 109 void *agp_bridge;
110#endif
111
106 void *alloc_queue; 112 void *alloc_queue;
107 113
108 void *timer_sp; 114 void *timer_sp;
@@ -127,19 +133,6 @@ typedef struct litmus_nv_linux_state_s {
127 /* lock for linux-specific alloc queue */ 133 /* lock for linux-specific alloc queue */
128 struct semaphore at_lock; 134 struct semaphore at_lock;
129 135
130#if 0
131#if defined(NV_USER_MAP)
132 /* list of user mappings */
133 struct nv_usermap_s *usermap_list;
134
135 /* lock for VMware-specific mapping list */
136 struct semaphore mt_lock;
137#endif /* defined(NV_USER_MAP) */
138#if defined(NV_PM_SUPPORT_OLD_STYLE_APM)
139 void *apm_nv_dev;
140#endif
141#endif
142
143 NvU32 device_num; 136 NvU32 device_num;
144 struct litmus_nv_linux_state_s *next; 137 struct litmus_nv_linux_state_s *next;
145} litmus_nv_linux_state_t; 138} litmus_nv_linux_state_t;
@@ -384,7 +377,7 @@ u32 get_work_nv_device_num(const struct work_struct *t)
384 377
385 378
386typedef struct { 379typedef struct {
387 raw_spinlock_t lock; /* not needed if GPU not shared between scheudling domains */ 380 raw_spinlock_t lock;
388 struct binheap owners; 381 struct binheap owners;
389 382
390#ifdef CONFIG_LITMUS_SOFTIRQD 383#ifdef CONFIG_LITMUS_SOFTIRQD
@@ -514,7 +507,8 @@ static int init_nv_device_reg(void)
514 INIT_BINHEAP_HANDLE(&NV_DEVICE_REG[i].owners, gpu_owner_max_priority_order); 507 INIT_BINHEAP_HANDLE(&NV_DEVICE_REG[i].owners, gpu_owner_max_priority_order);
515 508
516#ifdef CONFIG_LITMUS_NV_KLMIRQD_DEBUG 509#ifdef CONFIG_LITMUS_NV_KLMIRQD_DEBUG
517 tasklet_init(&NV_DEVICE_REG[i].nv_klmirqd_dbg_tasklet, nv_klmirqd_dbg_tasklet_func, (unsigned long)&NV_DEVICE_REG[i]); 510 tasklet_init(&NV_DEVICE_REG[i].nv_klmirqd_dbg_tasklet,
511 nv_klmirqd_dbg_tasklet_func, (unsigned long)&NV_DEVICE_REG[i]);
518#endif 512#endif
519 513
520#ifdef CONFIG_LITMUS_SOFTIRQD 514#ifdef CONFIG_LITMUS_SOFTIRQD
@@ -798,8 +792,8 @@ int gpu_owner_increase_priority(struct task_struct *t)
798 gpu = find_first_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus)); 792 gpu = find_first_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus));
799 793
800 if (!binheap_is_in_heap(&tsk_rt(t)->gpu_owner_node)) { 794 if (!binheap_is_in_heap(&tsk_rt(t)->gpu_owner_node)) {
801 WARN_ON(!is_running(t)); 795 WARN_ON(!is_running(t) && !tsk_rt(t)->hide_from_gpu);
802 TRACE_CUR("gpu klmirqd may not inherit from %s/%d on GPU %d\n", 796 TRACE_CUR("nv klmirqd may not inherit from %s/%d on GPU %d\n",
803 t->comm, t->pid, gpu); 797 t->comm, t->pid, gpu);
804 goto out; 798 goto out;
805 } 799 }
@@ -848,7 +842,7 @@ int gpu_owner_decrease_priority(struct task_struct *t)
848 gpu = find_first_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus)); 842 gpu = find_first_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus));
849 843
850 if (!binheap_is_in_heap(&tsk_rt(t)->gpu_owner_node)) { 844 if (!binheap_is_in_heap(&tsk_rt(t)->gpu_owner_node)) {
851 WARN_ON(!is_running(t)); 845 WARN_ON(!is_running(t) && !tsk_rt(t)->hide_from_gpu);
852 TRACE_CUR("nv klmirqd may not inherit from %s/%d on GPU %d\n", 846 TRACE_CUR("nv klmirqd may not inherit from %s/%d on GPU %d\n",
853 t->comm, t->pid, gpu); 847 t->comm, t->pid, gpu);
854 goto out; 848 goto out;
@@ -881,12 +875,6 @@ out:
881 875
882 876
883 877
884
885
886
887
888
889
890static int __reg_nv_device(int reg_device_id, struct task_struct *t) 878static int __reg_nv_device(int reg_device_id, struct task_struct *t)
891{ 879{
892 __set_bit(reg_device_id, &tsk_rt(t)->held_gpus); 880 __set_bit(reg_device_id, &tsk_rt(t)->held_gpus);
@@ -923,26 +911,6 @@ int reg_nv_device(int reg_device_id, int reg_action, struct task_struct *t)
923 911
924 912
925 913
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946#ifdef CONFIG_LITMUS_PAI_SOFTIRQD 914#ifdef CONFIG_LITMUS_PAI_SOFTIRQD
947//void pai_check_priority_increase(struct task_struct *t, int reg_device_id) 915//void pai_check_priority_increase(struct task_struct *t, int reg_device_id)
948//{ 916//{