diff options
| author | Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> | 2018-05-02 03:25:59 -0400 |
|---|---|---|
| committer | Cornelia Huck <cohuck@redhat.com> | 2018-05-29 03:27:41 -0400 |
| commit | 2c861d89ccda2fbcea9358eff9cc5f8fae548be5 (patch) | |
| tree | fd337ef9fab21ce5b064c2e2cff7c585772f7849 | |
| parent | 3376d98021e915196f4894d835325a884e635a04 (diff) | |
vfio: ccw: fix error return in vfio_ccw_sch_event
If the device has not been registered, or there is work pending,
we should reschedule a sch_event call again.
Signed-off-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Message-Id: <20180502072559.50691-1-bjsdjshi@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
| -rw-r--r-- | drivers/s390/cio/vfio_ccw_drv.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/s390/cio/vfio_ccw_drv.c b/drivers/s390/cio/vfio_ccw_drv.c index ea6a2d0b2894..770fa9cfc310 100644 --- a/drivers/s390/cio/vfio_ccw_drv.c +++ b/drivers/s390/cio/vfio_ccw_drv.c | |||
| @@ -177,6 +177,7 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) | |||
| 177 | { | 177 | { |
| 178 | struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); | 178 | struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); |
| 179 | unsigned long flags; | 179 | unsigned long flags; |
| 180 | int rc = -EAGAIN; | ||
| 180 | 181 | ||
| 181 | spin_lock_irqsave(sch->lock, flags); | 182 | spin_lock_irqsave(sch->lock, flags); |
| 182 | if (!device_is_registered(&sch->dev)) | 183 | if (!device_is_registered(&sch->dev)) |
| @@ -187,6 +188,7 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) | |||
| 187 | 188 | ||
| 188 | if (cio_update_schib(sch)) { | 189 | if (cio_update_schib(sch)) { |
| 189 | vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER); | 190 | vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER); |
| 191 | rc = 0; | ||
| 190 | goto out_unlock; | 192 | goto out_unlock; |
| 191 | } | 193 | } |
| 192 | 194 | ||
| @@ -195,11 +197,12 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) | |||
| 195 | private->state = private->mdev ? VFIO_CCW_STATE_IDLE : | 197 | private->state = private->mdev ? VFIO_CCW_STATE_IDLE : |
| 196 | VFIO_CCW_STATE_STANDBY; | 198 | VFIO_CCW_STATE_STANDBY; |
| 197 | } | 199 | } |
| 200 | rc = 0; | ||
| 198 | 201 | ||
| 199 | out_unlock: | 202 | out_unlock: |
| 200 | spin_unlock_irqrestore(sch->lock, flags); | 203 | spin_unlock_irqrestore(sch->lock, flags); |
| 201 | 204 | ||
| 202 | return 0; | 205 | return rc; |
| 203 | } | 206 | } |
| 204 | 207 | ||
| 205 | static struct css_device_id vfio_ccw_sch_ids[] = { | 208 | static struct css_device_id vfio_ccw_sch_ids[] = { |
