Commit dd1a47c2 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: unsolicited interrupts during sense pgid.
  [S390] cio: no path after machine check.
  [S390] cio: kernel stack overflow.
  [S390] dasd: fix device shutdown process.
  [S390] broken copy_in_user function.
parents 22db37ec 7b7db1b5
......@@ -88,30 +88,31 @@ __copy_to_user_asm:
.globl __copy_in_user_asm
# %r2 = from, %r3 = n, %r4 = to
__copy_in_user_asm:
ahi %r3,-1
jo 6f
sacf 256
bras 1,1f
mvc 0(1,%r4),0(%r2)
0: mvc 0(256,%r4),0(%r2)
la %r2,256(%r2)
la %r4,256(%r4)
1: ahi %r3,-256
jnm 0b
2: ex %r3,0(%r1)
sacf 0
slr %r2,%r2
br 14
3: mvc 0(1,%r4),0(%r2)
bras %r1,4f
0: ahi %r3,257
1: mvc 0(1,%r4),0(%r2)
la %r2,1(%r2)
la %r4,1(%r4)
ahi %r3,-1
jnz 1b
2: lr %r2,%r3
br %r14
3: mvc 0(256,%r4),0(%r2)
la %r2,256(%r2)
la %r4,256(%r4)
4: ahi %r3,-256
jnm 3b
4: lr %r2,%r3
5: ex %r3,4(%r1)
sacf 0
6: slr %r2,%r2
br %r14
.section __ex_table,"a"
.long 0b,3b
.long 2b,3b
.long 3b,4b
.long 1b,2b
.long 3b,0b
.long 5b,0b
.previous
.align 4
......
......@@ -88,30 +88,31 @@ __copy_to_user_asm:
.globl __copy_in_user_asm
# %r2 = from, %r3 = n, %r4 = to
__copy_in_user_asm:
aghi %r3,-1
jo 6f
sacf 256
bras 1,1f
mvc 0(1,%r4),0(%r2)
0: mvc 0(256,%r4),0(%r2)
la %r2,256(%r2)
la %r4,256(%r4)
1: aghi %r3,-256
jnm 0b
2: ex %r3,0(%r1)
sacf 0
slgr %r2,%r2
br 14
3: mvc 0(1,%r4),0(%r2)
bras %r1,4f
0: aghi %r3,257
1: mvc 0(1,%r4),0(%r2)
la %r2,1(%r2)
la %r4,1(%r4)
aghi %r3,-1
jnz 1b
2: lgr %r2,%r3
br %r14
3: mvc 0(256,%r4),0(%r2)
la %r2,256(%r2)
la %r4,256(%r4)
4: aghi %r3,-256
jnm 3b
4: lgr %r2,%r3
5: ex %r3,4(%r1)
sacf 0
br %r14
6: slgr %r2,%r2
br 14
.section __ex_table,"a"
.quad 0b,3b
.quad 2b,3b
.quad 3b,4b
.quad 1b,2b
.quad 3b,0b
.quad 5b,0b
.previous
.align 4
......
This diff is collapsed.
......@@ -83,10 +83,12 @@ dasd_gendisk_alloc(struct dasd_device *device)
void
dasd_gendisk_free(struct dasd_device *device)
{
if (device->gdp) {
del_gendisk(device->gdp);
device->gdp->queue = NULL;
put_disk(device->gdp);
device->gdp = NULL;
}
}
/*
......
......@@ -183,11 +183,9 @@ ccwgroup_create(struct device *root,
gdev->creator_id = creator_id;
gdev->count = argc;
gdev->dev = (struct device ) {
.bus = &ccwgroup_bus_type,
.parent = root,
.release = ccwgroup_release,
};
gdev->dev.bus = &ccwgroup_bus_type;
gdev->dev.parent = root;
gdev->dev.release = ccwgroup_release;
snprintf (gdev->dev.bus_id, BUS_ID_SIZE, "%s",
gdev->cdev[0]->dev.bus_id);
......@@ -391,10 +389,8 @@ int
ccwgroup_driver_register (struct ccwgroup_driver *cdriver)
{
/* register our new driver with the core */
cdriver->driver = (struct device_driver) {
.bus = &ccwgroup_bus_type,
.name = cdriver->name,
};
cdriver->driver.bus = &ccwgroup_bus_type;
cdriver->driver.name = cdriver->name;
return driver_register(&cdriver->driver);
}
......
......@@ -238,8 +238,6 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
/* Check for single path devices. */
if (sch->schib.pmcw.pim == 0x80)
goto out_unreg;
if (sch->vpm == mask)
goto out_unreg;
if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) &&
(sch->schib.scsw.actl & SCSW_ACTL_SCHACT) &&
......@@ -258,6 +256,8 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
/* trigger path verification. */
if (sch->driver && sch->driver->verify)
sch->driver->verify(&sch->dev);
else if (sch->vpm == mask)
goto out_unreg;
out_unlock:
spin_unlock_irq(&sch->lock);
return 0;
......@@ -1391,10 +1391,8 @@ new_channel_path(int chpid)
/* fill in status, etc. */
chp->id = chpid;
chp->state = 1;
chp->dev = (struct device) {
.parent = &css[0]->device,
.release = chp_release,
};
chp->dev.parent = &css[0]->device;
chp->dev.release = chp_release;
snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp0.%x", chpid);
/* Obtain channel path description and fill it in. */
......
......@@ -556,12 +556,11 @@ get_disc_ccwdev_by_devno(unsigned int devno, unsigned int ssid,
struct ccw_device *sibling)
{
struct device *dev;
struct match_data data = {
.devno = devno,
.ssid = ssid,
.sibling = sibling,
};
struct match_data data;
data.devno = devno;
data.ssid = ssid;
data.sibling = sibling;
dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno);
return dev ? to_ccwdev(dev) : NULL;
......@@ -835,10 +834,8 @@ io_subchannel_probe (struct subchannel *sch)
return -ENOMEM;
}
atomic_set(&cdev->private->onoff, 0);
cdev->dev = (struct device) {
.parent = &sch->dev,
.release = ccw_device_release,
};
cdev->dev.parent = &sch->dev;
cdev->dev.release = ccw_device_release;
INIT_LIST_HEAD(&cdev->private->kick_work.entry);
/* Do first half of device_register. */
device_initialize(&cdev->dev);
......@@ -977,9 +974,7 @@ ccw_device_console_enable (struct ccw_device *cdev, struct subchannel *sch)
int rc;
/* Initialize the ccw_device structure. */
cdev->dev = (struct device) {
.parent = &sch->dev,
};
cdev->dev.parent= &sch->dev;
rc = io_subchannel_recog(cdev, sch);
if (rc)
return rc;
......
......@@ -267,12 +267,10 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
notify = 1;
}
/* fill out sense information */
cdev->id = (struct ccw_device_id) {
.cu_type = cdev->private->senseid.cu_type,
.cu_model = cdev->private->senseid.cu_model,
.dev_type = cdev->private->senseid.dev_type,
.dev_model = cdev->private->senseid.dev_model,
};
cdev->id.cu_type = cdev->private->senseid.cu_type;
cdev->id.cu_model = cdev->private->senseid.cu_model;
cdev->id.dev_type = cdev->private->senseid.dev_type;
cdev->id.dev_model = cdev->private->senseid.dev_model;
if (notify) {
cdev->private->state = DEV_STATE_OFFLINE;
if (same_dev) {
......@@ -566,12 +564,10 @@ ccw_device_verify_done(struct ccw_device *cdev, int err)
/* Deliver fake irb to device driver, if needed. */
if (cdev->private->flags.fake_irb) {
memset(&cdev->private->irb, 0, sizeof(struct irb));
cdev->private->irb.scsw = (struct scsw) {
.cc = 1,
.fctl = SCSW_FCTL_START_FUNC,
.actl = SCSW_ACTL_START_PEND,
.stctl = SCSW_STCTL_STATUS_PEND,
};
cdev->private->irb.scsw.cc = 1;
cdev->private->irb.scsw.fctl = SCSW_FCTL_START_FUNC;
cdev->private->irb.scsw.actl = SCSW_ACTL_START_PEND;
cdev->private->irb.scsw.stctl = SCSW_STCTL_STATUS_PEND;
cdev->private->flags.fake_irb = 0;
if (cdev->handler)
cdev->handler(cdev, cdev->private->intparm,
......
......@@ -23,6 +23,21 @@
#include "device.h"
#include "ioasm.h"
/*
* Helper function called from interrupt context to decide whether an
* operation should be tried again.
*/
static int __ccw_device_should_retry(struct scsw *scsw)
{
/* CC is only valid if start function bit is set. */
if ((scsw->fctl & SCSW_FCTL_START_FUNC) && scsw->cc == 1)
return 1;
/* No more activity. For sense and set PGID we stubbornly try again. */
if (!scsw->actl)
return 1;
return 0;
}
/*
* Start Sense Path Group ID helper function. Used in ccw_device_recog
* and ccw_device_sense_pgid.
......@@ -155,10 +170,10 @@ ccw_device_sense_pgid_irq(struct ccw_device *cdev, enum dev_event dev_event)
int ret;
irb = (struct irb *) __LC_IRB;
/* Retry sense pgid for cc=1. */
if (irb->scsw.stctl ==
(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
if (irb->scsw.cc == 1) {
if (__ccw_device_should_retry(&irb->scsw)) {
ret = __ccw_device_sense_pgid_start(cdev);
if (ret && ret != -EBUSY)
ccw_device_sense_pgid_done(cdev, ret);
......@@ -391,10 +406,10 @@ ccw_device_verify_irq(struct ccw_device *cdev, enum dev_event dev_event)
int ret;
irb = (struct irb *) __LC_IRB;
/* Retry set pgid for cc=1. */
if (irb->scsw.stctl ==
(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
if (irb->scsw.cc == 1)
if (__ccw_device_should_retry(&irb->scsw))
__ccw_device_verify_start(cdev);
return;
}
......@@ -494,10 +509,10 @@ ccw_device_disband_irq(struct ccw_device *cdev, enum dev_event dev_event)
int ret;
irb = (struct irb *) __LC_IRB;
/* Retry set pgid for cc=1. */
if (irb->scsw.stctl ==
(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
if (irb->scsw.cc == 1)
if (__ccw_device_should_retry(&irb->scsw))
__ccw_device_disband_start(cdev);
return;
}
......
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