linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remtoteproc: Export notification id range
@ 2012-09-03 13:48 sjur.brandeland
  2012-09-12  7:30 ` Ohad Ben-Cohen
  0 siblings, 1 reply; 2+ messages in thread
From: sjur.brandeland @ 2012-09-03 13:48 UTC (permalink / raw)
  To: Ohad Ben-Cohen; +Cc: Sjur Brændeland, linux-kernel, Sjur Brændeland

From: Sjur Brændeland <sjur.brandeland@stericsson.com>

Some of the rproc drivers needs to know the range
of the notification IDs used for notifying the device.
Export a variable in struct rproc holding the
largest allocated notification id.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
---
 drivers/remoteproc/remoteproc_core.c |    3 +++
 include/linux/remoteproc.h           |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index d5c2dbf..00e1674 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -215,6 +215,9 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
 		return ret;
 	}
 
+	/* Store largest notifyid */
+	rproc->max_notifyid = max(rproc->max_notifyid, notifyid);
+
 	dev_dbg(dev, "vring%d: va %p dma %x size %x idr %d\n", i, va,
 					dma, size, notifyid);
 
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 131b539..c37e359 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -382,6 +382,7 @@ enum rproc_state {
  * @bootaddr: address of first instruction to boot rproc with (optional)
  * @rvdevs: list of remote virtio devices
  * @notifyids: idr for dynamically assigning rproc-wide unique notify ids
+ * @max_notifyid: Largest allocated notify id.
  * @index: index of this rproc device
  */
 struct rproc {
@@ -406,6 +407,7 @@ struct rproc {
 	struct list_head rvdevs;
 	struct idr notifyids;
 	int index;
+	int max_notifyid;
 };
 
 /* we currently support only two vrings per rvdev */
-- 
1.7.5.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] remtoteproc: Export notification id range
  2012-09-03 13:48 [PATCH] remtoteproc: Export notification id range sjur.brandeland
@ 2012-09-12  7:30 ` Ohad Ben-Cohen
  0 siblings, 0 replies; 2+ messages in thread
From: Ohad Ben-Cohen @ 2012-09-12  7:30 UTC (permalink / raw)
  To: sjur.brandeland; +Cc: Sjur Brændeland, linux-kernel

Hi Sjur,

On Mon, Sep 3, 2012 at 4:48 PM,  <sjur.brandeland@stericsson.com> wrote:
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index d5c2dbf..00e1674 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -215,6 +215,9 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
>                 return ret;
>         }
>
> +       /* Store largest notifyid */
> +       rproc->max_notifyid = max(rproc->max_notifyid, notifyid);

For completeness, I think we probably also want to update max_notifyid
when a notifyid is removed (i.e. on rproc_free_vring).

Thanks,
Ohad.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-12  7:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-03 13:48 [PATCH] remtoteproc: Export notification id range sjur.brandeland
2012-09-12  7:30 ` Ohad Ben-Cohen

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).