diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-07 10:55:46 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-07 10:55:46 -0700 |
| commit | 344107862b45d3d0a15b186ebc178859e6c7f975 (patch) | |
| tree | 69c4d7f24455551600a97715c331a7684c44e27f /tty | |
| parent | d63d4b49a0297ef53ed687810d3ff7df0ad9c934 (diff) | |
| download | patches-344107862b45d3d0a15b186ebc178859e6c7f975.tar.gz | |
more patches
Diffstat (limited to 'tty')
| -rw-r--r-- | tty/jsm-remove-the-uart-port-on-errors.patch | 39 | ||||
| -rw-r--r-- | tty/serial-imx-serial-driver-fix-resume.patch | 55 |
2 files changed, 94 insertions, 0 deletions
diff --git a/tty/jsm-remove-the-uart-port-on-errors.patch b/tty/jsm-remove-the-uart-port-on-errors.patch new file mode 100644 index 00000000000000..68380a0b7b10c2 --- /dev/null +++ b/tty/jsm-remove-the-uart-port-on-errors.patch @@ -0,0 +1,39 @@ +From linux-serial-owner@vger.kernel.org Thu Oct 7 10:48:23 2010 +From: Breno Leitao <leitao@linux.vnet.ibm.com> +To: greg@kroah.com +Cc: linux-serial@vger.kernel.org, + Breno Leitao <leitao@linux.vnet.ibm.com> +Subject: jsm: Remove the uart port on errors +Date: Thu, 7 Oct 2010 13:40:42 -0300 +Message-Id: <1286469642-18796-1-git-send-email-leitao@linux.vnet.ibm.com> + +If kzmalloc fails, the uart port is not removed causing a leak. +This patch just add another label that removes the uart when the +kzmalloc fails. + +Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/jsm/jsm_driver.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/serial/jsm/jsm_driver.c ++++ b/drivers/serial/jsm/jsm_driver.c +@@ -172,13 +172,15 @@ static int __devinit jsm_probe_one(struc + jsm_uart_port_init here! */ + dev_err(&pdev->dev, "memory allocation for flipbuf failed\n"); + rc = -ENOMEM; +- goto out_free_irq; ++ goto out_free_uart; + } + + pci_set_drvdata(pdev, brd); + pci_save_state(pdev); + + return 0; ++ out_free_uart: ++ jsm_remove_uart_port(brd); + out_free_irq: + jsm_remove_uart_port(brd); + free_irq(brd->irq, brd); diff --git a/tty/serial-imx-serial-driver-fix-resume.patch b/tty/serial-imx-serial-driver-fix-resume.patch new file mode 100644 index 00000000000000..b68bb284517808 --- /dev/null +++ b/tty/serial-imx-serial-driver-fix-resume.patch @@ -0,0 +1,55 @@ +From daniel@caiaq.de Thu Oct 7 10:49:08 2010 +From: Volker Ernst <volker.ernst@txtr.com> +To: linux-arm-kernel@lists.infradead.org +Cc: gregkh@suse.de, akpm@linux-foundation.org, + s.hauer@pengutronix.de, Volker Ernst <volker.ernst@txtr.com>, + Daniel Mack <daniel@caiaq.de>, Andy Green <andy@warmcat.com> +Subject: serial: imx serial driver: fix resume +Date: Wed, 6 Oct 2010 18:57:16 +0200 +Message-Id: <1286384236-4241-1-git-send-email-daniel@caiaq.de> + +From: Volker Ernst <volker.ernst@txtr.com> + +I just came across a bug in the IMX31 serial driver which is still +present in the newest kernels and which prevents successful +resume-operation for the IMX31 serial ports. + +What happens is that in "drivers/serial/imx.c" on resume function +"serial_imx_resume" gets called. This function in turn calls +"uart_resume_port" (in the generic serial driver "serial_core.c"), +which in turn calls "imx_start_tx" in "imx.c" (in case the SIO-port +was really suspended) which in turn calls "imx_transmit_buffer". + +However calling "imx_transmit_buffer" with an empty TX-fifo (as is +usually the case) will result in the serial port starting to transmit +(actually the old [already sent] tx-buffer), as there is no check if +the tx-buffer is empty before starting to feed tx-fifo-data to the +serial port hardware. + +Signed-off-by: Volker Ernst <volker.ernst@txtr.com> +Cc: Daniel Mack <daniel@caiaq.de> +Cc: Andy Green <andy@warmcat.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/imx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/serial/imx.c ++++ b/drivers/serial/imx.c +@@ -328,13 +328,13 @@ static inline void imx_transmit_buffer(s + struct circ_buf *xmit = &sport->port.state->xmit; + + while (!(readl(sport->port.membase + UTS) & UTS_TXFULL)) { ++ if (uart_circ_empty(xmit)) ++ break; + /* send xmit->buf[xmit->tail] + * out the port here */ + writel(xmit->buf[xmit->tail], sport->port.membase + URTX0); + xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); + sport->port.icount.tx++; +- if (uart_circ_empty(xmit)) +- break; + } + + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
