mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	"Ritesh Harjani" <riteshh@codeaurora.org>
Cc: <linux-mmc@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] mmc: sdhci: Add support for setting parent clock
Date: Mon, 20 Mar 2017 20:31:20 +0000	[thread overview]
Message-ID: <5556520b-d972-f40c-db84-43583b6dad9b@nvidia.com> (raw)
In-Reply-To: <693f9e04-b2b0-4d11-1359-0364961687e9@intel.com>


On 20/03/17 19:22, Adrian Hunter wrote:
> On 03/16/2017 12:32 PM, Jon Hunter wrote:
>> It is common for SD/MMC host controllers to set the parent clock that
>> drives the SD/MMC interface in order to support various operating
>> speeds. Typically, this is performed by calling common clock framework
>> APIs such as clk_set_rate(). The problem is that these APIs may sleep
>> and must not be called from within atomic sections and therefore, these
>> functions cannot be called within the existing 'set_clock' SDHCI
>> operator because they are called from within the context of a spinlock.
>> Add a new 'set_parent_clock' operator for the SDHCI driver that is
>> called early during the SDHCI 'set_ios' before the spinlock is aquire to
>> give the platform driver the opportunity to set the parent clock rate.
> 
> I just posted a patch to remove the spin lock from set_ios().  Does that help?

Yes it does, thanks!

Technically, the only other place this could occur is in
sdhci_request_done() because this also calls ->set_clock() with the
spinlock held. However, this is only called if
SDHCI_QUIRK_CLOCK_BEFORE_RESET is set, which is only currently true for
a device in sdhci-pci-core.c and this one just uses the normal
sdhci_set_clock() routine. 	

Cheers
Jon

-- 
nvpublic

      reply	other threads:[~2017-03-20 20:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 10:32 Jon Hunter
2017-03-16 10:32 ` [PATCH 2/2] mmc: tegra: Fix setting of Tegra SDHCI module clock Jon Hunter
2017-03-16 18:00 ` [PATCH 1/2] mmc: sdhci: Add support for setting parent clock Jon Hunter
2017-03-20 19:22 ` Adrian Hunter
2017-03-20 20:31   ` Jon Hunter [this message]

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=5556520b-d972-f40c-db84-43583b6dad9b@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=riteshh@codeaurora.org \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.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

all inboxes | Powered by JetHome®