MGS-3806: clocksource: tpm: make sure returning -ETIME case correct
authorAnson Huang <Anson.Huang@nxp.com>
Wed, 18 Apr 2018 07:20:03 +0000 (15:20 +0800)
committerAnson Huang <Anson.Huang@nxp.com>
Thu, 19 Apr 2018 01:18:12 +0000 (09:18 +0800)
commit25fbe1eba777a1f93ccb045037194166cdfdecc0
tree753fde1bb11843cfb9c3de4f905ba01804d14815
parentbbc7f4db8340fe0ba9c05485955c1a42b477b665
MGS-3806: clocksource: tpm: make sure returning -ETIME case correct

Incorrect condition check causes -ETIME return only
happen when next event is equal to current counter, and
it would cause various system issue like RCU stalls etc.,
the correct case should be whenever next event is less
than current counter, -ETIME should be returned. Correct
the type cast during return condition check to make it
work right.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
drivers/clocksource/timer-imx-tpm.c