Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211552
b: refs/heads/master
c: 51ea8a8
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Oct 19, 2010
1 parent 53763f7 commit 540d9e1
Show file tree
Hide file tree
Showing 21 changed files with 191 additions and 130 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: 6a2a11dbea5db417d200d38dda53c30a2e5603e0
refs/heads/master: 51ea8a88aae425915b458bfe295f1f10a3d52781
4 changes: 4 additions & 0 deletions trunk/arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,15 @@ config NO_IOPORT
config GENERIC_ISA_DMA
bool
select ZONE_DMA if GENERIC_ISA_DMA_SUPPORT_BROKEN=n
select ISA_DMA_API

config GENERIC_ISA_DMA_SUPPORT_BROKEN
bool
select GENERIC_ISA_DMA

config ISA_DMA_API
bool

config GENERIC_GPIO
bool

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mips/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ OBJCOPYFLAGS_vmlinuz.srec := $(OBJCOPYFLAGS) -S -O srec
vmlinuz.srec: vmlinuz
$(call cmd,objcopy)

clean-files := $(objtree)/vmlinuz.*
clean-files := $(objtree)/vmlinuz $(objtree)/vmlinuz.{32,ecoff,bin,srec}
1 change: 1 addition & 0 deletions trunk/arch/mips/include/asm/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
*/

#ifdef CONFIG_32BIT
#include <linux/types.h>

struct flock {
short l_type;
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/mips/kernel/branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ int __compute_return_epc(struct pt_regs *regs)
return -EFAULT;
}

regs->regs[0] = 0;
switch (insn.i_format.opcode) {
/*
* jr and jalr are in r_format format.
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/mips/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
{
/* do the secure computing check first */
if (!entryexit)
secure_computing(regs->regs[0]);
secure_computing(regs->regs[2]);

if (unlikely(current->audit_context) && entryexit)
audit_syscall_exit(AUDITSC_RESULT(regs->regs[2]),
Expand Down Expand Up @@ -565,7 +565,7 @@ asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)

out:
if (unlikely(current->audit_context) && !entryexit)
audit_syscall_entry(audit_arch(), regs->regs[0],
audit_syscall_entry(audit_arch(), regs->regs[2],
regs->regs[4], regs->regs[5],
regs->regs[6], regs->regs[7]);
}
11 changes: 5 additions & 6 deletions trunk/arch/mips/kernel/scall32-o32.S
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ stack_done:
sw t0, PT_R7(sp) # set error flag
beqz t0, 1f

lw t1, PT_R2(sp) # syscall number
negu v0 # error
sw v0, PT_R0(sp) # set flag for syscall
# restarting
sw t1, PT_R0(sp) # save it for syscall restarting
1: sw v0, PT_R2(sp) # result

o32_syscall_exit:
Expand Down Expand Up @@ -104,9 +104,9 @@ syscall_trace_entry:
sw t0, PT_R7(sp) # set error flag
beqz t0, 1f

lw t1, PT_R2(sp) # syscall number
negu v0 # error
sw v0, PT_R0(sp) # set flag for syscall
# restarting
sw t1, PT_R0(sp) # save it for syscall restarting
1: sw v0, PT_R2(sp) # result

j syscall_exit
Expand Down Expand Up @@ -169,8 +169,7 @@ stackargs:
* We probably should handle this case a bit more drastic.
*/
bad_stack:
negu v0 # error
sw v0, PT_R0(sp)
li v0, EFAULT
sw v0, PT_R2(sp)
li t0, 1 # set error flag
sw t0, PT_R7(sp)
Expand Down
7 changes: 4 additions & 3 deletions trunk/arch/mips/kernel/scall64-64.S
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ NESTED(handle_sys64, PT_SIZE, sp)
sd t0, PT_R7(sp) # set error flag
beqz t0, 1f

ld t1, PT_R2(sp) # syscall number
dnegu v0 # error
sd v0, PT_R0(sp) # set flag for syscall
# restarting
sd t1, PT_R0(sp) # save it for syscall restarting
1: sd v0, PT_R2(sp) # result

n64_syscall_exit:
Expand Down Expand Up @@ -109,8 +109,9 @@ syscall_trace_entry:
sd t0, PT_R7(sp) # set error flag
beqz t0, 1f

ld t1, PT_R2(sp) # syscall number
dnegu v0 # error
sd v0, PT_R0(sp) # set flag for syscall restarting
sd t1, PT_R0(sp) # save it for syscall restarting
1: sd v0, PT_R2(sp) # result

j syscall_exit
Expand Down
6 changes: 4 additions & 2 deletions trunk/arch/mips/kernel/scall64-n32.S
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ NESTED(handle_sysn32, PT_SIZE, sp)
sd t0, PT_R7(sp) # set error flag
beqz t0, 1f

ld t1, PT_R2(sp) # syscall number
dnegu v0 # error
sd v0, PT_R0(sp) # set flag for syscall restarting
sd t1, PT_R0(sp) # save it for syscall restarting
1: sd v0, PT_R2(sp) # result

local_irq_disable # make sure need_resched and
Expand Down Expand Up @@ -106,8 +107,9 @@ n32_syscall_trace_entry:
sd t0, PT_R7(sp) # set error flag
beqz t0, 1f

ld t1, PT_R2(sp) # syscall number
dnegu v0 # error
sd v0, PT_R0(sp) # set flag for syscall restarting
sd t1, PT_R0(sp) # save it for syscall restarting
1: sd v0, PT_R2(sp) # result

j syscall_exit
Expand Down
9 changes: 5 additions & 4 deletions trunk/arch/mips/kernel/scall64-o32.S
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ NESTED(handle_sys, PT_SIZE, sp)
sd t0, PT_R7(sp) # set error flag
beqz t0, 1f

ld t1, PT_R2(sp) # syscall number
dnegu v0 # error
sd v0, PT_R0(sp) # flag for syscall restarting
sd t1, PT_R0(sp) # save it for syscall restarting
1: sd v0, PT_R2(sp) # result

o32_syscall_exit:
Expand Down Expand Up @@ -142,8 +143,9 @@ trace_a_syscall:
sd t0, PT_R7(sp) # set error flag
beqz t0, 1f

ld t1, PT_R2(sp) # syscall number
dnegu v0 # error
sd v0, PT_R0(sp) # set flag for syscall restarting
sd t1, PT_R0(sp) # save it for syscall restarting
1: sd v0, PT_R2(sp) # result

j syscall_exit
Expand All @@ -154,8 +156,7 @@ trace_a_syscall:
* The stackpointer for a call with more than 4 arguments is bad.
*/
bad_stack:
dnegu v0 # error
sd v0, PT_R0(sp)
li v0, EFAULT
sd v0, PT_R2(sp)
li t0, 1 # set error flag
sd t0, PT_R7(sp)
Expand Down
45 changes: 22 additions & 23 deletions trunk/arch/mips/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
{
struct rt_sigframe __user *frame;
sigset_t set;
stack_t st;
int sig;

frame = (struct rt_sigframe __user *) regs.regs[29];
Expand All @@ -411,11 +410,9 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
else if (sig)
force_sig(sig, current);

if (__copy_from_user(&st, &frame->rs_uc.uc_stack, sizeof(st)))
goto badframe;
/* It is more difficult to avoid calling this function than to
call it and ignore errors. */
do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]);
do_sigaltstack(&frame->rs_uc.uc_stack, NULL, regs.regs[29]);

