]> rtime.felk.cvut.cz Git - vajnamar/linux-xlnx.git/commitdiff
remoteproc: zynqmp_r5: notify vqs and vdev from isr
authorWendy Liang <wendy.liang@xilinx.com>
Wed, 1 Feb 2017 07:49:05 +0000 (23:49 -0800)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 1 Feb 2017 13:52:28 +0000 (14:52 +0100)
When we receive the interrupt from IPI, we should notify all
vdevs and virtqueues instead of just rvq.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/remoteproc/zynqmp_r5_remoteproc.c

index e16612f53d92d423af4d58fff67a873b6ebd37db..709f7b1b2b559726452d637f175b0b383b24f08c 100644 (file)
@@ -35,6 +35,8 @@
 #include <linux/delay.h>
 #include <linux/list.h>
 #include <linux/genalloc.h>
+#include <linux/pfn.h>
+#include <linux/idr.h>
 
 #include "remoteproc_internal.h"
 
@@ -383,15 +385,30 @@ static inline void enable_ipi(struct zynqmp_r5_rproc_pdata *pdata)
        reg_write(pdata->ipi_base, IER_OFFSET, pdata->ipi_dest_mask);
 }
 
+/**
+ * event_notified_idr_cb - event notified idr callback
+ * @id: idr id
+ * @ptr: pointer to idr private data
+ * @data: data passed to idr_for_each callback
+ *
+ * Pass notification to remtoeproc virtio
+ */
+static int event_notified_idr_cb(int id, void *ptr, void *data)
+{
+       struct rproc *rproc = data;
+       (void)rproc_virtio_interrupt(rproc, id);
+       return 0;
+}
+
 static void handle_event_notified(struct work_struct *work)
 {
+       struct rproc *rproc;
        struct zynqmp_r5_rproc_pdata *local = container_of(
                                work, struct zynqmp_r5_rproc_pdata,
                                workqueue);
 
-       if (rproc_vq_interrupt(local->rproc, 0) == IRQ_NONE)
-               dev_dbg(local->rproc->dev.parent,
-                       "no message found in vqid 0\n");
+       rproc = local->rproc;
+       idr_for_each(&rproc->notifyids, event_notified_idr_cb, rproc);
 }