Merge tag 'disintegrate-net-20121009' of git://git.infradead.org/users/dhowells/linux...
[cascardo/linux.git] / include / linux / remoteproc.h
index 131b539..faf3332 100644 (file)
@@ -360,6 +360,19 @@ enum rproc_state {
        RPROC_LAST      = 4,
 };
 
+/**
+ * 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
@@ -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)
 {