diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2012-02-29 14:42:13 +0200 |
---|---|---|
committer | Ohad Ben-Cohen <ohad@wizery.com> | 2012-03-06 19:14:37 +0200 |
commit | 63140e0ed2e69bdafe62bc19fd6551d9213f80a7 (patch) | |
tree | a885f08832b5479721898b3dbef17edc17958d2c /drivers/remoteproc/remoteproc_core.c | |
parent | 55f34080d99be0ac75122a27e7b151c76a5b070d (diff) |
remoteproc: remove the hardcoded vring alignment
Remove the hardcoded vring alignment of 4096 bytes,
and instead utilize tha vring alignment as specified in
the resource table.
This is needed for remote processors that have rigid
memory requirement, and which have found the alignment of
4096 bytes to be excessively big.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Brian Swetland <swetland@google.com>
Cc: Iliyan Malchev <malchev@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Mark Grosen <mgrosen@ti.com>
Cc: John Williams <john.williams@petalogix.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Loic PALLARDY <loic.pallardy@stericsson.com>
Cc: Ludovic BARRE <ludovic.barre@stericsson.com>
Cc: Omar Ramirez Luna <omar.luna@linaro.org>
Cc: Guzman Lugo Fernando <fernando.lugo@ti.com>
Cc: Anna Suman <s-anna@ti.com>
Cc: Clark Rob <rob@ti.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Saravana Kannan <skannan@codeaurora.org>
Cc: David Brown <davidb@codeaurora.org>
Cc: Kieran Bingham <kieranbingham@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/remoteproc/remoteproc_core.c')
-rw-r--r-- | drivers/remoteproc/remoteproc_core.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index ca02f128b435..9be5dadaa3a3 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -298,14 +298,15 @@ __rproc_handle_vring(struct rproc_vdev *rvdev, struct fw_rsc_vdev *rsc, int i) return -EINVAL; } - /* the firmware must provide the expected queue size */ - if (!vring->num) { - dev_err(dev, "invalid qsz (%d)\n", vring->num); + /* verify queue size and vring alignment are sane */ + if (!vring->num || !vring->align) { + dev_err(dev, "invalid qsz (%d) or alignment (%d)\n", + vring->num, vring->align); return -EINVAL; } /* actual size of vring (in bytes) */ - size = PAGE_ALIGN(vring_size(vring->num, AMP_VRING_ALIGN)); + size = PAGE_ALIGN(vring_size(vring->num, vring->align)); if (!idr_pre_get(&rproc->notifyids, GFP_KERNEL)) { dev_err(dev, "idr_pre_get failed\n"); @@ -340,6 +341,7 @@ __rproc_handle_vring(struct rproc_vdev *rvdev, struct fw_rsc_vdev *rsc, int i) dma, size, notifyid); rvdev->vring[i].len = vring->num; + rvdev->vring[i].align = vring->align; rvdev->vring[i].va = va; rvdev->vring[i].dma = dma; rvdev->vring[i].notifyid = notifyid; @@ -354,7 +356,7 @@ static void __rproc_free_vrings(struct rproc_vdev *rvdev, int i) for (i--; i > 0; i--) { struct rproc_vring *rvring = &rvdev->vring[i]; - int size = PAGE_ALIGN(vring_size(rvring->len, AMP_VRING_ALIGN)); + int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align)); dma_free_coherent(rproc->dev, size, rvring->va, rvring->dma); idr_remove(&rproc->notifyids, rvring->notifyid); |