From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753391AbcEBJYW (ORCPT ); Mon, 2 May 2016 05:24:22 -0400 Received: from mga01.intel.com ([192.55.52.88]:40340 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753218AbcEBJYR (ORCPT ); Mon, 2 May 2016 05:24:17 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,566,1455004800"; d="scan'208";a="796743953" Date: Mon, 2 May 2016 15:00:15 +0530 From: Vinod Koul To: Peter Griffin Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, srinivas.kandagatla@gmail.com, maxime.coquelin@st.com, patrice.chotard@st.com, lee.jones@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, arnd@arndb.de, broonie@kernel.org, ludovic.barre@st.com Subject: Re: [PATCH 03/18] dmaengine: st_fdma: Add STMicroelectronics FDMA engine driver support Message-ID: <20160502093015.GD2274@localhost> References: <1461236675-10176-1-git-send-email-peter.griffin@linaro.org> <1461236675-10176-4-git-send-email-peter.griffin@linaro.org> <20160426165622.GR2274@localhost> <20160427125923.GA12756@griffinp-ThinkPad-X1-Carbon-2nd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160427125923.GA12756@griffinp-ThinkPad-X1-Carbon-2nd> 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 Wed, Apr 27, 2016 at 01:59:23PM +0100, Peter Griffin wrote: > > bunch of this seems similar to cyclic case, can you create common setup > > routine for these, anyway cyclic is a special cases of slave_sg > > In v4 I've made a st_fdma_prep_common() which abstracts out all the common > checks at the beginning of the *_prep*() functions. > > In v3 fill_fw_node() is already (from one of your previous reviews) > abstracting out all the common parts from these loops. So everything > that is now left is actually differences between the two setups. > > Is that Ok? Sounds better > > and you irq is still enabled and tasklets can be scheduled!! > > > Eeek! Very good point. Also looking at some other drivers we > should be doing a of_dma_controller_free() and > dma_async_device_unregister(). > > So something like this: - > > st_fdma_disable(); /*disables irqs*/ > of_dma_controller_free(pdev->dev.of_node); > dma_async_device_unregister(&priv->slave); > st_fdma_clk_disable(fdev); you can call devm_free_irq() explictyly, that will syncronize irq and free it up. Also you should kill the tasklet afterwards. -- ~Vinod