public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Bryan Wu <cooloney@kernel.org>
To: alan@redhat.com
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	Sonic Zhang <sonic.zhang@analog.com>,
	Bryan Wu <cooloney@kernel.org>
Subject: [PATCH 8/9] Blackfin Serial Driver: fix a in dma circle rx buffer handling
Date: Fri, 17 Oct 2008 01:44:06 +0800	[thread overview]
Message-ID: <1224179047-13073-9-git-send-email-cooloney@kernel.org> (raw)
In-Reply-To: <1224179047-13073-1-git-send-email-cooloney@kernel.org>

From: Sonic Zhang <sonic.zhang@analog.com>

Reported-by: Qian Zhang <zhangq@sansitech.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 drivers/serial/bfin_5xx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 350bfc4..1e027e3 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -402,9 +402,11 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart)
 	else
 		flg = TTY_NORMAL;
 
-	for (i = uart->rx_dma_buf.tail; i != uart->rx_dma_buf.head; i++) {
+	for (i = uart->rx_dma_buf.tail; ; i++) {
 		if (i >= UART_XMIT_SIZE)
 			i = 0;
+		if (i == uart->rx_dma_buf.head)
+			break;
 		if (!uart_handle_sysrq_char(&uart->port, uart->rx_dma_buf.buf[i]))
 			uart_insert_char(&uart->port, status, OE,
 				uart->rx_dma_buf.buf[i], flg);
-- 
1.5.6


  parent reply	other threads:[~2008-10-16 17:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-16 17:43 [PATCH 0/9] Blacfin Serial Driver updates for 2.6.28-rc1 (v2) Bryan Wu
2008-10-16 17:43 ` [PATCH 1/9] Blackfin Serial Driver: updates kgdb over Blackfin serial driver with kgdb framework Bryan Wu
2008-10-17 17:41   ` Alan Cox
2008-10-16 17:44 ` [PATCH 2/9] Blackfin Serial Driver: Add a debug function to serial driver Bryan Wu
2008-10-16 17:44 ` [PATCH 3/9] Blackfin Serial Driver: use barrier instead of cpu_relax for Blackfin SMP like patch Bryan Wu
2008-10-16 17:44 ` [PATCH 4/9] Blackfin Serial Driver: fix bug - SIR driver stop receiving randomly Bryan Wu
2008-10-16 17:44 ` [PATCH 5/9] Blackfin Serial Driver: Clean serial console and early prink code` Bryan Wu
2008-10-16 17:44 ` [PATCH 6/9] Blackfin Serial Driver: Fix bug - BF527-EZKIT unable to receive large files over UART in DMA mode Bryan Wu
2008-10-16 17:44 ` [PATCH 7/9] Blackfin Serial Driver: Remove BI status for known_good_char Bryan Wu
2008-10-16 17:44 ` Bryan Wu [this message]
2008-10-16 17:44 ` [PATCH 9/9] Blackfin Serial Driver: Change hardware flowcontrol from poll to interrupt driven Bryan Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1224179047-13073-9-git-send-email-cooloney@kernel.org \
    --to=cooloney@kernel.org \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sonic.zhang@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox