Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4145691imm; Thu, 17 May 2018 23:30:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoLf+aJHa15dFaD8DJcash9OSjV+Y6PDaYoYnNp9z+sl19Hy5ix3VxqTGPKnPbUKhukYQ2p X-Received: by 2002:a17:902:5610:: with SMTP id h16-v6mr8180538pli.140.1526625005072; Thu, 17 May 2018 23:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526625005; cv=none; d=google.com; s=arc-20160816; b=FdlUQRq5og/tBRK+ban3pCYp1TjRc2ct/AdFztB/7SVd/edtS3mCmSmgAE6PHwuYEK MbuIscSfQUhuE19dhCLXby+uOSr+BkSyvzI0f7UajNiWrrO+uL2ZJBdgpspEkg66Mecq O71WG9XSLjdAwHaceo/76QmGJFPKSIQs/hXCOO75boyk5bMEcXkoiyMNIFsyDgoxbP0J iZ5/IpaL6Scjlhoxnk8ll98v/DEDu8YuWRjgmntq8KK+QgN/+qc3x9GsaXW5W2KTvuSs WYa5t2OiLkeiF4OtqsA8KRJru+32UIOQ+BsKOq5qOZbH6legDUWCzRH5GKTn0RtamNgM 9zdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter :arc-authentication-results; bh=GcHl2C5Iv/lXhqVb4MDzsFOdkOGhdQ7HmweBeWao0HA=; b=ZS8vnF7Pu3jI0DYEIDxxiLuMN/5J/5aeO0prXdR5U2jU6QLSV3XBWBQ0HpSnUDa3l8 iLaF0C3gYvrcZNRJMixhF/Nc364CHhpNusor/rnNPvibdok5winh7TIa/tZ3hgRbJaQK oxJ2Mvnxsg4cM+W4A7BzrptMrYMhwQ1Couaxmf0uXWxLjh55ZqKryBe4ORFRhNjmHEIQ 3t4j3KIPbUi9S3QVCchzjtmpDu4zPy2wbzHcbrUF4k5wMlSI/82W1j2Ac89kXKPwKQJT E+2NIeyiiCoz5Jp4C7HO/lo2Is2FFKbutMdjpzumsT4PeATcR3VwmatLlDIXyzv3vEnF FE4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=EcMPueyE; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4-v6si5356324pgt.613.2018.05.17.23.29.50; Thu, 17 May 2018 23:30:05 -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=@samsung.com header.s=mail20170921 header.b=EcMPueyE; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752320AbeERG2W (ORCPT + 99 others); Fri, 18 May 2018 02:28:22 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:49433 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672AbeERG2U (ORCPT ); Fri, 18 May 2018 02:28:20 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180518062818euoutp01aed4428ec924e1085b3933e9e1e8be45~vqUGowQ_Z1114211142euoutp019 for ; Fri, 18 May 2018 06:28:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180518062818euoutp01aed4428ec924e1085b3933e9e1e8be45~vqUGowQ_Z1114211142euoutp019 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1526624898; bh=GcHl2C5Iv/lXhqVb4MDzsFOdkOGhdQ7HmweBeWao0HA=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=EcMPueyECM83NQMIqpfgSXKSfUnVs12sc3xd1tSCPGnwlICgFggTNR/KFwVOsgiOh TTtqICilEy4ccuhbxYdSfgtBzGuBg1dzsjxT63HUMHp5fw3QbDhpZpA8oASXZyvuH1 GwsAudii8j/QPZgL7hSyJzrhywDnYuNcqqhuZMCA= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180518062816eucas1p2ef3afbfe4eb616ff9d91c69dcab9aa28~vqUFYQYlC2018220182eucas1p2N; Fri, 18 May 2018 06:28:16 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 2F.32.10409.0827EFA5; Fri, 18 May 2018 07:28:16 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180518062815eucas1p10e1a213f6ceb84ca1e2ab16b0938a8cd~vqUEhe-dX0359503595eucas1p1p; Fri, 18 May 2018 06:28:15 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180518062815eusmtrp1b2a904fb93d74e6ea36012eeaf286986~vqUERvo9T2577925779eusmtrp1H; Fri, 18 May 2018 06:28:15 +0000 (GMT) X-AuditID: cbfec7f5-b5fff700000028a9-c9-5afe72807357 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 28.75.04178.F727EFA5; Fri, 18 May 2018 07:28:15 +0100 (BST) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20180518062815eusmtip29e5203a6fbba141fe873870419e10416~vqUDzlpal0867208672eusmtip2D; Fri, 18 May 2018 06:28:15 +0000 (GMT) Subject: Re: Revert "dmaengine: pl330: add DMA_PAUSE feature" To: Vinod , Frank Mori Hess Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Williams , r.baldyga@hackerion.com, Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Linux Samsung SOC From: Marek Szyprowski Message-ID: <7f0b7404-ee12-977f-02a4-a463d1873aee@samsung.com> Date: Fri, 18 May 2018 08:28:14 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180518040349.GB2932@vkoul-mobl> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA01Se0hTcRjld+92dzea3Ka2D1cZi6KCfFDCxVL8o2j2R0R/GAwzb3lRaU7Z nGWljR6WQ1QsU+erF2WmqcPMmRk+2ErRqT0Ua2ZoScEU05TMR253lv+d75zzcc4HH4lLXvB9 yHh1MqtRMyo5IeI1WH737NZrlpQB1gVfuq6whk8X5Pci+kn+Ip8uHy0laJutVkC/bSoh6EJb C0bbl34i2vzpNR4mVJiNdoGiw2whFPebv2MKU2Umociur0SKadPmo4RStD+GVcWnsBr/0GhR XMW1cizJBucem8b5emTxNCAhCdReaMzL5RuQiJRQFQimvlW4hxkEBaMGxA3TCIbnyojVle4B PcEJjxBUTFS7XZMICj8O4U6XJxUC1+s7XRteVBjY5gcwpwmnCjDIH/nMdwoEFQgGh8FlElOh kHPLijkxj9oG1Z0WF+9NRcLtsgGM86yHN0VjPCcWUv7wp6PHxeOULzx3lOAclsLQWLkrDCiL AL7aqty9D8Czjmwehz3hh7VewOGN0HUzy81fguy5DvdyFoKXV/MxTtgH7da+ldbkSsJ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NDQ3Njc2s1AS5z1vUBklJJCeWJKanZpakFoE08fEwSnVwDjpfuTtj9sNhPco6yj9 zrngxZyZ9MHBfIpV3I/6My96yjNSn/QHLNebu+5fzy9Hg1jjLpfYNrGbDy8d/HsztmKCnH7l bHuJvDqvqXWWaS4ZZsuiT7HkWB9dYV3PcCOf1WG1j+y/K/oBwice+7+rcTdqvbSk8fRNp3ty ZbFxukvKTptGGD2YrsRSnJFoqMVcVJwIAEeSIpjgAgAA X-CMS-MailID: 20180518062815eucas1p10e1a213f6ceb84ca1e2ab16b0938a8cd X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-MTR: 20180518062815eucas1p10e1a213f6ceb84ca1e2ab16b0938a8cd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180518040358epcas2p353b0096d33116ca78a03b16d24569813 X-RootMTR: 20180518040358epcas2p353b0096d33116ca78a03b16d24569813 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vinod, On 2018-05-18 06:03, Vinod wrote: > On 17-05-18, 12:20, Frank Mori Hess wrote: >> Sorry to keep coming back to this, but I'm experiencing a bit of >> incredulity that you are saying what you seem to be saying. You seem >> to be saying dmaengine provides no way to permanently stop a transfer >> safely other than transferring the full number of bytes initially >> requested. So the proper resolution is the 8250 serial driver needs >> to remove rx dma support, because they are just trying to do something >> that is not supported. ... >> I see two ways of interpreting what you are saying. First, from the >> point of view of the user of the dmaengine api. From this point of >> view it is impossible for data loss to occur during pause or reading >> the residue, so saying they cause no data loss during >> pause/residue/terminate is meaningless. This is because the user >> can't confirm any data loss until after they have read the residue and >> the transfer is terminated, since optimistically the data may still be >> available if only the user would resume and allow the transfer to >> continue. >> >> Second there is the interpretation I want to believe. This is "no >> data loss on pause" means that after the pause, no data has been >> discarded by the dma controller hardware, in fact all the data it has >> read before being paused has been fully transferred to its >> destination. Reading the residue while paused gives you an accurate, >> up-to-date state of the paused transfer. Then finally, although in >> general dma terminate causes data loss, it does not in this case since >> we terminated while we were paused and read the up-to-date residue. >> This is the interpretation implicit in the 8250 serial driver. > You are simply mixing things up! 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! > > 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! Okay, I see that in theory, there are some tricky bits in implementing DMA support in UART drivers. On the other hand there are already drivers with seems to be working fine. This discussion is about revert of the feature present in pl330 driver, which is required by other in-kernel driver without proper fix to them. Can we drop it for now and discuss what and how should be implemented to make everyone happy, without any regressions? Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland