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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRiOZyAAoJELLolMlTRIoM7ToQAIsuq4S/YWfvZGDmHg7wsyGn
 DTtTEGo61mE+B0yJ0+fGw/b1LLjFrai9Ugr5zKyntwNWjuVJwtAtfvGcjoOSs3pK
 CJcpAADp+y92Dl5/6iLZwwQSMb2/OD0dfltTyvehoj4GOyVTmXZRwqLcsClZUYL3
 ISrxNaRKoEGyyGSUSRG2B6g1YvuoY39UFmFOXAMHitT0Oq2rgZR/RzFXmk/FUsPy
 sTxmevaLuN65RufqO2qAprdIZDk4TZf+2YC2BAEdHHiuFhykZukUxLCRH9L4DLhw
 j+EHWH8vLrfLCHb1FFR6Qj3R0mMsHiYHvfsdHIbRZGB9iJfszEMi53otGUdY3EF8
 bj7aAv/aI71Mg+OC98TWcCCRzdFowjfMKVTSpDwp6hNj0MrYGbmrmuqpDPiq+cmo
 axeUJWeytMEI/N1Lh+uJBMUa3Qa5j++iPur/vw2EZj/KWqGFTFACKagUp7fMT8QD
 7qlQF/6Dfmh5WzI5U7RrryaP6h/hKAFNIzNoiQRGFl+eybLULm+/6NluTPQunNbo
 7EgBpS+5ktpGu6fbDr8z+CUYrV4b6wXNinj7qjnGOwYJlQiyNaRtM3cuL34ZIP3q
 g2p23stIkjOlCkDt25SOBz6vrLTPzybxCaL8ipSl3HAOXDAKxT+055IhAYeYCJQ1
 op1V1BIAw6TTxhvL3del
 =dDx5
 -----END PGP SIGNATURE-----

Merge tag 'rpmsg-3.10' of git://git.kernel.org/pub/scm/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
This commit is contained in:
Linus Torvalds 2013-05-07 14:02:00 -07:00
commit 3e11a00d85
3 changed files with 44 additions and 14 deletions

View File

@ -6716,6 +6716,14 @@ F: drivers/remoteproc/
F: Documentation/remoteproc.txt
F: include/linux/remoteproc.h
REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM
M: Ohad Ben-Cohen <ohad@wizery.com>
T: git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg.git
S: Maintained
F: drivers/rpmsg/
F: Documentation/rpmsg.txt
F: include/linux/rpmsg.h
RFKILL
M: Johannes Berg <johannes@sipsolutions.net>
L: linux-wireless@vger.kernel.org

View File

@ -4,5 +4,6 @@ menu "Rpmsg drivers"
config RPMSG
tristate
select VIRTIO
select VIRTUALIZATION
endmenu

View File

@ -776,23 +776,13 @@ out:
}
EXPORT_SYMBOL(rpmsg_send_offchannel_raw);
/* called when an rx buffer is used, and it's time to digest a message */
static void rpmsg_recv_done(struct virtqueue *rvq)
static int rpmsg_recv_single(struct virtproc_info *vrp, struct device *dev,
struct rpmsg_hdr *msg, unsigned int len)
{
struct rpmsg_hdr *msg;
unsigned int len;
struct rpmsg_endpoint *ept;
struct scatterlist sg;
struct virtproc_info *vrp = rvq->vdev->priv;
struct device *dev = &rvq->vdev->dev;
int err;
msg = virtqueue_get_buf(rvq, &len);
if (!msg) {
dev_err(dev, "uhm, incoming signal, but no used buffer ?\n");
return;
}
dev_dbg(dev, "From: 0x%x, To: 0x%x, Len: %d, Flags: %d, Reserved: %d\n",
msg->src, msg->dst, msg->len,
msg->flags, msg->reserved);
@ -806,7 +796,7 @@ static void rpmsg_recv_done(struct virtqueue *rvq)
if (len > RPMSG_BUF_SIZE ||
msg->len > (len - sizeof(struct rpmsg_hdr))) {
dev_warn(dev, "inbound msg too big: (%d, %d)\n", len, msg->len);
return;
return -EINVAL;
}
/* use the dst addr to fetch the callback of the appropriate user */
@ -842,11 +832,42 @@ static void rpmsg_recv_done(struct virtqueue *rvq)
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;
}
while (msg) {
err = rpmsg_recv_single(vrp, dev, msg, len);
if (err)
break;
msgs_received++;
msg = virtqueue_get_buf(rvq, &len);
};
dev_dbg(dev, "Received %u messages\n", msgs_received);
/* tell the remote processor we added another available rx buffer */
virtqueue_kick(vrp->rvq);
if (msgs_received)
virtqueue_kick(vrp->rvq);
}
/*