Commit Graph

149 Commits

Author SHA1 Message Date
Clement Leger
b1a17513a2 remoteproc: add vendor resources handling
In order to allow rproc backend to handle vendor resources such as in
OpenAMP, add a handle_rsc hook. This hook allow the rproc backends to
handle vendor resources as they like. The hook will be called only for
vendor resources and should return RSC_HANDLED on successful resource
handling, RSC_IGNORED if resource was ignored, or a negative value on
error.

Signed-off-by: Clement Leger <cleger@kalray.eu>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-06-29 12:02:17 -07:00
Loic Pallardy
28d7d5c66d remoteproc: fix rproc_check_carveout_da() returned error and comments
Fix typo in comments.
Change returned error from ENOMEM to EINVAL as
not dealing with memory allocation.
Remove carveout forced da update and return an error
when no configuration match

Fixes: c874bf59ad ("remoteproc: add helper function to check carveout device address")

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-02-20 21:34:19 -08:00
Loic Pallardy
a987e6b91a remoteproc: fix trace buffer va initialization
With rproc_alloc_registered_carveouts() introduction, carveouts are
allocated after resource table parsing.
rproc_da_to_va() may return NULL at trace resource registering.
This patch modifies trace debufs registering to provide device address
(da) instead of va.
da to va translation is done at each trace buffer access
through debugfs interface.

Fixes: d7c51706d0 ("remoteproc: add alloc ops in rproc_mem_entry struct")

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-02-20 21:34:18 -08:00
Loic Pallardy
60f849a5c1 remoteproc: fix rproc_alloc_carveout() for rproc with iommu domain
Correct remoteproc core behavior when memory carveout device
address is fixed in resource table and rproc device doesn't have
associated IOMMU.
Current returned error is breaking legacy on TI platforms.
This patch restores previous behavior. It adds a warn message when
allocation doesn't fit carveout request, but doesn't stop rproc_start()
sequence anymore.

Fixes: 3bc8140b15 ("remoteproc: configure IOMMU only if device address requested")

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-02-20 21:34:18 -08:00
Loic Pallardy
b36de8cfd1 remoteproc: add warning on resource table cast
Today resource table supports only 32bit address fields.
This is not compliant with 64bit platform for which addresses
are cast in 32bit.
This patch adds warn messages when address cast is done.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-02-20 21:34:18 -08:00
Loic Pallardy
80137b4072 remoteproc: fix rproc_alloc_carveout() bad variable cast
As dma member of struct rproc_mem_entry is dma_addr_t, no
need to cast in u32.

Fixes: d7c51706d0 ("remoteproc: add alloc ops in rproc_mem_entry struct")

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-02-20 21:34:18 -08:00
Loic Pallardy
74457c40f9 remoteproc: fix rproc_da_to_va in case of unallocated carveout
With introduction of rproc_alloc_registered_carveouts() which
delays carveout allocation just before the start of the remote
processor, rproc_da_to_va() could be called before all carveouts
are allocated.
This patch adds a check in rproc_da_to_va() to return NULL if
carveout is not allocated.

