From: Todd Poynor Date: Thu, 19 Apr 2012 22:15:48 +0000 (-0700) Subject: Merge linux-stable 3.0.28 into android-3.0 X-Git-Tag: firefly_0821_release~7613^2~127 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=94225ab0bef6f32108eaa410bb894caa2b4317e2;p=firefly-linux-kernel-4.4.55.git Merge linux-stable 3.0.28 into android-3.0 Change-Id: Iee820738e53627f5d0447a87ceff34443aa72786 Signed-off-by: Todd Poynor --- 94225ab0bef6f32108eaa410bb894caa2b4317e2 diff --cc block/genhd.c index cbf7b880e9d4,f6ecddb79952..026d0700adc5 --- a/block/genhd.c +++ b/block/genhd.c @@@ -1103,24 -1112,10 +1112,26 @@@ static void disk_release(struct device disk_replace_part_tbl(disk, NULL); free_part_stats(&disk->part0); free_part_info(&disk->part0); + if (disk->queue) + blk_put_queue(disk->queue); kfree(disk); } + +static int disk_uevent(struct device *dev, struct kobj_uevent_env *env) +{ + struct gendisk *disk = dev_to_disk(dev); + struct disk_part_iter piter; + struct hd_struct *part; + int cnt = 0; + + disk_part_iter_init(&piter, disk, 0); + while((part = disk_part_iter_next(&piter))) + cnt++; + disk_part_iter_exit(&piter); + add_uevent_var(env, "NPARTS=%u", cnt); + return 0; +} + struct class block_class = { .name = "block", }; diff --cc drivers/usb/host/ehci.h index 9706c2b64a94,3ffb27f472c2..db0d14e47e38 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@@ -736,25 -737,24 +737,41 @@@ static inline u32 hc32_to_cpup (const s #endif +/* + * Writing to dma coherent memory on ARM may be delayed via L2 + * writing buffer, so introduce the helper which can flush L2 writing + * buffer into memory immediately, especially used to flush ehci + * descriptor to memory. + * */ +#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE +static inline void ehci_sync_mem() +{ + mb(); +} +#else +static inline void ehci_sync_mem() +{ +} +#endif + /*-------------------------------------------------------------------------*/ + #ifdef CONFIG_PCI + + /* For working around the MosChip frame-index-register bug */ + static unsigned ehci_read_frame_index(struct ehci_hcd *ehci); + + #else + + static inline unsigned ehci_read_frame_index(struct ehci_hcd *ehci) + { + return ehci_readl(ehci, &ehci->regs->frame_index); + } + + #endif + + /*-------------------------------------------------------------------------*/ + #ifndef DEBUG #define STUB_DEBUG_FILES #endif /* DEBUG */ diff --cc fs/proc/base.c index 1a8d756021f2,22794e8ab996..6a938aa9e294 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@@ -269,8 -205,7 +211,8 @@@ static struct mm_struct *mm_access(stru mm = get_task_mm(task); if (mm && mm != current->mm && - !ptrace_may_access(task, PTRACE_MODE_READ) && - !ptrace_may_access(task, mode)) { ++ !ptrace_may_access(task, mode) && + !capable(CAP_SYS_RESOURCE)) { mmput(mm); mm = ERR_PTR(-EACCES); } @@@ -937,23 -822,36 +829,41 @@@ static ssize_t mem_rw(struct file *file copied = -EIO; break; } - copied += retval; - buf += retval; - dst += retval; - count -= retval; + + if (!write && copy_to_user(buf, page, this_len)) { + copied = -EFAULT; + break; + } + + buf += this_len; + addr += this_len; + copied += this_len; + count -= this_len; } - *ppos = dst; + *ppos = addr; - out_mm: mmput(mm); - out_free: + free: free_page((unsigned long) page); - out_task: - put_task_struct(task); - out_no_task: return copied; } + + static ssize_t mem_read(struct file *file, char __user *buf, + size_t count, loff_t *ppos) + { + return mem_rw(file, buf, count, ppos, 0); + } + ++#define mem_write NULL ++ ++#ifndef mem_write ++/* This is a security hazard */ + static ssize_t mem_write(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) + { + return mem_rw(file, (char __user*)buf, count, ppos, 1); + } +#endif loff_t mem_lseek(struct file *file, loff_t offset, int orig) {