Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp64559imm; Mon, 21 May 2018 02:16:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpvOP7xumN0B3v1KyFS4/a5s7eusAsKurPnGlp+uOyYfRBwDat8gkLiSQuWMtZ4yme/yYbt X-Received: by 2002:a17:902:2f84:: with SMTP id t4-v6mr20198499plb.24.1526894219304; Mon, 21 May 2018 02:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526894219; cv=none; d=google.com; s=arc-20160816; b=OjUpbG+PgFCsGNWPdH0LXiLy2bAAOxIE+y5aGodNUaatNC5u69Zfbxyx3ccxF3YUqD X+QTABby33GMlGZS6w2e3PjkR+L2zorwoKFLGFzj4ubO27lCWZ8POB/M9rC37sEcxtym 7M3HPkzFzv6csIc+HRLEooJbkl3VhGz/0XyhhE4ANjFUpZYZW2El4k81q/U/sKFN2eHU tUOddwhFqz/mXPZcNRzT1X1egGHifJk3Q9aNlNNphwaHxe9cqK8oiJEvs5eX8vs8MWEK OJcm/bvqFjquXDKUQiXs7D/oKQo1l9K8IJTzWh3iHmzzSrBLd3JxyvJtQC4zx5Ohowzu 0omA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=NlLh34WV10bc5VkbOlkMqKFvz8Bx8BLNazLfJJwneZo=; b=crQBpRuZgqjYOhIFSlojUT38zQv5CPUymJdX8kp3c/qvdV4e8nC/DKUhvRo1EpD+hm lK7m7pIAyVeD1/jLZDqrC85Qx+nCUNk5VqBm/1nMvHRuxVdCM4daNHrm16z5TYnhLnIK JwXxTY+z0eQL7eVY3lZYVAY4MgFPLMGklGhB7u/Osk7l1Vd3vDHPSbqTdEoFkB0h1bWn apg9nnEyvdZsO3NjRjIvcJqYQaFVi145hq1cjat4cvqQfw5F96HaBylT+1dK4M6EStZ2 wPp+RpXZChRkhgOooIOIQTfI5e5tTcRYSeGAANIoeHEbPwizktu1gg4pubanmeMaJhKl d1Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YDcnorb+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 128-v6si3523276pgj.289.2018.05.21.02.16.43; Mon, 21 May 2018 02:16:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YDcnorb+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751161AbeEUJQb (ORCPT + 99 others); Mon, 21 May 2018 05:16:31 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:41178 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbeEUJQ3 (ORCPT ); Mon, 21 May 2018 05:16:29 -0400 Received: by mail-pg0-f67.google.com with SMTP id d14-v6so2512703pgv.8 for ; Mon, 21 May 2018 02:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NlLh34WV10bc5VkbOlkMqKFvz8Bx8BLNazLfJJwneZo=; b=YDcnorb+/Rr5YjVAqzE35a1v42+sx2XRxwtKxXA0gRS1mO/FNiigulKCV6HdrnuliH aaNDWQc/II/k3Mn8znM0V/ak8NlXoNZIVtZM2YLo+Dpsc04Z8voWJBDHL6rBItVQ4k3c /SmkgClYtg+dEWhIh/DKDLF5heqe/dTIRvrMk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NlLh34WV10bc5VkbOlkMqKFvz8Bx8BLNazLfJJwneZo=; b=qIo2Qjy70OcZa8X2YGCKcLvYFP1QCR69tH5XKD6/IWJ4YQO4FH3+IGRfFmKWa8mgim D3Ht1r8AFEOYNbS5pOQ61Kv7wfORnKsRPc6QqhEgw3hea6fNdQSwRg1yRPyFH6DNxSB+ Jv6mna2dvn6cmPc7GTosApTfVWM/vXDZsDWgCA6/EUtz1/72pvBkIGLYwDA1bxh3TAuQ ymbXuGCLohz89V61dYIX1kEwA4fYlzT3Dz7FUV+BPJ4sbI8nL+avoZFrp6yYm8DBx6RB I13vtyFyFcqH0MPJjXwttbWI/1g6TolHFj7+1WIbwJ6K7XeQPHzwuqyD/XY2cjpX+eai 9vKA== X-Gm-Message-State: ALKqPwdrfKVjtCMJ+XIK6JpPUm/Q1LWUBqXWPAM5gZGBl0KEr23l66uS /LxJosWfWUBffD3U2QJmnqChYA== X-Received: by 2002:a62:9c93:: with SMTP id u19-v6mr19475483pfk.74.1526894189022; Mon, 21 May 2018 02:16:29 -0700 (PDT) Received: from localhost ([171.76.76.14]) by smtp.gmail.com with ESMTPSA id m72-v6sm30214648pfk.110.2018.05.21.02.16.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 May 2018 02:16:28 -0700 (PDT) Date: Mon, 21 May 2018 14:46:26 +0530 From: Vinod Koul To: Frank Mori Hess Cc: Marek Szyprowski , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Williams , r.baldyga@hackerion.com, Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Linux Samsung SOC Subject: Re: Revert "dmaengine: pl330: add DMA_PAUSE feature" Message-ID: <20180521091626.GB14654@vkoul-mobl> References: <06f54061-c537-b399-e493-ec2cdf4def5d@samsung.com> <20180515062144.GC13271@vkoul-mobl> <20180517041946.GQ13271@vkoul-mobl> <20180518040349.GB2932@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18-05-18, 14:56, Frank Mori Hess wrote: > On Fri, May 18, 2018 at 12:03 AM, Vinod wrote: > > > > You are simply mixing things up! > > It certainly feels like I'm mixed up. If I have to resolve this, I'd > like to be a little less mixed up before I submit more patches which > are going to inevitably result in subtly broken code suddenly becoming > prominently and unignorably broken code. Unfortunately I get the > impression I'm exhausting your patience to answer my questions, and > I've failed to fully communicate what the question is. > > > > On Pause we don't expect data loss, as user can > > resume the transfer. This means as you rightly guessed, the DMA HW should not drop > > any data, nor should SW. > > > > Now if you want to read residue at this point it is perfectly valid. But if you > > decide to terminate the channel (yes it is terminate_all API), we abort and don't > > have context to report back! > > I understand the residue can't be read after terminate, that's why > reading the residue is step 2 in pause/residue/terminate. My question > was whether the entire sequence pause/residue/terminate taken as a > whole can or cannot lose data. Saying that individual steps can or > can't lose data is not enough, context is required. The key point is > whether pause flushes in-flight data to its destination or not. If it > does, and our residue is accurate, the terminate cannot cause data > loss. If pause doesn't flush, an additional step of flush_sync as > Lars suggested is required. So pause/flush_sync/residue/terminate > would be the safe sequence that cannot lose data. I wouldn't use cannot, shouldn't would be better here as it depends on HW and where all data has been buffered and if it can be flushed or not. Have you checked if pl330 supports such flushing? > > As Lars rightly pointed out, residue calculation are very tricky, DMA fifo may > > have data, some data may be in device FIFO, so residue is always from DMA point > > of view and may differ from device view (more or less depending upon direction) > > > > Now if you require to add more features for your usecase, please do feel free to > > send a patch. The framework can always be improved, we haven't solved world > > hunger yet! > > World hunger? I don't see how asking questions about a dma engine's > data integrity guarantees is either unreasonable or out of scope. No they are not out of scope, and dmaengine APIs support requested usages. Have we solved all cases, hell no. Can we add more to support different scenarios, absolutely! -- ~Vinod