/*
* Don't let your children do this ...
Expand Down Expand Up @@ -550,23 +547,26 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
struct mips_abi *abi = current->thread.abi;
void *vdso = current->mm->context.vdso;

switch(regs->regs[0]) {
case ERESTART_RESTARTBLOCK:
case ERESTARTNOHAND:
regs->regs[2] = EINTR;
break;
case ERESTARTSYS:
if (!(ka->sa.sa_flags & SA_RESTART)) {
if (regs->regs[0]) {
switch(regs->regs[2]) {
case ERESTART_RESTARTBLOCK:
case ERESTARTNOHAND:
regs->regs[2] = EINTR;
break;
case ERESTARTSYS:
if (!(ka->sa.sa_flags & SA_RESTART)) {
regs->regs[2] = EINTR;
break;
}
/* fallthrough */
case ERESTARTNOINTR:
regs->regs[7] = regs->regs[26];
regs->regs[2] = regs->regs[0];
regs->cp0_epc -= 4;
}
/* fallthrough */
case ERESTARTNOINTR: /* Userland will reload $v0. */
regs->regs[7] = regs->regs[26];
regs->cp0_epc -= 8;
}

regs->regs[0] = 0; /* Don't deal with this again. */
regs->regs[0] = 0; /* Don't deal with this again. */
}

if (sig_uses_siginfo(ka))
ret = abi->setup_rt_frame(vdso + abi->rt_signal_return_offset,
Expand All @@ -575,6 +575,9 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
ret = abi->setup_frame(vdso + abi->signal_return_offset,
ka, regs, sig, oldset);

if (ret)
return ret;

spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
if (!(ka->sa.sa_flags & SA_NODEFER))
Expand Down Expand Up @@ -622,17 +625,13 @@ static void do_signal(struct pt_regs *regs)
return;
}

/*
* Who's code doesn't conform to the restartable syscall convention
* dies here!!! The li instruction, a single machine instruction,
* must directly be followed by the syscall instruction.
*/
if (regs->regs[0]) {
if (regs->regs[2] == ERESTARTNOHAND ||
regs->regs[2] == ERESTARTSYS ||
regs->regs[2] == ERESTARTNOINTR) {
regs->regs[2] = regs->regs[0];
regs->regs[7] = regs->regs[26];
regs->cp0_epc -= 8;
regs->cp0_epc -= 4;
}
if (regs->regs[2] == ERESTART_RESTARTBLOCK) {
regs->regs[2] = current->thread.abi->restart;
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/mips/kernel/signal_n32.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ asmlinkage int sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
{
struct rt_sigframe_n32 __user *frame;
mm_segment_t old_fs;
sigset_t set;
stack_t st;
s32 sp;
Expand Down Expand Up @@ -143,7 +144,11 @@ asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)

/* It is more difficult to avoid calling this function than to
call it and ignore errors. */
old_fs = get_fs();
set_fs(KERNEL_DS);
do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]);
set_fs(old_fs);


