octeontx2-af: Add additional register check to rvu_poll_reg()
authorSmadar Fuks <smadarf@marvell.com>
Wed, 1 Sep 2021 05:38:59 +0000 (11:08 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:28:01 +0000 (12:28 +0200)
commitc422c555053e5adc192b0f08d16d26cb59e4f249
tree7197c518eac25da7eb1087fbf308c0c7c5c6006d
parent1cac475eeb9f5c46c1b5ddb4ca79f531ad15e1c8
octeontx2-af: Add additional register check to rvu_poll_reg()

[ Upstream commit 21274aa1781941884599a97ab59be7f8f36af98c ]

Check one more time before exiting the API with an error.
Fix API to poll at least twice, in case there are other high priority
tasks and this API doesn't get CPU cycles for multiple jiffies update.

In addition, increase timeout from usecs_to_jiffies(10000) to
usecs_to_jiffies(20000), to prevent the case that for CONFIG_100HZ
timeout will be a single jiffies.
A single jiffies results actual timeout that can be any time between
1usec and 10msec. To solve this, a value of usecs_to_jiffies(20000)
ensures that timeout is 2 jiffies.

Signed-off-by: Smadar Fuks <smadarf@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/rvu.c