Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190069
b: refs/heads/master
c: 1519ae4
h: refs/heads/master
i:
  190067: f308ed5
v: v3
  • Loading branch information
Linus Torvalds committed Apr 21, 2010
1 parent 09128d5 commit 4e65fc0
Show file tree
Hide file tree
Showing 29 changed files with 276 additions and 190 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 35f2a591192d0a5d9f7fc696869c76f0b8e49c3d
refs/heads/master: 1519ae4dc785995c548bca98b75190b9f0667dde
4 changes: 2 additions & 2 deletions trunk/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 34
EXTRAVERSION = -rc4
NAME = Man-Eating Seals of Antiquity
EXTRAVERSION = -rc5
NAME = Sheep on Meth

# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/include/asm/thread_info_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct thread_info {
#define THREAD_SHIFT PAGE_SHIFT
#endif /* PAGE_SHIFT == 13 */

#define PREEMPT_ACTIVE 0x4000000
#define PREEMPT_ACTIVE 0x10000000

/*
* macros/functions for gaining access to the thread information structure
Expand Down
20 changes: 2 additions & 18 deletions trunk/arch/sparc/kernel/irq_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/seq_file.h>
#include <linux/ftrace.h>
#include <linux/irq.h>
#include <linux/kmemleak.h>

#include <asm/ptrace.h>
#include <asm/processor.h>
Expand All @@ -46,6 +47,7 @@

#include "entry.h"
#include "cpumap.h"
#include "kstack.h"

#define NUM_IVECS (IMAP_INR + 1)

Expand Down Expand Up @@ -712,24 +714,6 @@ void ack_bad_irq(unsigned int virt_irq)
void *hardirq_stack[NR_CPUS];
void *softirq_stack[NR_CPUS];

static __attribute__((always_inline)) void *set_hardirq_stack(void)
{
void *orig_sp, *sp = hardirq_stack[smp_processor_id()];

__asm__ __volatile__("mov %%sp, %0" : "=r" (orig_sp));
if (orig_sp < sp ||
orig_sp > (sp + THREAD_SIZE)) {
sp += THREAD_SIZE - 192 - STACK_BIAS;
__asm__ __volatile__("mov %0, %%sp" : : "r" (sp));
}

return orig_sp;
}
static __attribute__((always_inline)) void restore_hardirq_stack(void *orig_sp)
{
__asm__ __volatile__("mov %0, %%sp" : : "r" (orig_sp));
}

void __irq_entry handler_irq(int irq, struct pt_regs *regs)
{
unsigned long pstate, bucket_pa;
Expand Down
19 changes: 19 additions & 0 deletions trunk/arch/sparc/kernel/kstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,23 @@ static inline bool kstack_is_trap_frame(struct thread_info *tp, struct pt_regs *

}

static inline __attribute__((always_inline)) void *set_hardirq_stack(void)
{
void *orig_sp, *sp = hardirq_stack[smp_processor_id()];

__asm__ __volatile__("mov %%sp, %0" : "=r" (orig_sp));
if (orig_sp < sp ||
orig_sp > (sp + THREAD_SIZE)) {
sp += THREAD_SIZE - 192 - STACK_BIAS;
__asm__ __volatile__("mov %0, %%sp" : : "r" (sp));
}

return orig_sp;
}

static inline __attribute__((always_inline)) void restore_hardirq_stack(void *orig_sp)
{
__asm__ __volatile__("mov %0, %%sp" : : "r" (orig_sp));
}

#endif /* _KSTACK_H */
7 changes: 7 additions & 0 deletions trunk/arch/sparc/kernel/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <asm/ptrace.h>
#include <asm/pcr.h>

#include "kstack.h"

/* We don't have a real NMI on sparc64, but we can fake one
* up using profiling counter overflow interrupts and interrupt
* levels.
Expand Down Expand Up @@ -92,13 +94,16 @@ static void die_nmi(const char *str, struct pt_regs *regs, int do_panic)
notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
{
unsigned int sum, touched = 0;
void *orig_sp;

clear_softint(1 << irq);

local_cpu_data().__nmi_count++;

nmi_enter();

orig_sp = set_hardirq_stack();

if (notify_die(DIE_NMI, "nmi", regs, 0,
pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP)
touched = 1;
Expand All @@ -124,6 +129,8 @@ notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
pcr_ops->write(pcr_enable);
}

restore_hardirq_stack(orig_sp);

nmi_exit();
}

Expand Down
12 changes: 11 additions & 1 deletion trunk/arch/sparc/kernel/rtrap_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,17 @@ rtrap_xcall:
nop
call trace_hardirqs_on
nop
wrpr %l4, %pil
/* Do not actually set the %pil here. We will do that
* below after we clear PSTATE_IE in the %pstate register.
* If we re-enable interrupts here, we can recurse down
* the hardirq stack potentially endlessly, causing a
* stack overflow.
*
* It is tempting to put this test and trace_hardirqs_on
* call at the 'rt_continue' label, but that will not work
* as that path hits unconditionally and we do not want to
* execute this in NMI return paths, for example.
*/
#endif
rtrap_no_irq_enable:
andcc %l1, TSTATE_PRIV, %l3
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/sparc/kernel/unaligned_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static inline enum direction decode_direction(unsigned int insn)
}

/* 16 = double-word, 8 = extra-word, 4 = word, 2 = half-word */
static inline int decode_access_size(unsigned int insn)
static inline int decode_access_size(struct pt_regs *regs, unsigned int insn)
{
unsigned int tmp;

Expand All @@ -66,7 +66,7 @@ static inline int decode_access_size(unsigned int insn)
return 2;
else {
printk("Impossible unaligned trap. insn=%08x\n", insn);
die_if_kernel("Byte sized unaligned access?!?!", current_thread_info()->kregs);
die_if_kernel("Byte sized unaligned access?!?!", regs);

/* GCC should never warn that control reaches the end
* of this function without returning a value because
Expand Down Expand Up @@ -286,7 +286,7 @@ static void log_unaligned(struct pt_regs *regs)
asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)
{
enum direction dir = decode_direction(insn);
int size = decode_access_size(insn);
int size = decode_access_size(regs, insn);
int orig_asi, asi;

current_thread_info()->kern_una_regs = regs;
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/sparc/lib/mcount.S
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mcount:
cmp %g1, %g2
be,pn %icc, 1f
mov %i7, %g3
save %sp, -128, %sp
save %sp, -176, %sp
mov %g3, %o1
jmpl %g1, %o7
mov %i7, %o0
Expand All @@ -56,7 +56,7 @@ mcount:
nop
5: mov %i7, %g2
mov %fp, %g3
save %sp, -128, %sp
save %sp, -176, %sp
mov %g2, %l0
ba,pt %xcc, ftrace_graph_caller
mov %g3, %l1
Expand Down Expand Up @@ -85,7 +85,7 @@ ftrace_caller:
lduw [%g1 + %lo(function_trace_stop)], %g1
brnz,pn %g1, ftrace_stub
mov %fp, %g3
save %sp, -128, %sp
save %sp, -176, %sp
mov %g2, %o1
mov %g2, %l0
mov %g3, %l1
Expand Down Expand Up @@ -120,7 +120,7 @@ ENTRY(ftrace_graph_caller)
END(ftrace_graph_caller)

ENTRY(return_to_handler)
save %sp, -128, %sp
save %sp, -176, %sp
call ftrace_return_to_handler
mov %fp, %o0
jmpl %o0 + 8, %g0
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/ia32/ia32entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ ia32_sys_call_table:
.quad stub32_sigreturn
.quad stub32_clone /* 120 */
.quad sys_setdomainname
.quad sys_uname
.quad sys_newuname
.quad sys_modify_ldt
.quad compat_sys_adjtimex
.quad sys32_mprotect /* 125 */
Expand Down
8 changes: 6 additions & 2 deletions trunk/arch/x86/kernel/dumpstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#define get_bp(bp) asm("movq %%rbp, %0" : "=r" (bp) :)
#endif

#include <linux/uaccess.h>

extern void
show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
unsigned long *stack, unsigned long bp, char *log_lvl);
Expand Down Expand Up @@ -42,8 +44,10 @@ static inline unsigned long rewind_frame_pointer(int n)
get_bp(frame);

#ifdef CONFIG_FRAME_POINTER
while (n--)
frame = frame->next_frame;
while (n--) {
if (probe_kernel_address(&frame->next_frame, frame))
break;
}
#endif

return (unsigned long)frame;
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/char/pcmcia/cm4000_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,14 +1026,16 @@ static ssize_t cmm_read(struct file *filp, __user char *buf, size_t count,

xoutb(0, REG_FLAGS1(iobase)); /* clear detectCMM */
/* last check before exit */
if (!io_detect_cm4000(iobase, dev))
count = -ENODEV;
if (!io_detect_cm4000(iobase, dev)) {
rc = -ENODEV;
goto release_io;
}

if (test_bit(IS_INVREV, &dev->flags) && count > 0)
str_invert_revert(dev->rbuf, count);

if (copy_to_user(buf, dev->rbuf, count))
return -EFAULT;
rc = -EFAULT;

release_io:
clear_bit(LOCK_IO, &dev->flags);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/gpu/drm/drm_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ void drm_put_dev(struct drm_device *dev)
}
driver = dev->driver;

drm_vblank_cleanup(dev);

drm_lastclose(dev);

if (drm_core_has_MTRR(dev) && drm_core_has_AGP(dev) &&
Expand All @@ -537,6 +535,8 @@ void drm_put_dev(struct drm_device *dev)
dev->agp = NULL;
}

drm_vblank_cleanup(dev);

list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head)
drm_rmmap(dev, r_list->map);
drm_ht_remove(&dev->map_hash);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/isdn/gigaset/gigaset.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/ctype.h>
Expand Down
9 changes: 7 additions & 2 deletions trunk/drivers/pcmcia/cistpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,11 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *info)
if (!s)
return -EINVAL;

