Received: by 10.192.165.148 with SMTP id m20csp856146imm; Thu, 10 May 2018 01:34:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrJprxgeE5yrnf2H3TXYENhFOBW/aXYiyqCZA22U4vSrxrlVoUM5PpP0JfCdBiMtfji25OT X-Received: by 2002:a17:902:7444:: with SMTP id e4-v6mr464117plt.225.1525941258748; Thu, 10 May 2018 01:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525941258; cv=none; d=google.com; s=arc-20160816; b=0+HwxlC7dLds2SLj6M2zO17mjbrexTujsGIu7m5Dm/h1VsOPOKWvdzjXiYDo+v5Kxb XyCasV8RcKEHucbO1s/vSys8vZCEgRtD851Guiq+p2/RfR0YTeXw2OiaykBJLg1iY/50 9+69IQ3ePJNhb8KgWfuuQJ26hg8Bc7av3XtkxGJfdTv95F77QKceK2KevWEwwQnfL/0v 5pp0GzfjXQVetIAOAyHZWtHATC9Zmj5tVdJwG/zHD+iZsGCwd3p0YrxhRZYi6OwujEcG V8407MIfA+csbGXgIBLVyDP51VcD8YBhsdunc3JRoCZRSxRn05sCl+UKZ/ahZN0Bz4QX IW7A== 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=6d0Jas23+tb9IyXzei6yi50tQ/fOoDqATKUTNRZuq/c=; b=qysJ/jLLqIWJui0i6TgUFn+MlmKAG0LVvlxrFnrDadnEpzpygkfyypJTn4+w5ZHWvm 5ivIn6xyqHgSDwnRkRShEXJfc5nEKp6tTZnNLI2Q28ethmceujCnKmnTW9/6GR6VUXxG RU/Kqw5ESpbn43GtMt+a/8DDH/YycIvUHons8vTKDYdbCBUFxPgYYZv8UQaepcyhjrQ0 jpA7M8Su+WiJuku+/nvyuq5ITGPEXnK2vS4ebb5dNlRFLGqjwhkymYS+pZ0aiSnn1Eb9 30aoASATF422u6Z3anGnN46Gd2HlYgc4sdsToPGGZM+TZwi4MHgNEW6b5oK+ZxFU3PHx aY+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=CcZGom4V; 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 k2-v6si297512pfg.75.2018.05.10.01.34.04; Thu, 10 May 2018 01:34:18 -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=CcZGom4V; 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 S934726AbeEJIcJ (ORCPT + 99 others); Thu, 10 May 2018 04:32:09 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57286 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934585AbeEJIcG (ORCPT ); Thu, 10 May 2018 04:32:06 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180510083203euoutp02d9cd6843533b65cc91ff37395474292e~tO13_sKZj1343413434euoutp02D for ; Thu, 10 May 2018 08:32:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180510083203euoutp02d9cd6843533b65cc91ff37395474292e~tO13_sKZj1343413434euoutp02D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1525941123; bh=6d0Jas23+tb9IyXzei6yi50tQ/fOoDqATKUTNRZuq/c=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=CcZGom4VacyoBEyVKaxlyDnn2uSpZg3uKE+Po7M2Dyzk0PA0jnyTCY2hCAXnqwOsu gBg6wh15EPxQHjCprHT+11ZUU549RfurF5Bn28O6787K2w+GBQC0QNLopfi/OrshuP PsUoFGSjkItoCeVmCTFlCeOhXckcYoxW8z230KtA= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180510083159eucas1p24247f8397977b2e2ff0a6d32545c11f3~tO10iOv5P2695226952eucas1p2B; Thu, 10 May 2018 08:31:59 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 6D.1F.17380.E7304FA5; Thu, 10 May 2018 09:31:58 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180510083156eucas1p1455f4fb3fe9a157a446d8d08b972c6b1~tO1xyoFn70562105621eucas1p1Q; Thu, 10 May 2018 08:31:56 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180510083156eusmtrp17ad907bbca24d9a5dbe87b1584f42487~tO1xxa2JV0358003580eusmtrp1g; Thu, 10 May 2018 08:31:56 +0000 (GMT) X-AuditID: cbfec7f4-713ff700000043e4-42-5af4037ee933 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 80.78.04183.C7304FA5; Thu, 10 May 2018 09:31:56 +0100 (BST) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180510083156eusmtip1dbef9420f2bed3b06eb43b47732abb3a~tO1xTr5YA0298902989eusmtip1p; Thu, 10 May 2018 08:31:56 +0000 (GMT) Subject: Re: Revert "dmaengine: pl330: add DMA_PAUSE feature" To: Frank Mori Hess Cc: Vinod Koul , 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: Date: Thu, 10 May 2018 10:31:53 +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: Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOKsWRmVeSWpSXmKPExsWy7djP87p1zF+iDA48VrLYOGM9q8X0qRcY LVZP/ctqMf/xXDaL8+c3sFtc3jWHzWLG+X1MFnf/fWK02HnnBLMDp8fOWXfZPY7sPMbmsXjP SyaPTas62Tz6tqxi9Pi8SS6ALYrLJiU1J7MstUjfLoEr4897iYKbChW/Oj+xNjAukepi5OSQ EDCRWHLqCWMXIxeHkMAKRomme7dYIZwvjBL/W3YzgVQJCXxmlLgyIaiLkQOs4/+XXIia5YwS n1evY4Jw3jNKfPm8jB2kQVjAVqJ9yyk2EFtEQE1iw/aDLCBFzAI7mCSW3/7CCJJgEzCU6Hrb BVbEK2AnMbO1FSzOIqAqsXbNdrC4qECMxLR515kgagQlTs58wgJicwoESqx6dwwsziwgL7H9 7RxmCFtc4taT+WAXSQicYpf4u+UBO8SjLhInHs2AsoUlXh3fAmXLSJye3MMCYddL9H0/AtXc wyixt2UqE0TCWuLw8YusIP8zC2hKrN+lDwkKW4mLj+QgTD6JG28FIU7gk5i0bTozRJhXoqNN CGKGmsSs4+vglh68cIl5AqPyLCSPzULyzCwkz8xCWLuAkWUVo3hqaXFuemqxUV5quV5xYm5x aV66XnJ+7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2mcTVn2rqbho275yY+yYq7tSLsveJ0YfWZOfxPlTTXum/sPsmsvff23HO8 Rq8T9JoPT9pz6R2T+2UT24fLGepOHGrN5jqiYdpTztEofv7FxD8Feh1X5u+yKt/8MbHYN3p3 /OLLBptn7Oi+b7ax1EiJpTgj0VCLuag4EQBuCGFP3gIAAA== X-CMS-MailID: 20180510083156eucas1p1455f4fb3fe9a157a446d8d08b972c6b1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-MTR: 20180510083156eucas1p1455f4fb3fe9a157a446d8d08b972c6b1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180508090407eucas1p13713284c2d3f5aa5c66f8d136be683c1 X-RootMTR: 20180508090407eucas1p13713284c2d3f5aa5c66f8d136be683c1 References: <2484918.HKVQc3yJkt@bear> <53b13d76-16a1-0e0a-09e1-c917e5d49326@samsung.com> <182f50b9-55b6-c9ce-07fb-718a1d22e9c8@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Frank, On 2018-05-09 19:48, Frank Mori Hess wrote: > On Wed, May 9, 2018 at 9:19 AM, Marek Szyprowski > wrote: >> I understand that pl330 doesn't support real PAUSE, but as it has been >> implemented since 2015 the limited support is perfectly possible - just >> to let serial driver to read the amount of data transferred. >> >> Please note that DMA engine documentation clearly states that the best >> residue granularity the driver might expect is BURST granularity. There >> is no way to get the information about the data which still sits in the >> DMA engine fifo when transfer is paused/terminated. This means that >> the serial driver should set maxburst = 1 if it is interested in >> getting exact number of bytes received/sent. With maxburst = 1 there >> is no such thing as data loose in the DMA engine fifo. > That is not my understanding of the dmaengine pause requirements, but > of course Vinod can speak authoritatively on this. Basing on the comments in dma_residue_granularity enum documentation (see include/linux/dmaengine.h) there is no better granularity of residue reporting than BURST units. If driver needs byte accuracy, then it should use MAXBURST=1 and DMA_SLAVE_BUSWIDTH_1_BYTE configuration. > I also don't agree > that data loss cannot happen for single transfers. It only becomes > less likely since there are fewer bytes in the dma controller fifo and > they stay there for a shorter period of time. But even so, there is > nothing stopping the DMAKILL from killing the transfer thread after it > does a single byte load but before it does the associated single byte > store, as they are performed by separate instructions. As far as your > serial port goes, the byte has been read by the host, even though it > never made it to memory, so it is gone forever. The dma-330 does have > a load lock which prevents some operations from interrupting a > load/store combination, but in my observations DMAKILL does not > respect the load lock. For the last 3 years no one observed any issue with the current design (single transfers with DMA_SLAVE_BUSWIDTH_1_BYTE). By removing this feature we will loose ability to use DMA in the serial drivers, what is mainly useful for low-power bluetooth operation (serial console is really negligible case). I agree that PL330 driver should not advertise PAUSE support, because HW doesn't have such ability, but for now this is the only way to get the number of bytes transferred after terminating a transfer. One would need to change DMA engine framework API to fix this. >> 3. Samsung driver doesn't check if DMA engine supports PAUSE feature and >> proper residue reporting granularity, so your revert simply breaks its >> operation. > Oh, I was wrongly assuming you were talking about an 8250 based serial driver. Nope, Samsung SoCs have a custom UART ip block. >> I've checked other device drivers, which use pl330 DMA on Samsung SoCs and >> besides serial, none of them configure maxburst > 1. When I forced such >> configuration, none worked fine. I'm a bit confused what does it mean. >> Either none of the Samsung SoC integrated peripherals support real burst >> DMA transfers, or the PL330 in Samsung SoCs are somehow limited or >> dysfunctional. There is already a quirk in pl330 for broken FLUSHP, but I >> have no idea how to diagnose if this is the case or the problem is in the >> SoC peripherals. I can live with maxburst set to 1 in those drivers as the >> proper fix. > When the DMA-330 is instructed to do a peripheral burst transfer, it > ignores single transfer requests from the peripheral. When it is > instructed to do a single transfer, it will do a single transfer in > response to either a burst request or a single request. So unless the > peripheral actually supports burst requests, the transfer will just > wait forever for a burst request which never comes. Okay, so if I get broken transfers when I forced BURST mode, then I can assume that peripherals doesn't really support it. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland