summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorIoana Radulescu <ruxandra.radulescu@nxp.com>2017-10-12 17:52:50 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-12-12 07:32:42 (GMT)
commit6372197ee1e986e9cc3f80e25b4f05169d2c3eb9 (patch)
tree996578b4c4bd6f1183cd2e1a8d3ac38449197814 /drivers
parentb3401428a2b4b0427b6f484a019e0bb64cdcab61 (diff)
downloadlinux-6372197ee1e986e9cc3f80e25b4f05169d2c3eb9.tar.xz
staging: fsl-dpaa2/eth: Don't yield the cpu unless necessary
When releasing buffers to the hardware pool, don't call cpu_relax() unless we are actually waiting for the QBMan portal to finish the previous command. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 2bbb0ca..47bf801 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -937,10 +937,9 @@ static int add_bufs(struct dpaa2_eth_priv *priv, u16 bpid)
release_bufs:
/* In case the portal is busy, retry until successful */
- do {
- err = dpaa2_io_service_release(NULL, bpid, buf_array, i);
+ while ((err = dpaa2_io_service_release(NULL, bpid,
+ buf_array, i)) == -EBUSY)
cpu_relax();
- } while (err == -EBUSY);
/* If release command failed, clean up and bail out; not much
* else we can do about it