From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753236AbcGLE2H (ORCPT ); Tue, 12 Jul 2016 00:28:07 -0400 Received: from mga04.intel.com ([192.55.52.120]:38277 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831AbcGLE2F (ORCPT ); Tue, 12 Jul 2016 00:28:05 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,349,1464678000"; d="scan'208";a="137613124" Date: Tue, 12 Jul 2016 10:05:16 +0530 From: Vinod Koul To: Robert Jarzmik Cc: Daniel Mack , Haojian Zhuang , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: pxa_dma: implement device_synchronize Message-ID: <20160712043516.GP9681@localhost> References: <1468187449-19466-1-git-send-email-robert.jarzmik@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468187449-19466-1-git-send-email-robert.jarzmik@free.fr> 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 Sun, Jul 10, 2016 at 11:50:49PM +0200, Robert Jarzmik wrote: > Implement the function which wait until a dma channel is stopped to have > a synchronization point. > > This also protects the pxad_remove() from races, such as spurious > interrupts while removing the driver, because : > - as long as there is one dma channel requested, ie. dma_chan_get() but > no dma_chan_put(), the try_module_get() of dma_chan_get() prevents > the remove() routine from running > - when the last channel is released, ie. the last dma_chan_put() is > called, if there is a running DMA, pxad_synchronize() is called > - pxad_synchronize() waits for the channel to stop, which in turn > ensures on pxa architecture that the interrupt cannot be fired anymore Applied, thanks -- ~Vinod