diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 22:08:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 22:08:13 -0400 |
commit | 4b8447184ae85de4ce710e5f561fbaada21b8394 (patch) | |
tree | 71aed2c654a6d8d83beff480bc84d9e63b366858 | |
parent | a43cdf08a1b1ab3c013059b5fa4c1b7561e53cb7 (diff) | |
parent | 1604f31895dcdb42edf6511ce7ef0546ff92c8e5 (diff) |
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
-rw-r--r-- | arch/parisc/hpux/fs.c | 2 | ||||
-rw-r--r-- | arch/parisc/kernel/drivers.c | 11 | ||||
-rw-r--r-- | arch/parisc/kernel/pci.c | 2 | ||||
-rw-r--r-- | arch/parisc/kernel/sys_parisc.c | 33 | ||||
-rw-r--r-- | arch/parisc/kernel/sys_parisc32.c | 25 | ||||
-rw-r--r-- | arch/parisc/kernel/time.c | 37 | ||||
-rw-r--r-- | drivers/parisc/sba_iommu.c | 4 |
7 files changed, 58 insertions, 56 deletions
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index 2d58b92b57e3..4204cd1f3cf9 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c | |||
@@ -73,7 +73,7 @@ struct getdents_callback { | |||
73 | #define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1)) | 73 | #define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1)) |
74 | 74 | ||
75 | static int filldir(void * __buf, const char * name, int namlen, loff_t offset, | 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 | struct hpux_dirent * dirent; | 78 | struct hpux_dirent * dirent; |
79 | struct getdents_callback * buf = (struct getdents_callback *) __buf; | 79 | struct getdents_callback * buf = (struct getdents_callback *) __buf; |
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c index 3d569a485a1a..2b257e4f17df 100644 --- a/arch/parisc/kernel/drivers.c +++ b/arch/parisc/kernel/drivers.c | |||
@@ -424,7 +424,10 @@ struct parisc_device * create_tree_node(char id, struct device *parent) | |||
424 | /* make the generic dma mask a pointer to the parisc one */ | 424 | /* make the generic dma mask a pointer to the parisc one */ |
425 | dev->dev.dma_mask = &dev->dma_mask; | 425 | dev->dev.dma_mask = &dev->dma_mask; |
426 | dev->dev.coherent_dma_mask = dev->dma_mask; | 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 | return dev; | 432 | return dev; |
430 | } | 433 | } |
@@ -850,8 +853,10 @@ static void print_parisc_device(struct parisc_device *dev) | |||
850 | */ | 853 | */ |
851 | void init_parisc_bus(void) | 854 | void init_parisc_bus(void) |
852 | { | 855 | { |
853 | bus_register(&parisc_bus_type); | 856 | if (!bus_register(&parisc_bus_type)) |
854 | device_register(&root); | 857 | panic("Could not register PA-RISC bus type\n"); |
858 | if (!device_register(&root)) | ||
859 | panic("Could not register PA-RISC root device\n"); | ||
855 | get_device(&root); | 860 | get_device(&root); |
856 | } | 861 | } |
857 | 862 | ||
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index d3b8fc52dfc1..199887a61c76 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c | |||
@@ -290,7 +290,7 @@ EXPORT_SYMBOL(pcibios_bus_to_resource); | |||
290 | void pcibios_align_resource(void *data, struct resource *res, | 290 | void pcibios_align_resource(void *data, struct resource *res, |
291 | resource_size_t size, resource_size_t alignment) | 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 | DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n", | 295 | DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n", |
296 | pci_name(((struct pci_dev *) data)), | 296 | pci_name(((struct pci_dev *) data)), |
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c index 1db5588ceacf..512642d8f707 100644 --- a/arch/parisc/kernel/sys_parisc.c +++ b/arch/parisc/kernel/sys_parisc.c | |||
@@ -266,30 +266,17 @@ long parisc_personality(unsigned long personality) | |||
266 | return err; | 266 | return err; |
267 | } | 267 | } |
268 | 268 | ||
269 | static inline int override_machine(char __user *mach) { | 269 | long parisc_newuname(struct new_utsname __user *name) |
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) | ||
284 | { | 270 | { |
285 | int err = 0; | 271 | int err = sys_newuname(name); |
286 | 272 | ||
287 | down_read(&uts_sem); | 273 | #ifdef CONFIG_COMPAT |
288 | if (copy_to_user(utsname, &system_utsname, sizeof(*utsname))) | 274 | if (!err && personality(current->personality) == PER_LINUX32) { |
289 | err = -EFAULT; | 275 | if (__put_user(0, name->machine + 6) || |
290 | up_read(&uts_sem); | 276 | __put_user(0, name->machine + 7)) |
291 | 277 | err = -EFAULT; | |
292 | err = override_machine(utsname->machine); | 278 | } |
279 | #endif | ||
293 | 280 | ||
294 | return (long)err; | 281 | return err; |
295 | } | 282 | } |
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index e3b30bc36453..29be4377aca6 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c | |||
@@ -111,13 +111,14 @@ struct __sysctl_args32 { | |||
111 | 111 | ||
112 | asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) | 112 | asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) |
113 | { | 113 | { |
114 | #ifndef CONFIG_SYSCTL_SYSCALL | ||
115 | return -ENOSYS; | ||
116 | #else | ||
114 | struct __sysctl_args32 tmp; | 117 | struct __sysctl_args32 tmp; |
115 | int error; | 118 | int error; |
116 | unsigned int oldlen32; | 119 | unsigned int oldlen32; |
117 | size_t oldlen, *oldlenp = NULL; | 120 | size_t oldlen, __user *oldlenp = NULL; |
118 | unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7; | 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 | DBG(("sysctl32(%p)\n", args)); | 123 | DBG(("sysctl32(%p)\n", args)); |
123 | 124 | ||
@@ -144,8 +145,9 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) | |||
144 | } | 145 | } |
145 | 146 | ||
146 | lock_kernel(); | 147 | lock_kernel(); |
147 | error = do_sysctl((int *)(u64)tmp.name, tmp.nlen, (void *)(u64)tmp.oldval, | 148 | error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen, |
148 | oldlenp, (void *)(u64)tmp.newval, tmp.newlen); | 149 | (void __user *)(u64)tmp.oldval, oldlenp, |
150 | (void __user *)(u64)tmp.newval, tmp.newlen); | ||
149 | unlock_kernel(); | 151 | unlock_kernel(); |
150 | if (oldlenp) { | 152 | if (oldlenp) { |
151 | if (!error) { | 153 | if (!error) { |
@@ -157,10 +159,11 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) | |||
157 | error = -EFAULT; | 159 | error = -EFAULT; |
158 | } | 160 | } |
159 | } | 161 | } |
160 | if (copy_to_user(&args->__unused[0], tmp.__unused, sizeof(tmp.__unused))) | 162 | if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused))) |
161 | error = -EFAULT; | 163 | error = -EFAULT; |
162 | } | 164 | } |
163 | return error; | 165 | return error; |
166 | #endif | ||
164 | } | 167 | } |
165 | 168 | ||
166 | #endif /* CONFIG_SYSCTL */ | 169 | #endif /* CONFIG_SYSCTL */ |
@@ -310,9 +313,8 @@ struct readdir32_callback { | |||
310 | 313 | ||
311 | #define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1))) | 314 | #define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1))) |
312 | #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) | 315 | #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) |
313 | static int | 316 | static int filldir32 (void *__buf, const char *name, int namlen, |
314 | filldir32 (void *__buf, const char *name, int namlen, loff_t offset, ino_t ino, | 317 | loff_t offset, u64 ino, unsigned int d_type) |
315 | unsigned int d_type) | ||
316 | { | 318 | { |
317 | struct linux32_dirent __user * dirent; | 319 | struct linux32_dirent __user * dirent; |
318 | struct getdents32_callback * buf = (struct getdents32_callback *) __buf; | 320 | struct getdents32_callback * buf = (struct getdents32_callback *) __buf; |
@@ -374,9 +376,8 @@ out: | |||
374 | return error; | 376 | return error; |
375 | } | 377 | } |
376 | 378 | ||
377 | static int | 379 | static int fillonedir32(void * __buf, const char * name, int namlen, |
378 | fillonedir32 (void * __buf, const char * name, int namlen, loff_t offset, ino_t ino, | 380 | loff_t offset, u64 ino, unsigned int d_type) |
379 | unsigned int d_type) | ||
380 | { | 381 | { |
381 | struct readdir32_callback * buf = (struct readdir32_callback *) __buf; | 382 | struct readdir32_callback * buf = (struct readdir32_callback *) __buf; |
382 | struct old_linux32_dirent __user * dirent; | 383 | struct old_linux32_dirent __user * dirent; |
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index b3496b592a2d..1d58ce0e37ad 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c | |||
@@ -38,11 +38,28 @@ static unsigned long clocktick __read_mostly; /* timer cycles per tick */ | |||
38 | extern void smp_do_timer(struct pt_regs *regs); | 38 | extern void smp_do_timer(struct pt_regs *regs); |
39 | #endif | 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 | irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 58 | irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
42 | { | 59 | { |
43 | unsigned long now; | 60 | unsigned long now; |
44 | unsigned long next_tick; | 61 | unsigned long next_tick; |
45 | unsigned long cycles_elapsed; | 62 | unsigned long cycles_elapsed, ticks_elapsed; |
46 | unsigned long cycles_remainder; | 63 | unsigned long cycles_remainder; |
47 | unsigned int cpu = smp_processor_id(); | 64 | unsigned int cpu = smp_processor_id(); |
48 | 65 | ||
@@ -67,11 +84,14 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
67 | * of the more expensive div/mul method | 84 | * of the more expensive div/mul method |
68 | */ | 85 | */ |
69 | cycles_remainder = cycles_elapsed; | 86 | cycles_remainder = cycles_elapsed; |
87 | ticks_elapsed = 1; | ||
70 | while (cycles_remainder > cpt) { | 88 | while (cycles_remainder > cpt) { |
71 | cycles_remainder -= cpt; | 89 | cycles_remainder -= cpt; |
90 | ticks_elapsed++; | ||
72 | } | 91 | } |
73 | } else { | 92 | } else { |
74 | cycles_remainder = cycles_elapsed % cpt; | 93 | cycles_remainder = cycles_elapsed % cpt; |
94 | ticks_elapsed = 1 + cycles_elapsed / cpt; | ||
75 | } | 95 | } |
76 | 96 | ||
77 | /* Can we differentiate between "early CR16" (aka Scenario 1) and | 97 | /* Can we differentiate between "early CR16" (aka Scenario 1) and |
@@ -81,18 +101,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
81 | * cycles after the IT fires. But it's arbitrary how much time passes | 101 | * cycles after the IT fires. But it's arbitrary how much time passes |
82 | * before we call it "late". I've picked one second. | 102 | * before we call it "late". I've picked one second. |
83 | */ | 103 | */ |
84 | /* aproximate HZ with shifts. Intended math is "(elapsed/clocktick) > HZ" */ | 104 | if (ticks_elapsed > HZ) { |
85 | #if HZ == 1000 | ||
86 | if (cycles_elapsed > (cpt << 10) ) | ||
87 | #elif HZ == 250 | ||
88 | if (cycles_elapsed > (cpt << 8) ) | ||
89 | #elif HZ == 100 | ||
90 | if (cycles_elapsed > (cpt << 7) ) | ||
91 | #else | ||
92 | #warn WTF is HZ set to anyway? | ||
93 | if (cycles_elapsed > (HZ * cpt) ) | ||
94 | #endif | ||
95 | { | ||
96 | /* Scenario 3: very long delay? bad in any case */ | 105 | /* Scenario 3: very long delay? bad in any case */ |
97 | printk (KERN_CRIT "timer_interrupt(CPU %d): delayed!" | 106 | printk (KERN_CRIT "timer_interrupt(CPU %d): delayed!" |
98 | " cycles %lX rem %lX " | 107 | " cycles %lX rem %lX " |
@@ -136,7 +145,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
136 | #endif | 145 | #endif |
137 | if (cpu == 0) { | 146 | if (cpu == 0) { |
138 | write_seqlock(&xtime_lock); | 147 | write_seqlock(&xtime_lock); |
139 | do_timer(regs); | 148 | do_timer(ticks_elapsed); |
140 | write_sequnlock(&xtime_lock); | 149 | write_sequnlock(&xtime_lock); |
141 | } | 150 | } |
142 | 151 | ||
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 294c1117098d..f1e7ccd5475b 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
@@ -1320,12 +1320,12 @@ sba_ioc_init_pluto(struct parisc_device *sba, struct ioc *ioc, int ioc_num) | |||
1320 | ** the GART code to handshake on. | 1320 | ** the GART code to handshake on. |
1321 | */ | 1321 | */ |
1322 | klist_iter_init(&sba->dev.klist_children, &i); | 1322 | klist_iter_init(&sba->dev.klist_children, &i); |
1323 | while (dev = next_device(&i)) { | 1323 | while ((dev = next_device(&i))) { |
1324 | struct parisc_device *lba = to_parisc_device(dev); | 1324 | struct parisc_device *lba = to_parisc_device(dev); |
1325 | if (IS_QUICKSILVER(lba)) | 1325 | if (IS_QUICKSILVER(lba)) |
1326 | agp_found = 1; | 1326 | agp_found = 1; |
1327 | } | 1327 | } |
1328 | klist_iter_exit(&sba->dev.klist_children, &i); | 1328 | klist_iter_exit(&i); |
1329 | 1329 | ||
1330 | if (agp_found && sba_reserve_agpgart) { | 1330 | if (agp_found && sba_reserve_agpgart) { |
1331 | printk(KERN_INFO "%s: reserving %dMb of IOVA space for agpgart\n", | 1331 | printk(KERN_INFO "%s: reserving %dMb of IOVA space for agpgart\n", |