From patchwork Thu Aug 18 12:23:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 1076522 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7ICO2ZA027662 for ; Thu, 18 Aug 2011 12:24:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755816Ab1HRMXT (ORCPT ); Thu, 18 Aug 2011 08:23:19 -0400 Received: from mga01.intel.com ([192.55.52.88]:53444 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755853Ab1HRMXR (ORCPT ); Thu, 18 Aug 2011 08:23:17 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 18 Aug 2011 05:23:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.68,245,1312182000"; d="scan'208";a="41088465" Received: from unknown (HELO mwesterb-mobl1.ger.corp.intel.com) ([10.255.18.90]) by fmsmga002.fm.intel.com with ESMTP; 18 Aug 2011 05:23:15 -0700 Received: from westeri by mwesterb-mobl1.ger.corp.intel.com with local (Exim 4.76) (envelope-from ) id 1Qu1dX-0003cR-4H; Thu, 18 Aug 2011 15:23:51 +0300 From: Mika Westerberg To: linux-mmc@vger.kernel.org Cc: cjb@laptop.org, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, Mika Westerberg Subject: [PATCH v2 3/3] mmc: use non-reentrant workqueue for clock gating Date: Thu, 18 Aug 2011 15:23:49 +0300 Message-Id: <3a0f9b45bda585158ba89d15d63967005367e834.1313664897.git.mika.westerberg@linux.intel.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 18 Aug 2011 12:24:02 +0000 (UTC) The default multithread workqueue can cause the same work to be executed concurrently on a different CPUs. This isn't really suitable for clock gating as it might already gated the clock and gating it twice results both host->clk_old and host->ios.clock to be set to 0. To prevent this from happening we use system_nrt_wq instead. Signed-off-by: Mika Westerberg Cc: Linus Walleij --- drivers/mmc/core/host.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 96a26b2..793d0a0 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -179,7 +179,7 @@ void mmc_host_clk_release(struct mmc_host *host) host->clk_requests--; if (mmc_host_may_gate_card(host->card) && !host->clk_requests) - schedule_work(&host->clk_gate_work); + queue_work(system_nrt_wq, &host->clk_gate_work); spin_unlock_irqrestore(&host->clk_lock, flags); }