if (s->functions) {
WARN_ON(1);
return -EINVAL;
}

/* We do not want to validate the CIS cache... */
mutex_lock(&s->ops_mutex);
destroy_cis_cache(s);
Expand Down Expand Up @@ -1639,7 +1644,7 @@ static ssize_t pccard_show_cis(struct kobject *kobj,
count = 0;
else {
struct pcmcia_socket *s;
unsigned int chains;
unsigned int chains = 1;

if (off + count > size)
count = size - off;
Expand All @@ -1648,7 +1653,7 @@ static ssize_t pccard_show_cis(struct kobject *kobj,

if (!(s->state & SOCKET_PRESENT))
return -ENODEV;
if (pccard_validate_cis(s, &chains))
if (!s->functions && pccard_validate_cis(s, &chains))
return -EIO;
if (!chains)
return -ENODATA;
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/pcmcia/db1xxx_ss.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)

ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq,
IRQF_DISABLED, "pcmcia_insert", sock);
if (ret)
if (ret) {
local_irq_restore(flags);
goto out1;
}

ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq,
IRQF_DISABLED, "pcmcia_eject", sock);
Expand Down
22 changes: 14 additions & 8 deletions trunk/drivers/pcmcia/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,12 +687,10 @@ static void pcmcia_requery(struct pcmcia_socket *s)
new_funcs = mfc.nfn;
else
new_funcs = 1;
if (old_funcs > new_funcs) {
if (old_funcs != new_funcs) {
/* we need to re-start */
pcmcia_card_remove(s, NULL);
pcmcia_card_add(s);
} else if (new_funcs > old_funcs) {
s->functions = new_funcs;
pcmcia_device_add(s, 1);
}
}

Expand Down Expand Up @@ -728,6 +726,8 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
struct pcmcia_socket *s = dev->socket;
const struct firmware *fw;
int ret = -ENOMEM;
cistpl_longlink_mfc_t mfc;
int old_funcs, new_funcs = 1;

if (!filename)
return -EINVAL;
Expand All @@ -750,6 +750,14 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
goto release;
}

/* we need to re-start if the number of functions changed */
old_funcs = s->functions;
if (!pccard_read_tuple(s, BIND_FN_ALL, CISTPL_LONGLINK_MFC,
&mfc))
new_funcs = mfc.nfn;

if (old_funcs != new_funcs)
ret = -EBUSY;

/* update information */
pcmcia_device_query(dev);
Expand Down Expand Up @@ -858,10 +866,8 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
if (did->match_flags & PCMCIA_DEV_ID_MATCH_FAKE_CIS) {
dev_dbg(&dev->dev, "device needs a fake CIS\n");
if (!dev->socket->fake_cis)
pcmcia_load_firmware(dev, did->cisfile);

if (!dev->socket->fake_cis)
return 0;
if (pcmcia_load_firmware(dev, did->cisfile))
return 0;
}

if (did->match_flags & PCMCIA_DEV_ID_MATCH_ANONYMOUS) {
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/pcmcia/pcmcia_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,12 +755,12 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
else
printk(KERN_WARNING "pcmcia: Driver needs updating to support IRQ sharing.\n");

#ifdef CONFIG_PCMCIA_PROBE

if (s->irq.AssignedIRQ != 0) {
/* If the interrupt is already assigned, it must be the same */
/* If the interrupt is already assigned, it must be the same */
if (s->irq.AssignedIRQ != 0)
irq = s->irq.AssignedIRQ;
} else {

#ifdef CONFIG_PCMCIA_PROBE
if (!irq) {
int try;
u32 mask = s->irq_mask;
void *data = p_dev; /* something unique to this device */
Expand Down
Loading

0 comments on commit 4e65fc0

Please sign in to comment.