diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-05-19 09:47:45 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-23 09:24:06 +0200 |
commit | 66e83e0e64d13376ff8b99c6b7a9f72de5f441ac (patch) | |
tree | cf74f4a2221c065c2debf26dd1278098fe6cfb72 /linux/drivers/soc/fsl/qbman/bman.c | |
parent | soc/qman: Do not enable stashing without PAMU (diff) | |
download | rtems-libbsd-66e83e0e64d13376ff8b99c6b7a9f72de5f441ac.tar.bz2 |
soc/qbman: Simplify bman_release()
Get the affine portal only once for the complete transaction.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Diffstat (limited to '')
-rw-r--r-- | linux/drivers/soc/fsl/qbman/bman.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/linux/drivers/soc/fsl/qbman/bman.c b/linux/drivers/soc/fsl/qbman/bman.c index 2cc7f5c5..29a30dcb 100644 --- a/linux/drivers/soc/fsl/qbman/bman.c +++ b/linux/drivers/soc/fsl/qbman/bman.c @@ -735,26 +735,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 |