|
@@ -951,6 +951,7 @@ static int rpmsg_probe(struct virtio_device *vdev)
|
|
void *bufs_va;
|
|
void *bufs_va;
|
|
int err = 0, i;
|
|
int err = 0, i;
|
|
size_t total_buf_space;
|
|
size_t total_buf_space;
|
|
|
|
+ bool notify;
|
|
|
|
|
|
vrp = kzalloc(sizeof(*vrp), GFP_KERNEL);
|
|
vrp = kzalloc(sizeof(*vrp), GFP_KERNEL);
|
|
if (!vrp)
|
|
if (!vrp)
|
|
@@ -1030,8 +1031,22 @@ static int rpmsg_probe(struct virtio_device *vdev)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Prepare to kick but don't notify yet - we can't do this before
|
|
|
|
+ * device is ready.
|
|
|
|
+ */
|
|
|
|
+ notify = virtqueue_kick_prepare(vrp->rvq);
|
|
|
|
+
|
|
|
|
+ /* From this point on, we can notify and get callbacks. */
|
|
|
|
+ virtio_device_ready(vdev);
|
|
|
|
+
|
|
/* tell the remote processor it can start sending messages */
|
|
/* tell the remote processor it can start sending messages */
|
|
- virtqueue_kick(vrp->rvq);
|
|
|
|
|
|
+ /*
|
|
|
|
+ * this might be concurrent with callbacks, but we are only
|
|
|
|
+ * doing notify, not a full kick here, so that's ok.
|
|
|
|
+ */
|
|
|
|
+ if (notify)
|
|
|
|
+ virtqueue_notify(vrp->rvq);
|
|
|
|
|
|
dev_info(&vdev->dev, "rpmsg host is online\n");
|
|
dev_info(&vdev->dev, "rpmsg host is online\n");
|
|
|
|
|