1 From: Greg Kroah-Hartman <gregkh@suse.de>
2 Subject: Linux 2.6.27.35
4 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 diff --git a/Makefile b/Makefile
7 index 1debf9a..5768979 100644
16 NAME = Trembling Tortoise
19 diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
20 index c2df53c..cd1f704 100644
21 --- a/arch/powerpc/include/asm/mmu-hash64.h
22 +++ b/arch/powerpc/include/asm/mmu-hash64.h
23 @@ -41,6 +41,7 @@ extern char initial_stab[];
25 #define SLB_NUM_BOLTED 3
26 #define SLB_CACHE_ENTRIES 8
27 +#define SLB_MIN_SIZE 32
29 /* Bits in the SLB ESID word */
30 #define SLB_ESID_V ASM_CONST(0x0000000008000000) /* valid */
31 @@ -299,6 +300,7 @@ extern void slb_flush_and_rebolt(void);
32 extern void stab_initialize(unsigned long stab);
34 extern void slb_vmalloc_update(void);
35 +extern void slb_set_size(u16 size);
36 #endif /* __ASSEMBLY__ */
39 diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
40 index b3eef30..c729910 100644
41 --- a/arch/powerpc/kernel/lparcfg.c
42 +++ b/arch/powerpc/kernel/lparcfg.c
45 #include <asm/vdso_datapage.h>
49 #define MODULE_VERS "1.8"
50 #define MODULE_NAME "lparcfg"
51 @@ -485,6 +486,8 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
53 seq_printf(m, "shared_processor_mode=%d\n", lppaca[0].shared_proc);
55 + seq_printf(m, "slb_size=%d\n", mmu_slb_size);
60 diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
61 index 1f8505c..49e6d91 100644
62 --- a/arch/powerpc/kernel/rtas.c
63 +++ b/arch/powerpc/kernel/rtas.c
65 #include <asm/syscalls.h>
67 #include <asm/atomic.h>
70 struct rtas_t rtas = {
71 .lock = SPIN_LOCK_UNLOCKED
72 @@ -665,6 +666,7 @@ static void rtas_percpu_suspend_me(void *info)
75 unsigned long msr_save;
76 + u16 slb_size = mmu_slb_size;
78 struct rtas_suspend_me_data *data =
79 (struct rtas_suspend_me_data *)info;
80 @@ -686,13 +688,16 @@ static void rtas_percpu_suspend_me(void *info)
81 /* All other cpus are in H_JOIN, this cpu does
84 + slb_set_size(SLB_MIN_SIZE);
85 printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n",
87 data->error = rtas_call(data->token, 0, 1, NULL);
91 printk(KERN_DEBUG "ibm,suspend-me returned %d\n",
93 + slb_set_size(slb_size);
96 printk(KERN_ERR "H_JOIN on cpu %i failed with rc = %ld\n",
97 smp_processor_id(), rc);
98 diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
99 index 89497fb..4d73765 100644
100 --- a/arch/powerpc/mm/slb.c
101 +++ b/arch/powerpc/mm/slb.c
102 @@ -247,14 +247,22 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
103 static inline void patch_slb_encoding(unsigned int *insn_addr,
106 - /* Assume the instruction had a "0" immediate value, just
107 - * "or" in the new value
109 - *insn_addr |= immed;
110 + *insn_addr = (*insn_addr & 0xffff0000) | immed;
111 flush_icache_range((unsigned long)insn_addr, 4+
112 (unsigned long)insn_addr);
115 +void slb_set_size(u16 size)
117 + extern unsigned int *slb_compare_rr_to_size;
119 + if (mmu_slb_size == size)
122 + mmu_slb_size = size;
123 + patch_slb_encoding(slb_compare_rr_to_size, mmu_slb_size);
126 void slb_initialize(void)
128 unsigned long linear_llp, vmalloc_llp, io_llp;
129 diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
130 index 7637bd3..e67e18d 100644
131 --- a/arch/powerpc/platforms/pseries/reconfig.c
132 +++ b/arch/powerpc/platforms/pseries/reconfig.c
134 #include <asm/machdep.h>
135 #include <asm/uaccess.h>
136 #include <asm/pSeries_reconfig.h>
137 +#include <asm/mmu.h>
141 @@ -439,9 +440,15 @@ static int do_update_property(char *buf, size_t bufsize)
145 + if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size"))
146 + slb_set_size(*(int *)value);
148 oldprop = of_find_property(np, name,NULL);
152 + return prom_add_property(np, newprop);
156 rc = prom_update_property(np, newprop, oldprop);
158 diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
159 index 2bcf350..5cdd821 100644
160 --- a/drivers/ata/libata-core.c
161 +++ b/drivers/ata/libata-core.c
162 @@ -565,7 +565,13 @@ u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev)
163 head = tf->device & 0xf;
166 - block = (cyl * dev->heads + head) * dev->sectors + sect;
168 + ata_dev_printk(dev, KERN_WARNING, "device reported "
169 + "invalid CHS sector 0\n");
170 + sect = 1; /* oh well */
173 + block = (cyl * dev->heads + head) * dev->sectors + sect - 1;
177 diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
178 index ed1879c..4180b55 100644
179 --- a/drivers/char/tpm/tpm_tis.c
180 +++ b/drivers/char/tpm/tpm_tis.c
181 @@ -450,6 +450,12 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
185 + /* Default timeouts */
186 + chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
187 + chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
188 + chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
189 + chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
191 if (request_locality(chip, 0) != 0) {
194 @@ -457,12 +463,6 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
196 vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
198 - /* Default timeouts */
199 - chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
200 - chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
201 - chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
202 - chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
205 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
206 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
207 diff --git a/drivers/ps3/ps3stor_lib.c b/drivers/ps3/ps3stor_lib.c
208 index 55955f1..40169a1 100644
209 --- a/drivers/ps3/ps3stor_lib.c
210 +++ b/drivers/ps3/ps3stor_lib.c
212 #include <asm/lv1call.h>
213 #include <asm/ps3stor.h>
216 + * A workaround for flash memory I/O errors when the internal hard disk
217 + * has not been formatted for OtherOS use. Delay disk close until flash
218 + * memory is closed.
221 +static struct ps3_flash_workaround {
224 + struct ps3_system_bus_device *disk_sbd;
225 +} ps3_flash_workaround;
227 +static int ps3stor_open_hv_device(struct ps3_system_bus_device *sbd)
229 + int error = ps3_open_hv_device(sbd);
234 + if (sbd->match_id == PS3_MATCH_ID_STOR_FLASH)
235 + ps3_flash_workaround.flash_open = 1;
237 + if (sbd->match_id == PS3_MATCH_ID_STOR_DISK)
238 + ps3_flash_workaround.disk_open = 1;
243 +static int ps3stor_close_hv_device(struct ps3_system_bus_device *sbd)
247 + if (sbd->match_id == PS3_MATCH_ID_STOR_DISK
248 + && ps3_flash_workaround.disk_open
249 + && ps3_flash_workaround.flash_open) {
250 + ps3_flash_workaround.disk_sbd = sbd;
254 + error = ps3_close_hv_device(sbd);
259 + if (sbd->match_id == PS3_MATCH_ID_STOR_DISK)
260 + ps3_flash_workaround.disk_open = 0;
262 + if (sbd->match_id == PS3_MATCH_ID_STOR_FLASH) {
263 + ps3_flash_workaround.flash_open = 0;
265 + if (ps3_flash_workaround.disk_sbd) {
266 + ps3_close_hv_device(ps3_flash_workaround.disk_sbd);
267 + ps3_flash_workaround.disk_open = 0;
268 + ps3_flash_workaround.disk_sbd = NULL;
275 static int ps3stor_probe_access(struct ps3_storage_device *dev)
277 @@ -90,7 +149,7 @@ int ps3stor_setup(struct ps3_storage_device *dev, irq_handler_t handler)
278 int error, res, alignment;
279 enum ps3_dma_page_size page_size;
281 - error = ps3_open_hv_device(&dev->sbd);
282 + error = ps3stor_open_hv_device(&dev->sbd);
284 dev_err(&dev->sbd.core,
285 "%s:%u: ps3_open_hv_device failed %d\n", __func__,
286 @@ -166,7 +225,7 @@ fail_free_irq:
287 fail_sb_event_receive_port_destroy:
288 ps3_sb_event_receive_port_destroy(&dev->sbd, dev->irq);
290 - ps3_close_hv_device(&dev->sbd);
291 + ps3stor_close_hv_device(&dev->sbd);
295 @@ -193,7 +252,7 @@ void ps3stor_teardown(struct ps3_storage_device *dev)
296 "%s:%u: destroy event receive port failed %d\n",
297 __func__, __LINE__, error);
299 - error = ps3_close_hv_device(&dev->sbd);
300 + error = ps3stor_close_hv_device(&dev->sbd);
302 dev_err(&dev->sbd.core,
303 "%s:%u: ps3_close_hv_device failed %d\n", __func__,
304 diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
305 index a6f8b8f..e012475 100644
306 --- a/fs/binfmt_elf.c
307 +++ b/fs/binfmt_elf.c
308 @@ -496,22 +496,22 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex,
313 - * Now fill out the bss section. First pad the last page up
314 - * to the page boundary, and then perform a mmap to make sure
315 - * that there are zero-mapped pages up to and including the
318 - if (padzero(elf_bss)) {
322 + if (last_bss > elf_bss) {
324 + * Now fill out the bss section. First pad the last page up
325 + * to the page boundary, and then perform a mmap to make sure
326 + * that there are zero-mapped pages up to and including the
329 + if (padzero(elf_bss)) {
334 - /* What we have mapped so far */
335 - elf_bss = ELF_PAGESTART(elf_bss + ELF_MIN_ALIGN - 1);
336 + /* What we have mapped so far */
337 + elf_bss = ELF_PAGESTART(elf_bss + ELF_MIN_ALIGN - 1);
339 - /* Map the last of the bss segment */
340 - if (last_bss > elf_bss) {
341 + /* Map the last of the bss segment */
342 down_write(¤t->mm->mmap_sem);
343 error = do_brk(elf_bss, last_bss - elf_bss);
344 up_write(¤t->mm->mmap_sem);
345 diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
346 index 4d617ea..988530d 100644
347 --- a/fs/nfsd/nfs3proc.c
348 +++ b/fs/nfsd/nfs3proc.c
349 @@ -201,6 +201,7 @@ nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
350 struct nfsd3_writeres *resp)
353 + unsigned long cnt = argp->len;
355 dprintk("nfsd: WRITE(3) %s %d bytes at %ld%s\n",
356 SVCFH_fmt(&argp->fh),
357 @@ -213,9 +214,9 @@ nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
358 nfserr = nfsd_write(rqstp, &resp->fh, NULL,
360 rqstp->rq_vec, argp->vlen,
364 - resp->count = argp->count;
366 RETURN_STATUS(nfserr);
369 diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
370 index e5b51ff..fddc656 100644
371 --- a/fs/nfsd/nfs4proc.c
372 +++ b/fs/nfsd/nfs4proc.c
373 @@ -685,6 +685,7 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
374 struct file *filp = NULL;
376 __be32 status = nfs_ok;
379 /* no need to check permission - this will be done in nfsd_write() */
381 @@ -703,7 +704,7 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
385 - write->wr_bytes_written = write->wr_buflen;
386 + cnt = write->wr_buflen;
387 write->wr_how_written = write->wr_stable_how;
388 p = (u32 *)write->wr_verifier.data;
389 *p++ = nfssvc_boot.tv_sec;
390 @@ -711,10 +712,12 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
392 status = nfsd_write(rqstp, &cstate->current_fh, filp,
393 write->wr_offset, rqstp->rq_vec, write->wr_vlen,
394 - write->wr_buflen, &write->wr_how_written);
395 + &cnt, &write->wr_how_written);
399 + write->wr_bytes_written = cnt;
401 if (status == nfserr_symlink)
402 status = nfserr_inval;
404 diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
405 index 0766f95..20c63b2 100644
406 --- a/fs/nfsd/nfsproc.c
407 +++ b/fs/nfsd/nfsproc.c
408 @@ -179,6 +179,7 @@ nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
412 + unsigned long cnt = argp->len;
414 dprintk("nfsd: WRITE %s %d bytes at %d\n",
415 SVCFH_fmt(&argp->fh),
416 @@ -187,7 +188,7 @@ nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
417 nfserr = nfsd_write(rqstp, fh_copy(&resp->fh, &argp->fh), NULL,
419 rqstp->rq_vec, argp->vlen,
423 return nfsd_return_attrs(nfserr, resp);
425 diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
426 index 18060be..ac31e0c 100644
429 @@ -957,7 +957,7 @@ static void kill_suid(struct dentry *dentry)
431 nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
432 loff_t offset, struct kvec *vec, int vlen,
433 - unsigned long cnt, int *stablep)
434 + unsigned long *cnt, int *stablep)
436 struct svc_export *exp;
437 struct dentry *dentry;
438 @@ -971,7 +971,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
441 if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
442 - (!lock_may_write(file->f_path.dentry->d_inode, offset, cnt)))
443 + (!lock_may_write(file->f_path.dentry->d_inode, offset, *cnt)))
447 @@ -1003,7 +1003,8 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
448 host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset);
451 - nfsdstats.io_write += cnt;
453 + nfsdstats.io_write += host_err;
454 fsnotify_modify(file->f_path.dentry);
457 @@ -1050,7 +1051,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
458 dprintk("nfsd: write complete host_err=%d\n", host_err);
463 err = nfserrno(host_err);
466 @@ -1092,7 +1093,7 @@ out:
469 nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
470 - loff_t offset, struct kvec *vec, int vlen, unsigned long cnt,
471 + loff_t offset, struct kvec *vec, int vlen, unsigned long *cnt,
475 diff --git a/fs/udf/lowlevel.c b/fs/udf/lowlevel.c
476 index 703843f..1b88fd5 100644
477 --- a/fs/udf/lowlevel.c
478 +++ b/fs/udf/lowlevel.c
479 @@ -56,7 +56,12 @@ unsigned long udf_get_last_block(struct super_block *sb)
480 struct block_device *bdev = sb->s_bdev;
481 unsigned long lblock = 0;
483 - if (ioctl_by_bdev(bdev, CDROM_LAST_WRITTEN, (unsigned long) &lblock))
485 + * ioctl failed or returned obviously bogus value?
486 + * Try using the device size...
488 + if (ioctl_by_bdev(bdev, CDROM_LAST_WRITTEN, (unsigned long) &lblock) ||
490 lblock = bdev->bd_inode->i_size >> sb->s_blocksize_bits;
493 diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
494 index 108f47e..9af9bca 100644
495 --- a/include/linux/nfsd/nfsd.h
496 +++ b/include/linux/nfsd/nfsd.h
497 @@ -105,7 +105,7 @@ void nfsd_close(struct file *);
498 __be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *,
499 loff_t, struct kvec *, int, unsigned long *);
500 __be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
501 - loff_t, struct kvec *,int, unsigned long, int *);
502 + loff_t, struct kvec *,int, unsigned long *, int *);
503 __be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *,
505 __be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *,
506 diff --git a/sound/pci/cs46xx/cs46xx_lib.h b/sound/pci/cs46xx/cs46xx_lib.h
507 index 018a7de..ba12825 100644
508 --- a/sound/pci/cs46xx/cs46xx_lib.h
509 +++ b/sound/pci/cs46xx/cs46xx_lib.h
513 #ifdef CONFIG_SND_CS46XX_NEW_DSP
514 -#define CS46XX_MIN_PERIOD_SIZE 1
515 +#define CS46XX_MIN_PERIOD_SIZE 64
516 #define CS46XX_MAX_PERIOD_SIZE 1024*1024
518 #define CS46XX_MIN_PERIOD_SIZE 2048
519 diff --git a/sound/pci/oxygen/oxygen_io.c b/sound/pci/oxygen/oxygen_io.c
520 index 83f135f..6ebd2f3 100644
521 --- a/sound/pci/oxygen/oxygen_io.c
522 +++ b/sound/pci/oxygen/oxygen_io.c
523 @@ -214,17 +214,8 @@ EXPORT_SYMBOL(oxygen_write_spi);
525 void oxygen_write_i2c(struct oxygen *chip, u8 device, u8 map, u8 data)
527 - unsigned long timeout;
529 /* should not need more than about 300 us */
530 - timeout = jiffies + msecs_to_jiffies(1);
532 - if (!(oxygen_read16(chip, OXYGEN_2WIRE_BUS_STATUS)
533 - & OXYGEN_2WIRE_BUSY))
537 - } while (time_after_eq(timeout, jiffies));
540 oxygen_write8(chip, OXYGEN_2WIRE_MAP, map);
541 oxygen_write8(chip, OXYGEN_2WIRE_DATA, data);