From: Linus Torvalds Date: Tue, 7 May 2013 21:02:00 +0000 (-0700) Subject: Merge tag 'rpmsg-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg X-Git-Tag: upstream/snapshot3+hdmi~5156 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e11a00d8561622a2598254853e2e8cc3e51e544;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Merge tag 'rpmsg-3.10' of git://git./linux/kernel/git/ohad/rpmsg Pull rpmsg changes from Ohad Ben-Cohen: "A small pull request consisting of: - Make rpmsg process all pending messages instead of just one, from Robert Tivy - Fix Kconfig dependency on VIRTUALIZATION, from Suman. Note: this was submitted late during the 3.9 rc cycle and it seemed appropriate to wait with it for the merge window. - Belated addition of an rpmsg entry to the MAINTAINERS file. People seem to look for this" * tag 'rpmsg-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg: rpmsg: fix kconfig dependencies for VIRTIO MAINTAINERS: add rpmsg entry rpmsg: process _all_ pending messages in rpmsg_recv_done --- 3e11a00d8561622a2598254853e2e8cc3e51e544 diff --cc drivers/rpmsg/virtio_rpmsg_bus.c index 56fceaf,07d5ea2..b6135d4 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@@ -839,9 -829,27 +829,27 @@@ static int rpmsg_recv_single(struct vir sg_init_one(&sg, msg, RPMSG_BUF_SIZE); /* add the buffer back to the remote processor's virtqueue */ - err = virtqueue_add_buf(vrp->rvq, &sg, 0, 1, msg, GFP_KERNEL); + err = virtqueue_add_inbuf(vrp->rvq, &sg, 1, msg, GFP_KERNEL); if (err < 0) { dev_err(dev, "failed to add a virtqueue buffer: %d\n", err); + return err; + } + + return 0; + } + + /* called when an rx buffer is used, and it's time to digest a message */ + static void rpmsg_recv_done(struct virtqueue *rvq) + { + struct virtproc_info *vrp = rvq->vdev->priv; + struct device *dev = &rvq->vdev->dev; + struct rpmsg_hdr *msg; + unsigned int len, msgs_received = 0; + int err; + + msg = virtqueue_get_buf(rvq, &len); + if (!msg) { + dev_err(dev, "uhm, incoming signal, but no used buffer ?\n"); return; }