]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
staging: unisys: visorbus: add timeout to controlvm_periodic_work
authorDavid Kershner <david.kershner@unisys.com>
Tue, 18 Apr 2017 20:55:06 +0000 (16:55 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Apr 2017 09:49:52 +0000 (11:49 +0200)
Limit the amount that gets pulled from the queue on each try so we don't
get stuck in an infinite loop if something has gone wrong with the s-Par
firmware.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorchipset.c

index 5cbc69ff338186728195b572d8885a4e61b7b5e7..67583692d95851ccd72135b739ab1bab86a3afa5 100644 (file)
@@ -1785,6 +1785,7 @@ static void
 controlvm_periodic_work(struct work_struct *work)
 {
        struct controlvm_message inmsg;
+       int count = 0;
        int err;
 
        /* Drain the RESPONSE queue make it empty */
@@ -1792,7 +1793,7 @@ controlvm_periodic_work(struct work_struct *work)
                err = visorchannel_signalremove(chipset_dev->controlvm_channel,
                                                CONTROLVM_QUEUE_RESPONSE,
                                                &inmsg);
-       } while (!err);
+       } while ((!err) && (++count < CONTROLVM_MESSAGE_MAX));
 
        if (err != -EAGAIN)
                goto schedule_out;