net: atlantic: check rpc result and wait for rpc address
authorIgor Russkikh <irusskikh@marvell.com>
Fri, 14 Feb 2020 15:44:52 +0000 (18:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 12:00:12 +0000 (13:00 +0100)
commit30f5a66eebc923ff97e735c65f8758d8533465ed
treec0942e51bdcf55813d7f9874202a27a2506e1bd5
parent58eecbf16e97518f6802cc8491fdd20906ce82e8
net: atlantic: check rpc result and wait for rpc address

[ Upstream commit e7b5f97e6574dc4918e375d5f8d24ec31653cd6d ]

Artificial HW reliability tests revealed a possible hangup in
the driver. Normally, when device disappears from bus, all
register reads returns 0xFFFFFFFF.

At remote procedure invocation towards FW there is a logic
where result is compared with -1 in a loop.
That caused an infinite loop if hardware due to some issues
disappears from bus.

Add extra result checks to prevent this.

Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c