summaryrefslogtreecommitdiffstats
path: root/include/linux/remoteproc.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-04 09:11:57 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-04 09:11:57 -0700
commit4d6d367232813af09d9a1d90e3259e3ac42ee8a8 (patch)
treef8921106542eb5bac53f1ef5ac9fee46f1def42f /include/linux/remoteproc.h
parentd66e6737d454553e1e62109d8298ede5351178a4 (diff)
parentd09f53a735bae43806a77754312a45d3f1198342 (diff)
downloadop-kernel-dev-4d6d367232813af09d9a1d90e3259e3ac42ee8a8.zip
op-kernel-dev-4d6d367232813af09d9a1d90e3259e3ac42ee8a8.tar.gz
Merge tag 'remoteproc-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc
Pull remoteproc update from Ohad Ben-Cohen: - Remoteproc Recovery - by Fernando Guzman Lugo When a remote processor crash is detected, this mechanism will remove all virtio children devices, wait until their drivers let go, hard reset the remote processor and reload the firmware (resulting in the relevant virtio children devices re-added). Essentially the entire software stack is reset, together with the relevant hardware, so users don't have to reset the entire phone. - STE Modem driver is added - by Sjur Brændeland - OMAP DSP boot address support is added - by Juan Gutierrez - A handful of fixes/cleanups - Sjur Brændeland, Dan Carpenter, Emil Goode * tag 'remoteproc-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc: remoteproc: Fix use of format specifyer remoteproc: fix a potential NULL-dereference on cleanup remoteproc: select VIRTIO to avoid build breakage remoteproc: return -EFAULT on copy_from_user failure remoteproc: snprintf() can return more than was printed remoteproc: Add STE modem driver remtoteproc: maintain max notifyid remoteproc: create a 'recovery' debugfs entry remoteproc: add actual recovery implementation remoteproc: add rproc_report_crash function to notify rproc crashes remoteproc: Add dependency to HAS_DMA remoteproc/omap: set bootaddr support
Diffstat (limited to 'include/linux/remoteproc.h')
-rw-r--r--include/linux/remoteproc.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 131b539..faf3332 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -361,6 +361,19 @@ enum rproc_state {
};
/**
+ * enum rproc_crash_type - remote processor crash types
+ * @RPROC_MMUFAULT: iommu fault
+ *
+ * Each element of the enum is used as an array index. So that, the value of
+ * the elements should be always something sane.
+ *
+ * Feel free to add more types when needed.
+ */
+enum rproc_crash_type {
+ RPROC_MMUFAULT,
+};
+
+/**
* struct rproc - represents a physical remote processor device
* @node: klist node of this rproc object
* @domain: iommu domain
@@ -383,6 +396,11 @@ enum rproc_state {
* @rvdevs: list of remote virtio devices
* @notifyids: idr for dynamically assigning rproc-wide unique notify ids
* @index: index of this rproc device
+ * @crash_handler: workqueue for handling a crash
+ * @crash_cnt: crash counter
+ * @crash_comp: completion used to sync crash handler and the rproc reload
+ * @recovery_disabled: flag that state if recovery was disabled
+ * @max_notifyid: largest allocated notify id.
*/
struct rproc {
struct klist_node node;
@@ -406,6 +424,11 @@ struct rproc {
struct list_head rvdevs;
struct idr notifyids;
int index;
+ struct work_struct crash_handler;
+ unsigned crash_cnt;
+ struct completion crash_comp;
+ bool recovery_disabled;
+ int max_notifyid;
};
/* we currently support only two vrings per rvdev */
@@ -460,6 +483,7 @@ int rproc_del(struct rproc *rproc);
int rproc_boot(struct rproc *rproc);
void rproc_shutdown(struct rproc *rproc);
+void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type);
static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev)
{
OpenPOWER on IntegriCloud