From 776e7f0f215dd11dde85277723408fae3d319143 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Fri, 26 Apr 2013 02:12:53 +0000 Subject: s390-ccw.img: Enhance drain_irqs(). - Use tpi + tsch to get interrupts. - Return an error if the irb indicates problems. Signed-off-by: Cornelia Huck Signed-off-by: Alexander Graf --- pc-bios/s390-ccw/virtio.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index 1968fc6619..1bd17d4781 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -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; } } } -- cgit v1.2.3