diff options
author | Kanigeri, Hari <h-kanigeri2@ti.com> | 2010-11-29 20:24:14 +0000 |
---|---|---|
committer | Hari Kanigeri <h-kanigeri2@ti.com> | 2010-12-02 05:43:16 -0600 |
commit | 582563074a691eb45cb22d2eca70eed8f2091c5f (patch) | |
tree | a10cfb02f1dd2c35f773d7892e6a8f75c3c7544c /arch/arm/plat-omap/include/plat/mailbox.h | |
parent | a42743c26a53a2a5f2b2018a9659ab3fb604d5bc (diff) | |
download | talos-op-linux-582563074a691eb45cb22d2eca70eed8f2091c5f.tar.gz talos-op-linux-582563074a691eb45cb22d2eca70eed8f2091c5f.zip |
OMAP: mailbox: add notification support for multiple readers
In the current mailbox driver, the mailbox internal pointer for
callback can be directly manipulated by the Users, so a second
User can easily corrupt the first user's callback pointer.
The initial effort to correct this issue can be referred here:
https://patchwork.kernel.org/patch/107520/
Along with fixing the above stated issue, this patch adds the
flexibility option to register notifications from
multiple readers to the events received on a mailbox instance.
The discussion regarding this can be referred here.
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30671.html
Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com>
Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Acked-by: Hiroshi Doyu <hiroshi.doyu@nokia.com>
Diffstat (limited to 'arch/arm/plat-omap/include/plat/mailbox.h')
-rw-r--r-- | arch/arm/plat-omap/include/plat/mailbox.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/include/plat/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h index 13f2ef3ea0ff..cc3921e9059c 100644 --- a/arch/arm/plat-omap/include/plat/mailbox.h +++ b/arch/arm/plat-omap/include/plat/mailbox.h @@ -46,7 +46,6 @@ struct omap_mbox_queue { struct kfifo fifo; struct work_struct work; struct tasklet_struct tasklet; - int (*callback)(void *); struct omap_mbox *mbox; bool full; }; @@ -58,13 +57,15 @@ struct omap_mbox { struct omap_mbox_ops *ops; struct device *dev; void *priv; + int use_count; + struct blocking_notifier_head notifier; }; int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg); void omap_mbox_init_seq(struct omap_mbox *); -struct omap_mbox *omap_mbox_get(const char *); -void omap_mbox_put(struct omap_mbox *); +struct omap_mbox *omap_mbox_get(const char *, struct notifier_block *nb); +void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb); int omap_mbox_register(struct device *parent, struct omap_mbox **); int omap_mbox_unregister(void); |