Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04dbc09b authored by David Kershner's avatar David Kershner Committed by Greg Kroah-Hartman
Browse files

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: default avatarDavid Kershner <david.kershner@unisys.com>
Reviewed-by: default avatarTim Sell <timothy.sell@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d02bde9d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;