Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753520AbbEIJZt (ORCPT ); Sat, 9 May 2015 05:25:49 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:32811 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbbEIJZr (ORCPT ); Sat, 9 May 2015 05:25:47 -0400 MIME-Version: 1.0 X-Originating-IP: [85.250.79.171] In-Reply-To: <1430500026-47990-1-git-send-email-lina.iyer@linaro.org> References: <1430500026-47990-1-git-send-email-lina.iyer@linaro.org> From: Ohad Ben-Cohen Date: Sat, 9 May 2015 12:25:26 +0300 Message-ID: Subject: Re: [PATCH RFC] hwspinlock: Don't take software spinlock before hwspinlock To: Lina Iyer Cc: "Anna, Suman" , Bjorn Andersson , Andy Gross , "linux-arm-msm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Kumar Gala , Jeffrey Hugo Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1300 Lines: 32 Hi Lina, On Fri, May 1, 2015 at 8:07 PM, Lina Iyer wrote: > Some uses of the hwspinlock could be that one entity acquires the lock > and the other entity releases the lock. This allows for a serialized > traversal path from the locking entity to the other. > > For example, the cpuidle entry from Linux to the firmware to power down > the core, can be serialized across the context switch by locking the > hwspinlock in Linux and releasing it in the firmware. > > Do not force the caller of __hwspin_trylock() to acquire a kernel > spinlock before acquiring the hwspinlock. Let's discuss whether we really want to expose this functionality under the same hwspinlock API or not. In this new mode, unlike previously, users will now be able to sleep after taking the lock, and others trying to take the lock might poll the hardware for a long period of time without the ability to sleep while waiting for the lock. It almost sounds like you were looking for some hwmutex functionality. What do you think about this? Thanks, Ohad. -- 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/