diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2012-05-30 15:01:25 -0400 |
---|---|---|
committer | Ohad Ben-Cohen <ohad@wizery.com> | 2012-07-05 17:53:03 -0400 |
commit | b5ab5e24e960b9f780a4cc96815cfd4b0d412720 (patch) | |
tree | d07fbf490e03e9e2706c14a9bc24ae4f47b05111 /drivers/remoteproc/remoteproc_debugfs.c | |
parent | 6db20ea8d85064175c7ef594c433c6c2e6bbab83 (diff) |
remoteproc: maintain a generic child device for each rproc
For each registered rproc, maintain a generic remoteproc device whose
parent is the low level platform-specific device (commonly a pdev, but
it may certainly be any other type of device too).
With this in hand, the resulting device hierarchy might then look like:
omap-rproc.0
|
- remoteproc0 <---- new !
|
- virtio0
|
- virtio1
|
- rpmsg0
|
- rpmsg1
|
- rpmsg2
Where:
- omap-rproc.0 is the low level device that's bound to the
driver which invokes rproc_register()
- remoteproc0 is the result of this patch, and will be added by the
remoteproc framework when rproc_register() is invoked
- virtio0 and virtio1 are vdevs that are registered by remoteproc
when it realizes that they are supported by the firmware
of the physical remote processor represented by omap-rproc.0
- rpmsg0, rpmsg1 and rpmsg2 are rpmsg devices that represent rpmsg
channels, and are registerd by the rpmsg bus when it gets notified
about their existence
Technically, this patch:
- changes 'struct rproc' to contain this generic remoteproc.x device
- creates a new "remoteproc" type, to which this new generic remoteproc.x
device belong to.
- adds a super simple enumeration method for the indices of the
remoteproc.x devices
- updates all dev_* messaging to use the generic remoteproc.x device
instead of the low level platform-specific device
- updates all dma_* allocations to use the parent of remoteproc.x (where
the platform-specific memory pools, most commonly CMA, are to be found)
Adding this generic device has several merits:
- we can now add remoteproc runtime PM support simply by hooking onto the
new "remoteproc" type
- all remoteproc log messages will now carry a common name prefix
instead of having a platform-specific one
- having a device as part of the rproc struct makes it possible to simplify
refcounting (see subsequent patch)
Thanks to Stephen Boyd <sboyd@codeaurora.org> for suggesting and
discussing these ideas in one of the remoteproc review threads and
to Fernando Guzman Lugo <fernando.lugo@ti.com> for trying them out
with the (upcoming) runtime PM support for remoteproc.
Cc: Fernando Guzman Lugo <fernando.lugo@ti.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Diffstat (limited to 'drivers/remoteproc/remoteproc_debugfs.c')
-rw-r--r-- | drivers/remoteproc/remoteproc_debugfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c index 85d31a69e117..03833850f214 100644 --- a/drivers/remoteproc/remoteproc_debugfs.c +++ b/drivers/remoteproc/remoteproc_debugfs.c | |||
@@ -124,7 +124,7 @@ struct dentry *rproc_create_trace_file(const char *name, struct rproc *rproc, | |||
124 | tfile = debugfs_create_file(name, 0400, rproc->dbg_dir, | 124 | tfile = debugfs_create_file(name, 0400, rproc->dbg_dir, |
125 | trace, &trace_rproc_ops); | 125 | trace, &trace_rproc_ops); |
126 | if (!tfile) { | 126 | if (!tfile) { |
127 | dev_err(rproc->dev, "failed to create debugfs trace entry\n"); | 127 | dev_err(&rproc->dev, "failed to create debugfs trace entry\n"); |
128 | return NULL; | 128 | return NULL; |
129 | } | 129 | } |
130 | 130 | ||
@@ -141,7 +141,7 @@ void rproc_delete_debug_dir(struct rproc *rproc) | |||
141 | 141 | ||
142 | void rproc_create_debug_dir(struct rproc *rproc) | 142 | void rproc_create_debug_dir(struct rproc *rproc) |
143 | { | 143 | { |
144 | struct device *dev = rproc->dev; | 144 | struct device *dev = &rproc->dev; |
145 | 145 | ||
146 | if (!rproc_dbg) | 146 | if (!rproc_dbg) |
147 | return; | 147 | return; |