[PULL,2/7] s390/cio: Set vfio-ccw FSM state before ioeventfd
diff mbox series

Message ID 20190603105038.11788-3-cohuck@redhat.com
State New
Headers show
  • [PULL,1/7] s390/cio: Update SCSW if it points to the end of the chain
Related show

Commit Message

Cornelia Huck June 3, 2019, 10:50 a.m. UTC
From: Eric Farman <farman@linux.ibm.com>

Otherwise, the guest can believe it's okay to start another I/O
and bump into the non-idle state.  This results in a cc=2 (with
the asynchronous CSCH/HSCH code) returned to the guest, which is
unfortunate since everything is otherwise working normally.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Message-Id: <20190514234248.36203-3-farman@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
 drivers/s390/cio/vfio_ccw_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff mbox series

diff --git a/drivers/s390/cio/vfio_ccw_drv.c b/drivers/s390/cio/vfio_ccw_drv.c
index ee8767f5845a..66a66ac1f3d1 100644
--- a/drivers/s390/cio/vfio_ccw_drv.c
+++ b/drivers/s390/cio/vfio_ccw_drv.c
@@ -95,11 +95,11 @@  static void vfio_ccw_sch_io_todo(struct work_struct *work)
 	memcpy(private->io_region->irb_area, irb, sizeof(*irb));
-	if (private->io_trigger)
-		eventfd_signal(private->io_trigger, 1);
 	if (private->mdev && is_final)
 		private->state = VFIO_CCW_STATE_IDLE;
+	if (private->io_trigger)
+		eventfd_signal(private->io_trigger, 1);