From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 8F154E0095D; Wed, 29 Apr 2015 10:15:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (picmaster[at]mail.bg) * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [193.201.172.118 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's * domain * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mx2.mail.bg (mx2.mail.bg [193.201.172.118]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 3F206E007B9 for ; Wed, 29 Apr 2015 10:15:55 -0700 (PDT) Received: from [192.168.0.62] (unknown [93.152.143.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx2.mail.bg (Postfix) with ESMTPSA id 1A4F96001E0F; Wed, 29 Apr 2015 20:15:54 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mail.bg; s=default; t=1430327754; bh=uHziGgmm9CA49G2P0BxpXsIkWjO1XiQ6l5yjc05qxBg=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=IogGXrKqIz4hUJvJ7VVCnNqxrF1RZBeQRvLasHz45mlXZfJKZixDPEBL/08hWXoJu FOySQeJXyiGijCDUM14AHfaYg3oaEOxBLASvxQjBUiszgj07S6ON0x0yfVecLMJ/+J Fth5iyrSa3NY3uz9194fJYcmiYGAx9ZJIGb+mh/8= Message-ID: <554111C9.3090802@mail.bg> Date: Wed, 29 Apr 2015 20:15:53 +0300 From: Nikolay Dimitrov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: Fabio Estevam , "Frazer, Will" References: In-Reply-To: Cc: "meta-freescale@yoctoproject.org" Subject: Re: imx.c RXTL X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 17:15:59 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Fabio, Will, On 04/29/2015 06:29 PM, Fabio Estevam wrote: > Hi Will, > > On Wed, Apr 29, 2015 at 10:24 AM, Fabio Estevam > wrote: >> Hi Will, >> >> On Wed, Apr 29, 2015 at 9:08 AM, Frazer, Will >> wrote: >> >>> In tests I can see that with the value set as 1, under intensive >>> serial use, CPU use goes towards about 20% (solo core). With the >>> value set to 14 it’s closer to 2%. >> >> I think your proposal makes sense. >> >> Should we also change TXTL? > > I tested your proposal and it seems we need some logic to adjust the > RXTL value. > > For console operation we need it to be RXTL, otherwise we miss > echoing the chars. It's normal to have this behavior when RXTL is 1, this essentially generates 1 interrupt per character. In order to reduce interrupt load, it's not enough to just increase the RXTL to a higher value, for reasons observed by Fabio. If one wants to use RXFIFO > 1 character, the solution is called "Aging Timer" (it was available even back in the 16550 days). It's functionality is to assert an interrupt when: - there's at least 1 character in RXFIFO - no characters have been received for several character periods (I think for imx6 it's 8) Both interrupts (RRDY & AgingTimeout) together handle all situations in appropriate manner. Let's look at the code (http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/drivers/tty/serial/imx.c?h=imx_3.14.28_1.0.0_ga): static irqreturn_t imx_int(int irq, void *dev_id) { ... sts = readl(sport->port.membase + USR1); if ((sts & USR1_RRDY || sts & USR1_AGTIM) && !sport->dma_is_enabled) { if (sts & USR1_AGTIM) writel(USR1_AGTIM, sport->port.membase + USR1); imx_rxint(irq, dev_id); } ... } It seems to me that AGTIM is not handled if DMA is enabled. Unfortunately these 2 features are not connected at all, imho. It's also good to note that the RXTL level is different for the system console and other serial ports: ... #define RXTL 1 /* For console port */ #define RXTL_UART 16 /* For uart */ static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode) { ... if (uart_console(&sport->port)) rx_fifo_trig = RXTL; else rx_fifo_trig = RXTL_UART; ... } What can you do to solve this? You can try disabling the dma and test how it works for you, or you can fix the driver logic to use the AgingTimer. Regards, Nikolay