Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1831574imm; Thu, 20 Sep 2018 03:42:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYOd5dzDWnbHnSuU6gJdRFUvubp8x7W02vfZaWzsSqjQz2lclzPMyJ6l1AZyOU9xR8DLsuQ X-Received: by 2002:a63:dd09:: with SMTP id t9-v6mr35288806pgg.370.1537440162083; Thu, 20 Sep 2018 03:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537440162; cv=none; d=google.com; s=arc-20160816; b=HwbMGdH8qHAyjUGJ85mybb+XPWDKtbBBh0W0QNvAOoKMTg28/lN72DvU77Gvid9B83 vrS3xIcehnFli/M5MUUS6jMXgW1IT8XibrxuBe/IR3yYjjuO2KbFgzmrhWvNZwsWfwIH 2o3rjuE6DjK/ZmKa3r4NtvnDlNAVWtsJxvu/59qT8pOkdC9Kcfp3iiXyzGA9JqS7OjI8 EtU7zVkyvxfQ551ALz3NJOHslcPjXZbcmoqDeeZQfE7wau2rC7WguT8/dftLOrmhFd4q 4IMJXe3eTzDaM0eAPJz8igWrpDEMcPgoyWZ9BiugNDJELJihXit9tMRAvq/n98sTZ/zc g1cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=mxgmk7UXWYQm09NiE62oIdnuUc+tjA2p69vhExIwSug=; b=LWl5Y1tmt5d8IfWgJXZOFRGtyiaCRoCoJZDtQDa0fITZ1SQu/4E9hEPmN+G8p5MWY9 jgfX19TDsONSSmKK8fOr4ZSc7lsNc0tezFxjvdR/PlTu+k9Tw/HRH97yxacA5PXS6vpA Awkf3NBbVs0wkYoFYE6RjtHnqSNPmTwETl9bU7upfC4ugVKUQTOvowh2D/btDsak3Igg lCe9sdtGb/8btam9NHTFrP6XyZGK7zudkqquM7eLee4PXFkVF4evssxbawhzHK/26WNG WnnDX1oTZ+/jygXdu5iAepIfOkxHp1UnlXuQsvtnmrPs76P1ury2XDGmWAW443IFN90n 9+EQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t64-v6si22403454pgd.176.2018.09.20.03.42.26; Thu, 20 Sep 2018 03:42:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732340AbeITQZB (ORCPT + 99 others); Thu, 20 Sep 2018 12:25:01 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:51465 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726610AbeITQZB (ORCPT ); Thu, 20 Sep 2018 12:25:01 -0400 Received: from kresse.hi.pengutronix.de ([2001:67c:670:100:1d::2a]) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1g2wPO-0005ds-N7; Thu, 20 Sep 2018 12:42:06 +0200 Message-ID: <1537440125.3362.161.camel@pengutronix.de> Subject: Re: [PATCH v1] tty: serial: imx: enable IDDMAEN for the last tail data From: Lucas Stach To: Andy Duan , Robin Gong , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= Cc: "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx , "kernel@pengutronix.de" , "jslaby@suse.com" Date: Thu, 20 Sep 2018 12:42:05 +0200 In-Reply-To: References: <1537457160-10792-1-git-send-email-yibin.gong@nxp.com> <20180920075513.6jqfbrrjax3sp4cn@pengutronix.de> <1537436376.3362.159.camel@pengutronix.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::2a X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Donnerstag, den 20.09.2018, 10:33 +0000 schrieb Andy Duan: > From: Lucas Stach Sent: 2018年9月20日 17:40 > > Am Donnerstag, den 20.09.2018, 08:39 +0000 schrieb Robin Gong: > > > > -----Original Message----- > > > > From: Uwe Kleine-König > > > > Sent: 2018年9月20日 15:55 > > > > To: Robin Gong > > > > Cc: jslaby@suse.com; Andy Duan ; > > > > linux-serial@vger.kernel.org; linux-kernel@vger.kernel.org; dl- > > > > linux-imx ; kernel@pengutronix.de > > > > Subject: Re: [PATCH v1] tty: serial: imx: enable IDDMAEN for > > > > the > > > > last tail data > > > > > > > > Hello, > > > > > > > > On Thu, Sep 20, 2018 at 11:26:00PM +0800, Robin Gong wrote: > > > > > enable IDDMAEN in UCR4 to let sdma script has the chance to > > > > > detect > > > > > the idle status and transfer the last tail data with the > > > > > interrupt > > > > > notifying uart driver.Otherwise, the last dma done interrupt > > > > > of > > > > > the tail data in rxfifo whose size is less than watermark may > > > > > never be received by uart driver. > > > > > > > > Is this a theoretic issue? Or does it fix a real problem? > > > > > > > > If the former I'd say UCR1_ATDMAEN being set should prevent > > > > this > > > > stall. > > > > > > It's a real fix, you will see 'timeout We read 0 byte' with the > > > attached stress test running on i.mx7d or i.mx6 if no this patch > > > applied. > > > ' while [ 1 ]; do /unit_tests/UART/mxc_uart_stress_test.out > > > /dev/ttymxc5 2000000 D L 100 100 L; done &' > > > Please make sure dma enabled on ttymxcX for your test, and sdma > > > firmware setup in your rootfs /lib/firmware/imx/sdma/sdma- > > > imx6q.bin > > > > or > > > /lib/firmware/imx/sdma/sdma- imx7d.bin. > > > You can get sdma firmware from below: > > > > > > > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2F > > gi > > t > > > .kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ffirmware%2Flin > > > > ux-& > > > ;data=02%7C01%7Cfugang.duan%40nxp.com%7C213076f6d1114148b5 > > > > ce08d61edcfb > > > > > > > 88%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636730331 > > 814804545& > > > ;sdata=d0uZMjLc%2FrIae3Wd6PWtX2gEGlvZcUjPBVqKK9550jg%3D& > > > > ;reserved=0 > > > firmware.git/tree/imx/sdma > > > > Please see commit 905c0decad28402aa166975023fb88c8f62f93c8 on > > why using the idle detect together with with SDMA is wrong. We > > don't > > want to re- introduce the broken behavior. > > > > The patch just want to use idle timer to stop SDMA transfer using the > new ram script, whose action is not the same as rom script. > Sdma rom script how to stop sdma transfer if only one byte in rx FIFO > that trigger SDMA request ? Right, and using the idle detect doesn't work with the ROM script as this doesn't read the remaining bytes in the FIFO when the idle detect condition is hit. Instead with the ROM script the aging timer is used to terminate the DMA transfer. So if 1 byte is sitting in the FIFO below the watermark level, the serial core will trigger a DMA request when the aging time is hit. The ROM script checks the aging status and reads the remaining bytes from the FIFO, then terminates the transfer. This is all documented in the reference manual. I fail to see why this shouldn't work with the RAM script. If it doesn't work with the RAM firmware, this script is violating the interface between the serial core and the script in an incompatible way and needs fixing. Regards, Lucas