[PATCH 06/25] staging: unisys: visorbus: add timeout to controlvm_periodic_work

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

 



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@xxxxxxxxxx>
Reviewed-by: Tim Sell <timothy.sell@xxxxxxxxxx>
---
 drivers/staging/unisys/visorbus/visorchipset.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 5cbc69f..6758369 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;
-- 
git-series 0.9.1
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux