From 6372197ee1e986e9cc3f80e25b4f05169d2c3eb9 Mon Sep 17 00:00:00 2001 From: Ioana Radulescu Date: Thu, 12 Oct 2017 20:52:50 +0300 Subject: 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 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 -- cgit v0.10.2