From patchwork Wed Apr 3 04:52:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 233234 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 9C3132C0153 for ; Wed, 3 Apr 2013 15:54:00 +1100 (EST) Received: from localhost ([::1]:33518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNFht-0002Jv-HI for incoming@patchwork.ozlabs.org; Wed, 03 Apr 2013 00:53:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNFhY-0002CI-0a for qemu-devel@nongnu.org; Wed, 03 Apr 2013 00:53:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNFhX-0003Ki-7M for qemu-devel@nongnu.org; Wed, 03 Apr 2013 00:53:35 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:50325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNFhX-0003Kb-1Q for qemu-devel@nongnu.org; Wed, 03 Apr 2013 00:53:35 -0400 Received: by mail-pa0-f48.google.com with SMTP id lj1so681255pab.7 for ; Tue, 02 Apr 2013 21:53:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references:x-gm-message-state; bh=is+zhR2Gnaxq/2nLp3oiSWhbWxdtykbqkDOYok0elhI=; b=ZsTWHSI56HpQs/Y140HhNjRool5RNaJsSIWrmVbPYtonO4lrGCAUItWbrbaaur4/JM n1VVbiLqwnI9iWT3HESkN9SfKW0APDhIafSEnz4z8lzpspYURH57Ct/jVCOeO6ZAm16r IgA+0Lueo45v5RuPg2dD/drMuHN+jc4uehafH977QaIg8zhkl48cLwhvhwDp36RTb3UM dmyAhw0AgrfBCmVT1wbxw+PsHwbjayPRLxxqIVeWIOmbkDDKRzQz9Jf560hf/uRILJni J1v5CPjLzuPiFX3ReeFR/O1/+jmFQvT+kq0ivs/rfnrKEXrwCaLnmwn5XiMMxR6zXEFd 8AnQ== X-Received: by 10.66.197.165 with SMTP id iv5mr1116263pac.7.1364964814251; Tue, 02 Apr 2013 21:53:34 -0700 (PDT) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPS id vd4sm4361089pbc.35.2013.04.02.21.53.32 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Tue, 02 Apr 2013 21:53:33 -0700 (PDT) From: Peter Crosthwaite To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Wed, 3 Apr 2013 14:52:21 +1000 Message-Id: <494c1e005e225c915d295ddfd75d992ad2dabc3c.1364964526.git.peter.crosthwaite@xilinx.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQmHAULfXXFiBXJupa9zK7ytxg+gl5wDxLH/PEJDB1DevWyfL1lco+faiRjSp2l/TMWDRNq0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.48 Cc: Jason Wu , Peter Crosthwaite , Wendy Liang Subject: [Qemu-devel] [PATCH arm-devs v1 1/1] cadence_uart: Flush queued characters on reset 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 Reset can be used to empty the rx-fifo. As the fifo full condition is used to return false from can_receive, queued rx data should be flushed on reset accordingly. Cc: Wendy Liang Cc: Jason Wu Signed-off-by: Peter Crosthwaite Reported-by: Jason Wu --- hw/cadence_uart.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/cadence_uart.c b/hw/cadence_uart.c index 5426f10..421ec99 100644 --- a/hw/cadence_uart.c +++ b/hw/cadence_uart.c @@ -157,6 +157,7 @@ static void uart_rx_reset(UartState *s) { s->rx_wpos = 0; s->rx_count = 0; + qemu_chr_accept_input(s->chr); s->r[R_SR] |= UART_SR_INTR_REMPTY; s->r[R_SR] &= ~UART_SR_INTR_RFUL;