OSDN Git Service

dpaa2-eth: Avoid unbounded while loops
authorIoana Radulescu <ruxandra.radulescu@nxp.com>
Mon, 7 Oct 2019 11:38:28 +0000 (14:38 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Oct 2019 14:08:09 +0000 (10:08 -0400)
commitef17bd7cc0c8bb14ea532fb66a708b02c5a4297e
tree52dccd870803855a4b530a6a7eb778bb97584ad3
parent4b177f065e7ec37399b18e18412a8c7b75f8f299
dpaa2-eth: Avoid unbounded while loops

Throughout the driver there are several places where we wait
indefinitely for DPIO portal commands to be executed, while
the portal returns a busy response code.

Even though in theory we are guaranteed the portals become
available eventually, in practice the QBMan hardware module
may become unresponsive in various corner cases.

Make sure we can never get stuck in an infinite while loop
by adding a retry counter for all portal commands.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h