Commit 2da6dc28 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] cio: Make ccw_device_register() static.
  [S390] Improve AP bus device removal.
  [S390] uaccess error handling.
  [S390] cio: css_probe_device() must be called enabled.
  [S390] Initialize interval value to 0.
  [S390] sys_getcpu compat wrapper.
parents 0c6cb974 3c9da7ba
...@@ -310,6 +310,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp, ...@@ -310,6 +310,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len)) { if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len)) {
return -EFAULT; return -EFAULT;
} }
interval = 0;
sscanf(buf, "%i", &interval); sscanf(buf, "%i", &interval);
if (interval <= 0) { if (interval <= 0) {
P_ERROR("Timer CPU interval has to be > 0!\n"); P_ERROR("Timer CPU interval has to be > 0!\n");
......
...@@ -757,7 +757,9 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) ...@@ -757,7 +757,9 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp))) put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)))
error = -EFAULT; error = -EFAULT;
} }
copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); if (copy_to_user(args->__unused, tmp.__unused,
sizeof(tmp.__unused)))
error = -EFAULT;
} }
return error; return error;
} }
......
...@@ -169,12 +169,12 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act, ...@@ -169,12 +169,12 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
compat_old_sigset_t mask; compat_old_sigset_t mask;
if (!access_ok(VERIFY_READ, act, sizeof(*act)) || if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(sa_handler, &act->sa_handler) || __get_user(sa_handler, &act->sa_handler) ||
__get_user(sa_restorer, &act->sa_restorer)) __get_user(sa_restorer, &act->sa_restorer) ||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
__get_user(mask, &act->sa_mask))
return -EFAULT; return -EFAULT;
new_ka.sa.sa_handler = (__sighandler_t) sa_handler; new_ka.sa.sa_handler = (__sighandler_t) sa_handler;
new_ka.sa.sa_restorer = (void (*)(void)) sa_restorer; new_ka.sa.sa_restorer = (void (*)(void)) sa_restorer;
__get_user(new_ka.sa.sa_flags, &act->sa_flags);
__get_user(mask, &act->sa_mask);
siginitset(&new_ka.sa.sa_mask, mask); siginitset(&new_ka.sa.sa_mask, mask);
} }
...@@ -185,10 +185,10 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act, ...@@ -185,10 +185,10 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
sa_restorer = (unsigned long) old_ka.sa.sa_restorer; sa_restorer = (unsigned long) old_ka.sa.sa_restorer;
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(sa_handler, &oact->sa_handler) || __put_user(sa_handler, &oact->sa_handler) ||
__put_user(sa_restorer, &oact->sa_restorer)) __put_user(sa_restorer, &oact->sa_restorer) ||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
return -EFAULT; return -EFAULT;
__put_user(old_ka.sa.sa_flags, &oact->sa_flags);
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
} }
return ret; return ret;
......
...@@ -1664,4 +1664,4 @@ sys_getcpu_wrapper: ...@@ -1664,4 +1664,4 @@ sys_getcpu_wrapper:
llgtr %r2,%r2 # unsigned * llgtr %r2,%r2 # unsigned *
llgtr %r3,%r3 # unsigned * llgtr %r3,%r3 # unsigned *
llgtr %r4,%r4 # struct getcpu_cache * llgtr %r4,%r4 # struct getcpu_cache *
jg sys_tee jg sys_getcpu
...@@ -80,10 +80,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, ...@@ -80,10 +80,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
old_sigset_t mask; old_sigset_t mask;
if (!access_ok(VERIFY_READ, act, sizeof(*act)) || if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) || __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
__get_user(mask, &act->sa_mask))
return -EFAULT; return -EFAULT;
__get_user(new_ka.sa.sa_flags, &act->sa_flags);
__get_user(mask, &act->sa_mask);
siginitset(&new_ka.sa.sa_mask, mask); siginitset(&new_ka.sa.sa_mask, mask);
} }
...@@ -92,10 +92,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, ...@@ -92,10 +92,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
if (!ret && oact) { if (!ret && oact) {
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) || __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
return -EFAULT; return -EFAULT;
__put_user(old_ka.sa.sa_flags, &oact->sa_flags);
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
} }
return ret; return ret;
......
...@@ -462,7 +462,8 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code) ...@@ -462,7 +462,8 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
local_irq_enable(); local_irq_enable();
if (regs->psw.mask & PSW_MASK_PSTATE) { if (regs->psw.mask & PSW_MASK_PSTATE) {
get_user(*((__u16 *) opcode), (__u16 __user *) location); if (get_user(*((__u16 *) opcode), (__u16 __user *) location))
return;
if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) { if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) {
if (current->ptrace & PT_PTRACED) if (current->ptrace & PT_PTRACED)
force_sig(SIGTRAP, current); force_sig(SIGTRAP, current);
...@@ -470,20 +471,25 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code) ...@@ -470,20 +471,25 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
signal = SIGILL; signal = SIGILL;
#ifdef CONFIG_MATHEMU #ifdef CONFIG_MATHEMU
} else if (opcode[0] == 0xb3) { } else if (opcode[0] == 0xb3) {
get_user(*((__u16 *) (opcode+2)), location+1); if (get_user(*((__u16 *) (opcode+2)), location+1))
return;
signal = math_emu_b3(opcode, regs); signal = math_emu_b3(opcode, regs);
} else if (opcode[0] == 0xed) { } else if (opcode[0] == 0xed) {
get_user(*((__u32 *) (opcode+2)), if (get_user(*((__u32 *) (opcode+2)),
(__u32 __user *)(location+1)); (__u32 __user *)(location+1)))
return;
signal = math_emu_ed(opcode, regs); signal = math_emu_ed(opcode, regs);
} else if (*((__u16 *) opcode) == 0xb299) { } else if (*((__u16 *) opcode) == 0xb299) {
get_user(*((__u16 *) (opcode+2)), location+1); if (get_user(*((__u16 *) (opcode+2)), location+1))
return;
signal = math_emu_srnm(opcode, regs); signal = math_emu_srnm(opcode, regs);
} else if (*((__u16 *) opcode) == 0xb29c) { } else if (*((__u16 *) opcode) == 0xb29c) {
get_user(*((__u16 *) (opcode+2)), location+1); if (get_user(*((__u16 *) (opcode+2)), location+1))
return;
signal = math_emu_stfpc(opcode, regs); signal = math_emu_stfpc(opcode, regs);
} else if (*((__u16 *) opcode) == 0xb29d) { } else if (*((__u16 *) opcode) == 0xb29d) {
get_user(*((__u16 *) (opcode+2)), location+1); if (get_user(*((__u16 *) (opcode+2)), location+1))
return;
signal = math_emu_lfpc(opcode, regs); signal = math_emu_lfpc(opcode, regs);
#endif #endif
} else } else
......
...@@ -271,10 +271,6 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow) ...@@ -271,10 +271,6 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow)
/* Reset intparm to zeroes. */ /* Reset intparm to zeroes. */
sch->schib.pmcw.intparm = 0; sch->schib.pmcw.intparm = 0;
cio_modify(sch); cio_modify(sch);
/* Probe if necessary. */
if (action == UNREGISTER_PROBE)
ret = css_probe_device(sch->schid);
break; break;
case REPROBE: case REPROBE:
device_trigger_reprobe(sch); device_trigger_reprobe(sch);
...@@ -283,6 +279,9 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow) ...@@ -283,6 +279,9 @@ static int css_evaluate_known_subchannel(struct subchannel *sch, int slow)
break; break;
} }
spin_unlock_irqrestore(&sch->lock, flags); spin_unlock_irqrestore(&sch->lock, flags);
/* Probe if necessary. */
if (action == UNREGISTER_PROBE)
ret = css_probe_device(sch->schid);
return ret; return ret;
} }
......
...@@ -532,8 +532,7 @@ device_remove_files(struct device *dev) ...@@ -532,8 +532,7 @@ device_remove_files(struct device *dev)
/* this is a simple abstraction for device_register that sets the /* this is a simple abstraction for device_register that sets the
* correct bus type and adds the bus specific files */ * correct bus type and adds the bus specific files */
int static int ccw_device_register(struct ccw_device *cdev)
ccw_device_register(struct ccw_device *cdev)
{ {
struct device *dev = &cdev->dev; struct device *dev = &cdev->dev;
int ret; int ret;
......
...@@ -78,7 +78,6 @@ void io_subchannel_recog_done(struct ccw_device *cdev); ...@@ -78,7 +78,6 @@ void io_subchannel_recog_done(struct ccw_device *cdev);
int ccw_device_cancel_halt_clear(struct ccw_device *); int ccw_device_cancel_halt_clear(struct ccw_device *);
int ccw_device_register(struct ccw_device *);
void ccw_device_do_unreg_rereg(void *); void ccw_device_do_unreg_rereg(void *);
void ccw_device_call_sch_unregister(void *); void ccw_device_call_sch_unregister(void *);
......
...@@ -739,11 +739,16 @@ static void ap_scan_bus(void *data) ...@@ -739,11 +739,16 @@ static void ap_scan_bus(void *data)
dev = bus_find_device(&ap_bus_type, NULL, dev = bus_find_device(&ap_bus_type, NULL,
(void *)(unsigned long)qid, (void *)(unsigned long)qid,
__ap_scan_bus); __ap_scan_bus);
rc = ap_query_queue(qid, &queue_depth, &device_type);
if (dev && rc) {
put_device(dev);
device_unregister(dev);
continue;
}
if (dev) { if (dev) {
put_device(dev); put_device(dev);
continue; continue;
} }
rc = ap_query_queue(qid, &queue_depth, &device_type);
if (rc) if (rc)
continue; continue;
rc = ap_init_queue(qid); rc = ap_init_queue(qid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment