net: qed: fix NVMe login fails over VFs
authorAlexander Lobakin <alobakin@marvell.com>
Tue, 23 Jun 2020 13:51:32 +0000 (16:51 +0300)
committerSasha Levin <sashal@kernel.org>
Tue, 30 Jun 2020 19:38:42 +0000 (15:38 -0400)
commit6a7cfbd6f5638e0f8fdf71a24f164314cc55a255
tree5211e52791b1e1415f32c7ae50372c1305aa0e6d
parentea6eb20cfeb4d94dea14c740812cca64bc0b89d4
net: qed: fix NVMe login fails over VFs

[ Upstream commit ccd7c7ce167a21dbf2b698ffcf00f11d96d44f9b ]

25ms sleep cycles in waiting for PF response are excessive and may lead
to different timeout failures.

Start to wait with short udelays, and in most cases polling will end
here. If the time was not sufficient, switch to msleeps.
usleep_range() may go far beyond 100us depending on platform and tick
configuration, hence atomic udelays for consistency.

Also add explicit DMA barriers since 'done' always comes from a shared
request-response DMA pool, and note that in the comment nearby.

Fixes: 1408cc1fa48c ("qed: Introduce VFs")
Signed-off-by: Alexander Lobakin <alobakin@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/qlogic/qed/qed_vf.c