+ arm-imx-serial-driver-fix-resume.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     ARM: imx serial driver: fix resume
has been added to the -mm tree.  Its filename is
     arm-imx-serial-driver-fix-resume.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: ARM: imx serial driver: fix resume
From: Volker Ernst <volker.ernst@xxxxxxxx>

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@xxxxxxxx>
Signed-off-by: Daniel Mack <daniel@xxxxxxxx>
Cc: Andy Green <andy@xxxxxxxxxxx>
Cc: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/serial/imx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/serial/imx.c~arm-imx-serial-driver-fix-resume drivers/serial/imx.c
--- a/drivers/serial/imx.c~arm-imx-serial-driver-fix-resume
+++ a/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)
_

Patches currently in -mm which might be from volker.ernst@xxxxxxxx are

arm-imx-serial-driver-fix-resume.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux