Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753140AbbBXWio (ORCPT ); Tue, 24 Feb 2015 17:38:44 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:39731 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753055AbbBXWim (ORCPT ); Tue, 24 Feb 2015 17:38:42 -0500 Date: Tue, 24 Feb 2015 16:38:40 -0600 From: Andy Gross To: Stanimir Varbanov Cc: Mark Brown , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-spi@vger.kernel.org, Rob Herring , Mark Rutland , Kumar Gala , Sagar Dharia , Daniel Sneddon Subject: Re: [PATCH v2] spi: qup: Add DMA capabilities Message-ID: <20150224223840.GA21310@qualcomm.com> References: <1424782803-13103-1-git-send-email-stanimir.varbanov@linaro.org> <20150224135622.GH6236@finisterre.sirena.org.uk> <54ECA216.306@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54ECA216.306@linaro.org> 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 Content-Length: 1312 Lines: 38 On Tue, Feb 24, 2015 at 06:08:54PM +0200, Stanimir Varbanov wrote: > > yes, there is a potential race between atomic_inc and dma callback. I > reordered these calls to save few checks, and now it returns to me. > > I imagine few options here: > > - reorder the dmaengine calls and atomic operations, i.e. > call atomic_inc for rx and tx channels before corresponding > dmaengine_submit and dmaengine_issue_pending. > > - have two different dma callbacks and two completions and waiting for > the two. This is probably the better solution. The only thing you'll have to take into consideration is that you may not have a RX DMA transactions. > > - manage to receive only one dma callback, i.e. the last transfer in > case of presence of the rx_buf and tx_buf at the same time. You use separate channels for the RX and TX, so as long as you have separate callbacks, it shouldnt be a problem. -- Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/