From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751834AbbBLUer (ORCPT ); Thu, 12 Feb 2015 15:34:47 -0500 Received: from www.linutronix.de ([62.245.132.108]:58132 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751045AbbBLUep (ORCPT ); Thu, 12 Feb 2015 15:34:45 -0500 Message-ID: <54DD0E5D.8070707@linutronix.de> Date: Thu, 12 Feb 2015 21:34:37 +0100 From: Sebastian Andrzej Siewior User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 MIME-Version: 1.0 To: Peter Hurley CC: Tony Lindgren , Nicolas Schichan , gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, balbi@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 03/16] tty: serial: 8250_core: read only RX if there is something in the FIFO References: <1410377411-26656-4-git-send-email-bigeasy@linutronix.de> <54D8B772.1010405@freebox.fr> <54D9441B.7070403@hurleysoftware.com> <54D9F3C7.5000809@freebox.fr> <54DA43F8.9090904@hurleysoftware.com> <54DBB531.2030504@hurleysoftware.com> <20150211200313.GE2531@atomide.com> <54DBBE9E.90104@hurleysoftware.com> <54DC6832.3070507@linutronix.de> <54DCD584.3010500@hurleysoftware.com> <20150212192333.GA18882@linutronix.de> <54DD053A.8060905@hurleysoftware.com> In-Reply-To: <54DD053A.8060905@hurleysoftware.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/12/2015 08:55 PM, Peter Hurley wrote: > On 02/12/2015 02:23 PM, Sebastian Andrzej Siewior wrote: >> * Peter Hurley | 2015-02-12 11:32:04 [-0500]: >> >>> That said, I don't think serial8250_do_startup() is really doing that much >>> for OMAP h/w startup; open-coding what omap_8250 really needs is probably >>> < 10 loc. >> >> 10 loc? I have a few more. > > :) > >> serial8250_clear_fifos(), >> serial_link_irq_chain() aren't exported. serial8250_set_mctrl() can >> maybe accessed via uart_ops->set_mctrl(). Maybe I'm not removing the >> obvious not required code but here it looks better to just a BUG flag for >> the Omap. > > Ok. Okay. I will try to post something tomorrow. >> --- a/drivers/tty/serial/8250/8250_omap.c >> +++ b/drivers/tty/serial/8250/8250_omap.c >> + >> + /* >> + * Clear the interrupt registers. >> + */ >> + if (serial_port_in(port, UART_LSR) & UART_LSR_DR) >> + serial_port_in(port, UART_RX); >> + serial_port_in(port, UART_IIR); >> + serial_port_in(port, UART_MSR); >> + >> + retval = serial_link_irq_chain(up); >> + if (retval) >> + goto out; > > omap doesn't really need the legacy irq chain handling; this could just be > request_irq(). > > In the 8250 split I'll be posting soon, all the irq chaining and > polling-via-timeout workarounds stays in the universal/legacy driver so > other 8250 drivers can opt-out. Ah. This sounds interesting. Sebastian From mboxrd@z Thu Jan 1 00:00:00 1970 From: bigeasy@linutronix.de (Sebastian Andrzej Siewior) Date: Thu, 12 Feb 2015 21:34:37 +0100 Subject: [PATCH 03/16] tty: serial: 8250_core: read only RX if there is something in the FIFO In-Reply-To: <54DD053A.8060905@hurleysoftware.com> References: <1410377411-26656-4-git-send-email-bigeasy@linutronix.de> <54D8B772.1010405@freebox.fr> <54D9441B.7070403@hurleysoftware.com> <54D9F3C7.5000809@freebox.fr> <54DA43F8.9090904@hurleysoftware.com> <54DBB531.2030504@hurleysoftware.com> <20150211200313.GE2531@atomide.com> <54DBBE9E.90104@hurleysoftware.com> <54DC6832.3070507@linutronix.de> <54DCD584.3010500@hurleysoftware.com> <20150212192333.GA18882@linutronix.de> <54DD053A.8060905@hurleysoftware.com> Message-ID: <54DD0E5D.8070707@linutronix.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 02/12/2015 08:55 PM, Peter Hurley wrote: > On 02/12/2015 02:23 PM, Sebastian Andrzej Siewior wrote: >> * Peter Hurley | 2015-02-12 11:32:04 [-0500]: >> >>> That said, I don't think serial8250_do_startup() is really doing that much >>> for OMAP h/w startup; open-coding what omap_8250 really needs is probably >>> < 10 loc. >> >> 10 loc? I have a few more. > > :) > >> serial8250_clear_fifos(), >> serial_link_irq_chain() aren't exported. serial8250_set_mctrl() can >> maybe accessed via uart_ops->set_mctrl(). Maybe I'm not removing the >> obvious not required code but here it looks better to just a BUG flag for >> the Omap. > > Ok. Okay. I will try to post something tomorrow. >> --- a/drivers/tty/serial/8250/8250_omap.c >> +++ b/drivers/tty/serial/8250/8250_omap.c >> + >> + /* >> + * Clear the interrupt registers. >> + */ >> + if (serial_port_in(port, UART_LSR) & UART_LSR_DR) >> + serial_port_in(port, UART_RX); >> + serial_port_in(port, UART_IIR); >> + serial_port_in(port, UART_MSR); >> + >> + retval = serial_link_irq_chain(up); >> + if (retval) >> + goto out; > > omap doesn't really need the legacy irq chain handling; this could just be > request_irq(). > > In the 8250 split I'll be posting soon, all the irq chaining and > polling-via-timeout workarounds stays in the universal/legacy driver so > other 8250 drivers can opt-out. Ah. This sounds interesting. Sebastian