Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755698AbdCTTeI (ORCPT ); Mon, 20 Mar 2017 15:34:08 -0400 Received: from mga03.intel.com ([134.134.136.65]:4404 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755583AbdCTTeF (ORCPT ); Mon, 20 Mar 2017 15:34:05 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,195,1486454400"; d="scan'208";a="946337443" Subject: Re: [PATCH 1/2] mmc: sdhci: Add support for setting parent clock To: Jon Hunter , Ulf Hansson , Thierry Reding , Ritesh Harjani References: <1489660364-17698-1-git-send-email-jonathanh@nvidia.com> Cc: linux-mmc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <693f9e04-b2b0-4d11-1359-0364961687e9@intel.com> Date: Mon, 20 Mar 2017 21:22:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1489660364-17698-1-git-send-email-jonathanh@nvidia.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 839 Lines: 13 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?