提交 776e7f0f 编写于 作者: C Cornelia Huck 提交者: Alexander Graf

s390-ccw.img: Enhance drain_irqs().

- Use tpi + tsch to get interrupts.
- Return an error if the irb indicates problems.
Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 22d67ab5
......@@ -38,12 +38,21 @@ static void virtio_notify(struct subchannel_id schid)
* Virtio functions *
***********************************************/
static void drain_irqs(struct subchannel_id schid)
static int drain_irqs(struct subchannel_id schid)
{
struct irb irb = {};
int r = 0;
while (1) {
/* FIXME: make use of TPI, for that enable subchannel and isc */
if (tsch(schid, &irb)) {
return;
/* Might want to differentiate error codes later on. */
if (irb.scsw.cstat) {
r = -EIO;
} else if (irb.scsw.dstat != 0xc) {
r = -EIO;
}
return r;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册