Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4860880imm; Fri, 18 May 2018 11:57:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpv/3xq6UR16axmAkaLzZ6vVI9prIuKcT4ULuMx1LQy+8F/YYCBK/s7mK6j30iotDVnmV2K X-Received: by 2002:a17:902:9048:: with SMTP id w8-v6mr10625202plz.34.1526669829715; Fri, 18 May 2018 11:57:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526669829; cv=none; d=google.com; s=arc-20160816; b=CJi0HDvdPnS7gZXOpbJlCEiwahplfcht9ssq+Z4dU6lpl9Pr6/v2MqP6gaE/Kd+jm7 TtFlI1ktej9iQS8kwIs9q+SbrNe6qRk1hcneVu6egP+cvlhHA1kRQIcPfatSoXGT3gXQ oBp9U56vOo8jsg0YzN+1az/noc7HVzP/8gA3sX9+uQ4Ox1wwj9t2nG3kr7mdvoqH9zjt lM3c7DRwJ2VdbAm7XmGrGaa3jiyWMAyQwbhkGAQYaA3dKxSp78FHl0AQURYas/Z0BOHI cqFL7np6mcp/APMNFEPR3szLqjvT71nNggaiOxBNdptR0pXwnmCl0kK/78GGm7Sn9SGT 6F6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=mwUzXkf98hGZBrkv5arZuYjbMk1JBJ4Kmolg6xLaYvI=; b=qdrxyhuUt5xBv/MH/PAtJRt7AKTR3K0AaFfURQWrr16pieq8FoTewahPLSsA+RK2Bm 3BDn3/57pf3J3HGtY/G9jEZd/rFaqTmzdNlyaqfQpWgiq2qn/fY0Er+gtO58B7v3ItJa T+YhSTPJt2n+W+3MUXBRwvYvX8uMrpsh5nEN/RTKY7KNDED9TfH0IYXzGtGejwCsmg85 f098VhbdAQ5NuJNQykOmVjgFV/O1IQy9TPDrEWU94eMRGRIxfP60g4JPfr7S+ruiGOlV V2yPZJ+pYlxDR/hwjyxRQM6Jw8aE+MvE/aWLNsZ7TyLJoOH8xEniWXmyuekmk2ot95zw zrkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mjgVDe+4; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a87-v6si7944997pfl.165.2018.05.18.11.56.55; Fri, 18 May 2018 11:57:09 -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=@gmail.com header.s=20161025 header.b=mjgVDe+4; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752188AbeERS4o (ORCPT + 99 others); Fri, 18 May 2018 14:56:44 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:39556 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbeERS4k (ORCPT ); Fri, 18 May 2018 14:56:40 -0400 Received: by mail-io0-f196.google.com with SMTP id r9-v6so7376688iod.6; Fri, 18 May 2018 11:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mwUzXkf98hGZBrkv5arZuYjbMk1JBJ4Kmolg6xLaYvI=; b=mjgVDe+4sberuT2+wfj0VNNL7hp6i1wjTIUSgm6CLX/LuNHauIwh7gVwmlDFGIs1OV XExr5qOAY0xbobmtEvA68ddNDiYcYjmUN2SkLYBNR/T+inC1R5zWXlnPrZQqGJpnF/UC nJiLI1lDJ463geri5dWFF6viOnLhf4NvEJO9BzZ6JB4Muy0k64RTfKJhWMANv9PgpXPq X77SRHm8ExJTYSwBSYvfBE+X0Vj9ieBEu3dnAcFKyO8XnOUKgAVAeUZ+lI8KvVhfhhEa PHJlqNeZKaHKYhX0jSEOUYjZ4AuR0VB+P7tjrALjIkB/euzimghSEhd4FDEhVHC0pRkf X4Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mwUzXkf98hGZBrkv5arZuYjbMk1JBJ4Kmolg6xLaYvI=; b=jR18aKBBpvFbfGhkBIQ1d5grVcWHhZMZGGMLHOsUaLrnyaPJyd9n4ybmEsaMmmYPF6 b0qa0CTFUnbfcnp64YanoRut7zaD86VgrqE8ufoC5vmy2k9a1SDCu9nCVpntHy4zc78J 4LnVomdrLf4DQ+wLza7smOvc2+yzb99nKjpIwMzMJoId1x/hlFRvzIVhMuoBl1AcSy2G Xynpxpn874Xx1SLY3W3PP73sbJBA6F2D5qhJvOdEGugWP5pgvRCXoMDpHe/DIA9iHEYW UjKx3vKmjyMbi6/UHJEyTEEgybS+Er360hYEXGdGO7WBaeuiQp+xU2HMlg+VkSln8GRC IWQw== X-Gm-Message-State: ALKqPwdcln9dZZOy2wCif34IaK4MYhf/Z/Vi618aG1pSdOFVFXAs3f6m XarPHKlYq61h4C0qfBZ8WvNl45NvS510n0+iFUI= X-Received: by 2002:a6b:dd16:: with SMTP id f22-v6mr11501550ioc.7.1526669800060; Fri, 18 May 2018 11:56:40 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:4d51:0:0:0:0:0 with HTTP; Fri, 18 May 2018 11:56:39 -0700 (PDT) In-Reply-To: <20180518040349.GB2932@vkoul-mobl> References: <182f50b9-55b6-c9ce-07fb-718a1d22e9c8@samsung.com> <06f54061-c537-b399-e493-ec2cdf4def5d@samsung.com> <20180515062144.GC13271@vkoul-mobl> <20180517041946.GQ13271@vkoul-mobl> <20180518040349.GB2932@vkoul-mobl> From: Frank Mori Hess Date: Fri, 18 May 2018 14:56:39 -0400 Message-ID: Subject: Re: Revert "dmaengine: pl330: add DMA_PAUSE feature" To: Vinod 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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. -- Frank