* [PATCH 5/6] serial: manually inline serial8250_handle_port
From: Paul Gortmaker @ 2011-12-04 23:42 UTC (permalink / raw)
To: alan, gregkh, scottwood, galak; +Cc: linux-serial, linuxppc-dev, linux-kernel
In-Reply-To: <1323042143-25330-1-git-send-email-paul.gortmaker@windriver.com>
Currently serial8250_handle_irq is a trivial wrapper around
serial8250_handle_port, which actually does all the work.
Since there are no other callers of serial8250_handle_port, we
can just move it inline into serial8250_handle_irq. This also
makes it more clear what functionality any custom IRQ handlers
need to provide if not using serial8250_default_handle_irq.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/tty/serial/8250.c | 23 ++++++++---------------
1 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 9e7780d..23332cb 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -1528,10 +1528,15 @@ EXPORT_SYMBOL_GPL(serial8250_modem_status);
/*
* This handles the interrupt from one port.
*/
-static void serial8250_handle_port(struct uart_8250_port *up)
+int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
{
unsigned char status;
unsigned long flags;
+ struct uart_8250_port *up =
+ container_of(port, struct uart_8250_port, port);
+
+ if (iir & UART_IIR_NO_INT)
+ return 0;
spin_lock_irqsave(&up->port.lock, flags);
@@ -1546,19 +1551,7 @@ static void serial8250_handle_port(struct uart_8250_port *up)
serial8250_tx_chars(up);
spin_unlock_irqrestore(&up->port.lock, flags);
-}
-
-int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
-{
- struct uart_8250_port *up =
- container_of(port, struct uart_8250_port, port);
-
- if (!(iir & UART_IIR_NO_INT)) {
- serial8250_handle_port(up);
- return 1;
- }
-
- return 0;
+ return 1;
}
EXPORT_SYMBOL_GPL(serial8250_handle_irq);
@@ -2825,7 +2818,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
local_irq_save(flags);
if (up->port.sysrq) {
- /* serial8250_handle_port() already took the lock */
+ /* serial8250_handle_irq() already took the lock */
locked = 0;
} else if (oops_in_progress) {
locked = spin_trylock(&up->port.lock);
--
1.7.7
^ permalink raw reply related
* [PATCH 6/6] serial: add irq handler for Freescale 16550 errata.
From: Paul Gortmaker @ 2011-12-04 23:42 UTC (permalink / raw)
To: alan, gregkh, scottwood, galak; +Cc: linux-serial, linuxppc-dev, linux-kernel
In-Reply-To: <1323042143-25330-1-git-send-email-paul.gortmaker@windriver.com>
Sending a break on the SOC UARTs found in some MPC83xx/85xx/86xx
chips seems to cause a short lived IRQ storm (/proc/interrupts
typically shows somewhere between 300 and 1500 events). Unfortunately
this renders SysRQ over the serial console completely inoperable.
The suggested workaround in the errata is to read the Rx register,
wait one character period, and then read the Rx register again.
We achieve this by tracking the old LSR value, and on the subsequent
interrupt event after a break, we don't read LSR, instead we just
read the RBR again and return immediately.
The "fsl,ns16550" is used in the compatible field of the serial
device to mark UARTs known to have this issue.
Thanks to Scott Wood for providing the errata data which led to
a much cleaner fix.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/powerpc/kernel/legacy_serial.c | 3 ++
drivers/tty/serial/8250_fsl.c | 63 +++++++++++++++++++++++++++++++++++
drivers/tty/serial/Kconfig | 5 +++
drivers/tty/serial/Makefile | 1 +
include/linux/serial_8250.h | 1 +
5 files changed, 73 insertions(+), 0 deletions(-)
create mode 100644 drivers/tty/serial/8250_fsl.c
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index c7b5afe..3fea368 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -441,6 +441,9 @@ static void __init fixup_port_irq(int index,
return;
port->irq = virq;
+
+ if (of_device_is_compatible(np, "fsl,ns16550"))
+ port->handle_irq = fsl8250_handle_irq;
}
static void __init fixup_port_pio(int index,
diff --git a/drivers/tty/serial/8250_fsl.c b/drivers/tty/serial/8250_fsl.c
new file mode 100644
index 0000000..f4d3c47
--- /dev/null
+++ b/drivers/tty/serial/8250_fsl.c
@@ -0,0 +1,63 @@
+#include <linux/serial_reg.h>
+#include <linux/serial_8250.h>
+
+#include "8250.h"
+
+/*
+ * Freescale 16550 UART "driver", Copyright (C) 2011 Paul Gortmaker.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This isn't a full driver; it just provides an alternate IRQ
+ * handler to deal with an errata. Everything else is just
+ * using the bog standard 8250 support.
+ *
+ * We follow code flow of serial8250_default_handle_irq() but add
+ * a check for a break and insert a dummy read on the Rx for the
+ * immediately following IRQ event.
+ *
+ * We re-use the already existing "bug handling" lsr_saved_flags
+ * field to carry the "what we just did" information from the one
+ * IRQ event to the next one.
+ */
+
+int fsl8250_handle_irq(struct uart_port *port)
+{
+ unsigned char lsr, orig_lsr;
+ unsigned long flags;
+ unsigned int iir;
+ struct uart_8250_port *up =
+ container_of(port, struct uart_8250_port, port);
+
+ spin_lock_irqsave(&up->port.lock, flags);
+
+ iir = port->serial_in(port, UART_IIR);
+ if (iir & UART_IIR_NO_INT) {
+ spin_unlock_irqrestore(&up->port.lock, flags);
+ return 0;
+ }
+
+ /* This is the WAR; if last event was BRK, then read and return */
+ if (unlikely(up->lsr_saved_flags & UART_LSR_BI)) {
+ up->lsr_saved_flags &= ~UART_LSR_BI;
+ port->serial_in(port, UART_RX);
+ spin_unlock_irqrestore(&up->port.lock, flags);
+ return 1;
+ }
+
+ lsr = orig_lsr = up->port.serial_in(&up->port, UART_LSR);
+
+ if (lsr & (UART_LSR_DR | UART_LSR_BI))
+ lsr = serial8250_rx_chars(up, lsr);
+
+ serial8250_modem_status(up);
+
+ if (lsr & UART_LSR_THRE)
+ serial8250_tx_chars(up);
+
+ up->lsr_saved_flags = orig_lsr;
+ spin_unlock_irqrestore(&up->port.lock, flags);
+ return 1;
+}
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 925a1e5..aa46993 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -97,6 +97,11 @@ config SERIAL_8250_PNP
This builds standard PNP serial support. You may be able to
disable this feature if you only need legacy serial support.
+config SERIAL_8250_FSL
+ bool
+ depends on SERIAL_8250 && PPC
+ default PPC
+
config SERIAL_8250_HP300
tristate
depends on SERIAL_8250 && HP300
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index e10cf5b..fb187a3 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_boca.o
obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) += 8250_exar_st16c554.o
obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o
+obj-$(CONFIG_SERIAL_8250_FSL) += 8250_fsl.o
obj-$(CONFIG_SERIAL_8250_DW) += 8250_dw.o
obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index b44034e..8f012f8 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -82,6 +82,7 @@ extern void serial8250_do_set_termios(struct uart_port *port,
struct ktermios *termios, struct ktermios *old);
extern void serial8250_do_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate);
+extern int fsl8250_handle_irq(struct uart_port *port);
int serial8250_handle_irq(struct uart_port *port, unsigned int iir);
unsigned char serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr);
void serial8250_tx_chars(struct uart_8250_port *up);
--
1.7.7
^ permalink raw reply related
* [PATCH 0/6] RFCv2 Fix Fsl 8250 BRK bug
From: Paul Gortmaker @ 2011-12-04 23:42 UTC (permalink / raw)
To: alan, gregkh, scottwood, galak; +Cc: linux-serial, linuxppc-dev, linux-kernel
In-Reply-To: <1322783258-20443-1-git-send-email-paul.gortmaker@windriver.com>
Alan wrote:
> Things like 8250_dw.c is perhaps more the style we want to be looking at
> for other devices and adjusting 8250.c as needed to export or split
> methods up so they can be used as helpers.
[...]
> Sorting out a ->handle_port override is probably ultimately the right
> thing to do and then we can push some of the other funnies out further.
I never figured spending this much time on this, but I think this is
a lot better, and 8250.c comes out slightly smaller and cleaner too,
hopefully satisfying Alan's other request "...we want less not more".
The errata is firewalled off in 8250_fsl.c (as per Alan's 1st comment),
and 8250.c now exports a couple more things to be used as helpers.
When I started looking at a handle_port override, I realized that it
really didn't need to exist at all, and the existing handle_irq
override we already have does the job nicely. In the process, I found
an interesting quirk while cleaning up duplicated code in the timeout
handler, where we don't use the custom IRQ handler if there is one.
So, the errata is dealt with by installing a custom IRQ handler, and
it doesn't have the "eew ick" factor that Scott mentioned, in regards
to trying to learn state from watching serial_in() traffic.
The timeout cleanup seemed so obvious, that I was convinced I must
be missing some subtle thing. So I confirmed it by stripping my IRQ
properties from my dts file and running the serial console IRQ-less.
I also re-tested the sysRq feature on sbc8349, to ensure the WAR was
actually doing its job, and I also tested with serial console on
an old SocketA board to make sure non-ppc didn't get hosed somehow.
Anyway, have a look and see if this version of things is acceptable
to all. (Again, the dts update from Kumar isn't shown here).
Thanks to all who provided the feedback on v1.
Paul.
------
Paul Gortmaker (6):
serial: move struct uart_8250_port from 8250.c to 8250.h
serial: clean up parameter passing for 8250 Rx IRQ handling
serial: export the key functions for an 8250 IRQ handler
serial: make 8250 timeout use the specified IRQ handler
serial: manually inline serial8250_handle_port
serial: add irq handler for Freescale 16550 errata.
arch/powerpc/kernel/legacy_serial.c | 3 +
drivers/tty/serial/8250.c | 92 ++++++++++++-----------------------
drivers/tty/serial/8250.h | 26 ++++++++++
drivers/tty/serial/8250_fsl.c | 63 ++++++++++++++++++++++++
drivers/tty/serial/Kconfig | 5 ++
drivers/tty/serial/Makefile | 1 +
include/linux/serial_8250.h | 5 ++
7 files changed, 134 insertions(+), 61 deletions(-)
create mode 100644 drivers/tty/serial/8250_fsl.c
--
1.7.7
^ permalink raw reply
* [PATCH] serial: bfin-uart: Request CTS GPIO PIN when the serial device starts up.
From: Sonic Zhang @ 2011-12-05 7:12 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-serial; +Cc: LKML, uclinux-dist-devel, Sonic Zhang
From: Sonic Zhang <sonic.zhang@analog.com>
Serial device may be probed earlier before GPIOLIB is initialized. Requesting and
configuring CTS GPIO PIN fails in that early stage. Do it when the serial device
really starts up.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
drivers/tty/serial/bfin_uart.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
index c7e592d..61af5ae 100644
--- a/drivers/tty/serial/bfin_uart.c
+++ b/drivers/tty/serial/bfin_uart.c
@@ -739,8 +739,13 @@ static int bfin_serial_startup(struct uart_port *port)
pr_info("Unable to attach BlackFin UART CTS interrupt. So, disable it.\n");
}
}
- if (uart->rts_pin >= 0)
- gpio_direction_output(uart->rts_pin, 0);
+ if (uart->rts_pin >= 0) {
+ if (gpio_request(uart->rts_pin, DRIVER_NAME)) {
+ pr_info("fail to request RTS PIN at GPIO_%d\n", uart->rts_pin);
+ uart->rts_pin = -1;
+ } else
+ gpio_direction_output(uart->rts_pin, 0);
+ }
#endif
#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
if (uart->cts_pin >= 0 && request_irq(uart->status_irq,
@@ -792,6 +797,8 @@ static void bfin_serial_shutdown(struct uart_port *port)
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
if (uart->cts_pin >= 0)
free_irq(gpio_to_irq(uart->cts_pin), uart);
+ if (uart->rts_pin >= 0)
+ gpio_free(uart->rts_pin);
#endif
#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
if (uart->cts_pin >= 0)
@@ -1378,10 +1385,6 @@ static int bfin_serial_probe(struct platform_device *pdev)
uart->rts_pin = -1;
else
uart->rts_pin = res->start;
-# if defined(CONFIG_SERIAL_BFIN_CTSRTS)
- if (uart->rts_pin >= 0)
- gpio_request(uart->rts_pin, DRIVER_NAME);
-# endif
#endif
}
@@ -1421,10 +1424,6 @@ static int __devexit bfin_serial_remove(struct platform_device *pdev)
if (uart) {
uart_remove_one_port(&bfin_serial_reg, &uart->port);
-#ifdef CONFIG_SERIAL_BFIN_CTSRTS
- if (uart->rts_pin >= 0)
- gpio_free(uart->rts_pin);
-#endif
iounmap(uart->port.membase);
peripheral_free_list(
(unsigned short *)pdev->dev.platform_data);
--
1.7.0.4
^ permalink raw reply related
* [PATCH 2/2] serial: bfin-uart: remove redundant CTS check for hardware CTS control.
From: Sonic Zhang @ 2011-12-05 10:13 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-serial; +Cc: LKML, uclinux-dist-devel, Sonic Zhang
In-Reply-To: <1323079991-4855-1-git-send-email-sonic.adi@gmail.com>
From: Sonic Zhang <sonic.zhang@analog.com>
Blackfin hardware CTS control generate interrupt for both CTS on and off.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
drivers/tty/serial/bfin_uart.c | 24 +-----------------------
1 files changed, 1 insertions(+), 23 deletions(-)
diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
index 2afd307..cf2d927 100644
--- a/drivers/tty/serial/bfin_uart.c
+++ b/drivers/tty/serial/bfin_uart.c
@@ -119,12 +119,10 @@ static irqreturn_t bfin_serial_mctrl_cts_int(int irq, void *dev_id)
unsigned int status;
status = bfin_serial_get_mctrl(&uart->port);
- uart_handle_cts_change(&uart->port, status & TIOCM_CTS);
#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
- uart->scts = 1;
UART_CLEAR_SCTS(uart);
- UART_CLEAR_IER(uart, EDSSI);
#endif
+ uart_handle_cts_change(&uart->port, status & TIOCM_CTS);
return IRQ_HANDLED;
}
@@ -175,13 +173,6 @@ static void bfin_serial_start_tx(struct uart_port *port)
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
struct tty_struct *tty = uart->port.state->port.tty;
-#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
- if (uart->scts && !(bfin_serial_get_mctrl(&uart->port) & TIOCM_CTS)) {
- uart->scts = 0;
- uart_handle_cts_change(&uart->port, uart->scts);
- }
-#endif
-
/*
* To avoid losting RX interrupt, we reset IR function
* before sending data.
@@ -380,12 +371,6 @@ static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id)
{
struct bfin_serial_port *uart = dev_id;
-#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
- if (uart->scts && !(bfin_serial_get_mctrl(&uart->port) & TIOCM_CTS)) {
- uart->scts = 0;
- uart_handle_cts_change(&uart->port, uart->scts);
- }
-#endif
spin_lock(&uart->port.lock);
if (UART_GET_LSR(uart) & THRE)
bfin_serial_tx_chars(uart);
@@ -531,13 +516,6 @@ static irqreturn_t bfin_serial_dma_tx_int(int irq, void *dev_id)
struct bfin_serial_port *uart = dev_id;
struct circ_buf *xmit = &uart->port.state->xmit;
-#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
- if (uart->scts && !(bfin_serial_get_mctrl(&uart->port)&TIOCM_CTS)) {
- uart->scts = 0;
- uart_handle_cts_change(&uart->port, uart->scts);
- }
-#endif
-
spin_lock(&uart->port.lock);
if (!(get_dma_curr_irqstat(uart->tx_dma_channel)&DMA_RUN)) {
disable_dma(uart->tx_dma_channel);
--
1.7.0.4
^ permalink raw reply related
* [PATCH 1/2] serial: bfin-uart: Add tty ASYNC_CTS_FLOW flag to do CTS flow control.
From: Sonic Zhang @ 2011-12-05 10:13 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-serial; +Cc: LKML, uclinux-dist-devel, Sonic Zhang
From: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
drivers/tty/serial/bfin_uart.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
index 61af5ae..2afd307 100644
--- a/drivers/tty/serial/bfin_uart.c
+++ b/drivers/tty/serial/bfin_uart.c
@@ -1377,8 +1377,10 @@ static int bfin_serial_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
if (res == NULL)
uart->cts_pin = -1;
- else
+ else {
uart->cts_pin = res->start;
+ uart->port.flags |= ASYNC_CTS_FLOW;
+ }
res = platform_get_resource(pdev, IORESOURCE_IO, 1);
if (res == NULL)
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH] serial: bfin-uart: Request CTS GPIO PIN when the serial device starts up.
From: Alan Cox @ 2011-12-05 11:32 UTC (permalink / raw)
To: Sonic Zhang
Cc: Greg Kroah-Hartman, linux-serial, LKML, uclinux-dist-devel,
Sonic Zhang
In-Reply-To: <1323069170-5881-1-git-send-email-sonic.adi@gmail.com>
On Mon, 5 Dec 2011 15:12:50 +0800
Sonic Zhang <sonic.adi@gmail.com> wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> Serial device may be probed earlier before GPIOLIB is initialized. Requesting and
> configuring CTS GPIO PIN fails in that early stage. Do it when the serial device
> really starts up.
>
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Alan Cox <alan@linux.intel.com>
^ permalink raw reply
* Re: [PATCH 2/2] serial: bfin-uart: remove redundant CTS check for hardware CTS control.
From: Alan Cox @ 2011-12-05 11:38 UTC (permalink / raw)
To: Sonic Zhang
Cc: Greg Kroah-Hartman, linux-serial, LKML, uclinux-dist-devel,
Sonic Zhang
In-Reply-To: <1323079991-4855-2-git-send-email-sonic.adi@gmail.com>
On Mon, 5 Dec 2011 18:13:11 +0800
Sonic Zhang <sonic.adi@gmail.com> wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> Blackfin hardware CTS control generate interrupt for both CTS on and off.
>
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Both
Acked-by: Alan Cox <alan@linux.intel.com>
^ permalink raw reply
* Re: [PATCH 0/6] RFCv2 Fix Fsl 8250 BRK bug
From: Alan Cox @ 2011-12-05 12:18 UTC (permalink / raw)
To: Paul Gortmaker
Cc: gregkh, scottwood, galak, linux-serial, linuxppc-dev,
linux-kernel
In-Reply-To: <1323042143-25330-1-git-send-email-paul.gortmaker@windriver.com>
> Anyway, have a look and see if this version of things is acceptable
> to all. (Again, the dts update from Kumar isn't shown here).
>
> Thanks to all who provided the feedback on v1.
Looks good to me
Acked-by: Alan Cox <alan@linux.intel.com>
^ permalink raw reply
* [PATCH 2/2] serial: bfin-sport-uart: Request CTS GPIO PIN when the sport emulated serial device starts up.
From: Sonic Zhang @ 2011-12-06 7:16 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-serial; +Cc: LKML, uclinux-dist-devel, Sonic Zhang
In-Reply-To: <1323155794-14696-1-git-send-email-sonic.adi@gmail.com>
From: Sonic Zhang <sonic.zhang@analog.com>
This patch is similar to that for bfin-uart hardware flow control.
Sport emulated serial device may be probed earlier before GPIOLIB is initialized.
Requesting and configuring CTS GPIO PIN fails in that early stage.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
drivers/tty/serial/bfin_sport_uart.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/tty/serial/bfin_sport_uart.c b/drivers/tty/serial/bfin_sport_uart.c
index ee101c0..f650526 100644
--- a/drivers/tty/serial/bfin_sport_uart.c
+++ b/drivers/tty/serial/bfin_sport_uart.c
@@ -299,8 +299,13 @@ static int sport_startup(struct uart_port *port)
dev_info(port->dev, "Unable to attach BlackFin UART over SPORT CTS interrupt. So, disable it.\n");
}
}
- if (up->rts_pin >= 0)
- gpio_direction_output(up->rts_pin, 0);
+ if (up->rts_pin >= 0) {
+ if (gpio_request(up->rts_pin, DRV_NAME)) {
+ dev_info(port->dev, "fail to request RTS PIN at GPIO_%d\n", up->rts_pin);
+ up->rts_pin = -1;
+ } else
+ gpio_direction_output(up->rts_pin, 0);
+ }
#endif
return 0;
@@ -445,6 +450,8 @@ static void sport_shutdown(struct uart_port *port)
#ifdef CONFIG_SERIAL_BFIN_SPORT_CTSRTS
if (up->cts_pin >= 0)
free_irq(gpio_to_irq(up->cts_pin), up);
+ if (up->rts_pin >= 0)
+ gpio_free(up->rts_pin);
#endif
}
@@ -811,9 +818,6 @@ static int __devinit sport_uart_probe(struct platform_device *pdev)
sport->rts_pin = -1;
else
sport->rts_pin = res->start;
-
- if (sport->rts_pin >= 0)
- gpio_request(sport->rts_pin, DRV_NAME);
#endif
}
@@ -853,10 +857,6 @@ static int __devexit sport_uart_remove(struct platform_device *pdev)
if (sport) {
uart_remove_one_port(&sport_uart_reg, &sport->port);
-#ifdef CONFIG_SERIAL_BFIN_CTSRTS
- if (sport->rts_pin >= 0)
- gpio_free(sport->rts_pin);
-#endif
iounmap(sport->port.membase);
peripheral_free_list(
(unsigned short *)pdev->dev.platform_data);
--
1.7.0.4
^ permalink raw reply related
* [PATCH 1/2] tty: bfin-sport-uart: Rx interrupt is not called always with irq disabled.
From: Sonic Zhang @ 2011-12-06 7:16 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-serial; +Cc: LKML, uclinux-dist-devel, Sonic Zhang
From: Sonic Zhang <sonic.zhang@analog.com>
Replace local_irq_disable by local_irq_save.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
drivers/tty/serial/bfin_sport_uart.h | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/bfin_sport_uart.h b/drivers/tty/serial/bfin_sport_uart.h
index 6d06ce1..e4510ea 100644
--- a/drivers/tty/serial/bfin_sport_uart.h
+++ b/drivers/tty/serial/bfin_sport_uart.h
@@ -45,11 +45,12 @@
#define SPORT_GET_RX32(sport) \
({ \
unsigned int __ret; \
+ unsigned long flags; \
if (ANOMALY_05000473) \
- local_irq_disable(); \
+ local_irq_save(flags); \
__ret = bfin_read32((sport)->port.membase + OFFSET_RX); \
if (ANOMALY_05000473) \
- local_irq_enable(); \
+ local_irq_restore(flags); \
__ret; \
})
#define SPORT_GET_RCR1(sport) bfin_read16(((sport)->port.membase + OFFSET_RCR1))
--
1.7.0.4
^ permalink raw reply related
* [PATCH] serial: bfin-sport-uart: Add tty ASYNC_CTS_FLOW flag to do CTS flow control.
From: Sonic Zhang @ 2011-12-06 8:22 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-serial; +Cc: LKML, uclinux-dist-devel, Sonic Zhang
From: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
drivers/tty/serial/bfin_sport_uart.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/tty/serial/bfin_sport_uart.c b/drivers/tty/serial/bfin_sport_uart.c
index f650526..7fbc3a0 100644
--- a/drivers/tty/serial/bfin_sport_uart.c
+++ b/drivers/tty/serial/bfin_sport_uart.c
@@ -810,8 +810,10 @@ static int __devinit sport_uart_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
if (res == NULL)
sport->cts_pin = -1;
- else
+ else {
sport->cts_pin = res->start;
+ sport->port.flags |= ASYNC_CTS_FLOW;
+ }
res = platform_get_resource(pdev, IORESOURCE_IO, 1);
if (res == NULL)
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH 2/2] serial: bfin-sport-uart: Request CTS GPIO PIN when the sport emulated serial device starts up.
From: Alan Cox @ 2011-12-06 11:36 UTC (permalink / raw)
To: Sonic Zhang
Cc: Greg Kroah-Hartman, linux-serial, LKML, uclinux-dist-devel,
Sonic Zhang
In-Reply-To: <1323155794-14696-2-git-send-email-sonic.adi@gmail.com>
On Tue, 6 Dec 2011 15:16:34 +0800
Sonic Zhang <sonic.adi@gmail.com> wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> This patch is similar to that for bfin-uart hardware flow control.
> Sport emulated serial device may be probed earlier before GPIOLIB is initialized.
> Requesting and configuring CTS GPIO PIN fails in that early stage.
>
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Alan Cox <alan@linux.intel.com>
^ permalink raw reply
* Re: [PATCH] serial: bfin-sport-uart: Add tty ASYNC_CTS_FLOW flag to do CTS flow control.
From: Alan Cox @ 2011-12-06 11:37 UTC (permalink / raw)
To: Sonic Zhang
Cc: Greg Kroah-Hartman, linux-serial, LKML, uclinux-dist-devel,
Sonic Zhang
In-Reply-To: <1323159754-15687-1-git-send-email-sonic.adi@gmail.com>
On Tue, 6 Dec 2011 16:22:34 +0800
Sonic Zhang <sonic.adi@gmail.com> wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> ---
> drivers/tty/serial/bfin_sport_uart.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/tty/serial/bfin_sport_uart.c b/drivers/tty/serial/bfin_sport_uart.c
> index f650526..7fbc3a0 100644
> --- a/drivers/tty/serial/bfin_sport_uart.c
> +++ b/drivers/tty/serial/bfin_sport_uart.c
> @@ -810,8 +810,10 @@ static int __devinit sport_uart_probe(struct platform_device *pdev)
> res = platform_get_resource(pdev, IORESOURCE_IO, 0);
> if (res == NULL)
> sport->cts_pin = -1;
> - else
> + else {
> sport->cts_pin = res->start;
> + sport->port.flags |= ASYNC_CTS_FLOW;
> + }
>
> res = platform_get_resource(pdev, IORESOURCE_IO, 1);
> if (res == NULLA
Acked-by: Alan Cox <alan@linux.intel.com>
^ permalink raw reply
* [PATCH 01/16 v2] pmac_zilog: fix unexpected irq
From: Finn Thain @ 2011-12-06 15:13 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Benjamin Herrenschmidt, linux-m68k, linuxppc-dev, linux-serial
In-Reply-To: <20111023141115.208699274@telegraphics.com.au>
On most 68k Macs the SCC IRQ is an autovector interrupt and cannot be
masked. This can be a problem when pmac_zilog starts up.
For example, the serial debugging code in arch/m68k/kernel/head.S may be
used beforehand. It disables the SCC interrupts at the chip but doesn't
ack them. Then when a pmac_zilog port is opened and SCC chip interrupts
become enabled, the machine locks up with "unexpected interrupt" because
request_irq() hasn't happened yet.
Fix this by setting the interrupt enable bits only after the handler is
installed and before it is uninstalled. Also move this bit flipping into a
separate pmz_interrupt_control() routine. Replace all instances of these
operations with calls to this routine.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
Re-implemented since v1 using a simpler approach that avoids messing with
the Master Interrupt Enable bit. As well as the ifdef problem, it turns
out that v1 was not sufficient to entirely fix the problem.
This patch has been tested on a PowerBook 520 but no PowerMacs yet.
Index: linux-git/drivers/tty/serial/pmac_zilog.c
===================================================================
--- linux-git.orig/drivers/tty/serial/pmac_zilog.c 2011-12-07 01:56:43.000000000 +1100
+++ linux-git/drivers/tty/serial/pmac_zilog.c 2011-12-07 01:56:55.000000000 +1100
@@ -216,6 +216,18 @@ static void pmz_maybe_update_regs(struct
}
}
+static void pmz_interrupt_control(struct uart_pmac_port *uap, int enable)
+{
+ if (enable) {
+ uap->curregs[1] |= INT_ALL_Rx | TxINT_ENAB;
+ if (!ZS_IS_EXTCLK(uap))
+ uap->curregs[1] |= EXT_INT_ENAB;
+ } else {
+ uap->curregs[1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
+ }
+ write_zsreg(uap, R1, uap->curregs[1]);
+}
+
static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap)
{
struct tty_struct *tty = NULL;
@@ -339,9 +351,7 @@ static struct tty_struct *pmz_receive_ch
return tty;
flood:
- uap->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
- write_zsreg(uap, R1, uap->curregs[R1]);
- zssync(uap);
+ pmz_interrupt_control(uap, 0);
pmz_error("pmz: rx irq flood !\n");
return tty;
}
@@ -990,12 +1000,9 @@ static int pmz_startup(struct uart_port
if (ZS_IS_IRDA(uap))
pmz_irda_reset(uap);
- /* Enable interrupts emission from the chip */
+ /* Enable interrupt requests for the channel */
spin_lock_irqsave(&port->lock, flags);
- uap->curregs[R1] |= INT_ALL_Rx | TxINT_ENAB;
- if (!ZS_IS_EXTCLK(uap))
- uap->curregs[R1] |= EXT_INT_ENAB;
- write_zsreg(uap, R1, uap->curregs[R1]);
+ pmz_interrupt_control(uap, 1);
spin_unlock_irqrestore(&port->lock, flags);
pmz_debug("pmz: startup() done.\n");
@@ -1015,6 +1022,25 @@ static void pmz_shutdown(struct uart_por
mutex_lock(&pmz_irq_mutex);
+ if (!ZS_IS_ASLEEP(uap)) {
+ spin_lock_irqsave(&port->lock, flags);
+
+ if (!ZS_IS_CONS(uap)) {
+ /* Disable receiver and transmitter */
+ uap->curregs[R3] &= ~RxENABLE;
+ uap->curregs[R5] &= ~TxENABLE;
+
+ /* Disable BRK assertion */
+ uap->curregs[R5] &= ~SND_BRK;
+ pmz_maybe_update_regs(uap);
+ }
+
+ /* Disable interrupt requests for the channel */
+ pmz_interrupt_control(uap, 0);
+
+ spin_unlock_irqrestore(&port->lock, flags);
+ }
+
/* Release interrupt handler */
free_irq(uap->port.irq, uap);
@@ -1025,29 +1051,8 @@ static void pmz_shutdown(struct uart_por
if (!ZS_IS_OPEN(uap->mate))
pmz_get_port_A(uap)->flags &= ~PMACZILOG_FLAG_IS_IRQ_ON;
- /* Disable interrupts */
- if (!ZS_IS_ASLEEP(uap)) {
- uap->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
- write_zsreg(uap, R1, uap->curregs[R1]);
- zssync(uap);
- }
-
- if (ZS_IS_CONS(uap) || ZS_IS_ASLEEP(uap)) {
- spin_unlock_irqrestore(&port->lock, flags);
- mutex_unlock(&pmz_irq_mutex);
- return;
- }
-
- /* Disable receiver and transmitter. */
- uap->curregs[R3] &= ~RxENABLE;
- uap->curregs[R5] &= ~TxENABLE;
-
- /* Disable all interrupts and BRK assertion. */
- uap->curregs[R5] &= ~SND_BRK;
- pmz_maybe_update_regs(uap);
-
- /* Shut the chip down */
- pmz_set_scc_power(uap, 0);
+ if (!ZS_IS_ASLEEP(uap) && !ZS_IS_CONS(uap))
+ pmz_set_scc_power(uap, 0); /* Shut the chip down */
spin_unlock_irqrestore(&port->lock, flags);
@@ -1352,19 +1357,15 @@ static void pmz_set_termios(struct uart_
spin_lock_irqsave(&port->lock, flags);
/* Disable IRQs on the port */
- uap->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
- write_zsreg(uap, R1, uap->curregs[R1]);
+ pmz_interrupt_control(uap, 0);
/* Setup new port configuration */
__pmz_set_termios(port, termios, old);
/* Re-enable IRQs on the port */
- if (ZS_IS_OPEN(uap)) {
- uap->curregs[R1] |= INT_ALL_Rx | TxINT_ENAB;
- if (!ZS_IS_EXTCLK(uap))
- uap->curregs[R1] |= EXT_INT_ENAB;
- write_zsreg(uap, R1, uap->curregs[R1]);
- }
+ if (ZS_IS_OPEN(uap))
+ pmz_interrupt_control(uap, 1);
+
spin_unlock_irqrestore(&port->lock, flags);
}
@@ -1670,15 +1671,13 @@ static int pmz_suspend(struct macio_dev
spin_lock_irqsave(&uap->port.lock, flags);
+ /* Disable receiver and transmitter. */
+ uap->curregs[R3] &= ~RxENABLE;
+ uap->curregs[R5] &= ~TxENABLE;
+
+ pmz_interrupt_control(uap, 0);
+
if (ZS_IS_OPEN(uap) || ZS_IS_CONS(uap)) {
- /* Disable receiver and transmitter. */
- uap->curregs[R3] &= ~RxENABLE;
- uap->curregs[R5] &= ~TxENABLE;
-
- /* Disable all interrupts and BRK assertion. */
- uap->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
- uap->curregs[R5] &= ~SND_BRK;
- pmz_load_zsregs(uap, uap->curregs);
uap->flags |= PMACZILOG_FLAG_IS_ASLEEP;
mb();
}
@@ -1738,14 +1737,6 @@ static int pmz_resume(struct macio_dev *
/* Take care of config that may have changed while asleep */
__pmz_set_termios(&uap->port, &uap->termios_cache, NULL);
- if (ZS_IS_OPEN(uap)) {
- /* Enable interrupts */
- uap->curregs[R1] |= INT_ALL_Rx | TxINT_ENAB;
- if (!ZS_IS_EXTCLK(uap))
- uap->curregs[R1] |= EXT_INT_ENAB;
- write_zsreg(uap, R1, uap->curregs[R1]);
- }
-
spin_unlock_irqrestore(&uap->port.lock, flags);
if (ZS_IS_CONS(uap))
@@ -1757,6 +1748,12 @@ static int pmz_resume(struct macio_dev *
enable_irq(uap->port.irq);
}
+ if (ZS_IS_OPEN(uap)) {
+ spin_lock_irqsave(&uap->port.lock, flags);
+ pmz_interrupt_control(uap, 1);
+ spin_unlock_irqrestore(&uap->port.lock, flags);
+ }
+
bail:
mutex_unlock(&state->port.mutex);
mutex_unlock(&pmz_irq_mutex);
^ permalink raw reply
* [GIT PULL] ARM: amba: Enable module alias autogeneration for AMBA drivers
From: Dave Martin @ 2011-12-06 15:15 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: patches, linux-kernel, linux-arm-kernel, Alan Cox,
Alessandro Rubini, Alessandro Zummo, alsa-devel, Chris Ball,
Dan Williams, Dmitry Torokhov, Grant Likely, Jaroslav Kysela,
Jassi Brar, Julia Lawall, Linus Walleij, linux-fbdev, linux-input,
linux-mmc, linux-serial, linux-watchdog, Paul Mundt,
Paweł Moll, rtc-linux, spi-devel-general, Takashi Iwai
In-Reply-To: <1321961573-4562-1-git-send-email-dave.martin@linaro.org>
Hi Russell,
Further to my previous pull request:
> The following changes since commit cfcfc9eca2bcbd26a8e206baeb005b055dbf8e37:
>
> Linux 3.2-rc2 (2011-11-15 15:02:59 -0200)
>
> are available in the git repository at:
> git://git.linaro.org/people/dmart/linux-2.6-arm.git arm/amba-modalias+for-rmk
>
> Dave Martin (16):
> ARM: amba: Move definition of struct amba_id to mod_devicetable.h
> ARM: amba: Auto-generate AMBA driver module aliases during modpost
[...]
... it looks like Alessandro's proposed change to tidy up scripts/mod/
ile2alias.c may get merged soon -- if that happens, you will get a
conflict with the second patch of the series referenced by the previous
pull request. Fixing it up is straightforward -- if you prefer to
resolve the conflict yourself, that's fine by me. Alternatively, you
can pull the following modified series instead.
The only difference is in the second patch
("ARM: amba: Auto-generate AMBA driver module aliases during modpost").
Cheers
---Dave
The following changes since commit 114339d31aa813995461866c659bbf07e1cf2267:
modpost: use table-lookup to build module aliases (2011-12-02 15:18:08 +0000)
are available in the git repository at:
git://git.linaro.org/people/dmart/linux-2.6-arm.git arm/amba-modalias+alessandro-modalias-v2+for-rmk
Dave Martin (16):
ARM: amba: Move definition of struct amba_id to mod_devicetable.h
ARM: amba: Auto-generate AMBA driver module aliases during modpost
hwrng: nomadik: Enable module alias autogeneration for AMBA drivers
dmaengine: pl08x: Enable module alias autogeneration for AMBA drivers
dmaengine: pl330: Enable module alias autogeneration for AMBA drivers
gpio: pl061: Enable module alias autogeneration for AMBA drivers
input: ambakmi: Enable module alias autogeneration for AMBA drivers
mmc: mmci: Enable module alias autogeneration for AMBA drivers
rtc: pl030: Enable module alias autogeneration for AMBA drivers
rtc: pl031: Enable module alias autogeneration for AMBA drivers
spi: pl022: Enable module alias autogeneration for AMBA drivers
serial: pl010: Enable module alias autogeneration for AMBA drivers
serial: pl011: Enable module alias autogeneration for AMBA drivers
fbdev: amba: Enable module alias autogeneration for AMBA drivers
watchdog: sp805: Enable module alias autogeneration for AMBA drivers
sound: aaci: Enable module alias autogeneration for AMBA drivers
drivers/amba/bus.c | 4 ++
drivers/char/hw_random/nomadik-rng.c | 2 +
drivers/dma/amba-pl08x.c | 2 +
drivers/dma/pl330.c | 2 +
drivers/gpio/gpio-pl061.c | 2 +
drivers/input/serio/ambakmi.c | 2 +
drivers/mmc/host/mmci.c | 2 +
drivers/rtc/rtc-pl030.c | 2 +
drivers/rtc/rtc-pl031.c | 2 +
drivers/spi/spi-pl022.c | 2 +
drivers/tty/serial/amba-pl010.c | 2 +
drivers/tty/serial/amba-pl011.c | 2 +
drivers/video/amba-clcd.c | 2 +
drivers/watchdog/sp805_wdt.c | 2 +
include/linux/amba/bus.h | 7 +---
include/linux/mod_devicetable.h | 18 +++++++++
scripts/mod/file2alias.c | 71 +++++++++++++++++++++++++++++++++-
sound/arm/aaci.c | 2 +
18 files changed, 121 insertions(+), 7 deletions(-)
^ permalink raw reply
* Re: [PATCH 01/16 v2] pmac_zilog: fix unexpected irq
From: Geert Uytterhoeven @ 2011-12-06 15:27 UTC (permalink / raw)
To: Finn Thain; +Cc: Benjamin Herrenschmidt, linux-m68k, linuxppc-dev, linux-serial
In-Reply-To: <alpine.LNX.2.00.1112070203310.14968@nippy.intranet>
Hi Finn,
On Tue, Dec 6, 2011 at 16:13, Finn Thain <fthain@telegraphics.com.au> wrote:
> +static void pmz_interrupt_control(struct uart_pmac_port *uap, int enable)
> +{
> + if (enable) {
> + uap->curregs[1] |= INT_ALL_Rx | TxINT_ENAB;
> + if (!ZS_IS_EXTCLK(uap))
> + uap->curregs[1] |= EXT_INT_ENAB;
> + } else {
> + uap->curregs[1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
Should there be a call to zssync() here?
The old code always did that after disabling interrupts.
> + }
> + write_zsreg(uap, R1, uap->curregs[1]);
> +}
> +
> static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap)
> {
> struct tty_struct *tty = NULL;
> @@ -339,9 +351,7 @@ static struct tty_struct *pmz_receive_ch
>
> return tty;
> flood:
> - uap->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
> - write_zsreg(uap, R1, uap->curregs[R1]);
> - zssync(uap);
Cfr. e.g. here.
> + pmz_interrupt_control(uap, 0);
> pmz_error("pmz: rx irq flood !\n");
> return tty;
> }
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH 01/16 v2] pmac_zilog: fix unexpected irq
From: Alan Cox @ 2011-12-06 15:39 UTC (permalink / raw)
To: Finn Thain
Cc: Geert Uytterhoeven, Benjamin Herrenschmidt, linux-m68k,
linuxppc-dev, linux-serial
In-Reply-To: <alpine.LNX.2.00.1112070203310.14968@nippy.intranet>
On Wed, 7 Dec 2011 02:13:41 +1100 (EST)
Finn Thain <fthain@telegraphics.com.au> wrote:
>
> On most 68k Macs the SCC IRQ is an autovector interrupt and cannot be
> masked. This can be a problem when pmac_zilog starts up.
>
> For example, the serial debugging code in arch/m68k/kernel/head.S may be
> used beforehand. It disables the SCC interrupts at the chip but doesn't
> ack them. Then when a pmac_zilog port is opened and SCC chip interrupts
> become enabled, the machine locks up with "unexpected interrupt" because
> request_irq() hasn't happened yet.
>
> Fix this by setting the interrupt enable bits only after the handler is
> installed and before it is uninstalled. Also move this bit flipping into a
> separate pmz_interrupt_control() routine. Replace all instances of these
> operations with calls to this routine.
>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Nice
Acked-by: Alan Cox <alan@linux.intel.com>
^ permalink raw reply
* Re: [GIT PULL] ARM: amba: Enable module alias autogeneration for AMBA drivers
From: Alessandro Rubini @ 2011-12-06 15:59 UTC (permalink / raw)
To: dave.martin-QSEj5FYQhm4dnm+yROfE0A
Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Pawel.Moll-5wv7dgnIgG8,
tiwai-l3A5Bk7waGM, linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA, perex-/Fr2/VpizcU,
wim-IQzOog9fTRqzQB+pC5nmwQ, julia-dAYI7NvHqcQ,
linux-lFZ/pmaqli7XmaaqVzeoHQ, vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
linux-serial-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA, cjb-2X9k7bc8m7Mdnm+yROfE0A,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
rtc-linux-/JYPxA39Uh5TLH3MbocFFw, patches-QSEj5FYQhm4dnm+yROfE0A,
dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
alan-VuQAYsv1563Yd54FQh9/CA, a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w,
linux-mmc-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
lethal-M7jkjyW5wf5g9hUCZPvPmw,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <20111206151541.GA13774-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ... it looks like Alessandro's proposed change to tidy up scripts/mod/
> ile2alias.c may get merged soon
No, I don't think it will happen. Rusty disagrees, and his own
suggestion is in the queue. I'm waiting a while to understand
what is happening.
Anyways, I think it's better for me to wait for amba to come in, and
work on scripts/mod later on. After all, it's meant to ease adding new
buses later, not to make it more difficult for already scheduled ones.
/alessandro
------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of
discussion for anyone considering optimizing the pricing and packaging model
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
^ permalink raw reply
* Re: [GIT PULL] ARM: amba: Enable module alias autogeneration for AMBA drivers
From: Dave Martin @ 2011-12-06 16:18 UTC (permalink / raw)
To: Alessandro Rubini
Cc: linux, patches, linux-kernel, linux-arm-kernel, alan, a.zummo,
alsa-devel, cjb, dan.j.williams, dmitry.torokhov, grant.likely,
perex, jassisinghbrar, julia, linus.walleij, linux-fbdev,
linux-input, linux-mmc, linux-serial, linux-watchdog, lethal,
Pawel.Moll, rtc-linux, spi-devel-general, tiwai, vinod.koul, wim
In-Reply-To: <20111206155911.GA11902@mail.gnudd.com>
On Tue, Dec 06, 2011 at 04:59:11PM +0100, Alessandro Rubini wrote:
> > ... it looks like Alessandro's proposed change to tidy up scripts/mod/
> > ile2alias.c may get merged soon
>
> No, I don't think it will happen. Rusty disagrees, and his own
> suggestion is in the queue. I'm waiting a while to understand
> what is happening.
>
> Anyways, I think it's better for me to wait for amba to come in, and
> work on scripts/mod later on. After all, it's meant to ease adding new
> buses later, not to make it more difficult for already scheduled ones.
OK -- thanks for the clarification.
Russell, it sounds like you shouldn't get a merge conflict with the
original version of the series after all.
For reference, the original pull request is here:
http://lists.infradead.org/pipermail/linux-arm-kernel/2011-November/073619.html
Cheers
---Dave
^ permalink raw reply
* Re: [PATCH v8 00/20] OMAP2+: UART: Runtime adaptation + cleanup
From: Kevin Hilman @ 2011-12-07 0:21 UTC (permalink / raw)
To: Alan Cox, Greg KH
Cc: Tony Lindgren, Rajendra Nayak, Partha Basak, Govindraj.R,
Santosh Shilimkar, linux-serial, Vishwanath Sripathy, linux-omap,
linux-arm-kernel
In-Reply-To: <1321005446-21741-1-git-send-email-govindraj.raja@ti.com>
"Govindraj.R" <govindraj.raja@ti.com> writes:
> Converting uart driver to adapt to pm runtime API's.
> Code re-org + cleanup.
> Moving some functionality from serial.c to omap-serial.c
Alan, can you confirm your Ack's are still valid on the drivers/tty
parts of this series? It has gone through quite a few changes since
your original ack.
Greg, are you ok with this series merging via the OMAP tree since it is
changing arch/arm/mach-omap2/* code as well as the driver, and should go
together. If so, with your ack (on the drivers/tty/* parts), I'll
handle this series through the OMAP tree.
Thanks,
Kevin
^ permalink raw reply
* Re: [PATCH v8 00/20] OMAP2+: UART: Runtime adaptation + cleanup
From: Alan Cox @ 2011-12-07 0:46 UTC (permalink / raw)
To: Kevin Hilman
Cc: Greg KH, linux-omap, linux-serial, linux-arm-kernel,
Tony Lindgren, Partha Basak, Vishwanath Sripathy, Rajendra Nayak,
Santosh Shilimkar, Govindraj.R
In-Reply-To: <874nxd5j0f.fsf@ti.com>
On Tue, 06 Dec 2011 16:21:20 -0800
Kevin Hilman <khilman@ti.com> wrote:
> "Govindraj.R" <govindraj.raja@ti.com> writes:
>
> > Converting uart driver to adapt to pm runtime API's.
> > Code re-org + cleanup.
> > Moving some functionality from serial.c to omap-serial.c
>
> Alan, can you confirm your Ack's are still valid on the drivers/tty
> parts of this series? It has gone through quite a few changes since
> your original ack.
Yes
^ permalink raw reply
* Re: [PATCH 01/16 v2] pmac_zilog: fix unexpected irq
From: Finn Thain @ 2011-12-07 1:26 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Benjamin Herrenschmidt, linux-m68k, linuxppc-dev, linux-serial
In-Reply-To: <CAMuHMdUB-jQQB=ieumYTehdZz1EnoSazEAhsnEunHSnK2o=k8Q@mail.gmail.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2634 bytes --]
On Tue, 6 Dec 2011, Geert Uytterhoeven wrote:
> Hi Finn,
>
> On Tue, Dec 6, 2011 at 16:13, Finn Thain <fthain@telegraphics.com.au> wrote:
> > +static void pmz_interrupt_control(struct uart_pmac_port *uap, int enable)
> > +{
> > + if (enable) {
> > + uap->curregs[1] |= INT_ALL_Rx | TxINT_ENAB;
> > + if (!ZS_IS_EXTCLK(uap))
> > + uap->curregs[1] |= EXT_INT_ENAB;
> > + } else {
> > + uap->curregs[1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
>
> Should there be a call to zssync() here?
I don't think so. Though I should have mentioned the change in the patch
header.
> The old code always did that after disabling interrupts.
pmz_load_zsregs(), pmz_set_termios() and pmz_suspend() don't do it.
sunzilog only does it on sparc64 and only when writing to the data
register or writing command modifiers to the control register ("On 64-bit
sparc we only need to flush single writes to ensure completion.")
I can't find any purpose for control register reads in the chip manual.
The zssync() calls following some WR1 writes originate here:
http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=9e9d9f693c7def3900725c04c6b64311655eea51
So I don't see any need for control register reads but hopefully Ben can
say for sure.
Reading the patch now I notice that I dropped a pmz_maybe_update_regs() or
pmz_load_zsregs() in the suspend path. I will send a new patch.
Finn
>
> > + }
> > + write_zsreg(uap, R1, uap->curregs[1]);
> > +}
> > +
> > static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap)
> > {
> > struct tty_struct *tty = NULL;
> > @@ -339,9 +351,7 @@ static struct tty_struct *pmz_receive_ch
> >
> > return tty;
> > flood:
> > - uap->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
> > - write_zsreg(uap, R1, uap->curregs[R1]);
> > - zssync(uap);
>
> Cfr. e.g. here.
>
> > + pmz_interrupt_control(uap, 0);
> > pmz_error("pmz: rx irq flood !\n");
> > return tty;
> > }
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
^ permalink raw reply
* [GIT PULL] tty-next: Fix Fsl 8250 BRK bug
From: Paul Gortmaker @ 2011-12-07 3:39 UTC (permalink / raw)
To: gregkh; +Cc: alan, galak, linux-serial, linuxppc-dev, linux-kernel
Hi Greg,
This is the Freescale hardware bug fix which turned into a
six-pack of 8250 updates. This is exactly what was posted
in the v2 review, with just Alan's ack added[1]. Since nobody
else has had any follow-on comments since then, I'm assuming
that it is now good to go.
[1] https://lkml.org/lkml/2011/12/5/156
Thanks,
Paul.
---
Please pull for tty-next to get:
The following changes since commit 5611cc4572e889b62a7b4c72a413536bf6a9c416:
Linux 3.2-rc4 (2011-12-01 14:56:01 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux fsl-uart-fix
Paul Gortmaker (6):
serial: move struct uart_8250_port from 8250.c to 8250.h
serial: clean up parameter passing for 8250 Rx IRQ handling
serial: export the key functions for an 8250 IRQ handler
serial: make 8250 timeout use the specified IRQ handler
serial: manually inline serial8250_handle_port
serial: add irq handler for Freescale 16550 errata.
arch/powerpc/kernel/legacy_serial.c | 3 +
drivers/tty/serial/8250.c | 92 ++++++++++++-----------------------
drivers/tty/serial/8250.h | 26 ++++++++++
drivers/tty/serial/8250_fsl.c | 63 ++++++++++++++++++++++++
drivers/tty/serial/Kconfig | 5 ++
drivers/tty/serial/Makefile | 1 +
include/linux/serial_8250.h | 5 ++
7 files changed, 134 insertions(+), 61 deletions(-)
create mode 100644 drivers/tty/serial/8250_fsl.c
^ permalink raw reply
* [PATCH 01/16 v3] pmac_zilog: fix unexpected irq
From: Finn Thain @ 2011-12-07 3:49 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Benjamin Herrenschmidt, linux-m68k, linuxppc-dev, linux-serial
In-Reply-To: <alpine.LNX.2.00.1112070203310.14968@nippy.intranet>
On most 68k Macs the SCC IRQ is an autovector interrupt and cannot be
masked. This can be a problem when pmac_zilog starts up.
For example, the serial debugging code in arch/m68k/kernel/head.S may be
used beforehand. It disables the SCC interrupts at the chip but doesn't
ack them. Then when a pmac_zilog port is used, the machine locks up with
"unexpected interrupt".
This can happen in pmz_shutdown() since the irq is freed before the
channel interrupts are disabled.
Fix this by clearing interrupt enable bits before the handler is
uninstalled. Also move the interrupt control bit flipping into a separate
pmz_interrupt_control() routine. Replace all instances of these operations
with calls to this routine. Omit the zssync() calls that seem to serve no
purpose.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Acked-by: Alan Cox <alan@linux.intel.com>
---
Re-implemented as v2 using a simpler approach that avoids messing with the
Master Interrupt Enable bit. As well as the ifdef problem, it turns out
that v1 was not sufficient to entirely fix the problem.
v3 avoids needless changes to the logic and locking in the suspend and
shutdown code and tries to keep register writes closer to their original
sequence.
This patch has been tested on a PowerBook 520 but no PowerMacs yet.
Index: linux-git/drivers/tty/serial/pmac_zilog.c
===================================================================
--- linux-git.orig/drivers/tty/serial/pmac_zilog.c 2011-12-07 12:36:32.000000000 +1100
+++ linux-git/drivers/tty/serial/pmac_zilog.c 2011-12-07 14:29:21.000000000 +1100
@@ -216,6 +216,18 @@ static void pmz_maybe_update_regs(struct
}
}
+static void pmz_interrupt_control(struct uart_pmac_port *uap, int enable)
+{
+ if (enable) {
+ uap->curregs[1] |= INT_ALL_Rx | TxINT_ENAB;
+ if (!ZS_IS_EXTCLK(uap))
+ uap->curregs[1] |= EXT_INT_ENAB;
+ } else {
+ uap->curregs[1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
+ }
+ write_zsreg(uap, R1, uap->curregs[1]);
+}
+
static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap)
{
struct tty_struct *tty = NULL;
@@ -339,9 +351,7 @@ static struct tty_struct *pmz_receive_ch
return tty;
flood:
- uap->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
- write_zsreg(uap, R1, uap->curregs[R1]);
- zssync(uap);
+ pmz_interrupt_control(uap, 0);
pmz_error("pmz: rx irq flood !\n");
return tty;
}
@@ -990,12 +1000,9 @@ static int pmz_startup(struct uart_port
if (ZS_IS_IRDA(uap))
pmz_irda_reset(uap);
- /* Enable interrupts emission from the chip */
+ /* Enable interrupt requests for the channel */
spin_lock_irqsave(&port->lock, flags);
- uap->curregs[R1] |= INT_ALL_Rx | TxINT_ENAB;
- if (!ZS_IS_EXTCLK(uap))
- uap->curregs[R1] |= EXT_INT_ENAB;
- write_zsreg(uap, R1, uap->curregs[R1]);
+ pmz_interrupt_control(uap, 1);
spin_unlock_irqrestore(&port->lock, flags);
pmz_debug("pmz: startup() done.\n");
@@ -1015,6 +1022,25 @@ static void pmz_shutdown(struct uart_por
mutex_lock(&pmz_irq_mutex);
+ spin_lock_irqsave(&port->lock, flags);
+
+ if (!ZS_IS_ASLEEP(uap)) {
+ /* Disable interrupt requests for the channel */
+ pmz_interrupt_control(uap, 0);
+
+ if (!ZS_IS_CONS(uap)) {
+ /* Disable receiver and transmitter */
+ uap->curregs[R3] &= ~RxENABLE;
+ uap->curregs[R5] &= ~TxENABLE;
+
+ /* Disable break assertion */
+ uap->curregs[R5] &= ~SND_BRK;
+ pmz_maybe_update_regs(uap);
+ }
+ }
+
+ spin_unlock_irqrestore(&port->lock, flags);
+
/* Release interrupt handler */
free_irq(uap->port.irq, uap);
@@ -1025,29 +1051,8 @@ static void pmz_shutdown(struct uart_por
if (!ZS_IS_OPEN(uap->mate))
pmz_get_port_A(uap)->flags &= ~PMACZILOG_FLAG_IS_IRQ_ON;
- /* Disable interrupts */
- if (!ZS_IS_ASLEEP(uap)) {
- uap->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
- write_zsreg(uap, R1, uap->curregs[R1]);
- zssync(uap);
- }
-
- if (ZS_IS_CONS(uap) || ZS_IS_ASLEEP(uap)) {
- spin_unlock_irqrestore(&port->lock, flags);
- mutex_unlock(&pmz_irq_mutex);
- return;
- }
-
- /* Disable receiver and transmitter. */
- uap->curregs[R3] &= ~RxENABLE;
- uap->curregs[R5] &= ~TxENABLE;
-
- /* Disable all interrupts and BRK assertion. */
- uap->curregs[R5] &= ~SND_BRK;
- pmz_maybe_update_regs(uap);
-
- /* Shut the chip down */
- pmz_set_scc_power(uap, 0);
+ if (!ZS_IS_ASLEEP(uap) && !ZS_IS_CONS(uap))
+ pmz_set_scc_power(uap, 0); /* Shut the chip down */
spin_unlock_irqrestore(&port->lock, flags);
@@ -1352,19 +1357,15 @@ static void pmz_set_termios(struct uart_
spin_lock_irqsave(&port->lock, flags);
/* Disable IRQs on the port */
- uap->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
- write_zsreg(uap, R1, uap->curregs[R1]);
+ pmz_interrupt_control(uap, 0);
/* Setup new port configuration */
__pmz_set_termios(port, termios, old);
/* Re-enable IRQs on the port */
- if (ZS_IS_OPEN(uap)) {
- uap->curregs[R1] |= INT_ALL_Rx | TxINT_ENAB;
- if (!ZS_IS_EXTCLK(uap))
- uap->curregs[R1] |= EXT_INT_ENAB;
- write_zsreg(uap, R1, uap->curregs[R1]);
- }
+ if (ZS_IS_OPEN(uap))
+ pmz_interrupt_control(uap, 1);
+
spin_unlock_irqrestore(&port->lock, flags);
}
@@ -1671,14 +1672,17 @@ static int pmz_suspend(struct macio_dev
spin_lock_irqsave(&uap->port.lock, flags);
if (ZS_IS_OPEN(uap) || ZS_IS_CONS(uap)) {
- /* Disable receiver and transmitter. */
+ /* Disable interrupt requests for the channel */
+ pmz_interrupt_control(uap, 0);
+
+ /* Disable receiver and transmitter */
uap->curregs[R3] &= ~RxENABLE;
uap->curregs[R5] &= ~TxENABLE;
- /* Disable all interrupts and BRK assertion. */
- uap->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
+ /* Disable break assertion */
uap->curregs[R5] &= ~SND_BRK;
pmz_load_zsregs(uap, uap->curregs);
+
uap->flags |= PMACZILOG_FLAG_IS_ASLEEP;
mb();
}
@@ -1738,14 +1742,6 @@ static int pmz_resume(struct macio_dev *
/* Take care of config that may have changed while asleep */
__pmz_set_termios(&uap->port, &uap->termios_cache, NULL);
- if (ZS_IS_OPEN(uap)) {
- /* Enable interrupts */
- uap->curregs[R1] |= INT_ALL_Rx | TxINT_ENAB;
- if (!ZS_IS_EXTCLK(uap))
- uap->curregs[R1] |= EXT_INT_ENAB;
- write_zsreg(uap, R1, uap->curregs[R1]);
- }
-
spin_unlock_irqrestore(&uap->port.lock, flags);
if (ZS_IS_CONS(uap))
@@ -1757,6 +1753,12 @@ static int pmz_resume(struct macio_dev *
enable_irq(uap->port.irq);
}
+ if (ZS_IS_OPEN(uap)) {
+ spin_lock_irqsave(&uap->port.lock, flags);
+ pmz_interrupt_control(uap, 1);
+ spin_unlock_irqrestore(&uap->port.lock, flags);
+ }
+
bail:
mutex_unlock(&state->port.mutex);
mutex_unlock(&pmz_irq_mutex);
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox