aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dynamic_debug.c
diff options
context:
space:
mode:
authorWanlong Gao <wanlong.gao@gmail.com>2011-04-10 02:14:43 -0400
committerHans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>2011-04-13 09:46:37 -0400
commit8faf9e3838c31c426e6203cb7dc6fc0f0bdb8b7e (patch)
treef9d9782e97904918c5080d5ce973269de86f762d /lib/dynamic_debug.c
parentaaa119a3d4e0b7421c82ae3fbe288e65d0f3485f (diff)
fix the wrong argument of the functions definition
The functions of eic_chip's memebers use the wrong argument . Signed-off-by: Wanlong Gao <wanlong.gao@gmail.com> Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Diffstat (limited to 'lib/dynamic_debug.c')
0 files changed, 0 insertions, 0 deletions
8 -0400 committer Rafael J. Wysocki <rjw@sisk.pl> 2010-07-18 20:00:18 -0400 pm_qos: Reimplement using plists' href='/cgit/cgit.cgi/litmus-rt-imx6.git/commit/kernel/pm_qos_params.c?id=5f279845f9d684661563894d44729a0c706375b4'>5f279845f9d6
d82b35186eaa


5f279845f9d6
d82b35186eaa



5f279845f9d6
d82b35186eaa


5f279845f9d6
d82b35186eaa




5f279845f9d6
d82b35186eaa


5f279845f9d6
d82b35186eaa









d82b35186eaa








6038f373a3dc
d82b35186eaa

5f279845f9d6

d82b35186eaa
5f279845f9d6

d82b35186eaa
5f279845f9d6

00fafcda1773
d82b35186eaa
5f279845f9d6
00fafcda1773
d82b35186eaa
5f279845f9d6







d82b35186eaa
d82b35186eaa
5f279845f9d6
d82b35186eaa

5f279845f9d6














d82b35186eaa
5f279845f9d6
d82b35186eaa

5f279845f9d6



d82b35186eaa
























ed77134bfccf
d82b35186eaa



ed77134bfccf
d82b35186eaa
5f279845f9d6







d82b35186eaa
ed77134bfccf
d82b35186eaa
82f682514a5d





d82b35186eaa
ed77134bfccf
25cc69ec34a5

d82b35186eaa


bf1db69fbf4f
25cc69ec34a5


d82b35186eaa
25cc69ec34a5
82f682514a5d

d82b35186eaa
82f682514a5d

d82b35186eaa
82f682514a5d










d82b35186eaa
ed77134bfccf
d82b35186eaa

ed77134bfccf

d82b35186eaa

ed77134bfccf
d82b35186eaa

ed77134bfccf
d82b35186eaa
ed77134bfccf
5f279845f9d6
d82b35186eaa
ed77134bfccf
5f279845f9d6
d82b35186eaa
5f279845f9d6


82f682514a5d




5f279845f9d6








d82b35186eaa
ed77134bfccf
d82b35186eaa

ed77134bfccf

d82b35186eaa
ed77134bfccf


d82b35186eaa
ed77134bfccf
d82b35186eaa
5f279845f9d6
ed77134bfccf



d82b35186eaa
82f682514a5d




5f279845f9d6

82f682514a5d
d82b35186eaa
ed77134bfccf
d82b35186eaa






bf1db69fbf4f
d82b35186eaa
ed77134bfccf
d82b35186eaa















bf1db69fbf4f
d82b35186eaa











d82b35186eaa

d82b35186eaa



bac1e74dba97
82f682514a5d




ed77134bfccf

d82b35186eaa

d82b35186eaa




ed77134bfccf
d82b35186eaa
82f682514a5d
ed77134bfccf
82f682514a5d
d82b35186eaa



ed77134bfccf
d82b35186eaa



ed77134bfccf









0109c2c48d06

ed77134bfccf


0109c2c48d06
ed77134bfccf
d82b35186eaa
d82b35186eaa
99a51792dbb7
ed77134bfccf


d82b35186eaa

























