From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933163AbbIURNE (ORCPT ); Mon, 21 Sep 2015 13:13:04 -0400 Received: from mga03.intel.com ([134.134.136.65]:29290 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932611AbbIURNB (ORCPT ); Mon, 21 Sep 2015 13:13:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,568,1437462000"; d="scan'208";a="773735120" Date: Mon, 21 Sep 2015 22:32:38 +0530 From: Vinod Koul To: Han Xu Cc: shijie.huang@arm.com, dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@free-electrons.com, fabio.estevam@freescale.com, hofrat@osadl.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dan.j.williams@intel.com, dmaengine@vger.kernel.org Subject: Re: [PATCH v3 2/6] dmaengine: mxs: support i.MX7D and deep sleep mode Message-ID: <20150921170238.GP2381@localhost> References: <1440790365-28072-1-git-send-email-b45815@freescale.com> <1440790365-28072-3-git-send-email-b45815@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1440790365-28072-3-git-send-email-b45815@freescale.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 28, 2015 at 02:32:41PM -0500, Han Xu wrote: > @@ -28,7 +28,6 @@ > #include > #include > #include > - Pl dont change at random places > + if (mxs_dma->dev_id == IMX7D_DMA) { > + ret = clk_prepare_enable(mxs_dma->clk_io); > + if (ret) > + goto err_clk_unprepare; > + } > + > mxs_dma_reset_chan(chan); > > dma_async_tx_descriptor_init(&mxs_chan->desc, chan); > @@ -450,6 +464,8 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan) > > return 0; > > +err_clk_unprepare: > + clk_disable_unprepare(mxs_dma->clk); and this doesn't look right. You are calling this for failure on clk_prepare_enable() so if clock prepare failed you are still going to disable and unprepare?? > -static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma) > +static int mxs_dma_init(struct mxs_dma_engine *mxs_dma) this should be separate change explaining why > +static int mxs_dma_pm_resume(struct device *dev) > +{ > + struct mxs_dma_engine *mxs_dma = dev_get_drvdata(dev); > + int ret; > + > + ret = mxs_dma_init(mxs_dma); > + if (ret) > + return ret; > + return 0; Aren't you supposed to prepare and unprepare clock in PM handlers too? -- ~Vinod