From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbcADPDr (ORCPT ); Mon, 4 Jan 2016 10:03:47 -0500 Received: from mga04.intel.com ([192.55.52.120]:43755 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751354AbcADPDq (ORCPT ); Mon, 4 Jan 2016 10:03:46 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,521,1444719600"; d="scan'208";a="883466665" Date: Mon, 4 Jan 2016 20:37:14 +0530 From: Vinod Koul To: Lars-Peter Clausen Cc: Ashutosh Dixit , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Sudeep Dutt , Nikhil Rao , Siva Yerramreddy , Saurabh Sengar Subject: Re: [PATCH] dma: Revert "dmaengine: mic_x100: add missing spin_unlock" Message-ID: <20160104150714.GH2940@localhost> References: <1450841723-6227-1-git-send-email-ashutosh.dixit@intel.com> <20160104033526.GA2940@localhost> <568A8336.1080202@metafoo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <568A8336.1080202@metafoo.de> 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 Mon, Jan 04, 2016 at 03:35:34PM +0100, Lars-Peter Clausen wrote: > On 01/04/2016 04:35 AM, Vinod Koul wrote: > > On Tue, Dec 22, 2015 at 07:35:23PM -0800, Ashutosh Dixit wrote: > >> This reverts commit e958e079e254 ("dmaengine: mic_x100: add missing > >> spin_unlock"). > >> > >> The above patch is incorrect. There is nothing wrong with the original > >> code. The spin_lock is acquired in the "prep" functions and released > >> in "submit". > > > > And going by dmaengine sematics, I do not think that is entrely right. > > > > A user may choose to prepare multiple desciptors and then sumbit later, > > looking at code I do not see how that will work. > > The DMAengine API actually mandates that prep and submit must always be > called in pairs, without any other DMAengine calls in between. The patch is > correct. > > Quoting from Documentation/dmaengine/client.txt: > > Once a descriptor has been obtained, the callback information can be > added and the descriptor must then be submitted. Some DMA engine > drivers may hold a spinlock between a successful preparation and > submission so it is important that these two operations are closely > paired. This is true for slave cases as has been made clear in the Documentation. For non slave cases that is not entirely right. mic_x100 falls in latter category. Thanks -- ~Vinod