From patchwork Tue Feb 4 18:58:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 316722 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CDB6D2C0081 for ; Wed, 5 Feb 2014 06:00:05 +1100 (EST) Received: from localhost ([::1]:54227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAlE2-0003IZ-P5 for incoming@patchwork.ozlabs.org; Tue, 04 Feb 2014 14:00:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAlDL-0003Gj-BV for qemu-devel@nongnu.org; Tue, 04 Feb 2014 13:59:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAlDC-00069F-WB for qemu-devel@nongnu.org; Tue, 04 Feb 2014 13:59:19 -0500 Received: from ssl.serverraum.org ([2a01:4f8:a0:1283::1:2]:55743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAlDC-000692-Q2 for qemu-devel@nongnu.org; Tue, 04 Feb 2014 13:59:10 -0500 Received: from localhost (localhost [127.0.0.1]) by ssl.serverraum.org (Postfix) with ESMTP id 175003F0C0; Tue, 4 Feb 2014 19:59:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ssl.serverraum.org Received: from ssl.serverraum.org ([127.0.0.1]) by localhost (ssl.serverraum.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rQWn7N_k7KeI; Tue, 4 Feb 2014 19:59:09 +0100 (CET) Received: from thanatos.fritz.box (88-134-75-61-dynip.superkabel.de [88.134.75.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 9B7293F0BB; Tue, 4 Feb 2014 19:59:09 +0100 (CET) From: Michael Walle To: qemu-devel@nongnu.org Date: Tue, 4 Feb 2014 19:58:25 +0100 Message-Id: <1391540314-16141-4-git-send-email-michael@walle.cc> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391540314-16141-1-git-send-email-michael@walle.cc> References: <1391540314-16141-1-git-send-email-michael@walle.cc> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:4f8:a0:1283::1:2 Cc: Peter Maydell , Michael Walle , Antony Pavlov , Anthony Liguori Subject: [Qemu-devel] [PULL v5 03/12] milkymist-uart: use qemu_chr_fe_write_all() instead of qemu_chr_fe_write() 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: Antony Pavlov qemu_chr_fe_write() is capable of returning 0 to indicate EAGAIN (and friends) and we don't handle this. Just change it to qemu_chr_fe_write_all() to fix. Reported-by: Peter Crosthwaite Acked-by: Peter Crosthwaite Signed-off-by: Antony Pavlov Signed-off-by: Michael Walle Reviewed-by: Peter Maydell --- hw/char/milkymist-uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c index 2c52a0f..da51f82 100644 --- a/hw/char/milkymist-uart.c +++ b/hw/char/milkymist-uart.c @@ -124,7 +124,7 @@ static void uart_write(void *opaque, hwaddr addr, uint64_t value, switch (addr) { case R_RXTX: if (s->chr) { - qemu_chr_fe_write(s->chr, &ch, 1); + qemu_chr_fe_write_all(s->chr, &ch, 1); } s->regs[R_STAT] |= STAT_TX_EVT; break;