From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: netdev@vger.kernel.org
Cc: Madalin Bucur <madalin.bucur@nxp.com>,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH] soc/qbman: Simplify bman_release()
Date: Mon, 10 Jul 2017 09:28:59 +0200 [thread overview]
Message-ID: <20170710072859.2616-1-sebastian.huber@embedded-brains.de> (raw)
Get the affine portal only once for the complete transaction.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
drivers/soc/fsl/qbman/bman.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/soc/fsl/qbman/bman.c b/drivers/soc/fsl/qbman/bman.c
index a3d6d7cfa929..0af2069a6b7e 100644
--- a/drivers/soc/fsl/qbman/bman.c
+++ b/drivers/soc/fsl/qbman/bman.c
@@ -723,26 +723,23 @@ int bman_release(struct bman_pool *pool, const struct bm_buffer *bufs, u8 num)
DPAA_ASSERT(num > 0 && num <= 8);
- do {
+ while (1) {
p = get_affine_portal();
local_irq_save(irqflags);
avail = bm_rcr_get_avail(&p->p);
if (avail < 2)
update_rcr_ci(p, avail);
r = bm_rcr_start(&p->p);
- local_irq_restore(irqflags);
- put_affine_portal();
if (likely(r))
break;
+ local_irq_restore(irqflags);
+ put_affine_portal();
+ if (unlikely(--timeout == 0))
+ return -ETIMEDOUT;
udelay(1);
- } while (--timeout);
-
- if (unlikely(!timeout))
- return -ETIMEDOUT;
+ }
- p = get_affine_portal();
- local_irq_save(irqflags);
/*
* we can copy all but the first entry, as this can trigger badness
* with the valid-bit
--
2.12.3
next reply other threads:[~2017-07-10 7:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 7:28 Sebastian Huber [this message]
2017-10-20 9:35 ` [PATCH] soc/qbman: Simplify bman_release() Sebastian Huber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170710072859.2616-1-sebastian.huber@embedded-brains.de \
--to=sebastian.huber@embedded-brains.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=madalin.bucur@nxp.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).