From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH 01/10] usb: otg: msm: Convert to clk_prepare/unprepare Date: Wed, 26 Sep 2012 11:48:25 -0700 Message-ID: <50634DF9.5010608@codeaurora.org> References: <1348194419-11486-1-git-send-email-sboyd@codeaurora.org> <1348194419-11486-2-git-send-email-sboyd@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from wolverine02.qualcomm.com ([199.106.114.251]:51801 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756757Ab2IZSs0 (ORCPT ); Wed, 26 Sep 2012 14:48:26 -0400 In-Reply-To: Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Pankaj Jangra Cc: David Brown , Daniel Walker , Bryan Huntsman , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, Felipe Balbi On 09/26/12 09:58, Pankaj Jangra wrote: > On Fri, Sep 21, 2012 at 7:56 AM, Stephen Boyd wrote: >> diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c >> index 9f5fc90..2ae0639 100644 >> --- a/drivers/usb/otg/msm_otg.c >> +++ b/drivers/usb/otg/msm_otg.c >> @@ -514,13 +514,13 @@ static int msm_otg_suspend(struct msm_otg *motg) >> motg->pdata->otg_control == OTG_PMIC_CONTROL) >> writel(readl(USB_PHY_CTRL) | PHY_RETEN, USB_PHY_CTRL); >> >> - clk_disable(motg->pclk); >> - clk_disable(motg->clk); >> + clk_disable_unprepare(motg->pclk); >> + clk_disable_unprepare(motg->clk); >> if (motg->core_clk) >> - clk_disable(motg->core_clk); >> + clk_disable_unprepare(motg->core_clk); >> > I was under assumption that system suspend/resume might be called from > the interrupt context. If that is case then its not appropriate to > call clk_prepare/unprepare here right? or my understanding is not correct???? Well we call disable_irq() at the top of this suspend function so I suspect your understanding is incorrect. disable_irq() can call schedule(). There are also a bunch of regulator calls in msm_hsusb_ldo_set_mode() that this suspend function calls (almost all regulator calls grab a mutex). -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation