diff options
author | Subramaniam C.A <subramaniam.ca@ti.com> | 2012-04-10 12:19:41 -0500 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 12:58:03 +0200 |
commit | 27404fd8b2c1e23ac21203a5c2546bccf9b94cd0 (patch) | |
tree | 2d2ab1f3cf2e3652092629f10c9a0439444400e3 | |
parent | 246e8a7349d048afb6025d2707554d4ffcbd11a4 (diff) | |
download | kernel_samsung_tuna-27404fd8b2c1e23ac21203a5c2546bccf9b94cd0.zip kernel_samsung_tuna-27404fd8b2c1e23ac21203a5c2546bccf9b94cd0.tar.gz kernel_samsung_tuna-27404fd8b2c1e23ac21203a5c2546bccf9b94cd0.tar.bz2 |
omap: mailbox: add pm constraint field to mbox structure
By adding this field, the pm qos apis can be selectively applied
only if the pm constraint is set to a +ve value.
Change-Id: I3b6930e85f65f7354826813798dec76b25149370
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/mailbox.c | 16 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/mailbox.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-omap/mailbox.c | 19 |
3 files changed, 21 insertions, 15 deletions
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 07e1f82..13bdf9d 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -41,6 +41,8 @@ #define MBOX_NR_REGS 2 #define OMAP4_MBOX_NR_REGS 3 +#define SET_MPU_CORE_CONSTRAINT 10 + static void __iomem *mbox_base; static u32 *mbox_ctx; @@ -325,9 +327,10 @@ static struct omap_mbox2_priv omap2_mbox_1_priv = { }; struct omap_mbox mbox_1_info = { - .name = "mailbox-1", - .ops = &omap2_mbox_ops, - .priv = &omap2_mbox_1_priv, + .name = "mailbox-1", + .ops = &omap2_mbox_ops, + .priv = &omap2_mbox_1_priv, + .pm_constraint = SET_MPU_CORE_CONSTRAINT, }; static struct omap_mbox2_priv omap2_mbox_2_priv = { @@ -347,9 +350,10 @@ static struct omap_mbox2_priv omap2_mbox_2_priv = { }; struct omap_mbox mbox_2_info = { - .name = "mailbox-2", - .ops = &omap2_mbox_ops, - .priv = &omap2_mbox_2_priv, + .name = "mailbox-2", + .ops = &omap2_mbox_ops, + .priv = &omap2_mbox_2_priv, + .pm_constraint = SET_MPU_CORE_CONSTRAINT, }; struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL }; diff --git a/arch/arm/plat-omap/include/plat/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h index cc3921e..0718658 100644 --- a/arch/arm/plat-omap/include/plat/mailbox.h +++ b/arch/arm/plat-omap/include/plat/mailbox.h @@ -59,6 +59,7 @@ struct omap_mbox { void *priv; int use_count; struct blocking_notifier_head notifier; + unsigned int pm_constraint; }; int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg); diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index 664ae42..c006751 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c @@ -39,9 +39,6 @@ static int mbox_configured; static DEFINE_MUTEX(mbox_configured_lock); struct pm_qos_request_list mbox_qos_request; -#define SET_MPU_CORE_CONSTRAINT 10 -#define CLEAR_MPU_CORE_CONSTRAINT -1 - static unsigned int mbox_kfifo_size = CONFIG_OMAP_MBOX_KFIFO_SIZE; module_param(mbox_kfifo_size, uint, S_IRUGO); MODULE_PARM_DESC(mbox_kfifo_size, "Size of omap's mailbox kfifo (bytes)"); @@ -256,8 +253,10 @@ static int omap_mbox_startup(struct omap_mbox *mbox) mutex_lock(&mbox_configured_lock); if (!mbox_configured++) { - pm_qos_update_request(&mbox_qos_request, - SET_MPU_CORE_CONSTRAINT); + if (mbox->pm_constraint) + pm_qos_update_request(&mbox_qos_request, + mbox->pm_constraint); + if (likely(mbox->ops->startup)) { ret = mbox->ops->startup(mbox); if (unlikely(ret)) @@ -303,8 +302,9 @@ fail_alloc_txq: mbox->use_count--; fail_startup: if (!--mbox_configured) - pm_qos_update_request(&mbox_qos_request, - CLEAR_MPU_CORE_CONSTRAINT); + if (mbox->pm_constraint) + pm_qos_update_request(&mbox_qos_request, + PM_QOS_DEFAULT_VALUE); mutex_unlock(&mbox_configured_lock); return ret; } @@ -324,8 +324,9 @@ static void omap_mbox_fini(struct omap_mbox *mbox) if (likely(mbox->ops->shutdown)) { if (!--mbox_configured) { mbox->ops->shutdown(mbox); - pm_qos_update_request(&mbox_qos_request, - CLEAR_MPU_CORE_CONSTRAINT); + if (mbox->pm_constraint) + pm_qos_update_request(&mbox_qos_request, + PM_QOS_DEFAULT_VALUE); } } |