/*
* Don't let your children do this ...
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/mips/kernel/unaligned.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ static void emulate_load_store_insn(struct pt_regs *regs,
unsigned long value;
unsigned int res;

regs->regs[0] = 0;

/*
* This load never faults.
*/
Expand Down
19 changes: 1 addition & 18 deletions trunk/drivers/firewire/ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2840,7 +2840,7 @@ static int __devinit pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
{
struct fw_ohci *ohci;
u32 bus_options, max_receive, link_speed, version, link_enh;
u32 bus_options, max_receive, link_speed, version;
u64 guid;
int i, err, n_ir, n_it;
size_t size;
Expand Down Expand Up @@ -2894,23 +2894,6 @@ static int __devinit pci_probe(struct pci_dev *dev,
if (param_quirks)
ohci->quirks = param_quirks;

/* TI OHCI-Lynx and compatible: set recommended configuration bits. */
if (dev->vendor == PCI_VENDOR_ID_TI) {
pci_read_config_dword(dev, PCI_CFG_TI_LinkEnh, &link_enh);

/* adjust latency of ATx FIFO: use 1.7 KB threshold */
link_enh &= ~TI_LinkEnh_atx_thresh_mask;
link_enh |= TI_LinkEnh_atx_thresh_1_7K;

/* use priority arbitration for asynchronous responses */
link_enh |= TI_LinkEnh_enab_unfair;

/* required for aPhyEnhanceEnable to work */
link_enh |= TI_LinkEnh_enab_accel;

pci_write_config_dword(dev, PCI_CFG_TI_LinkEnh, link_enh);
}

ar_context_init(&ohci->ar_request_ctx, ohci,
OHCI1394_AsReqRcvContextControlSet);

Expand Down
8 changes: 0 additions & 8 deletions trunk/drivers/firewire/ohci.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,4 @@

#define OHCI1394_phy_tcode 0xe

/* TI extensions */

#define PCI_CFG_TI_LinkEnh 0xf4
#define TI_LinkEnh_enab_accel 0x00000002
#define TI_LinkEnh_enab_unfair 0x00000080
#define TI_LinkEnh_atx_thresh_mask 0x00003000
#define TI_LinkEnh_atx_thresh_1_7K 0x00001000

#endif /* _FIREWIRE_OHCI_H */
24 changes: 15 additions & 9 deletions trunk/drivers/i2c/busses/i2c-davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,21 +331,16 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop)
INIT_COMPLETION(dev->cmd_complete);
dev->cmd_err = 0;

/* Take I2C out of reset, configure it as master and set the
* start bit */
flag = DAVINCI_I2C_MDR_IRS | DAVINCI_I2C_MDR_MST | DAVINCI_I2C_MDR_STT;
/* Take I2C out of reset and configure it as master */
flag = DAVINCI_I2C_MDR_IRS | DAVINCI_I2C_MDR_MST;

/* if the slave address is ten bit address, enable XA bit */
if (msg->flags & I2C_M_TEN)
flag |= DAVINCI_I2C_MDR_XA;
if (!(msg->flags & I2C_M_RD))
flag |= DAVINCI_I2C_MDR_TRX;
if (stop)
flag |= DAVINCI_I2C_MDR_STP;
if (msg->len == 0) {
if (msg->len == 0)
flag |= DAVINCI_I2C_MDR_RM;
flag &= ~DAVINCI_I2C_MDR_STP;
}

/* Enable receive or transmit interrupts */
w = davinci_i2c_read_reg(dev, DAVINCI_I2C_IMR_REG);
Expand All @@ -357,18 +352,29 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop)

dev->terminate = 0;

/*
* Write mode register first as needed for correct behaviour
* on OMAP-L138, but don't set STT yet to avoid a race with XRDY
* occuring before we have loaded DXR
*/
davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag);

/*
* First byte should be set here, not after interrupt,
* because transmit-data-ready interrupt can come before
* NACK-interrupt during sending of previous message and
* ICDXR may have wrong data
* It also saves us one interrupt, slightly faster
*/
if ((!(msg->flags & I2C_M_RD)) && dev->buf_len) {
davinci_i2c_write_reg(dev, DAVINCI_I2C_DXR_REG, *dev->buf++);
dev->buf_len--;
}

/* write the data into mode register; start transmitting */
/* Set STT to begin transmit now DXR is loaded */
flag |= DAVINCI_I2C_MDR_STT;
if (stop && msg->len != 0)
flag |= DAVINCI_I2C_MDR_STP;
davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag);

r = wait_for_completion_interruptible_timeout(&dev->cmd_complete,
Expand Down
Loading

0 comments on commit 540d9e1

Please sign in to comment.