From patchwork Thu Mar 12 19:38:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 5998841 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 163B89F380 for ; Thu, 12 Mar 2015 19:39:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42B29202D1 for ; Thu, 12 Mar 2015 19:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E0B0202C8 for ; Thu, 12 Mar 2015 19:39:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756367AbbCLTil (ORCPT ); Thu, 12 Mar 2015 15:38:41 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:41676 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756365AbbCLTii (ORCPT ); Thu, 12 Mar 2015 15:38:38 -0400 Received: by pablj1 with SMTP id lj1so22954396pab.8 for ; Thu, 12 Mar 2015 12:38:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=r+jPgAefHVkpwDQRfYnvyEMRIU5vDJ6GAnrWuC0nkl8=; b=jMBLb48vf24FP/JjdTx5KptEtCtSBFAzAlOCD2BMIeAEsaXuBbPgjjpCKrY65GTyke EOIcZGV4vYYDWjSUm6juupiWkuMxN+yHnMls7G1jM1sUpZHNzNhfWvp7dBida2NaSKhM 4SwfadOJpx4fhnuj9TGTQZLHmGytOriJ5q3ra0Hvs4azkCWdS4dByawlfDGNqnoqThGN oqdnCBm8Y9OUP/8mC6iJqJ+7VhfJEhkrNKuhPs+ljC1kIfHTq9jfN4FNIUPvAi7LcoUn EuPv+HNIlvdVxNtLe4pVpGen2GQBqXWlSrMiVhY+3w9BlOh0r1G7J9kpurnLTsHafcJi J4NQ== X-Gm-Message-State: ALoCoQlGL5gdTmwV7pYQ/jP816UbKpg2KEVoizWiF1O97ssVLeTsfk/MiK0v2n9Q1xhXHrvjC9ot X-Received: by 10.70.131.15 with SMTP id oi15mr93308653pdb.161.1426189117412; Thu, 12 Mar 2015 12:38:37 -0700 (PDT) Received: from ubuntu.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by mx.google.com with ESMTPSA id tg14sm12256237pac.15.2015.03.12.12.38.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Mar 2015 12:38:36 -0700 (PDT) From: Lina Iyer To: bjorn.andersson@sonymobile.com Cc: linux-arm-msm@vger.kernel.org, jhugo@codeaurora.org, agross@codeaurora.org, linux-kernel@vger.kernel.org, Lina Iyer Subject: [PATCH] Lock 7 is cpuidle specific, use non-generic value for locking Date: Thu, 12 Mar 2015 13:38:28 -0600 Message-Id: <1426189108-35488-1-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1425076217-10415-2-git-send-email-bjorn.andersson@sonymobile.com> References: <1425076217-10415-2-git-send-email-bjorn.andersson@sonymobile.com> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP --- 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)