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: 45747 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4E35F214BF for ; Thu, 12 Mar 2015 19:39:13 +0000 (UTC) Received: by wghk14 with SMTP id k14sf13147510wgh.3 for ; Thu, 12 Mar 2015 12:39:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=8/RfQsrBELV8yNtSLV6+M+zaWLBZNUjPCYH1UCkQ6V8=; b=Pw4U+VhOvjx4OALQ8iopp3/RQ1rlDoxDjkXu17HkJq+qfBeuR5j+NtiKxFXO7gUoXA AYcvYFbZRThj6XToGX5QrQ4RDntq14Ekzl02ZfTMNnfRQ1Ue/NUBfMC+j1VPT7BuUTJO 5W3oiQDPmLD17esR/3W16qaz5RsYnkWTEeWZJeLhahemI3RCOykStzVzpAkSyePc/q6x sHP6LRvUGuRYtzPoigzK6wSGI4Arwkk6viYAxzpB2w1/2Mp3dGMn4DLnFHqaTlPUwSfb cnWr/KMwRJ4IooNHgz2OUUjWeXan8ElDRC1dJewKt9NTaKi/DJ0KvInI0x6GLX5Bvia6 WXpA== X-Gm-Message-State: ALoCoQk1yUo2/ed2Xjk/sRONUOXO08tZX97ekOhihGMZJpveMQGMEoP19QwcQJZFMXvYLqGmzXvh X-Received: by 10.180.80.132 with SMTP id r4mr3308561wix.4.1426189152646; Thu, 12 Mar 2015 12:39:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.36 with SMTP id dd4ls331636lac.43.gmail; Thu, 12 Mar 2015 12:39:12 -0700 (PDT) X-Received: by 10.112.225.137 with SMTP id rk9mr39040320lbc.11.1426189152491; Thu, 12 Mar 2015 12:39:12 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id i5si5128085lbl.37.2015.03.12.12.39.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Mar 2015 12:39:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labgq15 with SMTP id gq15so18197033lab.4 for ; Thu, 12 Mar 2015 12:39:12 -0700 (PDT) X-Received: by 10.152.178.197 with SMTP id da5mr41476033lac.56.1426189152359; Thu, 12 Mar 2015 12:39:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp447579lbj; Thu, 12 Mar 2015 12:39:11 -0700 (PDT) X-Received: by 10.70.130.37 with SMTP id ob5mr48092832pdb.54.1426189146165; Thu, 12 Mar 2015 12:39:06 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rt5si4976747pab.25.2015.03.12.12.39.05; Thu, 12 Mar 2015 12:39:06 -0700 (PDT) Received-SPF: none (google.com: linux-arm-msm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756367AbbCLTil (ORCPT + 5 others); 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-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: list List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lina.iyer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , --- 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)