Magellan Linux

Contents of /trunk/kernel26-alx/patches-2.6.27-r3/0134-2.6.27.35-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1176 - (show annotations) (download)
Thu Oct 14 15:11:06 2010 UTC (14 years ago) by niro
File size: 16308 byte(s)
-2.6.27-alx-r3: new magellan 0.5.2 kernel
1 diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
2 index c2df53c..cd1f704 100644
3 --- a/arch/powerpc/include/asm/mmu-hash64.h
4 +++ b/arch/powerpc/include/asm/mmu-hash64.h
5 @@ -41,6 +41,7 @@ extern char initial_stab[];
6
7 #define SLB_NUM_BOLTED 3
8 #define SLB_CACHE_ENTRIES 8
9 +#define SLB_MIN_SIZE 32
10
11 /* Bits in the SLB ESID word */
12 #define SLB_ESID_V ASM_CONST(0x0000000008000000) /* valid */
13 @@ -299,6 +300,7 @@ extern void slb_flush_and_rebolt(void);
14 extern void stab_initialize(unsigned long stab);
15
16 extern void slb_vmalloc_update(void);
17 +extern void slb_set_size(u16 size);
18 #endif /* __ASSEMBLY__ */
19
20 /*
21 diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
22 index b3eef30..c729910 100644
23 --- a/arch/powerpc/kernel/lparcfg.c
24 +++ b/arch/powerpc/kernel/lparcfg.c
25 @@ -35,6 +35,7 @@
26 #include <asm/prom.h>
27 #include <asm/vdso_datapage.h>
28 #include <asm/vio.h>
29 +#include <asm/mmu.h>
30
31 #define MODULE_VERS "1.8"
32 #define MODULE_NAME "lparcfg"
33 @@ -485,6 +486,8 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
34
35 seq_printf(m, "shared_processor_mode=%d\n", lppaca[0].shared_proc);
36
37 + seq_printf(m, "slb_size=%d\n", mmu_slb_size);
38 +
39 return 0;
40 }
41
42 diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
43 index 1f8505c..49e6d91 100644
44 --- a/arch/powerpc/kernel/rtas.c
45 +++ b/arch/powerpc/kernel/rtas.c
46 @@ -38,6 +38,7 @@
47 #include <asm/syscalls.h>
48 #include <asm/smp.h>
49 #include <asm/atomic.h>
50 +#include <asm/mmu.h>
51
52 struct rtas_t rtas = {
53 .lock = SPIN_LOCK_UNLOCKED
54 @@ -665,6 +666,7 @@ static void rtas_percpu_suspend_me(void *info)
55 {
56 long rc;
57 unsigned long msr_save;
58 + u16 slb_size = mmu_slb_size;
59 int cpu;
60 struct rtas_suspend_me_data *data =
61 (struct rtas_suspend_me_data *)info;
62 @@ -686,13 +688,16 @@ static void rtas_percpu_suspend_me(void *info)
63 /* All other cpus are in H_JOIN, this cpu does
64 * the suspend.
65 */
66 + slb_set_size(SLB_MIN_SIZE);
67 printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n",
68 smp_processor_id());
69 data->error = rtas_call(data->token, 0, 1, NULL);
70
71 - if (data->error)
72 + if (data->error) {
73 printk(KERN_DEBUG "ibm,suspend-me returned %d\n",
74 data->error);
75 + slb_set_size(slb_size);
76 + }
77 } else {
78 printk(KERN_ERR "H_JOIN on cpu %i failed with rc = %ld\n",
79 smp_processor_id(), rc);
80 diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
81 index 89497fb..4d73765 100644
82 --- a/arch/powerpc/mm/slb.c
83 +++ b/arch/powerpc/mm/slb.c
84 @@ -247,14 +247,22 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
85 static inline void patch_slb_encoding(unsigned int *insn_addr,
86 unsigned int immed)
87 {
88 - /* Assume the instruction had a "0" immediate value, just
89 - * "or" in the new value
90 - */
91 - *insn_addr |= immed;
92 + *insn_addr = (*insn_addr & 0xffff0000) | immed;
93 flush_icache_range((unsigned long)insn_addr, 4+
94 (unsigned long)insn_addr);
95 }
96
97 +void slb_set_size(u16 size)
98 +{
99 + extern unsigned int *slb_compare_rr_to_size;
100 +
101 + if (mmu_slb_size == size)
102 + return;
103 +
104 + mmu_slb_size = size;
105 + patch_slb_encoding(slb_compare_rr_to_size, mmu_slb_size);
106 +}
107 +
108 void slb_initialize(void)
109 {
110 unsigned long linear_llp, vmalloc_llp, io_llp;
111 diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
112 index 7637bd3..e67e18d 100644
113 --- a/arch/powerpc/platforms/pseries/reconfig.c
114 +++ b/arch/powerpc/platforms/pseries/reconfig.c
115 @@ -20,6 +20,7 @@
116 #include <asm/machdep.h>
117 #include <asm/uaccess.h>
118 #include <asm/pSeries_reconfig.h>
119 +#include <asm/mmu.h>
120
121
122
123 @@ -439,9 +440,15 @@ static int do_update_property(char *buf, size_t bufsize)
124 if (!newprop)
125 return -ENOMEM;
126
127 + if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size"))
128 + slb_set_size(*(int *)value);
129 +
130 oldprop = of_find_property(np, name,NULL);
131 - if (!oldprop)
132 + if (!oldprop) {
133 + if (strlen(name))
134 + return prom_add_property(np, newprop);
135 return -ENODEV;
136 + }
137
138 rc = prom_update_property(np, newprop, oldprop);
139 if (rc)
140 diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
141 index 2bcf350..5cdd821 100644
142 --- a/drivers/ata/libata-core.c
143 +++ b/drivers/ata/libata-core.c
144 @@ -565,7 +565,13 @@ u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev)
145 head = tf->device & 0xf;
146 sect = tf->lbal;
147
148 - block = (cyl * dev->heads + head) * dev->sectors + sect;
149 + if (!sect) {
150 + ata_dev_printk(dev, KERN_WARNING, "device reported "
151 + "invalid CHS sector 0\n");
152 + sect = 1; /* oh well */
153 + }
154 +
155 + block = (cyl * dev->heads + head) * dev->sectors + sect - 1;
156 }
157
158 return block;
159 diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
160 index ed1879c..4180b55 100644
161 --- a/drivers/char/tpm/tpm_tis.c
162 +++ b/drivers/char/tpm/tpm_tis.c
163 @@ -450,6 +450,12 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
164 goto out_err;
165 }
166
167 + /* Default timeouts */
168 + chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
169 + chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
170 + chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
171 + chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
172 +
173 if (request_locality(chip, 0) != 0) {
174 rc = -ENODEV;
175 goto out_err;
176 @@ -457,12 +463,6 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
177
178 vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
179
180 - /* Default timeouts */
181 - chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
182 - chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
183 - chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
184 - chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
185 -
186 dev_info(dev,
187 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
188 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
189 diff --git a/drivers/ps3/ps3stor_lib.c b/drivers/ps3/ps3stor_lib.c
190 index 55955f1..40169a1 100644
191 --- a/drivers/ps3/ps3stor_lib.c
192 +++ b/drivers/ps3/ps3stor_lib.c
193 @@ -23,6 +23,65 @@
194 #include <asm/lv1call.h>
195 #include <asm/ps3stor.h>
196
197 +/*
198 + * A workaround for flash memory I/O errors when the internal hard disk
199 + * has not been formatted for OtherOS use. Delay disk close until flash
200 + * memory is closed.
201 + */
202 +
203 +static struct ps3_flash_workaround {
204 + int flash_open;
205 + int disk_open;
206 + struct ps3_system_bus_device *disk_sbd;
207 +} ps3_flash_workaround;
208 +
209 +static int ps3stor_open_hv_device(struct ps3_system_bus_device *sbd)
210 +{
211 + int error = ps3_open_hv_device(sbd);
212 +
213 + if (error)
214 + return error;
215 +
216 + if (sbd->match_id == PS3_MATCH_ID_STOR_FLASH)
217 + ps3_flash_workaround.flash_open = 1;
218 +
219 + if (sbd->match_id == PS3_MATCH_ID_STOR_DISK)
220 + ps3_flash_workaround.disk_open = 1;
221 +
222 + return 0;
223 +}
224 +
225 +static int ps3stor_close_hv_device(struct ps3_system_bus_device *sbd)
226 +{
227 + int error;
228 +
229 + if (sbd->match_id == PS3_MATCH_ID_STOR_DISK
230 + && ps3_flash_workaround.disk_open
231 + && ps3_flash_workaround.flash_open) {
232 + ps3_flash_workaround.disk_sbd = sbd;
233 + return 0;
234 + }
235 +
236 + error = ps3_close_hv_device(sbd);
237 +
238 + if (error)
239 + return error;
240 +
241 + if (sbd->match_id == PS3_MATCH_ID_STOR_DISK)
242 + ps3_flash_workaround.disk_open = 0;
243 +
244 + if (sbd->match_id == PS3_MATCH_ID_STOR_FLASH) {
245 + ps3_flash_workaround.flash_open = 0;
246 +
247 + if (ps3_flash_workaround.disk_sbd) {
248 + ps3_close_hv_device(ps3_flash_workaround.disk_sbd);
249 + ps3_flash_workaround.disk_open = 0;
250 + ps3_flash_workaround.disk_sbd = NULL;
251 + }
252 + }
253 +
254 + return 0;
255 +}
256
257 static int ps3stor_probe_access(struct ps3_storage_device *dev)
258 {
259 @@ -90,7 +149,7 @@ int ps3stor_setup(struct ps3_storage_device *dev, irq_handler_t handler)
260 int error, res, alignment;
261 enum ps3_dma_page_size page_size;
262
263 - error = ps3_open_hv_device(&dev->sbd);
264 + error = ps3stor_open_hv_device(&dev->sbd);
265 if (error) {
266 dev_err(&dev->sbd.core,
267 "%s:%u: ps3_open_hv_device failed %d\n", __func__,
268 @@ -166,7 +225,7 @@ fail_free_irq:
269 fail_sb_event_receive_port_destroy:
270 ps3_sb_event_receive_port_destroy(&dev->sbd, dev->irq);
271 fail_close_device:
272 - ps3_close_hv_device(&dev->sbd);
273 + ps3stor_close_hv_device(&dev->sbd);
274 fail:
275 return error;
276 }
277 @@ -193,7 +252,7 @@ void ps3stor_teardown(struct ps3_storage_device *dev)
278 "%s:%u: destroy event receive port failed %d\n",
279 __func__, __LINE__, error);
280
281 - error = ps3_close_hv_device(&dev->sbd);
282 + error = ps3stor_close_hv_device(&dev->sbd);
283 if (error)
284 dev_err(&dev->sbd.core,
285 "%s:%u: ps3_close_hv_device failed %d\n", __func__,
286 diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
287 index a6f8b8f..e012475 100644
288 --- a/fs/binfmt_elf.c
289 +++ b/fs/binfmt_elf.c
290 @@ -496,22 +496,22 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
291 }
292 }
293
294 - /*
295 - * Now fill out the bss section. First pad the last page up
296 - * to the page boundary, and then perform a mmap to make sure
297 - * that there are zero-mapped pages up to and including the
298 - * last bss page.
299 - */
300 - if (padzero(elf_bss)) {
301 - error = -EFAULT;
302 - goto out_close;
303 - }
304 + if (last_bss > elf_bss) {
305 + /*
306 + * Now fill out the bss section. First pad the last page up
307 + * to the page boundary, and then perform a mmap to make sure
308 + * that there are zero-mapped pages up to and including the
309 + * last bss page.
310 + */
311 + if (padzero(elf_bss)) {
312 + error = -EFAULT;
313 + goto out_close;
314 + }
315
316 - /* What we have mapped so far */
317 - elf_bss = ELF_PAGESTART(elf_bss + ELF_MIN_ALIGN - 1);
318 + /* What we have mapped so far */
319 + elf_bss = ELF_PAGESTART(elf_bss + ELF_MIN_ALIGN - 1);
320
321 - /* Map the last of the bss segment */
322 - if (last_bss > elf_bss) {
323 + /* Map the last of the bss segment */
324 down_write(&current->mm->mmap_sem);
325 error = do_brk(elf_bss, last_bss - elf_bss);
326 up_write(&current->mm->mmap_sem);
327 diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
328 index 4d617ea..988530d 100644
329 --- a/fs/nfsd/nfs3proc.c
330 +++ b/fs/nfsd/nfs3proc.c
331 @@ -201,6 +201,7 @@ nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
332 struct nfsd3_writeres *resp)
333 {
334 __be32 nfserr;
335 + unsigned long cnt = argp->len;
336
337 dprintk("nfsd: WRITE(3) %s %d bytes at %ld%s\n",
338 SVCFH_fmt(&argp->fh),
339 @@ -213,9 +214,9 @@ nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
340 nfserr = nfsd_write(rqstp, &resp->fh, NULL,
341 argp->offset,
342 rqstp->rq_vec, argp->vlen,
343 - argp->len,
344 + &cnt,
345 &resp->committed);
346 - resp->count = argp->count;
347 + resp->count = cnt;
348 RETURN_STATUS(nfserr);
349 }
350
351 diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
352 index e5b51ff..fddc656 100644
353 --- a/fs/nfsd/nfs4proc.c
354 +++ b/fs/nfsd/nfs4proc.c
355 @@ -685,6 +685,7 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
356 struct file *filp = NULL;
357 u32 *p;
358 __be32 status = nfs_ok;
359 + unsigned long cnt;
360
361 /* no need to check permission - this will be done in nfsd_write() */
362
363 @@ -703,7 +704,7 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
364 return status;
365 }
366
367 - write->wr_bytes_written = write->wr_buflen;
368 + cnt = write->wr_buflen;
369 write->wr_how_written = write->wr_stable_how;
370 p = (u32 *)write->wr_verifier.data;
371 *p++ = nfssvc_boot.tv_sec;
372 @@ -711,10 +712,12 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
373
374 status = nfsd_write(rqstp, &cstate->current_fh, filp,
375 write->wr_offset, rqstp->rq_vec, write->wr_vlen,
376 - write->wr_buflen, &write->wr_how_written);
377 + &cnt, &write->wr_how_written);
378 if (filp)
379 fput(filp);
380
381 + write->wr_bytes_written = cnt;
382 +
383 if (status == nfserr_symlink)
384 status = nfserr_inval;
385 return status;
386 diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
387 index 0766f95..20c63b2 100644
388 --- a/fs/nfsd/nfsproc.c
389 +++ b/fs/nfsd/nfsproc.c
390 @@ -179,6 +179,7 @@ nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
391 {
392 __be32 nfserr;
393 int stable = 1;
394 + unsigned long cnt = argp->len;
395
396 dprintk("nfsd: WRITE %s %d bytes at %d\n",
397 SVCFH_fmt(&argp->fh),
398 @@ -187,7 +188,7 @@ nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
399 nfserr = nfsd_write(rqstp, fh_copy(&resp->fh, &argp->fh), NULL,
400 argp->offset,
401 rqstp->rq_vec, argp->vlen,
402 - argp->len,
403 + &cnt,
404 &stable);
405 return nfsd_return_attrs(nfserr, resp);
406 }
407 diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
408 index 18060be..ac31e0c 100644
409 --- a/fs/nfsd/vfs.c
410 +++ b/fs/nfsd/vfs.c
411 @@ -957,7 +957,7 @@ static void kill_suid(struct dentry *dentry)
412 static __be32
413 nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
414 loff_t offset, struct kvec *vec, int vlen,
415 - unsigned long cnt, int *stablep)
416 + unsigned long *cnt, int *stablep)
417 {
418 struct svc_export *exp;
419 struct dentry *dentry;
420 @@ -971,7 +971,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
421 err = nfserr_perm;
422
423 if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
424 - (!lock_may_write(file->f_path.dentry->d_inode, offset, cnt)))
425 + (!lock_may_write(file->f_path.dentry->d_inode, offset, *cnt)))
426 goto out;
427 #endif
428
429 @@ -1003,7 +1003,8 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
430 host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset);
431 set_fs(oldfs);
432 if (host_err >= 0) {
433 - nfsdstats.io_write += cnt;
434 + *cnt = host_err;
435 + nfsdstats.io_write += host_err;
436 fsnotify_modify(file->f_path.dentry);
437 }
438
439 @@ -1050,7 +1051,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
440 dprintk("nfsd: write complete host_err=%d\n", host_err);
441 if (host_err >= 0)
442 err = 0;
443 - else
444 + else
445 err = nfserrno(host_err);
446 out:
447 return err;
448 @@ -1092,7 +1093,7 @@ out:
449 */
450 __be32
451 nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
452 - loff_t offset, struct kvec *vec, int vlen, unsigned long cnt,
453 + loff_t offset, struct kvec *vec, int vlen, unsigned long *cnt,
454 int *stablep)
455 {
456 __be32 err = 0;
457 diff --git a/fs/udf/lowlevel.c b/fs/udf/lowlevel.c
458 index 703843f..1b88fd5 100644
459 --- a/fs/udf/lowlevel.c
460 +++ b/fs/udf/lowlevel.c
461 @@ -56,7 +56,12 @@ unsigned long udf_get_last_block(struct super_block *sb)
462 struct block_device *bdev = sb->s_bdev;
463 unsigned long lblock = 0;
464
465 - if (ioctl_by_bdev(bdev, CDROM_LAST_WRITTEN, (unsigned long) &lblock))
466 + /*
467 + * ioctl failed or returned obviously bogus value?
468 + * Try using the device size...
469 + */
470 + if (ioctl_by_bdev(bdev, CDROM_LAST_WRITTEN, (unsigned long) &lblock) ||
471 + lblock == 0)
472 lblock = bdev->bd_inode->i_size >> sb->s_blocksize_bits;
473
474 if (lblock)
475 diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
476 index 108f47e..9af9bca 100644
477 --- a/include/linux/nfsd/nfsd.h
478 +++ b/include/linux/nfsd/nfsd.h
479 @@ -105,7 +105,7 @@ void nfsd_close(struct file *);
480 __be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *,
481 loff_t, struct kvec *, int, unsigned long *);
482 __be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
483 - loff_t, struct kvec *,int, unsigned long, int *);
484 + loff_t, struct kvec *,int, unsigned long *, int *);
485 __be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *,
486 char *, int *);
487 __be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *,
488 diff --git a/sound/pci/cs46xx/cs46xx_lib.h b/sound/pci/cs46xx/cs46xx_lib.h
489 index 018a7de..ba12825 100644
490 --- a/sound/pci/cs46xx/cs46xx_lib.h
491 +++ b/sound/pci/cs46xx/cs46xx_lib.h
492 @@ -35,7 +35,7 @@
493
494
495 #ifdef CONFIG_SND_CS46XX_NEW_DSP
496 -#define CS46XX_MIN_PERIOD_SIZE 1
497 +#define CS46XX_MIN_PERIOD_SIZE 64
498 #define CS46XX_MAX_PERIOD_SIZE 1024*1024
499 #else
500 #define CS46XX_MIN_PERIOD_SIZE 2048
501 diff --git a/sound/pci/oxygen/oxygen_io.c b/sound/pci/oxygen/oxygen_io.c
502 index 83f135f..6ebd2f3 100644
503 --- a/sound/pci/oxygen/oxygen_io.c
504 +++ b/sound/pci/oxygen/oxygen_io.c
505 @@ -214,17 +214,8 @@ EXPORT_SYMBOL(oxygen_write_spi);
506
507 void oxygen_write_i2c(struct oxygen *chip, u8 device, u8 map, u8 data)
508 {
509 - unsigned long timeout;
510 -
511 /* should not need more than about 300 us */
512 - timeout = jiffies + msecs_to_jiffies(1);
513 - do {
514 - if (!(oxygen_read16(chip, OXYGEN_2WIRE_BUS_STATUS)
515 - & OXYGEN_2WIRE_BUSY))
516 - break;
517 - udelay(1);
518 - cond_resched();
519 - } while (time_after_eq(timeout, jiffies));
520 + msleep(1);
521
522 oxygen_write8(chip, OXYGEN_2WIRE_MAP, map);
523 oxygen_write8(chip, OXYGEN_2WIRE_DATA, data);