aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-09 16:24:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-09 16:24:00 -0400
commit6f5410b688c6326a3a54feffed5119987187c357 (patch)
tree6ceee879bc0c668b2e2a57bbe6433560646f6850 /include
parent84836bf9739f93ca43d7b2b6bdda1ea1b8e3e0a4 (diff)
parent15fd943af50dbc5f7f4de33835795c72595f7bf4 (diff)
Merge tag 'rpmsg-3.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg
Pull rpmsg fixes from Ohad Ben-Cohen: "Fixing two (somewhat rare) endpoint-related race issues, both of which were reported by Fernando Guzman Lugo." * tag 'rpmsg-3.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg: rpmsg: make sure inflight messages don't invoke just-removed callbacks rpmsg: avoid premature deallocation of endpoints
Diffstat (limited to 'include')
-rw-r--r--include/linux/rpmsg.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h
index a8e50e44203c..82a673905edb 100644
--- a/include/linux/rpmsg.h
+++ b/include/linux/rpmsg.h
@@ -38,6 +38,8 @@
38#include <linux/types.h> 38#include <linux/types.h>
39#include <linux/device.h> 39#include <linux/device.h>
40#include <linux/mod_devicetable.h> 40#include <linux/mod_devicetable.h>
41#include <linux/kref.h>
42#include <linux/mutex.h>
41 43
42/* The feature bitmap for virtio rpmsg */ 44/* The feature bitmap for virtio rpmsg */
43#define VIRTIO_RPMSG_F_NS 0 /* RP supports name service notifications */ 45#define VIRTIO_RPMSG_F_NS 0 /* RP supports name service notifications */
@@ -120,7 +122,9 @@ typedef void (*rpmsg_rx_cb_t)(struct rpmsg_channel *, void *, int, void *, u32);
120/** 122/**
121 * struct rpmsg_endpoint - binds a local rpmsg address to its user 123 * struct rpmsg_endpoint - binds a local rpmsg address to its user
122 * @rpdev: rpmsg channel device 124 * @rpdev: rpmsg channel device
125 * @refcount: when this drops to zero, the ept is deallocated
123 * @cb: rx callback handler 126 * @cb: rx callback handler
127 * @cb_lock: must be taken before accessing/changing @cb
124 * @addr: local rpmsg address 128 * @addr: local rpmsg address
125 * @priv: private data for the driver's use 129 * @priv: private data for the driver's use
126 * 130 *
@@ -140,7 +144,9 @@ typedef void (*rpmsg_rx_cb_t)(struct rpmsg_channel *, void *, int, void *, u32);
140 */ 144 */
141struct rpmsg_endpoint { 145struct rpmsg_endpoint {
142 struct rpmsg_channel *rpdev; 146 struct rpmsg_channel *rpdev;
147 struct kref refcount;
143 rpmsg_rx_cb_t cb; 148 rpmsg_rx_cb_t cb;
149 struct mutex cb_lock;
144 u32 addr; 150 u32 addr;
145 void *priv; 151 void *priv;
146}; 152};