Skip to content

Commit

Permalink
DPAA2: Simplify software portal locking.
Browse files Browse the repository at this point in the history
New universal structure (dpaa2_buf) added to describe all of the DMA
mapped buffers for DPAA2 drivers. Software portals use sleep mutexes
from now on only to simplify locking.
  • Loading branch information
dsalychev committed Aug 1, 2022
1 parent 1a7aba9 commit e95fb52
Show file tree
Hide file tree
Showing 6 changed files with 436 additions and 416 deletions.
9 changes: 4 additions & 5 deletions sys/dev/dpaa2/dpaa2_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,7 @@ dpaa2_io_attach(device_t dev)
(sc->swp_desc.swp_clk / 1000000);

/* Initialize QBMan software portal. */
error = dpaa2_swp_init_portal(&sc->swp, &sc->swp_desc, DPAA2_SWP_DEF,
true);
error = dpaa2_swp_init_portal(&sc->swp, &sc->swp_desc, DPAA2_SWP_DEF);
if (error) {
device_printf(dev, "%s: failed to initialize dpaa2_swp: "
"error=%d\n", __func__, error);
Expand Down Expand Up @@ -503,10 +502,10 @@ dpaa2_io_intr(void *arg)
if (status == 0)
return;

dpaa2_swp_lock(sc->swp, &flags);
DPAA2_SWP_LOCK(sc->swp, &flags);
if (flags & DPAA2_SWP_DESTROYED) {
/* Terminate operation if portal is destroyed. */
dpaa2_swp_unlock(sc->swp);
DPAA2_SWP_UNLOCK(sc->swp);
return;
}

Expand All @@ -524,7 +523,7 @@ dpaa2_io_intr(void *arg)

dpaa2_swp_write_reg(sc->swp, DPAA2_SWP_CINH_DCAP, idx);
}
dpaa2_swp_unlock(sc->swp);
DPAA2_SWP_UNLOCK(sc->swp);

/* Enqueue notification tasks. */
for (int i = 0; i < cdan_n; i++)
Expand Down
Loading

0 comments on commit e95fb52

Please sign in to comment.