aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/vfio_ccw_ops.c
diff options
context:
space:
mode:
authorCornelia Huck <cohuck@redhat.com>2019-01-29 16:13:57 +0100
committerCornelia Huck <cohuck@redhat.com>2019-04-24 14:18:51 +0200
commit690f6a1581c7c08e85451f62bcbfe40f29072842 (patch)
tree27971d432e7baa0f7d74a182575fda241c704a75 /drivers/s390/cio/vfio_ccw_ops.c
parentvfio-ccw: make it safe to access channel programs (diff)
downloadlinux-dev-690f6a1581c7c08e85451f62bcbfe40f29072842.tar.xz
linux-dev-690f6a1581c7c08e85451f62bcbfe40f29072842.zip
vfio-ccw: rework ssch state handling
The flow for processing ssch requests can be improved by splitting the BUSY state: - CP_PROCESSING: We reject any user space requests while we are in the process of translating a channel program and submitting it to the hardware. Use -EAGAIN to signal user space that it should retry the request. - CP_PENDING: We have successfully submitted a request with ssch and are now expecting an interrupt. As we can't handle more than one channel program being processed, reject any further requests with -EBUSY. A final interrupt will move us out of this state. By making this a separate state, we make it possible to issue a halt or a clear while we're still waiting for the final interrupt for the ssch (in a follow-on patch). It also makes a lot of sense not to preemptively filter out writes to the io_region if we're in an incorrect state: the state machine will handle this correctly. Reviewed-by: Eric Farman <farman@linux.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'drivers/s390/cio/vfio_ccw_ops.c')
-rw-r--r--drivers/s390/cio/vfio_ccw_ops.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/s390/cio/vfio_ccw_ops.c b/drivers/s390/cio/vfio_ccw_ops.c
index f673e106c041..3fdcc6dfe0bf 100644
--- a/drivers/s390/cio/vfio_ccw_ops.c
+++ b/drivers/s390/cio/vfio_ccw_ops.c
@@ -193,8 +193,6 @@ static ssize_t vfio_ccw_mdev_write(struct mdev_device *mdev,
return -EINVAL;
private = dev_get_drvdata(mdev_parent_dev(mdev));
- if (private->state != VFIO_CCW_STATE_IDLE)
- return -EACCES;
region = private->io_region;
if (copy_from_user((void *)region + *ppos, buf, count))