mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-25 21:17:47 +08:00
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>
This commit is contained in:
parent
1908686c31
commit
66e83e0e64
@ -735,26 +735,23 @@ int bman_release(struct bman_pool *pool, const struct bm_buffer *bufs, u8 num)
|
|||||||
|
|
||||||
DPAA_ASSERT(num > 0 && num <= 8);
|
DPAA_ASSERT(num > 0 && num <= 8);
|
||||||
|
|
||||||
do {
|
while (1) {
|
||||||
p = get_affine_portal();
|
p = get_affine_portal();
|
||||||
local_irq_save(irqflags);
|
local_irq_save(irqflags);
|
||||||
avail = bm_rcr_get_avail(&p->p);
|
avail = bm_rcr_get_avail(&p->p);
|
||||||
if (avail < 2)
|
if (avail < 2)
|
||||||
update_rcr_ci(p, avail);
|
update_rcr_ci(p, avail);
|
||||||
r = bm_rcr_start(&p->p);
|
r = bm_rcr_start(&p->p);
|
||||||
local_irq_restore(irqflags);
|
|
||||||
put_affine_portal();
|
|
||||||
if (likely(r))
|
if (likely(r))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
local_irq_restore(irqflags);
|
||||||
|
put_affine_portal();
|
||||||
|
if (unlikely(--timeout == 0))
|
||||||
|
return -ETIMEDOUT;
|
||||||
udelay(1);
|
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
|
* we can copy all but the first entry, as this can trigger badness
|
||||||
* with the valid-bit
|
* with the valid-bit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user