Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'for-linus' of git://www.jni.nu/cris

* 'for-linus' of git://www.jni.nu/cris:
  CRIS: Don't use mask_irq as symbol name
  CRIS: Simplify param.h by simply including <asm-generic/param.h>
  CRISv10: Whitespace fixes for hw_settings.S
  CRISv10: Trivial fixes.
  CRISv32: Fix RS485 port 4 CD Kconfig item.
  CRISv32: Remove duplicated Kconfig items.
  cris: push down BKL into some device drivers
  • Loading branch information...
commit b904d7131d116900524bd36ec170dcd97846bfd3 2 parents 2e8949f + 4150764
Linus Torvalds authored
20  arch/cris/arch-v10/drivers/ds1302.c
@@ -19,6 +19,7 @@
19 19
 #include <linux/module.h>
20 20
 #include <linux/miscdevice.h>
21 21
 #include <linux/delay.h>
  22
+#include <linux/smp_lock.h>
22 23
 #include <linux/bcd.h>
23 24
 #include <linux/capability.h>
24 25
 
@@ -238,9 +239,7 @@ static unsigned char days_in_mo[] =
238 239
 
239 240
 /* ioctl that supports RTC_RD_TIME and RTC_SET_TIME (read and set time/date). */
240 241
 
241  
-static int
242  
-rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
243  
-	  unsigned long arg) 
  242
+static int rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
244 243
 {
245 244
 	unsigned long flags;
246 245
 
@@ -354,6 +353,17 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
354 353
 	}
355 354
 }
356 355
 
  356
+static long rtc_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
  357
+{
  358
+	int ret;
  359
+
  360
+	lock_kernel();
  361
+	ret = rtc_ioctl(file, cmd, arg);
  362
+	unlock_kernel();
  363
+
  364
+	return ret;
  365
+}
  366
+
357 367
 static void
358 368
 print_rtc_status(void)
