aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hung_task.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2012-05-29 14:26:30 -0400
committerJ. Bruce Fields <bfields@redhat.com>2012-05-31 20:30:31 -0400
commit32f16b3823b854a1f73bfad43782fbbcfe086090 (patch)
tree1ea8f6980351f646ac1c21408717ac804f68bb2b /kernel/hung_task.c
parent778df3f0feaeb03ebf9f370cba8437491ffa889f (diff)
nfsd4: remove some dprintk's and a comment
The comment is redundant, and if we really want dprintk's here they'd probably be better in the common (check-slot_seqid) code. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'kernel/hung_task.c')
0 files changed, 0 insertions, 0 deletions
alds <torvalds@woody.linux-foundation.org> 2007-05-11 11:29:35 -0400 MPC52xx PSC SPI master driver' href='/cgit/cgit.cgi/litmus-rt-ext-res.git/commit/drivers/spi/mpc52xx_psc_spi.c?id=00b8fd236764e3d5bc1d30dc65e256e283de4c3d'>00b8fd236764
7390284290b1

00b8fd236764










4874cc1b5142
00b8fd236764






b7d271df873c
00b8fd236764








b7d271df873c
00b8fd236764


b7d271df873c
00b8fd236764


9a7867e1b34c

b7d271df873c
9a7867e1b34c


00b8fd236764
9a7867e1b34c
00b8fd236764
00b8fd236764


3a4fa0a25da8
00b8fd236764







4874cc1b5142
00b8fd236764


4874cc1b5142
00b8fd236764





























































0a6d38795a40

00b8fd236764






























































00b8fd236764
4874cc1b5142
00b8fd236764
f856cf017873
00b8fd236764
00b8fd236764
4fb4c5582475
f856cf017873


00b8fd236764








4874cc1b5142
00b8fd236764




a897ea13f7a8
00b8fd236764






f856cf017873
00b8fd236764
















fd4a319bc933
00b8fd236764

8074cf063e41
00b8fd236764



00b8fd236764






e7db06b5d5af


00b8fd236764

f6bd03a74627

7390284290b1
00b8fd236764



7390284290b1
00b8fd236764






12b15e83289b
00b8fd236764






4874cc1b5142

00b8fd236764






f856cf017873

00b8fd236764
f856cf017873
00b8fd236764






6c7377ab6814
00b8fd236764






















fd4a319bc933
00b8fd236764




61c7a080a5a0
00b8fd236764
5cc17d7e01ab
00b8fd236764

61c7a080a5a0
00b8fd236764
8888735fcaac
00b8fd236764
8888735fcaac
00b8fd236764
61c7a080a5a0
8888735fcaac
5cc17d7e01ab
8888735fcaac
00b8fd236764
8888735fcaac
00b8fd236764

12b15e83289b
61c7a080a5a0
00b8fd236764

fd4a319bc933
00b8fd236764
24b5a82cf570
5aa68b85951a







c8c87c656f95
5aa68b85951a

00b8fd236764

631e61b7ca12
66ffbe490b61


00b8fd236764



18d306d13756
00b8fd236764
fd4a319bc933
00b8fd236764


4018294b53d1
00b8fd236764

940ab88962bc
00b8fd236764
00b8fd236764


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
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
  
                                  











                                                                           
                        

                            
                             
                              





                              
                       







                                               
                                                            



                                        
                                              
































































                                                                          
                                                




                                                        
                                                

                                               

                                                                        





                                                                          

                                                                        










                                                                          
                                                          






                                                               
                           








                                                                            
                                       


                                                                      
                                       


                                                                       

                                                                       
                                                            


                                                         
                                                                              
                            
                                                                     


                 
                                                         







                                                                          
                                                          


                                                                       
                                                     





























































                                                                                

                                                






























































                                                                               
                                                   
                                                          
                       
                
 
                                      
                                                                    


                                                         








                                                                              
                                




                                                                         
                                                                              






                                
                 
















                                                                       
                                                                    

                                                                        
                                                                    



                                    






                                                    


                                                                              

                            

                                                                                                        
                                       



                                             
                                                    






                                                               
                                           






                                                                   

                                                                            






                                                                              

                                                                             
                              
         






                                                       
                                              






















                                          
                                                               




                              
                                                                      
                         
                                                           

                               
                                                                     
 
                                                    
                                            
                                    
 
                                                                                
                                                 
                                                                           
                                       
                 
                                   

         
                                                                              
                                                                              

 
                                                                
 
                                                                             







                                                                     
                               

                 

 
                                                               


                                                       



                                                  
                                                           
                                          
                                            


                                          
                                                           

          
                                                  
 


                                             
/*
 * MPC52xx PSC in SPI mode driver.
 *
 * Maintainer: Dragos Carp
 *
 * Copyright (C) 2006 TOPTICA Photonics AG.
 *
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 */

