diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-26 19:19:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-26 19:19:08 -0400 |
commit | a9197f903f72a81393932d452379c8847fade544 (patch) | |
tree | d5c6acae9e45efb664288be0d4ad99849ac0e20c /Documentation | |
parent | e2aed8dfa50bb061747eeb14e6af099554a03b76 (diff) | |
parent | 6bb697b6b06041d2d0affc862b17b4b443a107e0 (diff) |
Merge tag 'remoteproc-for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc
Pull remoteproc update from Ohad Ben-Cohen:
- custom binary format support from Sjur Brændeland
- groundwork for recovery and runtime pm support
- some cleanups and API simplifications
Fix up conflicts in drivers/remoteproc/remoteproc_core.c due to clashes
with earlier cleanups by Sjur Brændeland (with part of the cleanups
moved into the new remoteproc_elf_loader.c file).
* tag 'remoteproc-for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
MAINTAINERS: add remoteproc's git
remoteproc: Support custom firmware handlers
remoteproc: Move Elf related functions to separate file
remoteproc: Add function rproc_get_boot_addr
remoteproc: Pass struct fw to load_segments and find_rsc_table.
remoteproc: adopt the driver core's alloc/add/del/put naming
remoteproc: remove the get_by_name/put API
remoteproc: support non-iommu carveout assignment
remoteproc: simplify unregister/free interfaces
remoteproc: remove the now-redundant kref
remoteproc: maintain a generic child device for each rproc
remoteproc: allocate vrings on demand, free when not needed
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/remoteproc.txt | 58 |
1 files changed, 14 insertions, 44 deletions
diff --git a/Documentation/remoteproc.txt b/Documentation/remoteproc.txt index 70a048cd3fa3..23a09b884bc7 100644 --- a/Documentation/remoteproc.txt +++ b/Documentation/remoteproc.txt | |||
@@ -36,8 +36,7 @@ cost. | |||
36 | Note: to use this function you should already have a valid rproc | 36 | Note: to use this function you should already have a valid rproc |
37 | handle. There are several ways to achieve that cleanly (devres, pdata, | 37 | handle. There are several ways to achieve that cleanly (devres, pdata, |
38 | the way remoteproc_rpmsg.c does this, or, if this becomes prevalent, we | 38 | the way remoteproc_rpmsg.c does this, or, if this becomes prevalent, we |
39 | might also consider using dev_archdata for this). See also | 39 | might also consider using dev_archdata for this). |
40 | rproc_get_by_name() below. | ||
41 | 40 | ||
42 | void rproc_shutdown(struct rproc *rproc) | 41 | void rproc_shutdown(struct rproc *rproc) |
43 | - Power off a remote processor (previously booted with rproc_boot()). | 42 | - Power off a remote processor (previously booted with rproc_boot()). |
@@ -51,30 +50,6 @@ cost. | |||
51 | which means that the @rproc handle stays valid even after | 50 | which means that the @rproc handle stays valid even after |
52 | rproc_shutdown() returns, and users can still use it with a subsequent | 51 | rproc_shutdown() returns, and users can still use it with a subsequent |
53 | rproc_boot(), if needed. | 52 | rproc_boot(), if needed. |
54 | - don't call rproc_shutdown() to unroll rproc_get_by_name(), exactly | ||
55 | because rproc_shutdown() _does not_ decrement the refcount of @rproc. | ||
56 | To decrement the refcount of @rproc, use rproc_put() (but _only_ if | ||
57 | you acquired @rproc using rproc_get_by_name()). | ||
58 | |||
59 | struct rproc *rproc_get_by_name(const char *name) | ||
60 | - Find an rproc handle using the remote processor's name, and then | ||
61 | boot it. If it's already powered on, then just immediately return | ||
62 | (successfully). Returns the rproc handle on success, and NULL on failure. | ||
63 | This function increments the remote processor's refcount, so always | ||
64 | use rproc_put() to decrement it back once rproc isn't needed anymore. | ||
65 | Note: currently rproc_get_by_name() and rproc_put() are not used anymore | ||
66 | by the rpmsg bus and its drivers. We need to scrutinize the use cases | ||
67 | that still need them, and see if we can migrate them to use the non | ||
68 | name-based boot/shutdown interface. | ||
69 | |||
70 | void rproc_put(struct rproc *rproc) | ||
71 | - Decrement @rproc's power refcount and shut it down if it reaches zero | ||
72 | (essentially by just calling rproc_shutdown), and then decrement @rproc's | ||
73 | validity refcount too. | ||
74 | After this function returns, @rproc may _not_ be used anymore, and its | ||
75 | handle should be considered invalid. | ||
76 | This function should be called _iff_ the @rproc handle was grabbed by | ||
77 | calling rproc_get_by_name(). | ||
78 | 53 | ||
79 | 3. Typical usage | 54 | 3. Typical usage |
80 | 55 | ||
@@ -115,21 +90,21 @@ int dummy_rproc_example(struct rproc *my_rproc) | |||
115 | This function should be used by rproc implementations during | 90 | This function should be used by rproc implementations during |
116 | initialization of the remote processor. | 91 | initialization of the remote processor. |
117 | After creating an rproc handle using this function, and when ready, | 92 | After creating an rproc handle using this function, and when ready, |
118 | implementations should then call rproc_register() to complete | 93 | implementations should then call rproc_add() to complete |
119 | the registration of the remote processor. | 94 | the registration of the remote processor. |
120 | On success, the new rproc is returned, and on failure, NULL. | 95 | On success, the new rproc is returned, and on failure, NULL. |
121 | 96 | ||
122 | Note: _never_ directly deallocate @rproc, even if it was not registered | 97 | Note: _never_ directly deallocate @rproc, even if it was not registered |
123 | yet. Instead, if you just need to unroll rproc_alloc(), use rproc_free(). | 98 | yet. Instead, when you need to unroll rproc_alloc(), use rproc_put(). |
124 | 99 | ||
125 | void rproc_free(struct rproc *rproc) | 100 | void rproc_put(struct rproc *rproc) |
126 | - Free an rproc handle that was allocated by rproc_alloc. | 101 | - Free an rproc handle that was allocated by rproc_alloc. |
127 | This function should _only_ be used if @rproc was only allocated, | 102 | This function essentially unrolls rproc_alloc(), by decrementing the |
128 | but not registered yet. | 103 | rproc's refcount. It doesn't directly free rproc; that would happen |
129 | If @rproc was already successfully registered (by calling | 104 | only if there are no other references to rproc and its refcount now |
130 | rproc_register()), then use rproc_unregister() instead. | 105 | dropped to zero. |
131 | 106 | ||
132 | int rproc_register(struct rproc *rproc) | 107 | int rproc_add(struct rproc *rproc) |
133 | - Register @rproc with the remoteproc framework, after it has been | 108 | - Register @rproc with the remoteproc framework, after it has been |
134 | allocated with rproc_alloc(). | 109 | allocated with rproc_alloc(). |
135 | This is called by the platform-specific rproc implementation, whenever | 110 | This is called by the platform-specific rproc implementation, whenever |
@@ -142,20 +117,15 @@ int dummy_rproc_example(struct rproc *my_rproc) | |||
142 | of registering this remote processor, additional virtio drivers might get | 117 | of registering this remote processor, additional virtio drivers might get |
143 | probed. | 118 | probed. |
144 | 119 | ||
145 | int rproc_unregister(struct rproc *rproc) | 120 | int rproc_del(struct rproc *rproc) |
146 | - Unregister a remote processor, and decrement its refcount. | 121 | - Unroll rproc_add(). |
147 | If its refcount drops to zero, then @rproc will be freed. If not, | ||
148 | it will be freed later once the last reference is dropped. | ||
149 | |||
150 | This function should be called when the platform specific rproc | 122 | This function should be called when the platform specific rproc |
151 | implementation decides to remove the rproc device. it should | 123 | implementation decides to remove the rproc device. it should |
152 | _only_ be called if a previous invocation of rproc_register() | 124 | _only_ be called if a previous invocation of rproc_add() |
153 | has completed successfully. | 125 | has completed successfully. |
154 | 126 | ||
155 | After rproc_unregister() returns, @rproc is _not_ valid anymore and | 127 | After rproc_del() returns, @rproc is still valid, and its |
156 | it shouldn't be used. More specifically, don't call rproc_free() | 128 | last refcount should be decremented by calling rproc_put(). |
157 | or try to directly free @rproc after rproc_unregister() returns; | ||
158 | none of these are needed, and calling them is a bug. | ||
159 | 129 | ||
160 | Returns 0 on success and -EINVAL if @rproc isn't valid. | 130 | Returns 0 on success and -EINVAL if @rproc isn't valid. |
161 | 131 | ||