Skip to content

Commit

Permalink
Merge tag 'rproc-3.7-fix' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/ohad/remoteproc

Pull remoteproc fix from Ohad Ben-Cohen:
 "A single remoteproc fix for an error path issue reported by Ido Yariv."

* tag 'rproc-3.7-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
  remoteproc: fix error path of ->find_vqs
  • Loading branch information
Linus Torvalds committed Dec 1, 2012
2 parents b45b161 + dab55bb commit a95251b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions drivers/remoteproc/remoteproc_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,11 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev,
return vq;
}

static void rproc_virtio_del_vqs(struct virtio_device *vdev)
static void __rproc_virtio_del_vqs(struct virtio_device *vdev)
{
struct virtqueue *vq, *n;
struct rproc *rproc = vdev_to_rproc(vdev);
struct rproc_vring *rvring;

/* power down the remote processor before deleting vqs */
rproc_shutdown(rproc);

list_for_each_entry_safe(vq, n, &vdev->vqs, list) {
rvring = vq->priv;
rvring->vq = NULL;
Expand All @@ -137,6 +133,16 @@ static void rproc_virtio_del_vqs(struct virtio_device *vdev)
}
}

static void rproc_virtio_del_vqs(struct virtio_device *vdev)
{
struct rproc *rproc = vdev_to_rproc(vdev);

/* power down the remote processor before deleting vqs */
rproc_shutdown(rproc);

__rproc_virtio_del_vqs(vdev);
}

static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs,
struct virtqueue *vqs[],
vq_callback_t *callbacks[],
Expand All @@ -163,7 +169,7 @@ static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs,
return 0;

error:
rproc_virtio_del_vqs(vdev);
__rproc_virtio_del_vqs(vdev);
return ret;
}

Expand Down

0 comments on commit a95251b

Please sign in to comment.