Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+97 -90
+15 -5
arch/cris/arch-v10/drivers/ds1302.c
··· 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 ··· 239 238 240 239 /* ioctl that supports RTC_RD_TIME and RTC_SET_TIME (read and set time/date). */ 241 240 242 - static int 243 - rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 244 - unsigned long arg) 241 + static int rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 245 242 { 246 243 unsigned long flags; 247 244 ··· 353 354 } 354 355 } 355 356 357 + static long rtc_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 358 + { 359 + int ret; 360 + 361 + lock_kernel(); 362 + ret = rtc_ioctl(file, cmd, arg); 363 + unlock_kernel(); 364 + 365 + return ret; 366 + } 367 + 356 368 static void 357 369 print_rtc_status(void) 358 370 { ··· 385 375 /* The various file operations we support. */ 386 376 387 377 static const struct file_operations rtc_fops = { 388 - .owner = THIS_MODULE, 389 - .ioctl = rtc_ioctl, 378 + .owner = THIS_MODULE, 379 + .unlocked_ioctl = rtc_unlocked_ioctl, 390 380 }; 391 381 392 382 /* Probe for the chip by writing something to its RAM and try reading it back. */
+15 -4
arch/cris/arch-v10/drivers/pcf8563.c
··· 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> ··· 54 53 static const unsigned char days_in_month[] = 55 54 { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 56 55 57 - int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); 56 + static long pcf8563_unlocked_ioctl(struct file *, unsigned int, unsigned long); 58 57 59 58 /* Cache VL bit value read at driver init since writing the RTC_SECOND 60 59 * register clears the VL status. ··· 63 62 64 63 static const struct file_operations pcf8563_fops = { 65 64 .owner = THIS_MODULE, 66 - .ioctl = pcf8563_ioctl, 65 + .unlocked_ioctl = pcf8563_unlocked_ioctl, 67 66 }; 68 67 69 68 unsigned char ··· 213 212 * ioctl calls for this driver. Why return -ENOTTY upon error? Because 214 213 * POSIX says so! 215 214 */ 216 - int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 217 - unsigned long arg) 215 + static int pcf8563_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 218 216 { 219 217 /* Some sanity checks. */ 220 218 if (_IOC_TYPE(cmd) != RTC_MAGIC) ··· 337 337 } 338 338 339 339 return 0; 340 + } 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; 340 351 } 341 352 342 353 static int __init pcf8563_register(void)
+4 -4
arch/cris/arch-v10/kernel/irq.c
··· 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 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)
+7 -8
arch/cris/arch-v10/lib/dmacopy.c
··· 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 ··· 12 13 unsigned int pn) 13 14 { 14 15 static etrax_dma_descr indma, outdma; 15 - 16 - D(printk("dma_memcpy %d bytes... ", pn)); 16 + 17 + D(printk(KERN_DEBUG "dma_memcpy %d bytes... ", pn)); 17 18 18 19 #if 0 19 - *R_GEN_CONFIG = genconfig_shadow = 20 + *R_GEN_CONFIG = genconfig_shadow = 20 21 (genconfig_shadow & ~0x3c0000) | 21 22 IO_STATE(R_GEN_CONFIG, dma6, intdma7) | 22 23 IO_STATE(R_GEN_CONFIG, dma7, intdma6); ··· 31 32 *R_DMA_CH7_FIRST = &outdma; 32 33 *R_DMA_CH6_CMD = IO_STATE(R_DMA_CH6_CMD, cmd, start); 33 34 *R_DMA_CH7_CMD = IO_STATE(R_DMA_CH7_CMD, cmd, start); 34 - 35 - while(*R_DMA_CH7_CMD == 1) /* wait for completion */ ; 36 35 37 - D(printk("done\n")); 36 + while (*R_DMA_CH7_CMD == 1) 37 + /* wait for completion */; 38 38 39 + D(printk(KERN_DEBUG "done\n")); 39 40 } 40 41 41 42
+6 -8
arch/cris/arch-v10/lib/hw_settings.S
··· 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) | \ ··· 13 15 #define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \ 14 16 (CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \ 15 17 (CONFIG_ETRAX_DEF_R_PORT_PB_DATA)) 16 - 18 + 17 19 .ascii "HW_PARAM_MAGIC" ; Magic number 18 20 .dword 0xc0004000 ; Kernel start address 19 21 20 22 ; Debug port 21 23 #ifdef CONFIG_ETRAX_DEBUG_PORT0 22 - .dword 0 24 + .dword 0 23 25 #elif defined(CONFIG_ETRAX_DEBUG_PORT1) 24 26 .dword 1 25 27 #elif defined(CONFIG_ETRAX_DEBUG_PORT2) ··· 28 30 .dword 3 29 31 #else 30 32 .dword 4 ; No debug 31 - #endif 33 + #endif 32 34 33 35 ; SDRAM or EDO DRAM? 34 36 #ifdef CONFIG_ETRAX_SDRAM ··· 37 39 .dword 0 38 40 #endif 39 41 40 - ; Register values 42 + ; Register values 41 43 .dword R_WAITSTATES 42 44 .dword CONFIG_ETRAX_DEF_R_WAITSTATES 43 45 .dword R_BUS_CONFIG ··· 54 56 .dword CONFIG_ETRAX_DEF_R_DRAM_TIMING 55 57 #endif 56 58 .dword R_PORT_PA_SET 57 - .dword PA_SET_VALUE 59 + .dword PA_SET_VALUE 58 60 .dword R_PORT_PB_SET 59 61 .dword PB_SET_VALUE 60 62 .dword 0 ; No more register values
+1 -15
arch/cris/arch-v32/drivers/Kconfig
··· 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 - 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 366 381 367 config ETRAX_SYNCHRONOUS_SERIAL 382 368 bool "Synchronous serial-port support"
+14 -8
arch/cris/arch-v32/drivers/i2c.c
··· 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 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; ··· 679 675 D(printk("i2cr %d %d ", 680 676 I2C_ARGSLAVE(arg), 681 677 I2C_ARGREG(arg))); 678 + lock_kernel(); 682 679 val = i2c_readreg(I2C_ARGSLAVE(arg), I2C_ARGREG(arg)); 680 + unlock_kernel(); 683 681 D(printk("= %d\n", val)); 684 682 return val; 685 683 } ··· 694 688 } 695 689 696 690 static const struct file_operations i2c_fops = { 697 - .owner = THIS_MODULE, 698 - .ioctl = i2c_ioctl, 699 - .open = i2c_open, 700 - .release = i2c_release, 691 + .owner = THIS_MODULE, 692 + .unlocked_ioctl = i2c_ioctl, 693 + .open = i2c_open, 694 + .release = i2c_release, 701 695 }; 702 696 703 697 static int __init i2c_init(void)
+16 -5
arch/cris/arch-v32/drivers/pcf8563.c
··· 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> ··· 50 49 static const unsigned char days_in_month[] = 51 50 { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 52 51 53 - int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); 52 + static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); 54 53 55 54 /* Cache VL bit value read at driver init since writing the RTC_SECOND 56 55 * register clears the VL status. ··· 58 57 static int voltage_low; 59 58 60 59 static const struct file_operations pcf8563_fops = { 61 - .owner = THIS_MODULE, 62 - .ioctl = pcf8563_ioctl 60 + .owner = THIS_MODULE, 61 + .unlocked_ioctl = pcf8563_unlocked_ioctl, 63 62 }; 64 63 65 64 unsigned char ··· 209 208 * ioctl calls for this driver. Why return -ENOTTY upon error? Because 210 209 * POSIX says so! 211 210 */ 212 - int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 213 - unsigned long arg) 211 + static int pcf8563_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 214 212 { 215 213 /* Some sanity checks. */ 216 214 if (_IOC_TYPE(cmd) != RTC_MAGIC) ··· 333 333 } 334 334 335 335 return 0; 336 + } 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; 336 347 } 337 348 338 349 static int __init pcf8563_register(void)
+2 -2
arch/cris/arch-v32/kernel/crisksyms.c
··· 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);
+6 -8
arch/cris/arch-v32/kernel/irq.c
··· 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 ··· 288 289 block_irq(irq, cpu); 289 290 } 290 291 291 - void 292 - unmask_irq(int irq) 292 + void crisv32_unmask_irq(int irq) 293 293 { 294 294 unblock_irq(irq, irq_cpu(irq)); 295 295 } ··· 296 298 297 299 static unsigned int startup_crisv32_irq(unsigned int irq) 298 300 { 299 - unmask_irq(irq); 301 + crisv32_unmask_irq(irq); 300 302 return 0; 301 303 } 302 304 303 305 static void shutdown_crisv32_irq(unsigned int irq) 304 306 { 305 - mask_irq(irq); 307 + crisv32_mask_irq(irq); 306 308 } 307 309 308 310 static void enable_crisv32_irq(unsigned int irq) 309 311 { 310 - unmask_irq(irq); 312 + crisv32_unmask_irq(irq); 311 313 } 312 314 313 315 static void disable_crisv32_irq(unsigned int irq) 314 316 { 315 - mask_irq(irq); 317 + crisv32_mask_irq(irq); 316 318 } 317 319 318 320 static void ack_crisv32_irq(unsigned int irq)
+2 -2
arch/cris/arch-v32/kernel/smp.c
··· 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();
+5 -4
arch/cris/include/arch-v10/arch/irq.h
··· 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)
+2 -2
arch/cris/include/arch-v32/arch/irq.h
··· 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
+2 -15
arch/cris/include/asm/param.h
··· 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 8 + #include <asm-generic/param.h> 20 9 21 - #define MAXHOSTNAMELEN 64 /* max length of hostname */ 22 - 23 - #endif 10 + #endif /* _ASMCRIS_PARAM_H */