summaryrefslogtreecommitdiff
path: root/drivers/staging/unisys
diff options
context:
space:
mode:
authorDavid Kershner <david.kershner@unisys.com>2017-04-18 16:55:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-28 11:49:52 +0200
commit04dbc09b255ec0be67e6b0f7bf114675ac143cd9 (patch)
tree78199bd5601090a87a1c624d5ac5f1b69905ca11 /drivers/staging/unisys
parentd02bde9d37bc00376727a2b422ee95323bbcd6d6 (diff)
staging: unisys: visorbus: add timeout to controlvm_periodic_work
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>
Diffstat (limited to 'drivers/staging/unisys')
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 5cbc69ff3381..67583692d958 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -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;