Fixes: d7c51706d0 ("remoteproc: add alloc ops in rproc_mem_entry struct")

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-02-20 21:34:18 -08:00
Loic Pallardy
a9f6fe0d72 remoteproc: correct rproc_mem_entry_init() comments
Add alloc parameter description and correct comment
about release one.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-02-20 21:34:18 -08:00
Loic Pallardy
d4c036fec3 remoteproc: fix recovery procedure
Commit 7e83cab824a87e83cab824a8 ("remoteproc: Modify recovery path
to use rproc_{start,stop}()") replaces rproc_{shutdown,boot}() with
rproc_{stop,start}(), which skips destroy the virtio device at stop
but re-initializes it again at start.

Issue is that struct virtio_dev is not correctly reinitialized like done
at initial allocation thanks to kzalloc() and kobject is considered as
already initialized by kernel. That is due to the fact struct virtio_dev
is allocated and released at vdev resource handling level managed and
virtio device is registered and unregistered at rproc subdevices level.

Moreover kernel documentation mentions that device struct must be
zero initialized before calling device_initialize().

This patch disentangles struct virtio_dev from struct rproc_vdev as
the two struct don't have the same life-cycle.

struct virtio_dev is now allocated on rproc_start() and released
on rproc_stop().

This patch applies on top of patch
remoteproc: create vdev subdevice with specific dma memory pool [1]

[1]: https://patchwork.kernel.org/patch/10755781/

Fixes: 7e83cab824 ("remoteproc: Modify recovery path to use rproc_{start,stop}()")

Reported-by: Xiang Xiao <xiaoxiang781216@gmail.com>
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-02-20 21:34:17 -08:00
Loic Pallardy
086d08725d remoteproc: create vdev subdevice with specific dma memory pool
This patch creates a dedicated vdev subdevice for each vdev declared
in firmware resource table and associates carveout named "vdev%dbuffer"
(with %d vdev index in resource table) if any as dma coherent memory pool.

Then vdev subdevice is used as parent for virtio device.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-02-20 21:15:35 -08:00
Sibi Sankar
ab8f873bb9 remoteproc: Add mechanism for custom dump function assignment
This patch adds a mechanism for assigning each rproc dump segment with
a custom dump function and private data. The dump function is to be
called for each rproc segment during coredump if assigned.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
[bjorn: reordred arguments to rproc_coredump_add_custom_segment()]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-19 12:53:55 -07:00
Sibi Sankar
3952105df4 remoteproc: Introduce custom dump function for each remoteproc segment
Introduce custom dump function and private data per remoteproc dump
segment. The dump function is responsible for filling the device memory
segment associated with coredump

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-19 11:14:16 -07:00
Loic Pallardy
c6aed238b7 remoteproc: modify vring allocation to rely on centralized carveout allocator
Current version of rproc_alloc_vring function supports only dynamic vring
allocation.

This patch allows to allocate vrings based on memory region declatation.
Vrings are now manage like memory carveouts, to communize memory management
code in rproc_alloc_registered_carveouts().

Allocated buffer is retrieved in rp_find_vq() thanks to
rproc_find_carveout_by_name() functions for.

This patch sets vrings names to vdev"x"vring"y" with x vdev index in
resource table and y vring index in vdev. This will be updated when
name will be associated to vdev in firmware resource table.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-14 23:37:40 -07:00
Loic Pallardy
ffa5f9c848 remoteproc: modify rproc_handle_carveout to support pre-registered region
In current version rproc_handle_carveout() function registers carveout
for allocation.
This patch extends rproc_handle_carveout() function to support
pre-registered region. Match is done on region name, then requested
device address and length are checked.
If match found, pre-registered region is associated with resource
table request.
If no name match found, new carveout is registered for allocation.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-09 22:41:04 -07:00
Loic Pallardy
c874bf59ad remoteproc: add helper function to check carveout device address
This patch introduces a function to verify that a specified carveout
is fitting request device address and associated length

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-09 22:40:55 -07:00
Loic Pallardy
1429cca117 remoteproc: add helper function to allocate rproc_mem_entry from reserved memory
This patch introduces rproc_res_mem_entry_init() helper function to
allocate a rproc_mem_entry structure from a reserved memory region.
In that case, rproc_mem_entry structure has no alloc and release ops.
It will be used to assigned the specified reserved memory to any
rproc sub device.
Relation between rproc_mem_entry and rproc sub device will be done
by name.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-09 22:39:14 -07:00
Loic Pallardy
d7c51706d0 remoteproc: add alloc ops in rproc_mem_entry struct
Memory entry could be allocated in different ways (ioremap,
dma_alloc_coherent, internal RAM allocator...).
This patch introduces an alloc ops in rproc_mem_entry structure
to associate dedicated allocation mechanism to each memory entry
descriptor in order to do remote core agnostic from memory allocators.

The introduction of this ops allows to perform allocation of all registered
carveout at the same time, just before calling rproc_start().
It simplifies and makes uniform carveout management whatever origin.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-09 22:39:12 -07:00
Loic Pallardy
b0019ccd7e remoteproc: introduce rproc_find_carveout_by_name function
This patch provides a new function to find a carveout according
to a name.
If match found, this function returns a pointer on the corresponding
carveout (rproc_mem_entry structure).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-09 22:39:11 -07:00
Loic Pallardy
15c0b0258e remoteproc: introduce rproc_add_carveout function
This patch introduces a new API to allow platform driver to register
platform specific carveout regions.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-09 22:39:08 -07:00
Loic Pallardy
72029c901a remoteproc: add helper function to allocate and init rproc_mem_entry struct
This patch introduces rproc_mem_entry_init helper function to
simplify rproc_mem_entry structure allocation and filling by
client.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-09 22:39:06 -07:00
Loic Pallardy
3265230c5b remoteproc: add name in rproc_mem_entry struct
Add name field in struct rproc_mem_entry.
This new field will be used to match memory area
requested in resource table with pre-registered carveout.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-09 22:39:05 -07:00
Loic Pallardy
f2e74abfaa remoteproc: add release ops in rproc_mem_entry struct
Memory entry could be allocated in different ways (ioremap,
dma_alloc_coherent, internal RAM allocator...).
This patch introduces a release ops in rproc_mem_entry structure
to associate dedicated release mechanism to each memory entry descriptor
in order to keep remoteproc core generic.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-09 22:39:04 -07:00
Loic Pallardy
eb30596eae remoteproc: add rproc_va_to_pa function
This new function translates CPU virtual address in
CPU physical one according to virtual address location.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-09 22:39:03 -07:00
Loic Pallardy
3bc8140b15 remoteproc: configure IOMMU only if device address requested
If there is no IOMMU associate to remote processor device,
remoteproc_core won't be able to satisfy device address requested
in firmware resource table.
Return an error as configuration won't be coherent.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-10-09 22:38:37 -07:00
Loic Pallardy
276ec99342 remoteproc: replace "%p" with "%pK"
The format specifier "%p" can leak kernel addresses.
Use "%pK" instead.

This patch proposes changes for remoteproc core only.

Acked-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-07-30 23:24:15 -07:00
Suman Anna
f68d51bd8a remoteproc: Reset table_ptr in rproc_start() failure paths
Unwind the modified table_ptr and restore it to the local copy
upon any subsequent failures in the rproc_start() function. This
keeps the function to remain balanced on failures without the need
to balance any modified variables elsewhere.

While at this, do some minor cleanup of the extra lines between
the failure labels as well.

Signed-off-by: Suman Anna <s-anna@ti.com>
[bjorn: unconditionally set table_ptr to cached_table]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-07-30 21:11:43 -07:00
Bjorn Andersson
c455daa4af remoteproc: Introduce prepare and unprepare for subdevices
On rare occasions a subdevice might need to prepare some hardware
resources before a remote processor is booted, and clean up some
state after it has been shut down.

One such example is the IP Accelerator found in various Qualcomm
platforms, which is accessed directly from both the modem remoteproc
and the application subsystem and requires an intricate lockstep
process when bringing the modem up and down.

Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
[elder@linaro.org: minor description and comment edits]
Signed-off-by Alex Elder <elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-06-26 14:09:12 -07:00
Alex Elder
6f8b037308 remoteproc: rename subdev probe and remove functions
Rename functions used when subdevices are started and stopped to
reflect the new naming scheme.

Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by Alex Elder <elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-06-26 14:09:12 -07:00
Bjorn Andersson
4902676f04 remoteproc: Make client initialize ops in rproc_subdev
In preparation of adding the additional prepare and unprepare operations
make the client responsible for filling out the function pointers of the
rproc_subdev. This makes the arguments to rproc_add_subdev() more
manageable, in particular when some of the functions are left out.

Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
[elder@linaro.org: added comment about assigning function pointers]
Signed-off-by Alex Elder <elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-06-26 13:53:07 -07:00
Bjorn Andersson
be37b1e0fb remoteproc: Make start and stop in subdev optional
Some subdevices, such as glink ssr only care about the stop operation,
so make the operations optional to reduce client code.

Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by Alex Elder <elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-06-26 13:53:06 -07:00
Bjorn Andersson
618fcff374 remoteproc: Rename subdev functions to start/stop
"start" and "stop" are more suitable names for how these two operations
are used, and they fit better with the upcoming introduction of two
additional operations in the struct.

Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
[elder@linaro.org: minor comment edits]
Signed-off-by Alex Elder <elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-06-26 13:53:05 -07:00
Arnaud Pouliquen
fcd58037f2 remoteproc: fix crashed parameter logic on stop call
Fix rproc_add_subdev parameter name and inverse the crashed logic.

Fixes: 880f5b3882 ("remoteproc: Pass type of shutdown to subdev remove")
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-04-25 16:43:55 -07:00
Bjorn Andersson
880f5b3882 remoteproc: Pass type of shutdown to subdev remove
remoteproc instances can be stopped either by invoking shutdown or by an
attempt to recover from a crash. For some subdev types it's expected to
clean up gracefully during a shutdown, but are unable to do so during a
crash - so pass this information to the subdev remove functions.

Acked-By: Chris Lew <clew@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-02-12 16:57:22 -08:00
Bjorn Andersson
c1d35c1ab4 remoteproc: Rename "load_rsc_table" to "parse_fw"
The resource table is just one possible source of information that can
be extracted from the firmware file. Generalize this interface to allow
drivers to override this with parsers of other types of information.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-02-12 11:05:30 -08:00
Sarangdhar Joshi
2666ca9197 remoteproc: Add remote processor coredump support
As the remoteproc framework restarts the remote processor after a fatal
event, it's useful to be able to acquire a coredump of the remote
processor's state, for post mortem debugging.

This patch introduces a mechanism for extracting the memory contents
after the remote has stopped and before the restart sequence has begun
in the recovery path. The remoteproc framework builds the core dump in
memory and use devcoredump to expose this to user space.

Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
[bjorn: Use vmalloc instead of composing the ELF on the fly]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-02-12 11:05:29 -08:00
Bjorn Andersson
0a8b81cb2e remoteproc: Reset table_ptr on stop
The installed resource table is no longer accessible after stopping the
remote, so update table_ptr to point to the local copy.

Reviewed-By: Loic Pallardy <loic.pallardy@st.com>
Tested-By: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-15 09:30:04 -08:00
Bjorn Andersson
58b6409067 remoteproc: Move resource table load logic to find
Extend the previous operation of finding the resource table in the ELF
with the extra step of populating the rproc struct with a copy and the
size. This allows drivers to override the mechanism used for acquiring
the resource table, or omit it for firmware that is known not to have a
resource table.

This leaves the custom, dummy, find_rsc_table implementations found in
some drivers dangling.

Reviewed-By: Loic Pallardy <loic.pallardy@st.com>
Tested-By: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-15 09:29:53 -08:00
Bjorn Andersson
d4bb86f2c3 remoteproc: Don't handle empty resource table
Allow a NULL table_ptr to have the same meaning as a table with 0
entries, allowing a subsequent patch to skip the assignment step.

A few other places in the implementation does dereference table_ptr, but
they are currently all coming from rproc_handle_resources().

Reviewed-By: Loic Pallardy <loic.pallardy@st.com>
Tested-By: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-15 09:29:48 -08:00
Bjorn Andersson
0f21f9cc9d remoteproc: Merge rproc_ops and rproc_fw_ops
There are currently a few different schemes used for overriding fw_ops
or parts of fw_ops. Merge fw_ops into rproc_ops and expose the default
ELF-loader symbols so that they can be assigned by the drivers.

To keep backwards compatibility with the "default" case, a driver not
specifying the "load" operation is assumed to want the full ELF-loader
suit of functions.

Reviewed-By: Loic Pallardy <loic.pallardy@st.com>
Tested-By: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-15 09:29:40 -08:00
Bjorn Andersson
fb98e2bdbd remoteproc: Clone rproc_ops in rproc_alloc()
In order to allow rproc_alloc() to, in a future patch, update entries in
the "ops" struct we need to make a local copy of it.

Reviewed-By: Loic Pallardy <loic.pallardy@st.com>
Tested-By: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-15 09:29:34 -08:00
Bjorn Andersson
a4b24c7560 remoteproc: Cache resource table size
We don't re-read the resource table during a recovery, so it is possible
in the recovery path that the resource table has a different size than
cached_table. Store the original size of cached_table to avoid these
getting out of sync.

Reviewed-By: Loic Pallardy <loic.pallardy@st.com>
Tested-By: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-15 09:29:29 -08:00
Bjorn Andersson
b26210cda6 remoteproc: Remove depricated crash completion
The crash handling now happens in a single execution context, so there's
no longer a need for a completion to synchronize this.

Reviewed-By: Loic Pallardy <loic.pallardy@st.com>
Tested-By: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-15 09:29:16 -08:00
Bjorn Andersson
7c89717f82 remoteproc: Introduce rproc handle accessor for children
In certain circumstances rpmsg devices needs to acquire a handle to the
ancestor remoteproc instance, e.g. to invoke rproc_report_crash() when a
fatal error is detected. Introduce an interface that walks the device
tree in search for a remoteproc instance and return this.

Tested-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-09-01 15:49:13 -07:00
Bjorn Andersson
f9cbbd256c remoteproc: Stop subdevices in reverse order
Subdevices might depend on earlier registered subdevices for
communication purposes, as such they should be stopped in reverse order
so that said communication channel is removed after the dependent
subdevice is stopped.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-08-30 16:29:55 -07:00
Bhumika Goyal
c42ca04da5 remoteproc: make device_type const
Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-08-24 10:25:50 -07:00
Suman Anna
1b0ef9068f remoteproc: Merge __rproc_boot() with rproc_boot()
The additional arguments in the internal __rproc_boot() function
were dropped in commit 2bfc311a57 ("remoteproc: Drop wait in
__rproc_boot()"). The exported rproc_boot() is now just a wrapper
around this internal function, so merge them together.

While at this, also remove the declaration for the previously
cleaned up rproc_boot_nowait() function.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-07-26 10:01:27 -07:00
Colin Ian King
ca91ab5f11 remoteproc: fix spelling mistake: "Resouce" -> "Resource"
Trivial fix to spelling mistake in dev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-05-30 20:57:40 -07:00
Sarangdhar Joshi
7e83cab824 remoteproc: Modify recovery path to use rproc_{start,stop}()
Replace rproc_shutdown() by rproc_stop() and rproc_boot() by
rproc_start() in the recovery path, in order to avoid remoteproc
resources re-allocation overhead and to assist with extracting the
coredumps after stopping the remote processor.

Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-05-26 18:11:33 -07:00
Sarangdhar Joshi
1efa30d089 remoteproc: Introduce rproc_{start,stop}() functions
In the context of recovering from crash, rproc_trigger_recovery() does
rproc_shutdown() followed by rproc_boot(). The remoteproc resources are
cleaned up in rproc_shutdown() and immediately reallocated in
rproc_boot() which is an unnecessary overhead. Furthermore, we want the
memory regions to be accessible after stopping the remote processor, to
be able to extract the memory content for a coredump.

This patch factors out the code in rproc_boot() and rproc_shutdown()
path and introduces rproc_{start,stop}() in order to avoid resource
allocation overhead.

Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-05-26 18:11:31 -07:00
Sarangdhar Joshi
5e6533f72c remoteproc: Modify the function names
The functions rproc_add_virtio_devices() and rproc_fw_config_virtio()
are reduced to trigger auto-boot only. Modify these function names and
related comments to reflect their current state.

This patch does not add any functional change.

Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-02-06 13:06:13 -08:00