diff --git a/[refs] b/[refs] index 515d3524533c..42889f1e650b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f5b40e363ad6041a96e3da32281d8faa191597b9 +refs/heads/master: 19ca5d27e15c10d8529984ecd98dcba2637edcd2 diff --git a/trunk/arch/arm/mach-sa1100/irq.c b/trunk/arch/arm/mach-sa1100/irq.c index c131a5201b5b..b3a56024182e 100644 --- a/trunk/arch/arm/mach-sa1100/irq.c +++ b/trunk/arch/arm/mach-sa1100/irq.c @@ -199,10 +199,26 @@ static void sa1100_unmask_irq(unsigned int irq) ICMR |= (1 << irq); } +/* + * Apart form GPIOs, only the RTC alarm can be a wakeup event. + */ +static int sa1100_set_wake(unsigned int irq, unsigned int on) +{ + if (irq == IRQ_RTCAlrm) { + if (on) + PWER |= PWER_RTC; + else + PWER &= ~PWER_RTC; + return 0; + } + return -EINVAL; +} + static struct irqchip sa1100_normal_chip = { .ack = sa1100_mask_irq, .mask = sa1100_mask_irq, .unmask = sa1100_unmask_irq, + .set_wake = sa1100_set_wake, }; static struct resource irq_resource = { diff --git a/trunk/kernel/ptrace.c b/trunk/kernel/ptrace.c index b0f8da80d7d4..4e0f0ec003f7 100644 --- a/trunk/kernel/ptrace.c +++ b/trunk/kernel/ptrace.c @@ -148,16 +148,12 @@ int ptrace_may_attach(struct task_struct *task) int ptrace_attach(struct task_struct *task) { int retval; - + task_lock(task); retval = -EPERM; if (task->pid <= 1) - goto out; + goto bad; if (task->tgid == current->tgid) - goto out; - - write_lock_irq(&tasklist_lock); - task_lock(task); - + goto bad; /* the same process cannot be attached many times */ if (task->ptrace & PT_PTRACED) goto bad; @@ -170,15 +166,17 @@ int ptrace_attach(struct task_struct *task) ? PT_ATTACHED : 0); if (capable(CAP_SYS_PTRACE)) task->ptrace |= PT_PTRACE_CAP; + task_unlock(task); + write_lock_irq(&tasklist_lock); __ptrace_link(task, current); + write_unlock_irq(&tasklist_lock); force_sig_specific(SIGSTOP, task); + return 0; bad: - write_unlock_irq(&tasklist_lock); task_unlock(task); -out: return retval; } @@ -419,22 +417,21 @@ int ptrace_request(struct task_struct *child, long request, */ int ptrace_traceme(void) { - int ret = -EPERM; + int ret; /* * Are we already being traced? */ - task_lock(current); - if (!(current->ptrace & PT_PTRACED)) { - ret = security_ptrace(current->parent, current); - /* - * Set the ptrace bit in the process ptrace flags. - */ - if (!ret) - current->ptrace |= PT_PTRACED; - } - task_unlock(current); - return ret; + if (current->ptrace & PT_PTRACED) + return -EPERM; + ret = security_ptrace(current->parent, current); + if (ret) + return -EPERM; + /* + * Set the ptrace bit in the process ptrace flags. + */ + current->ptrace |= PT_PTRACED; + return 0; } /**