Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751408AbaB1Fwp (ORCPT ); Fri, 28 Feb 2014 00:52:45 -0500 Received: from mail-ob0-f173.google.com ([209.85.214.173]:38198 "EHLO mail-ob0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750701AbaB1Fwn (ORCPT ); Fri, 28 Feb 2014 00:52:43 -0500 MIME-Version: 1.0 In-Reply-To: <1376507361-26907-1-git-send-email-galak@codeaurora.org> References: <1376507361-26907-1-git-send-email-galak@codeaurora.org> Date: Thu, 27 Feb 2014 21:52:43 -0800 Message-ID: Subject: Re: [PATCH v3] hwspinlock/msm: Add support for Qualcomm MSM HW Mutex block From: Bjorn Andersson To: Kumar Gala Cc: Ohad Ben-Cohen , Rob Herring , Pawel Moll , Mark Rutland , Stephen Warren , Ian Campbell , Grant Likely , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-arm-msm , Jeffrey Hugo , Eric Holmberg Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kumar, I pulled this in to my 3.14 tree and gave it a spin. But I keep hitting the case of unlock below telling me that someone else is holding the lock. On Wed, Aug 14, 2013 at 12:09 PM, Kumar Gala wrote: [...] > + > +static int msm_hwspinlock_trylock(struct hwspinlock *lock) > +{ > + void __iomem *lock_addr = lock->priv; > + > + writel_relaxed(SPINLOCK_ID_APPS_PROC, lock_addr); You need some sort of barrier here; the caf code have a smp_mb() here, inserting that solves the problem. > + > + return readl_relaxed(lock_addr) == SPINLOCK_ID_APPS_PROC; > +} > + > +static void msm_hwspinlock_unlock(struct hwspinlock *lock) > +{ > + u32 lock_owner; > + void __iomem *lock_addr = lock->priv; > + > + lock_owner = readl_relaxed(lock_addr); > + if (lock_owner != SPINLOCK_ID_APPS_PROC) { > + pr_err("%s: spinlock not owned by us (actual owner is %d)\n", > + __func__, lock_owner); > + } > + > + writel_relaxed(0, lock_addr); > +} > + Part of this I think this driver looks good, it would be nice to get the last details cleaned up so we could get it into the tree. Regards, Bjorn -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/