Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[firefly-linux-kernel-4.4.55.git] / drivers / remoteproc / remoteproc_virtio.c
index a34b50690b4efd28a3616d98f304185b723233b8..e1a10232a9437b5884e16965d4b5bced5b069ffe 100644 (file)
@@ -207,7 +207,7 @@ static void rproc_virtio_reset(struct virtio_device *vdev)
 }
 
 /* provide the vdev features as retrieved from the firmware */
-static u32 rproc_virtio_get_features(struct virtio_device *vdev)
+static u64 rproc_virtio_get_features(struct virtio_device *vdev)
 {
        struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
        struct fw_rsc_vdev *rsc;
@@ -217,7 +217,7 @@ static u32 rproc_virtio_get_features(struct virtio_device *vdev)
        return rsc->dfeatures;
 }
 
-static void rproc_virtio_finalize_features(struct virtio_device *vdev)
+static int rproc_virtio_finalize_features(struct virtio_device *vdev)
 {
        struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
        struct fw_rsc_vdev *rsc;
@@ -227,11 +227,16 @@ static void rproc_virtio_finalize_features(struct virtio_device *vdev)
        /* Give virtio_ring a chance to accept features */
        vring_transport_features(vdev);
 
+       /* Make sure we don't have any features > 32 bits! */
+       BUG_ON((u32)vdev->features != vdev->features);
+
        /*
         * Remember the finalized features of our vdev, and provide it
         * to the remote processor once it is powered on.
         */
-       rsc->gfeatures = vdev->features[0];
+       rsc->gfeatures = vdev->features;
+
+       return 0;
 }
 
 static void rproc_virtio_get(struct virtio_device *vdev, unsigned offset,