linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: collinsd@codeaurora.org (David Collins)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/4] mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs
Date: Thu, 31 Jul 2014 13:33:49 -0700	[thread overview]
Message-ID: <53DAA82D.4020901@codeaurora.org> (raw)
In-Reply-To: <53DA02C0.2050606@mm-sol.com>

On 07/31/2014 01:48 AM, Stanimir Varbanov wrote:
> Hi David,
> 
> Thanks for the comments!
> 
> On 07/30/2014 12:54 AM, David Collins wrote:
>> On 07/24/2014 05:45 AM, Stanimir Varbanov wrote:
>>> From: Josh Cartwright <joshc@codeaurora.org>
>>>
>>> The Qualcomm SPMI PMIC chips are components used with the
>>> Snapdragon 800 series SoC family.  This driver exists
>>> largely as a glue mfd component, it exists to be an owner
>>> of an SPMI regmap for children devices described in
>>> device tree.

(...)
>>> +static const struct regmap_config pm8xxx_regmap_config = {
>>> +	.reg_bits	= 16,
>>> +	.val_bits	= 8,
>>> +	.max_register	= 0xffff,
>>
>> Can you please add the following line here?
>>
>> 	.fast_io	= true;
>>
>> This will cause a spinlock to be held during SPMI transactions instead of
>> a mutex lock.  This is needed because several downstream peripheral
>> drivers need to make SPMI read and write calls from atomic context.  I
>> have commented on this point in a previous thread with specific examples [2].
> 
> OK, I understand the need of atomic context, but pmic_arb_read_cmd() and
> pmic_arb_write_cmd() functions use raw_spin_lock_irqsave already. Isn't
> those locks enough?

No, that isn't sufficient.  The problem is that the peripheral driver
would already be in atomic context at the time that it needs to perform an
SPMI read or write via regmap_read() or regmap_write() respectively.
These regmap calls would take a mutex lock if fast_io == false.  This is
not allowed since calling a sleepable function in atomic context can lead
to deadlock.

Take care,
David

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

  reply	other threads:[~2014-07-31 20:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24 12:45 [PATCH v3 0/4] Support for Qualcomm QPNP PMIC's Stanimir Varbanov
2014-07-24 12:45 ` [PATCH v3 1/4] mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs Stanimir Varbanov
2014-07-29 21:54   ` David Collins
2014-07-31  8:48     ` Stanimir Varbanov
2014-07-31 20:33       ` David Collins [this message]
2014-08-01  8:31       ` Stanimir Varbanov
2014-08-01 11:23         ` Lee Jones
2014-07-24 12:45 ` [PATCH v3 2/4] mfd: pm8xxx-spmi: document DT bindings " Stanimir Varbanov
2014-07-29 22:23   ` David Collins
2014-07-31  8:58     ` Stanimir Varbanov
2014-07-31 20:53       ` David Collins
2014-07-24 12:45 ` [PATCH v3 3/4] ARM: dts: qcom: add pm8941 and pm8841 PMICs device nodes Stanimir Varbanov
2014-07-24 12:45 ` [PATCH v3 4/4] mfd: pm8921: rename pm8921-core driver Stanimir Varbanov
2014-07-28 14:20 ` [PATCH v3 0/4] Support for Qualcomm QPNP PMIC's Stanimir Varbanov

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=53DAA82D.4020901@codeaurora.org \
    --to=collinsd@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).