359 369
 {
@@ -375,8 +385,8 @@ print_rtc_status(void)
375 385
 /* The various file operations we support. */
376 386
 
377 387
 static const struct file_operations rtc_fops = {
378  
-	.owner =	THIS_MODULE,
379  
-	.ioctl =	rtc_ioctl,
  388
+	.owner		= THIS_MODULE,
  389
+	.unlocked_ioctl = rtc_unlocked_ioctl,
380 390
 }; 
381 391
 
382 392
 /* Probe for the chip by writing something to its RAM and try reading it back. */
19  arch/cris/arch-v10/drivers/pcf8563.c
@@ -27,6 +27,7 @@
27 27
 #include <linux/delay.h>
28 28
 #include <linux/bcd.h>
29 29
 #include <linux/mutex.h>
  30
+#include <linux/smp_lock.h>
30 31
 
31 32
 #include <asm/uaccess.h>
32 33
 #include <asm/system.h>
@@ -53,7 +54,7 @@ static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
53 54
 static const unsigned char days_in_month[] =
54 55
 	{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
55 56
 
56  
-int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
  57
+static long pcf8563_unlocked_ioctl(struct file *, unsigned int, unsigned long);
57 58
 
58 59
 /* Cache VL bit value read at driver init since writing the RTC_SECOND
59 60
  * register clears the VL status.
@@ -62,7 +63,7 @@ static int voltage_low;
62 63
 
63 64
 static const struct file_operations pcf8563_fops = {
64 65
 	.owner = THIS_MODULE,
65  
-	.ioctl = pcf8563_ioctl,
  66
+	.unlocked_ioctl = pcf8563_unlocked_ioctl,
66 67
 };
67 68
 
68 69
 unsigned char
@@ -212,8 +213,7 @@ pcf8563_exit(void)
212 213
  * ioctl calls for this driver. Why return -ENOTTY upon error? Because
213 214
  * POSIX says so!
214 215
  */
215  
-int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
216  
-	unsigned long arg)
  216
+static int pcf8563_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
217 217
 {
218 218
 	/* Some sanity checks. */
219 219
 	if (_IOC_TYPE(cmd) != RTC_MAGIC)
@@ -339,6 +339,17 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
339 339
 	return 0;
340 340
 }
341 341
 
  342
+static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
  343
+{
  344
+	int ret;
  345
+
  346
+	lock_kernel();
  347
+	return pcf8563_ioctl(filp, cmd, arg);
  348
+	unlock_kernel();
  349
+
  350
+	return ret;
  351
+}
  352
+
342 353
 static int __init pcf8563_register(void)
343 354
 {
344 355
 	if (pcf8563_init() < 0) {
8  arch/cris/arch-v10/kernel/irq.c
@@ -17,8 +17,8 @@
17 17
 #include <linux/kernel.h>
18 18
 #include <linux/init.h>
19 19
 
20  
-#define mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
21  
-#define unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
  20
+#define crisv10_mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
  21
+#define crisv10_unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
22 22
 
23 23
 /* don't use set_int_vector, it bypasses the linux interrupt handlers. it is
24 24
  * global just so that the kernel gdb can use it.
@@ -116,12 +116,12 @@ static unsigned int startup_crisv10_irq(unsigned int irq)
116 116
 
117 117
 static void enable_crisv10_irq(unsigned int irq)
118 118
 {
119  
-	unmask_irq(irq);
  119
+	crisv10_unmask_irq(irq);
120 120
 }
121 121
 
122 122
 static void disable_crisv10_irq(unsigned int irq)
123 123
 {
124  
-	mask_irq(irq);
  124
+	crisv10_mask_irq(irq);
125 125
 }
126 126
 
127 127
 static void ack_crisv10_irq(unsigned int irq)
15  arch/cris/arch-v10/lib/dmacopy.c
... ...
@@ -1,5 +1,4 @@
1  
-/* $Id: dmacopy.c,v 1.1 2001/12/17 13:59:27 bjornw Exp $ 
2  
- *
  1
+/*
3 2
  * memcpy for large blocks, using memory-memory DMA channels 6 and 7 in Etrax
4 3
  */
5 4
 
@@ -13,11 +12,11 @@ void *dma_memcpy(void *pdst,
13 12
 		 unsigned int pn)
14 13
 {
15 14
 	static etrax_dma_descr indma, outdma;
16  
-	
17  
-	D(printk("dma_memcpy %d bytes... ", pn));
  15
+
  16
+	D(printk(KERN_DEBUG "dma_memcpy %d bytes... ", pn));
18 17
 
19 18
 #if 0
20  
-	*R_GEN_CONFIG = genconfig_shadow = 
  19
+	*R_GEN_CONFIG = genconfig_shadow =
21 20
 		(genconfig_shadow & ~0x3c0000) |
22 21
 		IO_STATE(R_GEN_CONFIG, dma6, intdma7) |
23 22
 		IO_STATE(R_GEN_CONFIG, dma7, intdma6);
@@ -32,11 +31,11 @@ void *dma_memcpy(void *pdst,
32 31
 	*R_DMA_CH7_FIRST = &outdma;
33 32
 	*R_DMA_CH6_CMD = IO_STATE(R_DMA_CH6_CMD, cmd, start);
34 33
 	*R_DMA_CH7_CMD = IO_STATE(R_DMA_CH7_CMD, cmd, start);
35  
-	
36  
-	while(*R_DMA_CH7_CMD == 1) /* wait for completion */ ;
37 34
 
38  
-	D(printk("done\n"));
  35
+	while (*R_DMA_CH7_CMD == 1)
  36
+		/* wait for completion */;
39 37
 
  38
+	D(printk(KERN_DEBUG "done\n"));
40 39
 }
41 40
 
42 41
 
14  arch/cris/arch-v10/lib/hw_settings.S
... ...
@@ -1,13 +1,11 @@
1 1
 /*
2  
- * $Id: hw_settings.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $
3  
- * 
4 2
  * This table is used by some tools to extract hardware parameters.
5 3
  * The table should be included in the kernel and the decompressor.
6 4
  * Don't forget to update the tools if you change this table.
7 5
  *
8 6
  * Copyright (C) 2001 Axis Communications AB
9 7
  *
10  
- * Authors:  Mikael Starvik (starvik@axis.com)	
  8
+ * Authors:  Mikael Starvik (starvik@axis.com)
11 9
  */
12 10
 
13 11
 #define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \
@@ -15,13 +13,13 @@
15 13
 #define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \
16 14
 		(CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \
17 15
 		(CONFIG_ETRAX_DEF_R_PORT_PB_DATA))
18  
-	
  16
+
19 17
 	.ascii "HW_PARAM_MAGIC" ; Magic number
20 18
 	.dword 0xc0004000	; Kernel start address
21 19
 
22 20
 	; Debug port
23 21
 #ifdef CONFIG_ETRAX_DEBUG_PORT0
24  
-	.dword 0		
  22
+	.dword 0
25 23
 #elif defined(CONFIG_ETRAX_DEBUG_PORT1)
26 24
 	.dword 1
27 25
 #elif defined(CONFIG_ETRAX_DEBUG_PORT2)
@@ -30,7 +28,7 @@
30 28
 	.dword 3
31 29
 #else
32 30
 	.dword 4 ; No debug
33  
-#endif			
  31
+#endif
34 32
 
35 33
 	; SDRAM or EDO DRAM?
36 34
 #ifdef CONFIG_ETRAX_SDRAM
@@ -39,7 +37,7 @@
39 37
 	.dword 0
40 38
 #endif
41 39
 
42  
-	; Register values 
  40
+	; Register values
43 41
 	.dword R_WAITSTATES
44 42
 	.dword CONFIG_ETRAX_DEF_R_WAITSTATES
45 43
 	.dword R_BUS_CONFIG
@@ -56,7 +54,7 @@
56 54
 	.dword CONFIG_ETRAX_DEF_R_DRAM_TIMING
57 55
 #endif
58 56
 	.dword R_PORT_PA_SET
59  
-	.dword PA_SET_VALUE 
  57
+	.dword PA_SET_VALUE
60 58
 	.dword R_PORT_PB_SET
61 59
 	.dword PB_SET_VALUE
62 60
 	.dword 0 ; No more register values
16  arch/cris/arch-v32/drivers/Kconfig
@@ -360,24 +360,10 @@ config ETRAX_SER4_DSR_BIT
360 360
 	string "Ser 4 DSR bit (empty = not used)"
361 361
 	depends on ETRAX_SERIAL_PORT4
362 362
 
363  
-config ETRAX_SER3_CD_BIT
  363
+config ETRAX_SER4_CD_BIT
364 364
 	string "Ser 4 CD bit (empty = not used)"
365 365
 	depends on ETRAX_SERIAL_PORT4
366 366
 
367  
-config ETRAX_RS485
368  
-	bool "RS-485 support"
369  
-	depends on ETRAXFS_SERIAL
370  
-	help
371  
-	  Enables support for RS-485 serial communication.  For a primer on
372  
-	  RS-485, see <http://www.hw.cz/english/docs/rs485/rs485.html>.
373  
-
374  
-config ETRAX_RS485_DISABLE_RECEIVER
375  
-	bool "Disable serial receiver"
376  
-	depends on ETRAX_RS485
377  
-	help
378  
-	  It is necessary to disable the serial receiver to avoid serial
379  
-	  loopback.  Not all products are able to do this in software only.
380  
-
381 367
 config ETRAX_SYNCHRONOUS_SERIAL
382 368
 	bool "Synchronous serial-port support"
383 369
 	depends on ETRAX_ARCH_V32
22  arch/cris/arch-v32/drivers/i2c.c
@@ -649,10 +649,10 @@ i2c_release(struct inode *inode, struct file *filp)
649 649
 /* Main device API. ioctl's to write or read to/from i2c registers.
650 650
  */
651 651
 
652  
-static int
653  
-i2c_ioctl(struct inode *inode, struct file *file,
654  
-	  unsigned int cmd, unsigned long arg)
  652
+static long
  653
+i2c_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
655 654
 {
  655
+	int ret;
656 656
 	if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) {
657 657
 		return -ENOTTY;
658 658
 	}
@@ -665,9 +665,13 @@ i2c_ioctl(struct inode *inode, struct file *file,
665 665
 				 I2C_ARGREG(arg),
666 666
 				 I2C_ARGVALUE(arg)));
667 667
 
668  
-			return i2c_writereg(I2C_ARGSLAVE(arg),
  668
+			lock_kernel();
  669
+			ret = i2c_writereg(I2C_ARGSLAVE(arg),
669 670
 					    I2C_ARGREG(arg),
670 671
 					    I2C_ARGVALUE(arg));
  672
+			unlock_kernel();
  673
+			return ret;
  674
+
671 675
 		case I2C_READREG:
672 676
 		{
673 677
 			unsigned char val;
@@ -675,7 +679,9 @@ i2c_ioctl(struct inode *inode, struct file *file,
675 679
 			D(printk("i2cr %d %d ",
676 680
 				I2C_ARGSLAVE(arg),
677 681
 				I2C_ARGREG(arg)));
  682
+			lock_kernel();
678 683
 			val = i2c_readreg(I2C_ARGSLAVE(arg), I2C_ARGREG(arg));
  684
+			unlock_kernel();
679 685
 			D(printk("= %d\n", val));
680 686
 			return val;
681 687
 		}
@@ -688,10 +694,10 @@ i2c_ioctl(struct inode *inode, struct file *file,
688 694
 }
689 695
 
690 696
 static const struct file_operations i2c_fops = {
691  
-	.owner =    THIS_MODULE,
692  
-	.ioctl =    i2c_ioctl,
693  
-	.open =     i2c_open,
694  
-	.release =  i2c_release,
  697
+	.owner		= THIS_MODULE,
  698
+	.unlocked_ioctl = i2c_ioctl,
  699
+	.open		= i2c_open,
  700
+	.release	= i2c_release,
695 701
 };
696 702
 
697 703
 static int __init i2c_init(void)
21  arch/cris/arch-v32/drivers/pcf8563.c
@@ -24,6 +24,7 @@
24 24
 #include <linux/init.h>
25 25
 #include <linux/fs.h>
26 26
 #include <linux/ioctl.h>
  27
+#include <linux/smp_lock.h>
27 28
 #include <linux/delay.h>
28 29
 #include <linux/bcd.h>
29 30
 #include <linux/mutex.h>
@@ -49,7 +50,7 @@ static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
49 50
 static const unsigned char days_in_month[] =
50 51
 	{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
51 52
 
52  
-int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
  53
+static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
53 54
 
54 55
 /* Cache VL bit value read at driver init since writing the RTC_SECOND
55 56
  * register clears the VL status.
@@ -57,8 +58,8 @@ int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
57 58
 static int voltage_low;
58 59
 
59 60
 static const struct file_operations pcf8563_fops = {
60  
-	.owner =	THIS_MODULE,
61  
-	.ioctl =	pcf8563_ioctl
  61
+	.owner		= THIS_MODULE,
  62
+	.unlocked_ioctl = pcf8563_unlocked_ioctl,
62 63
 };
63 64
 
64 65
 unsigned char
@@ -208,8 +209,7 @@ pcf8563_exit(void)
208 209
  * ioctl calls for this driver. Why return -ENOTTY upon error? Because
209 210
  * POSIX says so!
210 211
  */
211  
-int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
212  
-	unsigned long arg)
  212
+static int pcf8563_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
213 213
 {
214 214
 	/* Some sanity checks. */
215 215
 	if (_IOC_TYPE(cmd) != RTC_MAGIC)
@@ -335,6 +335,17 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
335 335
 	return 0;
336 336
 }
337 337
 
  338
+static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
  339
+{
  340
+	int ret;
  341
+
  342
+	lock_kernel();
  343
+	return pcf8563_ioctl(filp, cmd, arg);
  344
+	unlock_kernel();
  345
+
  346
+	return ret;
  347
+}
  348
+
338 349
 static int __init pcf8563_register(void)
339 350
 {
340 351
 	if (pcf8563_init() < 0) {
4  arch/cris/arch-v32/kernel/crisksyms.c
@@ -24,5 +24,5 @@ EXPORT_SYMBOL(crisv32_io_get_name);
24 24
 EXPORT_SYMBOL(crisv32_io_get);
25 25
 
26 26
 /* Functions masking/unmasking interrupts */
27  
-EXPORT_SYMBOL(mask_irq);
28  
-EXPORT_SYMBOL(unmask_irq);
  27
+EXPORT_SYMBOL(crisv32_mask_irq);
  28
+EXPORT_SYMBOL(crisv32_unmask_irq);
14  arch/cris/arch-v32/kernel/irq.c
@@ -280,8 +280,7 @@ static int irq_cpu(int irq)
280 280
 	return cpu;
281 281
 }
282 282
 
283  
-void
284  
-mask_irq(int irq)
  283
+void crisv32_mask_irq(int irq)
285 284
 {
286 285
 	int cpu;
287 286
 
@@ -289,8 +288,7 @@ mask_irq(int irq)
289 288
 		block_irq(irq, cpu);
290 289
 }
291 290
 
292  
-void
293  
-unmask_irq(int irq)
  291
+void crisv32_unmask_irq(int irq)
294 292
 {
295 293
 	unblock_irq(irq, irq_cpu(irq));
296 294
 }
@@ -298,23 +296,23 @@ unmask_irq(int irq)
298 296
 
299 297
 static unsigned int startup_crisv32_irq(unsigned int irq)
300 298
 {
301  
-	unmask_irq(irq);
  299
+	crisv32_unmask_irq(irq);
302 300
 	return 0;
303 301
 }
304 302
 
305 303
 static void shutdown_crisv32_irq(unsigned int irq)
306 304
 {
307  
-	mask_irq(irq);
  305
+	crisv32_mask_irq(irq);
308 306
 }
309 307
 
310 308
 static void enable_crisv32_irq(unsigned int irq)
311 309
 {
312  
-	unmask_irq(irq);
  310
+	crisv32_unmask_irq(irq);
313 311
 }
314 312
 
315 313
 static void disable_crisv32_irq(unsigned int irq)
316 314
 {
317  
-	mask_irq(irq);
  315
+	crisv32_mask_irq(irq);
318 316
 }
319 317
 
320 318
 static void ack_crisv32_irq(unsigned int irq)
4  arch/cris/arch-v32/kernel/smp.c
@@ -168,8 +168,8 @@ void __init smp_callin(void)
168 168
 
169 169
 	/* Enable IRQ and idle */
170 170
 	REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask);
171  
-	unmask_irq(IPI_INTR_VECT);
172  
-	unmask_irq(TIMER0_INTR_VECT);
  171
+	crisv32_unmask_irq(IPI_INTR_VECT);
  172
+	crisv32_unmask_irq(TIMER0_INTR_VECT);
173 173
 	preempt_disable();
174 174
 	notify_cpu_starting(cpu);
175 175
 	local_irq_enable();
9  arch/cris/include/arch-v10/arch/irq.h
@@ -93,15 +93,16 @@ void set_break_vector(int n, irqvectptr addr);
93 93
   "push $r10\n\t"       /* push orig_r10 */ \
94 94
   "clear.d [$sp=$sp-4]\n\t"  /* frametype - this is a normal stackframe */
95 95
 
96  
-  /* BLOCK_IRQ and UNBLOCK_IRQ do the same as mask_irq and unmask_irq */
  96
+/* BLOCK_IRQ and UNBLOCK_IRQ do the same as
  97
+ * crisv10_mask_irq and crisv10_unmask_irq */
97 98
 
98 99
 #define BLOCK_IRQ(mask,nr) \
99 100
   "move.d " #mask ",$r0\n\t" \
100  
-  "move.d $r0,[0xb00000d8]\n\t" 
101  
-  
  101
+  "move.d $r0,[0xb00000d8]\n\t"
  102
+
102 103
 #define UNBLOCK_IRQ(mask) \
103 104
   "move.d " #mask ",$r0\n\t" \
104  
-  "move.d $r0,[0xb00000dc]\n\t" 
  105
+  "move.d $r0,[0xb00000dc]\n\t"
105 106
 
106 107
 #define IRQ_NAME2(nr) nr##_interrupt(void)
107 108
 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
4  arch/cris/include/arch-v32/arch/irq.h
@@ -23,8 +23,8 @@ struct etrax_interrupt_vector {
23 23
 
24 24
 extern struct etrax_interrupt_vector *etrax_irv;	/* head.S */
25 25
 
26  
-void mask_irq(int irq);
27  
-void unmask_irq(int irq);
  26
+void crisv32_mask_irq(int irq);
  27
+void crisv32_unmask_irq(int irq);
28 28
 
29 29
 void set_exception_vector(int n, irqvectptr addr);
30 30
 
17  arch/cris/include/asm/param.h
@@ -2,22 +2,9 @@
2 2
 #define _ASMCRIS_PARAM_H
3 3
 
4 4
 /* Currently we assume that HZ=100 is good for CRIS. */
5  
-#ifdef __KERNEL__
6  
-# define HZ		CONFIG_HZ	/* Internal kernel timer frequency */
7  
-# define USER_HZ	100		/* .. some user interfaces are in "ticks" */
8  
-# define CLOCKS_PER_SEC	(USER_HZ)	/* like times() */
9  
-#endif
10  
-
11  
-#ifndef HZ
12  
-#define HZ 100
13  
-#endif
14 5
 
15 6
 #define EXEC_PAGESIZE	8192
16 7
 
17  
-#ifndef NOGROUP
18  
-#define NOGROUP		(-1)
19  
-#endif
20  
-
21  
-#define MAXHOSTNAMELEN	64	/* max length of hostname */
  8
+#include <asm-generic/param.h>
22 9
 
23  
-#endif
  10
+#endif /* _ASMCRIS_PARAM_H */

0 notes on commit b904d71

Please sign in to comment.
Something went wrong with that request. Please try again.