提交 b26ba22b 编写于 作者: C Christian Borntraeger 提交者: Marcelo Tosatti

KVM: s390: Gracefully handle busy conditions on ccw_device_start

In rare cases a virtio command might try to issue a ccw before a former
ccw was answered with a tsch. This will cause CC=2 (busy). Lets just
retry in that case.
Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
上级 73fa21ea
...@@ -132,11 +132,14 @@ static int ccw_io_helper(struct virtio_ccw_device *vcdev, ...@@ -132,11 +132,14 @@ static int ccw_io_helper(struct virtio_ccw_device *vcdev,
unsigned long flags; unsigned long flags;
int flag = intparm & VIRTIO_CCW_INTPARM_MASK; int flag = intparm & VIRTIO_CCW_INTPARM_MASK;
spin_lock_irqsave(get_ccwdev_lock(vcdev->cdev), flags); do {
ret = ccw_device_start(vcdev->cdev, ccw, intparm, 0, 0); spin_lock_irqsave(get_ccwdev_lock(vcdev->cdev), flags);
if (!ret) ret = ccw_device_start(vcdev->cdev, ccw, intparm, 0, 0);
vcdev->curr_io |= flag; if (!ret)
spin_unlock_irqrestore(get_ccwdev_lock(vcdev->cdev), flags); vcdev->curr_io |= flag;
spin_unlock_irqrestore(get_ccwdev_lock(vcdev->cdev), flags);
cpu_relax();
} while (ret == -EBUSY);
wait_event(vcdev->wait_q, doing_io(vcdev, flag) == 0); wait_event(vcdev->wait_q, doing_io(vcdev, flag) == 0);
return ret ? ret : vcdev->err; return ret ? ret : vcdev->err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册