#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/workqueue.h>
#include <linux/completion.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/spi/spi.h>
#include <linux/fsl_devices.h>
#include <linux/slab.h>

#include <asm/mpc52xx.h>
#include <asm/mpc52xx_psc.h>

#define MCLK 20000000 /* PSC port MClk in hz */

struct mpc52xx_psc_spi {
	/* fsl_spi_platform data */
	void (*cs_control)(struct spi_device *spi, bool on);
	u32 sysclk;

	/* driver internal data */
	struct mpc52xx_psc __iomem *psc;
	struct mpc52xx_psc_fifo __iomem *fifo;
	unsigned int irq;
	u8 bits_per_word;
	u8 busy;

	struct workqueue_struct *workqueue;
	struct work_struct work;

	struct list_head queue;
	spinlock_t lock;

	struct completion done;
};

/* controller state */
struct mpc52xx_psc_spi_cs {
	int bits_per_word;
	int speed_hz;
};

/* set clock freq, clock ramp, bits per work
 * if t is NULL then reset the values to the default values
 */
static int mpc52xx_psc_spi_transfer_setup(struct spi_device *spi,
		struct spi_transfer *t)
{
	struct mpc52xx_psc_spi_cs *cs = spi->controller_state;

	cs->speed_hz = (t && t->speed_hz)
			? t->speed_hz : spi->max_speed_hz;
	cs->bits_per_word = (t && t->bits_per_word)
			? t->bits_per_word : spi->bits_per_word;
	cs->bits_per_word = ((cs->bits_per_word + 7) / 8) * 8;
	return 0;
}

static void mpc52xx_psc_spi_activate_cs(struct spi_device *spi)
{
	struct mpc52xx_psc_spi_cs *cs = spi->controller_state;
	struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master);
	struct mpc52xx_psc __iomem *psc = mps->psc;
	u32 sicr;
	u16 ccr;

	sicr = in_be32(&psc->sicr);

	/* Set clock phase and polarity */
	if (spi->mode & SPI_CPHA)
		sicr |= 0x00001000;
	else
		sicr &= ~0x00001000;
	if (spi->mode & SPI_CPOL)
		sicr |= 0x00002000;
	else
		sicr &= ~0x00002000;

	if (spi->mode & SPI_LSB_FIRST)
		sicr |= 0x10000000;
	else
		sicr &= ~0x10000000;
	out_be32(&psc->sicr, sicr);

	/* Set clock frequency and bits per word
	 * Because psc->ccr is defined as 16bit register instead of 32bit
	 * just set the lower byte of BitClkDiv
	 */
	ccr = in_be16((u16 __iomem *)&psc->ccr);
	ccr &= 0xFF00;
	if (cs->speed_hz)
		ccr |= (MCLK / cs->speed_hz - 1) & 0xFF;
	else /* by default SPI Clk 1MHz */
		ccr |= (MCLK / 1000000 - 1) & 0xFF;
	out_be16((u16 __iomem *)&psc->ccr, ccr);
	mps->bits_per_word = cs->bits_per_word;

	if (mps->cs_control)
		mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 1 : 0);
}

static void mpc52xx_psc_spi_deactivate_cs(struct spi_device *spi)
{
	struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master);

	if (mps->cs_control)
		mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 0 : 1);
}

#define MPC52xx_PSC_BUFSIZE (MPC52xx_PSC_RFNUM_MASK + 1)
/* wake up when 80% fifo full */
#define MPC52xx_PSC_RFALARM (MPC52xx_PSC_BUFSIZE * 20 / 100)

static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
						struct spi_transfer *t)
{
	struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master);
	struct mpc52xx_psc __iomem *psc = mps->psc;