[PATCH 0/2] Blackfin serial driver bug fixing

Previous thread: Re: HPET regression in 2.6.26 versus 2.6.25 -- retried 2.6.27-rc3 patch (and patch method) by David Witbrodt on Thursday, August 14, 2008 - 8:40 pm. (2 messages)

Next thread: Re: ath5k on the Acer Aspire One by J.A. on Friday, August 15, 2008 - 1:21 am. (5 messages)
From: Bryan Wu
Date: Friday, August 15, 2008 - 1:14 am

Hi Alan,

Here is 2 critical bug fixing patch for Blackfin serial driver.
And as you acked the previous 8 Blackfin serial driver patches, need I
push them to blackfin-2.6 git tree and ask Linus to pull from that or
they were queued in your serial tree?

Thanks,
-Bryan
--


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

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 arch/blackfin/kernel/bfin_dma_5xx.c |   13 ++++-----
 drivers/serial/bfin_5xx.c           |   50 +++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 93229b3..339293d 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -117,15 +117,14 @@ int request_dma(unsigned int channel, char *device_id)
 
 #ifdef CONFIG_BF54x
 	if (channel >= CH_UART2_RX && channel <= CH_UART3_TX) {
-		if (strncmp(device_id, "BFIN_UART", 9) == 0) {
-			dma_ch[channel].regs->peripheral_map &= 0x0FFF;
-			dma_ch[channel].regs->peripheral_map |=
+		unsigned int per_map;
+		per_map = dma_ch[channel].regs->peripheral_map & 0xFFF;
+		if (strncmp(device_id, "BFIN_UART", 9) == 0)
+			dma_ch[channel].regs->peripheral_map = per_map |
 				((channel - CH_UART2_RX + 0xC)<<12);
-		} else {
-			dma_ch[channel].regs->peripheral_map &= 0x0FFF;
-			dma_ch[channel].regs->peripheral_map |=
+		else
+			dma_ch[channel].regs->peripheral_map = per_map |
 				((channel - CH_UART2_RX + 0x6)<<12);
-		}
 	}
 #endif
 
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 5ae1bfa..487a562 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -649,6 +649,42 @@ static int bfin_serial_startup(struct uart_port *port)
 		free_irq(uart->port.irq, uart);
 		return -EBUSY;
 	}
+
+# ifdef CONFIG_BF54x
+	{
+		unsigned uart_dma_ch_rx, uart_dma_ch_tx;
+
+		switch (uart->port.irq) {
+		case IRQ_UART3_RX:
+			uart_dma_ch_rx = CH_UART3_RX;
+			uart_dma_ch_tx = CH_UART3_TX;
+			break;
+		case IRQ_UART2_RX:
+			uart_dma_ch_rx = CH_UART2_RX;
+			uart_dma_ch_tx = CH_UART2_TX;
+			break;
+		default:
+			uart_dma_ch_rx = uart_dma_ch_tx = 0;
+			break;
+		};
+
+		if ...
From: Bryan Wu
Date: Friday, August 15, 2008 - 1:14 am

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

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 drivers/serial/bfin_5xx.c |   43 ++++++++++++++++++++++++++-----------------
 1 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 487a562..a5ff54e 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -124,8 +124,6 @@ static void bfin_serial_enable_ms(struct uart_port *port)
 }
 
 #ifdef CONFIG_KGDB_UART
-static int kgdb_entry_state;
-
 void kgdb_put_debug_char(int chr)
 {
 	struct bfin_serial_port *uart;
@@ -178,7 +176,7 @@ int kgdb_get_debug_char(void)
 #ifdef CONFIG_SERIAL_BFIN_PIO
 static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
 {
-	struct tty_struct *tty = uart->port.info->port.tty;
+	struct tty_struct *tty = NULL;
 	unsigned int status, ch, flg;
 	static struct timeval anomaly_start = { .tv_sec = 0 };
 
@@ -191,24 +189,33 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
 #ifdef CONFIG_KGDB_UART
 	if (uart->port.line == CONFIG_KGDB_UART_PORT) {
 		struct pt_regs *regs = get_irq_regs();
-		if (uart->port.cons->index == CONFIG_KGDB_UART_PORT && ch == 0x1) { /* Ctrl + A */
-			kgdb_breakkey_pressed(regs);
-			return;
-		} else if (kgdb_entry_state == 0 && ch == '$') {/* connection from KGDB */
-			kgdb_entry_state = 1;
-		} else if (kgdb_entry_state == 1 && ch == 'q') {
-			kgdb_entry_state = 0;
+		int kgdb_timeout;
+		if (uart->port.cons->index == CONFIG_KGDB_UART_PORT
+			&& ch == 0x1) { /* Ctrl + A */
 			kgdb_breakkey_pressed(regs);
 			return;
+		}
+		if (ch == '$') {
+			/* connection from KGDB */
+			kgdb_timeout = get_cclk()/10000;
+			while (!(UART_GET_LSR(uart) & DR)
+				&& kgdb_timeout > 0) {
+				kgdb_timeout--;
+				cpu_relax();
+			}
+			if (kgdb_timeout && UART_GET_CHAR(uart) == 'q') {
+				kgdb_breakkey_pressed(regs);
+				return;
+			}
 		} else if (ch == 0x3) ...
From: Alan Cox
Date: Friday, August 15, 2008 - 2:00 am

On Fri, 15 Aug 2008 16:14:07 +0800

The existing ones were queued for 2.6.28 as I assumed that was what your
email meant you want to do. If you have critical fixes at this point in
the -rc series I would send them direct to Linus
--

Previous thread: Re: HPET regression in 2.6.26 versus 2.6.25 -- retried 2.6.27-rc3 patch (and patch method) by David Witbrodt on Thursday, August 14, 2008 - 8:40 pm. (2 messages)

Next thread: Re: ath5k on the Acer Aspire One by J.A. on Friday, August 15, 2008 - 1:21 am. (5 messages)