public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lina Iyer <lina.iyer@linaro.org>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: "Anna, Suman" <s-anna@ti.com>,
	Bjorn Andersson <Bjorn.Andersson@sonymobile.com>,
	Andy Gross <agross@codeaurora.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Kumar Gala <galak@codeaurora.org>,
	Jeffrey Hugo <jhugo@codeaurora.org>
Subject: Re: [PATCH RFC] hwspinlock: Don't take software spinlock before hwspinlock
Date: Mon, 11 May 2015 08:46:08 -0600	[thread overview]
Message-ID: <20150511144608.GB16124@linaro.org> (raw)
In-Reply-To: <CAK=WgbYK24aTSmoSZGXDRq2GOBn6296Xa3zPZP0ycNGOtfHRxg@mail.gmail.com>

On Sat, May 09 2015 at 03:25 -0600, Ohad Ben-Cohen wrote:
>Hi Lina,
>
>On Fri, May 1, 2015 at 8:07 PM, Lina Iyer <lina.iyer@linaro.org> 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?

I agree, that it opens up a possiblity that user may sleep after holding
a hw spinlock.  But really, why should it prevents us from using it as a
hw mutex, if the need is legitimate?

We could make a check that the caller with NO_LOCK option calls only
with irq disabled, if thats required.

Thanks for the review.

-- Lina

  reply	other threads:[~2015-05-11 14:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-01 17:07 [PATCH RFC] hwspinlock: Don't take software spinlock before hwspinlock Lina Iyer
2015-05-09  9:25 ` Ohad Ben-Cohen
2015-05-11 14:46   ` Lina Iyer [this message]
2015-05-16  9:03     ` Ohad Ben-Cohen
2015-05-18 15:03       ` Lina Iyer
2015-05-19 20:13         ` Andy Gross
2015-05-20 22:02           ` Lina Iyer
2015-05-23  7:35         ` Ohad Ben-Cohen
2015-05-26 20:36           ` Lina Iyer
2015-06-05  1:09             ` Ohad Ben-Cohen
2015-06-05 23:50               ` Jeffrey Hugo
2015-06-06  3:28                 ` Ohad Ben-Cohen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150511144608.GB16124@linaro.org \
    --to=lina.iyer@linaro.org \
    --cc=Bjorn.Andersson@sonymobile.com \
    --cc=agross@codeaurora.org \
    --cc=galak@codeaurora.org \
    --cc=jhugo@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=s-anna@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox