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

Merge master.kernel.org:/pub/scm/linux/kernel/git/willy/parisc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/willy/parisc-2.6:
[PA-RISC] Fix time.c for new do_timer() calling convention
[PA-RISC] Fix must_check warnings in drivers.c
[PA-RISC] Fix parisc_newuname()
[PA-RISC] Remove warning from pci.c
[PA-RISC] Fix filldir warnings
[PA-RISC] Fix sys32_sysctl
[PA-RISC] Fix sba_iommu compilation

+58 -56
+1 -1
arch/parisc/hpux/fs.c
··· 73 73 #define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1)) 74 74 75 75 static int filldir(void * __buf, const char * name, int namlen, loff_t offset, 76 - ino_t ino, unsigned d_type) 76 + u64 ino, unsigned d_type) 77 77 { 78 78 struct hpux_dirent * dirent; 79 79 struct getdents_callback * buf = (struct getdents_callback *) __buf;
+8 -3
arch/parisc/kernel/drivers.c
··· 424 424 /* make the generic dma mask a pointer to the parisc one */ 425 425 dev->dev.dma_mask = &dev->dma_mask; 426 426 dev->dev.coherent_dma_mask = dev->dma_mask; 427 - device_register(&dev->dev); 427 + if (!device_register(&dev->dev)) { 428 + kfree(dev); 429 + return NULL; 430 + } 428 431 429 432 return dev; 430 433 } ··· 853 850 */ 854 851 void init_parisc_bus(void) 855 852 { 856 - bus_register(&parisc_bus_type); 857 - device_register(&root); 853 + if (!bus_register(&parisc_bus_type)) 854 + panic("Could not register PA-RISC bus type\n"); 855 + if (!device_register(&root)) 856 + panic("Could not register PA-RISC root device\n"); 858 857 get_device(&root); 859 858 } 860 859
+1 -1
arch/parisc/kernel/pci.c
··· 290 290 void pcibios_align_resource(void *data, struct resource *res, 291 291 resource_size_t size, resource_size_t alignment) 292 292 { 293 - unsigned long mask, align; 293 + resource_size_t mask, align; 294 294 295 295 DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n", 296 296 pci_name(((struct pci_dev *) data)),
+10 -23
arch/parisc/kernel/sys_parisc.c
··· 266 266 return err; 267 267 } 268 268 269 - static inline int override_machine(char __user *mach) { 270 - #ifdef CONFIG_COMPAT 271 - if (personality(current->personality) == PER_LINUX32) { 272 - if (__put_user(0, mach + 6) || 273 - __put_user(0, mach + 7)) 274 - return -EFAULT; 275 - } 276 - 277 - return 0; 278 - #else /*!CONFIG_COMPAT*/ 279 - return 0; 280 - #endif /*CONFIG_COMPAT*/ 281 - } 282 - 283 - long parisc_newuname(struct new_utsname __user *utsname) 269 + long parisc_newuname(struct new_utsname __user *name) 284 270 { 285 - int err = 0; 271 + int err = sys_newuname(name); 286 272 287 - down_read(&uts_sem); 288 - if (copy_to_user(utsname, &system_utsname, sizeof(*utsname))) 289 - err = -EFAULT; 290 - up_read(&uts_sem); 273 + #ifdef CONFIG_COMPAT 274 + if (!err && personality(current->personality) == PER_LINUX32) { 275 + if (__put_user(0, name->machine + 6) || 276 + __put_user(0, name->machine + 7)) 277 + err = -EFAULT; 278 + } 279 + #endif 291 280 292 - err = override_machine(utsname->machine); 293 - 294 - return (long)err; 281 + return err; 295 282 }
+13 -12
arch/parisc/kernel/sys_parisc32.c
··· 111 111 112 112 asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) 113 113 { 114 + #ifndef CONFIG_SYSCTL_SYSCALL 115 + return -ENOSYS; 116 + #else 114 117 struct __sysctl_args32 tmp; 115 118 int error; 116 119 unsigned int oldlen32; 117 - size_t oldlen, *oldlenp = NULL; 120 + size_t oldlen, __user *oldlenp = NULL; 118 121 unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7; 119 - extern int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp, 120 - void *newval, size_t newlen); 121 122 122 123 DBG(("sysctl32(%p)\n", args)); 123 124 ··· 145 144 } 146 145 147 146 lock_kernel(); 148 - error = do_sysctl((int *)(u64)tmp.name, tmp.nlen, (void *)(u64)tmp.oldval, 149 - oldlenp, (void *)(u64)tmp.newval, tmp.newlen); 147 + error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen, 148 + (void __user *)(u64)tmp.oldval, oldlenp, 149 + (void __user *)(u64)tmp.newval, tmp.newlen); 150 150 unlock_kernel(); 151 151 if (oldlenp) { 152 152 if (!error) { ··· 159 157 error = -EFAULT; 160 158 } 161 159 } 162 - if (copy_to_user(&args->__unused[0], tmp.__unused, sizeof(tmp.__unused))) 160 + if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused))) 163 161 error = -EFAULT; 164 162 } 165 163 return error; 164 + #endif 166 165 } 167 166 168 167 #endif /* CONFIG_SYSCTL */ ··· 313 310 314 311 #define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1))) 315 312 #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) 316 - static int 317 - filldir32 (void *__buf, const char *name, int namlen, loff_t offset, ino_t ino, 318 - unsigned int d_type) 313 + static int filldir32 (void *__buf, const char *name, int namlen, 314 + loff_t offset, u64 ino, unsigned int d_type) 319 315 { 320 316 struct linux32_dirent __user * dirent; 321 317 struct getdents32_callback * buf = (struct getdents32_callback *) __buf; ··· 376 374 return error; 377 375 } 378 376 379 - static int 380 - fillonedir32 (void * __buf, const char * name, int namlen, loff_t offset, ino_t ino, 381 - unsigned int d_type) 377 + static int fillonedir32(void * __buf, const char * name, int namlen, 378 + loff_t offset, u64 ino, unsigned int d_type) 382 379 { 383 380 struct readdir32_callback * buf = (struct readdir32_callback *) __buf; 384 381 struct old_linux32_dirent __user * dirent;
+23 -14
arch/parisc/kernel/time.c
··· 38 38 extern void smp_do_timer(struct pt_regs *regs); 39 39 #endif 40 40 41 + /* 42 + * We keep time on PA-RISC Linux by using the Interval Timer which is 43 + * a pair of registers; one is read-only and one is write-only; both 44 + * accessed through CR16. The read-only register is 32 or 64 bits wide, 45 + * and increments by 1 every CPU clock tick. The architecture only 46 + * guarantees us a rate between 0.5 and 2, but all implementations use a 47 + * rate of 1. The write-only register is 32-bits wide. When the lowest 48 + * 32 bits of the read-only register compare equal to the write-only 49 + * register, it raises a maskable external interrupt. Each processor has 50 + * an Interval Timer of its own and they are not synchronised. 51 + * 52 + * We want to generate an interrupt every 1/HZ seconds. So we program 53 + * CR16 to interrupt every @clocktick cycles. The it_value in cpu_data 54 + * is programmed with the intended time of the next tick. We can be 55 + * held off for an arbitrarily long period of time by interrupts being 56 + * disabled, so we may miss one or more ticks. 57 + */ 41 58 irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 42 59 { 43 60 unsigned long now; 44 61 unsigned long next_tick; 45 - unsigned long cycles_elapsed; 62 + unsigned long cycles_elapsed, ticks_elapsed; 46 63 unsigned long cycles_remainder; 47 64 unsigned int cpu = smp_processor_id(); 48 65 ··· 84 67 * of the more expensive div/mul method 85 68 */ 86 69 cycles_remainder = cycles_elapsed; 70 + ticks_elapsed = 1; 87 71 while (cycles_remainder > cpt) { 88 72 cycles_remainder -= cpt; 73 + ticks_elapsed++; 89 74 } 90 75 } else { 91 76 cycles_remainder = cycles_elapsed % cpt; 77 + ticks_elapsed = 1 + cycles_elapsed / cpt; 92 78 } 93 79 94 80 /* Can we differentiate between "early CR16" (aka Scenario 1) and ··· 101 81 * cycles after the IT fires. But it's arbitrary how much time passes 102 82 * before we call it "late". I've picked one second. 103 83 */ 104 - /* aproximate HZ with shifts. Intended math is "(elapsed/clocktick) > HZ" */ 105 - #if HZ == 1000 106 - if (cycles_elapsed > (cpt << 10) ) 107 - #elif HZ == 250 108 - if (cycles_elapsed > (cpt << 8) ) 109 - #elif HZ == 100 110 - if (cycles_elapsed > (cpt << 7) ) 111 - #else 112 - #warn WTF is HZ set to anyway? 113 - if (cycles_elapsed > (HZ * cpt) ) 114 - #endif 115 - { 84 + if (ticks_elapsed > HZ) { 116 85 /* Scenario 3: very long delay? bad in any case */ 117 86 printk (KERN_CRIT "timer_interrupt(CPU %d): delayed!" 118 87 " cycles %lX rem %lX " ··· 145 136 #endif 146 137 if (cpu == 0) { 147 138 write_seqlock(&xtime_lock); 148 - do_timer(regs); 139 + do_timer(ticks_elapsed); 149 140 write_sequnlock(&xtime_lock); 150 141 } 151 142
+2 -2
drivers/parisc/sba_iommu.c
··· 1320 1320 ** the GART code to handshake on. 1321 1321 */ 1322 1322 klist_iter_init(&sba->dev.klist_children, &i); 1323 - while (dev = next_device(&i)) { 1323 + while ((dev = next_device(&i))) { 1324 1324 struct parisc_device *lba = to_parisc_device(dev); 1325 1325 if (IS_QUICKSILVER(lba)) 1326 1326 agp_found = 1; 1327 1327 } 1328 - klist_iter_exit(&sba->dev.klist_children, &i); 1328 + klist_iter_exit(&i); 1329 1329 1330 1330 if (agp_found && sba_reserve_agpgart) { 1331 1331 printk(KERN_INFO "%s: reserving %dMb of IOVA space for agpgart\n",