linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] serial:bfin_uart: Put TX IRQ in individual platform resource.
@ 2011-08-02  3:45 Sonic Zhang
  2011-08-11  8:03 ` Sonic Zhang
  2011-08-12  2:17 ` Mike Frysinger
  0 siblings, 2 replies; 6+ messages in thread
From: Sonic Zhang @ 2011-08-02  3:45 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-serial, linux-kernel, uclinux-dist-devel, Sonic Zhang

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

Serial TX IRQ is not RX IRQ plus 1 in some blackfin chips.
Give individual platform resources to both TX and RX irqs.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 drivers/tty/serial/bfin_uart.c |   35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
index e08bc04..881c6e7 100644
--- a/drivers/tty/serial/bfin_uart.c
+++ b/drivers/tty/serial/bfin_uart.c
@@ -667,17 +667,17 @@ static int bfin_serial_startup(struct uart_port *port)
 		kgdboc_break_enabled = 0;
 	else {
 # endif
-	if (request_irq(uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED,
+	if (request_irq(uart->rx_irq, bfin_serial_rx_int, IRQF_DISABLED,
 	     "BFIN_UART_RX", uart)) {
 		printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n");
 		return -EBUSY;
 	}
 
 	if (request_irq
-	    (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED,
+	    (uart->tx_irq, bfin_serial_tx_int, IRQF_DISABLED,
 	     "BFIN_UART_TX", uart)) {
 		printk(KERN_NOTICE "Unable to attach BlackFin UART TX interrupt\n");
-		free_irq(uart->port.irq, uart);
+		free_irq(uart->rx_irq, uart);
 		return -EBUSY;
 	}
 
@@ -692,7 +692,7 @@ static int bfin_serial_startup(struct uart_port *port)
 		 */
 		unsigned uart_dma_ch_rx, uart_dma_ch_tx;
 
-		switch (uart->port.irq) {
+		switch (uart->rx_irq) {
 		case IRQ_UART3_RX:
 			uart_dma_ch_rx = CH_UART3_RX;
 			uart_dma_ch_tx = CH_UART3_TX;
@@ -709,16 +709,16 @@ static int bfin_serial_startup(struct uart_port *port)
 		if (uart_dma_ch_rx &&
 			request_dma(uart_dma_ch_rx, "BFIN_UART_RX") < 0) {
 			printk(KERN_NOTICE"Fail to attach UART interrupt\n");
-			free_irq(uart->port.irq, uart);
-			free_irq(uart->port.irq + 1, uart);
+			free_irq(uart->rx_irq, uart);
+			free_irq(uart->tx_irq, uart);
 			return -EBUSY;
 		}
 		if (uart_dma_ch_tx &&
 			request_dma(uart_dma_ch_tx, "BFIN_UART_TX") < 0) {
 			printk(KERN_NOTICE "Fail to attach UART interrupt\n");
 			free_dma(uart_dma_ch_rx);
-			free_irq(uart->port.irq, uart);
-			free_irq(uart->port.irq + 1, uart);
+			free_irq(uart->rx_irq, uart);
+			free_irq(uart->tx_irq, uart);
 			return -EBUSY;
 		}
 	}
@@ -785,8 +785,8 @@ static void bfin_serial_shutdown(struct uart_port *port)
 		break;
 	};
 #endif
-	free_irq(uart->port.irq, uart);
-	free_irq(uart->port.irq+1, uart);
+	free_irq(uart->rx_irq, uart);
+	free_irq(uart->tx_irq, uart);
 #endif
 
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
@@ -1319,14 +1319,21 @@ static int bfin_serial_probe(struct platform_device *pdev)
 		}
 		uart->port.mapbase = res->start;
 
-		uart->port.irq = platform_get_irq(pdev, 0);
-		if (uart->port.irq < 0) {
-			dev_err(&pdev->dev, "No uart RX/TX IRQ specified\n");
+		uart->tx_irq = platform_get_irq(pdev, 0);
+		if (uart->tx_irq < 0) {
+			dev_err(&pdev->dev, "No uart TX IRQ specified\n");
 			ret = -ENOENT;
 			goto out_error_unmap;
 		}
 
-		uart->status_irq = platform_get_irq(pdev, 1);
+		uart->rx_irq = platform_get_irq(pdev, 1);
+		if (uart->rx_irq < 0) {
+			dev_err(&pdev->dev, "No uart RX IRQ specified\n");
+			ret = -ENOENT;
+			goto out_error_unmap;
+		}
+
+		uart->status_irq = platform_get_irq(pdev, 2);
 		if (uart->status_irq < 0) {
 			dev_err(&pdev->dev, "No uart status IRQ specified\n");
 			ret = -ENOENT;
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] serial:bfin_uart: Put TX IRQ in individual platform resource.
  2011-08-02  3:45 [PATCH v2] serial:bfin_uart: Put TX IRQ in individual platform resource Sonic Zhang
@ 2011-08-11  8:03 ` Sonic Zhang
  2011-08-11  9:19   ` Alan Cox
  2011-08-12  2:17 ` Mike Frysinger
  1 sibling, 1 reply; 6+ messages in thread
From: Sonic Zhang @ 2011-08-11  8:03 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-serial, linux-kernel, uclinux-dist-devel, Sonic Zhang

Hi Alan,

Any comments?

Sonic Zhang

On Tue, Aug 2, 2011 at 11:45 AM, Sonic Zhang <sonic.adi@gmail.com> wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> Serial TX IRQ is not RX IRQ plus 1 in some blackfin chips.
> Give individual platform resources to both TX and RX irqs.
>
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> ---
>  drivers/tty/serial/bfin_uart.c |   35 +++++++++++++++++++++--------------
>  1 files changed, 21 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
> index e08bc04..881c6e7 100644
> --- a/drivers/tty/serial/bfin_uart.c
> +++ b/drivers/tty/serial/bfin_uart.c
> @@ -667,17 +667,17 @@ static int bfin_serial_startup(struct uart_port *port)
>                kgdboc_break_enabled = 0;
>        else {
>  # endif
> -       if (request_irq(uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED,
> +       if (request_irq(uart->rx_irq, bfin_serial_rx_int, IRQF_DISABLED,
>             "BFIN_UART_RX", uart)) {
>                printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n");
>                return -EBUSY;
>        }
>
>        if (request_irq
> -           (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED,
> +           (uart->tx_irq, bfin_serial_tx_int, IRQF_DISABLED,
>             "BFIN_UART_TX", uart)) {
>                printk(KERN_NOTICE "Unable to attach BlackFin UART TX interrupt\n");
> -               free_irq(uart->port.irq, uart);
> +               free_irq(uart->rx_irq, uart);
>                return -EBUSY;
>        }
>
> @@ -692,7 +692,7 @@ static int bfin_serial_startup(struct uart_port *port)
>                 */
>                unsigned uart_dma_ch_rx, uart_dma_ch_tx;
>
> -               switch (uart->port.irq) {
> +               switch (uart->rx_irq) {
>                case IRQ_UART3_RX:
>                        uart_dma_ch_rx = CH_UART3_RX;
>                        uart_dma_ch_tx = CH_UART3_TX;
> @@ -709,16 +709,16 @@ static int bfin_serial_startup(struct uart_port *port)
>                if (uart_dma_ch_rx &&
>                        request_dma(uart_dma_ch_rx, "BFIN_UART_RX") < 0) {
>                        printk(KERN_NOTICE"Fail to attach UART interrupt\n");
> -                       free_irq(uart->port.irq, uart);
> -                       free_irq(uart->port.irq + 1, uart);
> +                       free_irq(uart->rx_irq, uart);
> +                       free_irq(uart->tx_irq, uart);
>                        return -EBUSY;
>                }
>                if (uart_dma_ch_tx &&
>                        request_dma(uart_dma_ch_tx, "BFIN_UART_TX") < 0) {
>                        printk(KERN_NOTICE "Fail to attach UART interrupt\n");
>                        free_dma(uart_dma_ch_rx);
> -                       free_irq(uart->port.irq, uart);
> -                       free_irq(uart->port.irq + 1, uart);
> +                       free_irq(uart->rx_irq, uart);
> +                       free_irq(uart->tx_irq, uart);
>                        return -EBUSY;
>                }
>        }
> @@ -785,8 +785,8 @@ static void bfin_serial_shutdown(struct uart_port *port)
>                break;
>        };
>  #endif
> -       free_irq(uart->port.irq, uart);
> -       free_irq(uart->port.irq+1, uart);
> +       free_irq(uart->rx_irq, uart);
> +       free_irq(uart->tx_irq, uart);
>  #endif
>
>  #ifdef CONFIG_SERIAL_BFIN_CTSRTS
> @@ -1319,14 +1319,21 @@ static int bfin_serial_probe(struct platform_device *pdev)
>                }
>                uart->port.mapbase = res->start;
>
> -               uart->port.irq = platform_get_irq(pdev, 0);
> -               if (uart->port.irq < 0) {
> -                       dev_err(&pdev->dev, "No uart RX/TX IRQ specified\n");
> +               uart->tx_irq = platform_get_irq(pdev, 0);
> +               if (uart->tx_irq < 0) {
> +                       dev_err(&pdev->dev, "No uart TX IRQ specified\n");
>                        ret = -ENOENT;
>                        goto out_error_unmap;
>                }
>
> -               uart->status_irq = platform_get_irq(pdev, 1);
> +               uart->rx_irq = platform_get_irq(pdev, 1);
> +               if (uart->rx_irq < 0) {
> +                       dev_err(&pdev->dev, "No uart RX IRQ specified\n");
> +                       ret = -ENOENT;
> +                       goto out_error_unmap;
> +               }
> +
> +               uart->status_irq = platform_get_irq(pdev, 2);
>                if (uart->status_irq < 0) {
>                        dev_err(&pdev->dev, "No uart status IRQ specified\n");
>                        ret = -ENOENT;
> --
> 1.7.0.4
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] serial:bfin_uart: Put TX IRQ in individual platform resource.
  2011-08-11  8:03 ` Sonic Zhang
@ 2011-08-11  9:19   ` Alan Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2011-08-11  9:19 UTC (permalink / raw)
  To: Sonic Zhang; +Cc: linux-serial, linux-kernel, uclinux-dist-devel, Sonic Zhang

On Thu, 11 Aug 2011 16:03:52 +0800
Sonic Zhang <sonic.adi@gmail.com> wrote:

> Hi Alan,
> 
> Any comments?
> 
> Sonic Zhang

Fine by me - doesn't really touch any tty specific code or tty
interfacing code anyway

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] serial:bfin_uart: Put TX IRQ in individual platform resource.
  2011-08-02  3:45 [PATCH v2] serial:bfin_uart: Put TX IRQ in individual platform resource Sonic Zhang
  2011-08-11  8:03 ` Sonic Zhang
@ 2011-08-12  2:17 ` Mike Frysinger
  2011-08-12  2:39   ` real mz
  1 sibling, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2011-08-12  2:17 UTC (permalink / raw)
  To: Sonic Zhang
  Cc: Alan Cox, linux-serial, linux-kernel, uclinux-dist-devel,
	Sonic Zhang

On Mon, Aug 1, 2011 at 23:45, Sonic Zhang wrote:
> Serial TX IRQ is not RX IRQ plus 1 in some blackfin chips.
> Give individual platform resources to both TX and RX irqs.

i guess you also need to fold in Scott's recent fix and send out a v3
-mike

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] serial:bfin_uart: Put TX IRQ in individual platform resource.
  2011-08-12  2:17 ` Mike Frysinger
@ 2011-08-12  2:39   ` real mz
  2011-08-12  2:47     ` Mike Frysinger
  0 siblings, 1 reply; 6+ messages in thread
From: real mz @ 2011-08-12  2:39 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Sonic Zhang, Alan Cox, linux-serial, linux-kernel,
	uclinux-dist-devel, Sonic Zhang

you mean the uart wakeup fix?
-steven

On Fri, Aug 12, 2011 at 10:17 AM, Mike Frysinger <vapier.adi@gmail.com> wrote:
> On Mon, Aug 1, 2011 at 23:45, Sonic Zhang wrote:
>> Serial TX IRQ is not RX IRQ plus 1 in some blackfin chips.
>> Give individual platform resources to both TX and RX irqs.
>
> i guess you also need to fold in Scott's recent fix and send out a v3
> -mike
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] serial:bfin_uart: Put TX IRQ in individual platform resource.
  2011-08-12  2:39   ` real mz
@ 2011-08-12  2:47     ` Mike Frysinger
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2011-08-12  2:47 UTC (permalink / raw)
  To: real mz
  Cc: Sonic Zhang, Alan Cox, linux-serial, linux-kernel,
	uclinux-dist-devel, Sonic Zhang

On Thu, Aug 11, 2011 at 22:39, real mz wrote:
> you mean the uart wakeup fix?

yarp.  seems like Sonic's refactor broke it to need your patch.  or i
misread things (i only glanced).
-mike

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-08-12  2:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-02  3:45 [PATCH v2] serial:bfin_uart: Put TX IRQ in individual platform resource Sonic Zhang
2011-08-11  8:03 ` Sonic Zhang
2011-08-11  9:19   ` Alan Cox
2011-08-12  2:17 ` Mike Frysinger
2011-08-12  2:39   ` real mz
2011-08-12  2:47     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).