1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431



                                                                     
                                                










                                                                              
                                                                          
  
                                                                   


                                                                             

                                                                          

                                                                          
                                      

   

                 














                                  
                                                           


                                                                           



                                                               

                      
                                   



                                                 
                              

  

                                    


                                                    
                                                                          


                                             
                           



                                                    
                                                                              


                                             
                          




                                                           
                                                                                     


                                                  
                           









                                               








                                                                            
                              

  

                                                           
 

                                           
 

                          
                                                       
 
                        
                                                      
 







                                                                           
 
                            
                                   

                                               














                                                                          
         
                                         

                                                    



                                                                       
























                                                                               
                                                               



                                                                      
                                    
 







                                                             
 
                                  
 





                                                          
   
                                                             

                                                             


                                                                              
                                                                             


                                                                             
   
 

                                                        
 

                                                              
 










                                                                                            
 
                                      

   

                                                                       

                                  
                                                                           

                                               
                                                                  
   
                                                                  
                                         
 
                 
                                
 


                                                                   




                                                                                        








                                                             
 
                                         

   

                                                           
  


                                                                      
   
                                                                  
 
                                



                                                            
 




                                                                                        

                                                                     
                                                   
 
                                         






                                                                            
                                                 
   
                                                                          















                                                                         
                                                 











                                                                             

                                                                    



                                                                  
                                                                                   




                                                                            

                                       

                                 




                                                                       
                                        
 
                                 
                                   
                   



                 
 



                                                                            









                                                             

                                              


                                                      
                                                                  
              
                               
 
                                        


                                                 

























                                                                                
/*
 * This module exposes the interface to kernel space for specifying
 * QoS dependencies.  It provides infrastructure for registration of:
 *
 * Dependents on a QoS value : register requests
 * Watchers of QoS value : get notified when target QoS value changes
 *
 * This QoS design is best effort based.  Dependents register their QoS needs.
 * Watchers register to keep track of the current QoS needs of the system.
 *
 * There are 3 basic classes of QoS parameter: latency, timeout, throughput
 * each have defined units:
 * latency: usec
 * timeout: usec <-- currently not used.
 * throughput: kbs (kilo byte / sec)
 *
 * There are lists of pm_qos_objects each one wrapping requests, notifiers
 *
 * User mode requests on a QOS parameter register themselves to the
 * subsystem by opening the device node /dev/... and writing there request to
 * the node.  As long as the process holds a file handle open to the node the
 * client continues to be accounted for.  Upon file release the usermode
 * request is removed and a new qos target is computed.  This way when the
 * request that the application has is cleaned up when closes the file
 * pointer or exits the pm_qos_object will get an opportunity to clean up.
 *
 * Mark Gross <mgross@linux.intel.com>
 */

/*#define DEBUG*/

#include <linux/pm_qos_params.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/fs.h>
#include <linux/device.h>
#include <linux/miscdevice.h>
#include <linux/string.h>
#include <linux/platform_device.h>
#include <linux/init.h>

#include <linux/uaccess.h>

/*
 * locking rule: all changes to requests or notifiers lists
 * or pm_qos_object list and pm_qos_objects need to happen with pm_qos_lock
 * held, taken with _irqsave.  One lock to rule them all
 */
enum pm_qos_type {
	PM_QOS_MAX,		/* return the largest value */
	PM_QOS_MIN		/* return the smallest value */
};

struct pm_qos_object {
	struct plist_head requests;
	struct blocking_notifier_head *notifiers;
	struct miscdevice pm_qos_power_miscdev;
	char *name;
	s32 default_value;
	enum pm_qos_type type;
};

static DEFINE_SPINLOCK(pm_qos_lock);

static struct pm_qos_object null_pm_qos;
static BLOCKING_NOTIFIER_HEAD(cpu_dma_lat_notifier);
static struct pm_qos_object cpu_dma_pm_qos = {
	.requests = PLIST_HEAD_INIT(cpu_dma_pm_qos.requests, pm_qos_lock),
	.notifiers = &cpu_dma_lat_notifier,
	.name = "cpu_dma_latency",
	.default_value = 2000 * USEC_PER_SEC,
	.type = PM_QOS_MIN,
};

static BLOCKING_NOTIFIER_HEAD(network_lat_notifier);
static struct pm_qos_object network_lat_pm_qos = {
	.requests = PLIST_HEAD_INIT(network_lat_pm_qos.requests, pm_qos_lock),
	.notifiers = &network_lat_notifier,
	.name = "network_latency",
	.default_value = 2000 * USEC_PER_SEC,
	.type = PM_QOS_MIN
};


static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier);
static struct pm_qos_object network_throughput_pm_qos = {
	.requests = PLIST_HEAD_INIT(network_throughput_pm_qos.requests, pm_qos_lock),
	.notifiers = &network_throughput_notifier,
	.name = "network_throughput",
	.default_value = 0,
	.type = PM_QOS_MAX,
};


static struct pm_qos_object *pm_qos_array[] = {
	&null_pm_qos,
	&cpu_dma_pm_qos,
	&network_lat_pm_qos,
	&network_throughput_pm_qos
};

static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
		size_t count, loff_t *f_pos);
static int pm_qos_power_open(struct inode *inode, struct file *filp);
static int pm_qos_power_release(struct inode *inode, struct file *filp);

static const struct file_operations pm_qos_power_fops = {
	.write = pm_qos_power_write,
	.open = pm_qos_power_open,
	.release = pm_qos_power_release,
	.llseek = noop_llseek,
};

/* unlocked internal variant */
static inline int pm_qos_get_value(struct pm_qos_object *o)
{
	if (plist_head_empty(&o->requests))
		return o->default_value;

	switch (o->type) {
	case PM_QOS_MIN:
		return plist_first(&o->requests)->prio;

	case PM_QOS_MAX:
		return plist_last(&o->requests)->prio;

	default:
		/* runtime check for not using enum */
		BUG();
	}
}

static void update_target(struct pm_qos_object *o, struct plist_node *node,
			  int del, int value)
{
	unsigned long flags;
	int prev_value, curr_value;

	spin_lock_irqsave(&pm_qos_lock, flags);
	prev_value = pm_qos_get_value(o);