Skip to content

Commit

Permalink
Merge branch 'akpm' (Andrew's patch-bomb)
Browse files Browse the repository at this point in the history
Merge misc fixes from Andrew Morton.

* emailed from Andrew Morton <akpm@linux-foundation.org>: (4 patches)
  frv: delete incorrect task prototypes causing compile fail
  slub: missing test for partial pages flush work in flush_all()
  fs, proc: fix ABBA deadlock in case of execution attempt of map_files/ entries
  drivers/rtc/rtc-pl031.c: configure correct wday for 2000-01-01
  • Loading branch information
Linus Torvalds committed May 18, 2012
2 parents 30a08bf + 93c2d65 commit 73f1f5d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
4 changes: 0 additions & 4 deletions arch/frv/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ unsigned long get_wchan(struct task_struct *p);
#define KSTK_EIP(tsk) ((tsk)->thread.frame0->pc)
#define KSTK_ESP(tsk) ((tsk)->thread.frame0->sp)

/* Allocation and freeing of basic task resources. */
extern struct task_struct *alloc_task_struct_node(int node);
extern void free_task_struct(struct task_struct *p);

#define cpu_relax() barrier()

/* data cache prefetch */
Expand Down
18 changes: 18 additions & 0 deletions drivers/rtc/rtc-pl031.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
int ret;
struct pl031_local *ldata;
struct rtc_class_ops *ops = id->data;
unsigned long time;

ret = amba_request_regions(adev, NULL);
if (ret)
Expand Down Expand Up @@ -343,6 +344,23 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN,
ldata->base + RTC_CR);

/*
* On ST PL031 variants, the RTC reset value does not provide correct
* weekday for 2000-01-01. Correct the erroneous sunday to saturday.
*/
if (ldata->hw_designer == AMBA_VENDOR_ST) {
if (readl(ldata->base + RTC_YDR) == 0x2000) {
time = readl(ldata->base + RTC_DR);
if ((time &
(RTC_MON_MASK | RTC_MDAY_MASK | RTC_WDAY_MASK))
== 0x02120000) {
time = time | (0x7 << RTC_WDAY_SHIFT);
writel(0x2000, ldata->base + RTC_YLR);
writel(time, ldata->base + RTC_LR);
}
}
}

ldata->rtc = rtc_device_register("pl031", &adev->dev, ops,
THIS_MODULE);
if (IS_ERR(ldata->rtc)) {
Expand Down
20 changes: 8 additions & 12 deletions fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2162,16 +2162,16 @@ static struct dentry *proc_map_files_lookup(struct inode *dir,
goto out;

result = ERR_PTR(-EACCES);
if (lock_trace(task))
if (!ptrace_may_access(task, PTRACE_MODE_READ))
goto out_put_task;

result = ERR_PTR(-ENOENT);
if (dname_to_vma_addr(dentry, &vm_start, &vm_end))
goto out_unlock;
goto out_put_task;

mm = get_task_mm(task);
if (!mm)
goto out_unlock;
goto out_put_task;

down_read(&mm->mmap_sem);
vma = find_exact_vma(mm, vm_start, vm_end);
Expand All @@ -2183,8 +2183,6 @@ static struct dentry *proc_map_files_lookup(struct inode *dir,
out_no_vma:
up_read(&mm->mmap_sem);
mmput(mm);
out_unlock:
unlock_trace(task);
out_put_task:
put_task_struct(task);
out:
Expand Down Expand Up @@ -2218,20 +2216,20 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir)
goto out;

ret = -EACCES;
if (lock_trace(task))
if (!ptrace_may_access(task, PTRACE_MODE_READ))
goto out_put_task;

ret = 0;
switch (filp->f_pos) {
case 0:
ino = inode->i_ino;
if (filldir(dirent, ".", 1, 0, ino, DT_DIR) < 0)
goto out_unlock;
goto out_put_task;
filp->f_pos++;
case 1:
ino = parent_ino(dentry);
if (filldir(dirent, "..", 2, 1, ino, DT_DIR) < 0)
goto out_unlock;
goto out_put_task;
filp->f_pos++;
default:
{
Expand All @@ -2242,7 +2240,7 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir)

mm = get_task_mm(task);
if (!mm)
goto out_unlock;
goto out_put_task;
down_read(&mm->mmap_sem);

nr_files = 0;
Expand Down Expand Up @@ -2272,7 +2270,7 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir)
flex_array_free(fa);
up_read(&mm->mmap_sem);
mmput(mm);
goto out_unlock;
goto out_put_task;
}
for (i = 0, vma = mm->mmap, pos = 2; vma;
vma = vma->vm_next) {
Expand Down Expand Up @@ -2317,8 +2315,6 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir)
}
}

out_unlock:
unlock_trace(task);
out_put_task:
put_task_struct(task);
out:
Expand Down
2 changes: 1 addition & 1 deletion mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2040,7 +2040,7 @@ static bool has_cpu_slab(int cpu, void *info)
struct kmem_cache *s = info;
struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu);

return !!(c->page);
return c->page || c->partial;
}

static void flush_all(struct kmem_cache *s)
Expand Down

0 comments on commit 73f1f5d

Please sign in to comment.