From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751826AbcADOfj (ORCPT ); Mon, 4 Jan 2016 09:35:39 -0500 Received: from smtp-out-007.synserver.de ([212.40.185.7]:1097 "EHLO smtp-out-188.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751308AbcADOfh (ORCPT ); Mon, 4 Jan 2016 09:35:37 -0500 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 17700 Subject: Re: [PATCH] dma: Revert "dmaengine: mic_x100: add missing spin_unlock" To: Vinod Koul , Ashutosh Dixit References: <1450841723-6227-1-git-send-email-ashutosh.dixit@intel.com> <20160104033526.GA2940@localhost> Cc: linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Sudeep Dutt , Nikhil Rao , Siva Yerramreddy , Saurabh Sengar From: Lars-Peter Clausen Message-ID: <568A8336.1080202@metafoo.de> Date: Mon, 4 Jan 2016 15:35:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.4.0 MIME-Version: 1.0 In-Reply-To: <20160104033526.GA2940@localhost> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.