From patchwork Fri Apr 26 18:19:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 239965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A1FF52C011C for ; Sat, 27 Apr 2013 04:34:04 +1000 (EST) Received: from localhost ([::1]:39779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnNi-0003wg-7J for incoming@patchwork.ozlabs.org; Fri, 26 Apr 2013 14:28:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnFF-0007oG-RG for qemu-devel@nongnu.org; Fri, 26 Apr 2013 14:19:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVnFA-0004DO-Nu for qemu-devel@nongnu.org; Fri, 26 Apr 2013 14:19:41 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38749 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnFA-0004Cn-6L; Fri, 26 Apr 2013 14:19:36 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 85BE15E000212; Fri, 26 Apr 2013 20:19:34 +0200 (CEST) From: Alexander Graf To: qemu-ppc@nongnu.org Date: Fri, 26 Apr 2013 20:19:25 +0200 Message-Id: <1367000373-7972-17-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1367000373-7972-1-git-send-email-agraf@suse.de> References: <1367000373-7972-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Blue Swirl , Cornelia Huck , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PATCH 16/24] s390-ccw.img: Enhance drain_irqs(). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Cornelia Huck - 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 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index 1968fc6..1bd17d4 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; } } }