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

[Xen-changelog] [xen stable-4.2] Fix inactive timer list corruption on second S3 resume



commit 4917ef594512e1f3b481bfbef83cc5ed743a465c
Author:     Tomasz Wroblewski <tomasz.wroblewski@xxxxxxxxxx>
AuthorDate: Fri Sep 6 14:48:49 2013 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Sep 6 14:48:49 2013 +0200

    Fix inactive timer list corruption on second S3 resume
    
    init_timer cannot be safely called multiple times on same timer since it 
does memset(0)
    on the structure, erasing the auxiliary member used by linked list code. 
This breaks
    inactive timer list in common/timer.c.
    
    Moved resume_timer initialisation to ns16550_init_postirq, so it's only 
done once.
    
    Signed-off-by: Tomasz Wroblewski <tomasz.wroblewski@xxxxxxxxxx>
    Acked-by: Keir Fraser <keir@xxxxxxx>
    master commit: 9e2c5938246546a5b3f698b7421640d85602b994
    master date: 2013-08-28 10:18:39 +0200
---
 xen/drivers/char/ns16550.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 12c5f84..342982c 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -125,6 +125,8 @@ static struct ns16550 {
 #define RESUME_DELAY    MILLISECS(10)
 #define RESUME_RETRIES  100
 
+static void ns16550_delayed_resume(void *data);
+
 static char ns_read_reg(struct ns16550 *uart, int reg)
 {
     if ( uart->remapped_io_base == NULL )
@@ -306,6 +308,7 @@ static void __init ns16550_init_postirq(struct serial_port 
*port)
     serial_async_transmit(port);
 
     init_timer(&uart->timer, ns16550_poll, port, 0);
+    init_timer(&uart->resume_timer, ns16550_delayed_resume, port, 0);
 
     /* Calculate time to fill RX FIFO and/or empty TX FIFO for polling. */
     bits = uart->data_bits + uart->stop_bits + !!uart->parity;
@@ -392,7 +395,6 @@ static void ns16550_resume(struct serial_port *port)
     if ( ns16550_ioport_invalid(uart) )
     {
         delayed_resume_tries = RESUME_RETRIES;
-        init_timer(&uart->resume_timer, ns16550_delayed_resume, port, 0);
         set_timer(&uart->resume_timer, NOW() + RESUME_DELAY);
     }
     else
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.