Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756664AbcDGXyS (ORCPT ); Thu, 7 Apr 2016 19:54:18 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:34119 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754166AbcDGXyQ (ORCPT ); Thu, 7 Apr 2016 19:54:16 -0400 Subject: Re: [PATCH v1 06/12] serial: 8250_dma: stop ongoing RX DMA on exception To: Andy Shevchenko References: <1460061433-63750-1-git-send-email-andriy.shevchenko@linux.intel.com> <1460061433-63750-7-git-send-email-andriy.shevchenko@linux.intel.com> Cc: Vinod Koul , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Greg Kroah-Hartman , ismo.puustinen@intel.com, Heikki Krogerus , linux-serial@vger.kernel.org From: Peter Hurley Message-ID: <5706F325.6090001@hurleysoftware.com> Date: Thu, 7 Apr 2016 16:54:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1460061433-63750-7-git-send-email-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2123 Lines: 68 On 04/07/2016 01:37 PM, Andy Shevchenko wrote: > If we get an exeption interrupt. i.e. UART_IIR_RLSI, stop any ongoing RX DMA > transfer otherwise it might generates more spurious interrupts and make port > unavailable anymore. Then how to know which rx byte the error is for if dma continues anyway? What if there are multiple error bytes? > As has been seen on Intel Broxton system: This system shouldn't be setup for UART DMA imo. > ... > [ 168.526281] serial8250: too much work for irq5 > [ 168.535908] serial8250: too much work for irq5 > [ 173.449464] serial8250_interrupt: 4439 callbacks suppressed > [ 173.455694] serial8250: too much work for irq5 > ... > > Signed-off-by: Andy Shevchenko > --- > drivers/tty/serial/8250/8250_dma.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c > index 9d80bb1..b134bec 100644 > --- a/drivers/tty/serial/8250/8250_dma.c > +++ b/drivers/tty/serial/8250/8250_dma.c > @@ -110,6 +110,16 @@ err: > return ret; > } > > +static void __dma_rx_stop(struct uart_8250_port *p, struct uart_8250_dma *dma) > +{ > + if (!dma->rx_running) > + return; > + > + dmaengine_pause(dma->rxchan); > + __dma_rx_complete(p); > + dmaengine_terminate_async(dma->rxchan); > +} > + > int serial8250_rx_dma(struct uart_8250_port *p, unsigned int iir) > { > struct uart_8250_dma *dma = p->dma; > @@ -118,17 +128,14 @@ int serial8250_rx_dma(struct uart_8250_port *p, unsigned int iir) > switch (iir & 0x3f) { > case UART_IIR_RLSI: > /* 8250_core handles errors and break interrupts */ > + __dma_rx_stop(p, dma); > return -EIO; > case UART_IIR_RX_TIMEOUT: > /* > * If RCVR FIFO trigger level was not reached, complete the > * transfer and let 8250_core copy the remaining data. > */ > - if (dma->rx_running) { > - dmaengine_pause(dma->rxchan); > - __dma_rx_complete(p); > - dmaengine_terminate_async(dma->rxchan); > - } > + __dma_rx_stop(p, dma); > return -ETIMEDOUT; > default: > break; >