linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc/qbman: Simplify bman_release()
@ 2017-07-10  7:28 Sebastian Huber
  2017-10-20  9:35 ` Sebastian Huber
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Huber @ 2017-07-10  7:28 UTC (permalink / raw)
  To: netdev; +Cc: Madalin Bucur, linuxppc-dev, linux-arm-kernel

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] soc/qbman: Simplify bman_release()
  2017-07-10  7:28 [PATCH] soc/qbman: Simplify bman_release() Sebastian Huber
@ 2017-10-20  9:35 ` Sebastian Huber
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Huber @ 2017-10-20  9:35 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, linux-arm-kernel, Madalin Bucur

Ping.

On 10/07/17 09:28, Sebastian Huber wrote:
> Get the affine portal only once for the complete transaction.
>
> Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>

--=20
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine gesch=C3=A4ftliche Mitteilung im Sinne des EHUG=
.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-20  9:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-10  7:28 [PATCH] soc/qbman: Simplify bman_release() Sebastian Huber
2017-10-20  9:35 ` Sebastian Huber

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).