This is a note to let you know that I've just added the patch titled

    tty/serial: at91: fix error handling in atmel_serial_probe()

to the 3.19-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tty-serial-at91-fix-error-handling-in-atmel_serial_probe.patch
and it can be found in the queue-3.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 6fbb9bdf0f3fbe23aeff806489791aa876adaffb Mon Sep 17 00:00:00 2001
From: Cyrille Pitchen <[email protected]>
Date: Tue, 9 Dec 2014 14:31:34 +0100
Subject: tty/serial: at91: fix error handling in atmel_serial_probe()

From: Cyrille Pitchen <[email protected]>

commit 6fbb9bdf0f3fbe23aeff806489791aa876adaffb upstream.

-EDEFER error wasn't handle properly by atmel_serial_probe().
As an example, when atmel_serial_probe() is called for the first time, we pass
the test_and_set_bit() test to check whether the port has already been
initalized. Then we call atmel_init_port(), which may return -EDEFER, possibly
returned before by clk_get(). Consequently atmel_serial_probe() used to return
this error code WITHOUT clearing the port bit in the "atmel_ports_in_use" mask.
When atmel_serial_probe() was called for the second time, it used to fail on
the test_and_set_bit() function then returning -EBUSY.

When atmel_serial_probe() fails, this patch make it clear the port bit in the
"atmel_ports_in_use" mask, if needed, before returning the error code.

Signed-off-by: Cyrille Pitchen <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/tty/serial/atmel_serial.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -2565,7 +2565,7 @@ static int atmel_serial_probe(struct pla
 
        ret = atmel_init_port(port, pdev);
        if (ret)
-               goto err;
+               goto err_clear_bit;
 
        if (!atmel_use_pdc_rx(&port->uart)) {
                ret = -ENOMEM;
@@ -2628,6 +2628,8 @@ err_alloc_ring:
                clk_put(port->clk);
                port->clk = NULL;
        }
+err_clear_bit:
+       clear_bit(port->uart.line, atmel_ports_in_use);
 err:
        return ret;
 }


Patches currently in stable-queue which might be from [email protected] 
are

queue-3.19/tty-serial-at91-fix-error-handling-in-atmel_serial_probe.patch
queue-3.19/tty-serial-at91-enable-peripheral-clock-before-accessing-i-o-registers.patch
queue-3.19/tty-serial-at91-use-correct-type-for-dma_sync_-_for_cpu-and-dma_sync_-_for_device.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to