[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1426189108-35488-1-git-send-email-lina.iyer@linaro.org>
Date: Thu, 12 Mar 2015 13:38:28 -0600
From: Lina Iyer <lina.iyer@...aro.org>
To: bjorn.andersson@...ymobile.com
Cc: linux-arm-msm@...r.kernel.org, jhugo@...eaurora.org,
agross@...eaurora.org, linux-kernel@...r.kernel.org,
Lina Iyer <lina.iyer@...aro.org>
Subject: [PATCH] Lock 7 is cpuidle specific, use non-generic value for locking
---
drivers/hwspinlock/qcom_hwspinlock.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/hwspinlock/qcom_hwspinlock.c b/drivers/hwspinlock/qcom_hwspinlock.c
index 93b62e0..7642524 100644
--- a/drivers/hwspinlock/qcom_hwspinlock.c
+++ b/drivers/hwspinlock/qcom_hwspinlock.c
@@ -25,16 +25,23 @@
#include "hwspinlock_internal.h"
-#define QCOM_MUTEX_APPS_PROC_ID 1
-#define QCOM_MUTEX_NUM_LOCKS 32
+#define QCOM_MUTEX_APPS_PROC_ID 1
+#define QCOM_MUTEX_CPUIDLE_OFFSET 128
+#define QCOM_CPUIDLE_LOCK 7
+#define QCOM_MUTEX_NUM_LOCKS 32
static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
{
struct regmap_field *field = lock->priv;
u32 lock_owner;
int ret;
+ u32 proc_id;
- ret = regmap_field_write(field, QCOM_MUTEX_APPS_PROC_ID);
+ proc_id = hwspin_lock_get_id(lock) == QCOM_CPUIDLE_LOCK ?
+ QCOM_MUTEX_CPUIDLE_OFFSET + smp_processor_id():
+ QCOM_MUTEX_APPS_PROC_ID;
+
+ ret = regmap_field_write(field, proc_id);
if (ret)
return ret;
@@ -42,7 +49,7 @@ static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
if (ret)
return ret;
- return lock_owner == QCOM_MUTEX_APPS_PROC_ID;
+ return lock_owner == proc_id;
}
static void qcom_hwspinlock_unlock(struct hwspinlock *lock)
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists