From: Barry Song <21cnbao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: workgroup.linux-kQvG35nSl+M@public.gmane.org,
Wei Chen <Wei.Chen-kQvG35nSl+M@public.gmane.org>,
Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>
Subject: [PATCH 1/3] drivers:remoteproc:support predefined vq notifyid
Date: Tue, 15 Sep 2015 05:37:07 +0000 [thread overview]
Message-ID: <1442295429-19137-2-git-send-email-21cnbao@gmail.com> (raw)
In-Reply-To: <1442295429-19137-1-git-send-email-21cnbao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
From: Wei Chen <Wei.Chen-kQvG35nSl+M@public.gmane.org>
In current rproc use scenario, the vq notifyid
will be allocated by Linux, and write back this
notifyid to RSC table to tell DSP.
But in some scenarios, we might meet the DSP
predefined the vq notifyid. In these scenarios,
the rproc have to read predefined vq notifyid
from RSC table, and then request a same notifyid
in Linux side.
Signed-off-by: Wei Chen <Wei.Chen-kQvG35nSl+M@public.gmane.org>
Signed-off-by: Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>
---
drivers/remoteproc/remoteproc_core.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 8b3130f..8f82417 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -206,7 +206,7 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
struct fw_rsc_vdev *rsc;
dma_addr_t dma;
void *va;
- int ret, size, notifyid;
+ int ret, size, notifyid, pre_nid;
/* actual size of vring (in bytes) */
size = PAGE_ALIGN(vring_size(rvring->len, rvring->align));
@@ -222,11 +222,16 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
}
/*
+ * read predefined notifyids (via resource table)
+ */
+ rsc = (void *)rproc->table_ptr + rvdev->rsc_offset;
+ pre_nid = rsc->vring[i].notifyid;
+
+ /*
* Assign an rproc-wide unique index for this vring
* TODO: assign a notifyid for rvdev updates as well
- * TODO: support predefined notifyids (via resource table)
*/
- ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL);
+ ret = idr_alloc(&rproc->notifyids, rvring, pre_nid, 0, GFP_KERNEL);
if (ret < 0) {
dev_err(dev, "idr_alloc failed: %d\n", ret);
dma_free_coherent(dev->parent, size, va, dma);
@@ -247,9 +252,10 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
* set up the iommu. In this case the device address (da) will
* hold the physical address and not the device address.
*/
- rsc = (void *)rproc->table_ptr + rvdev->rsc_offset;
rsc->vring[i].da = dma;
- rsc->vring[i].notifyid = notifyid;
+ /* If notifyid is not predefined, write back to rsc */
+ if (!pre_nid)
+ rsc->vring[i].notifyid = notifyid;
return 0;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-09-15 5:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-15 5:37 [PATCH 0/3] remoteproc: add CSRatlas7 remoteproc driver Barry Song
[not found] ` <1442295429-19137-1-git-send-email-21cnbao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-15 5:37 ` Barry Song [this message]
2015-09-15 5:37 ` [PATCH 2/3] drivers:remoteproc:support always on remote processor Barry Song
2015-09-15 5:37 ` [PATCH 3/3] remoteproc: add CSRatlas7 remoteproc driver Barry Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442295429-19137-2-git-send-email-21cnbao@gmail.com \
--to=21cnbao-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=Baohua.Song-kQvG35nSl+M@public.gmane.org \
--cc=Wei.Chen-kQvG35nSl+M@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org \
--cc=workgroup.linux-kQvG35nSl+M@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).