xtensa: ISS: don't hang if stdin EOF is reached
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 8 Feb 2016 22:02:38 +0000 (01:02 +0300)
committerChris Zankel <chris@zankel.net>
Fri, 11 Mar 2016 08:53:31 +0000 (08:53 +0000)
commit362014c8d9d51d504c167c44ac280169457732be
tree9ba3fdc258387e5d94355f8230bf5e64d397fc48
parentbb2f3486041aa126cb7ce4929f1e45ede85f0051
xtensa: ISS: don't hang if stdin EOF is reached

Simulator stdin may be connected to a file, when its end is reached
kernel hangs in infinite loop inside rs_poll, because simc_poll always
signals that descriptor 0 is readable and simc_read always returns 0.
Check simc_read return value and exit loop if it's not positive. Also
don't rewind polling timer if it's zero.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/platforms/iss/console.c