From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754709AbbCLU4H (ORCPT ); Thu, 12 Mar 2015 16:56:07 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:43634 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752346AbbCLU4E (ORCPT ); Thu, 12 Mar 2015 16:56:04 -0400 Date: Thu, 12 Mar 2015 14:56:00 -0600 From: Lina Iyer To: Andy Gross Cc: bjorn.andersson@sonymobile.com, linux-arm-msm@vger.kernel.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Lock 7 is cpuidle specific, use non-generic value for locking Message-ID: <20150312205600.GE497@linaro.org> References: <1425076217-10415-2-git-send-email-bjorn.andersson@sonymobile.com> <1426189108-35488-1-git-send-email-lina.iyer@linaro.org> <20150312204902.GA14659@qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20150312204902.GA14659@qualcomm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12 2015 at 14:49 -0600, Andy Gross wrote: >On Thu, Mar 12, 2015 at 01:38:28PM -0600, Lina Iyer wrote: > > > >> 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); > >I think I'd rather have a qcom specific function and EXPORT_SYMBOL that to deal >with this special case. > I was going back and forth between a function and inlining this here. But Stephen just made a good point that this is needed for unlock as well. A function would be good. >> 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 >> > >-- >Qualcomm Innovation Center, Inc. >The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, >a Linux Foundation Collaborative Project >