From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763904AbdEWMcA (ORCPT ); Tue, 23 May 2017 08:32:00 -0400 Received: from mail1.bemta5.messagelabs.com ([195.245.231.137]:58949 "EHLO mail1.bemta5.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763798AbdEWMb4 (ORCPT ); Tue, 23 May 2017 08:31:56 -0400 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBIsWRWlGSWpSXmKPExsUSt3Opse4WbZV Ig2drGS2aF69ns5iy4QOTxYO5N5ksLu+aw2ZxZnEvu8XliZ3sFrcnTmZ0YPfYOesuu8f+uWvY Pfr/Gnis33KVxePzJrkA1ijWzLyk/IoE1owJz3sZC6bKVNw/UdXAOFu8i5GLQ0hgPaNE55oJr F2MnEBOhUTH32MsIDabgKHEvDfvGUFsFgFViWmPu4FsDg5hgQSJGUc8QHpFBDqZJLY+f80GEm cWMJfYcEMfxOQVcJD4eksWpJNXQFDi5MwnYBOZBSQkDr54wQxSIiSgJbH8WCRIWELAXmL6+6t gYQkBfYnGY7EQYUOJ77O+sUDY5hIznz1hncDIPwvJ0FlIhi5gZFrFqF6cWlSWWqRropdUlJme UZKbmJmja2hgqpebWlycmJ6ak5hUrJecn7uJERjCDECwg/FWn/MhRkkOJiVR3j0JypFCfEn5K ZUZicUZ8UWlOanFhxhlODiUJHi7tVQihQSLUtNTK9Iyc4DRBJOW4OBREuE9CJLmLS5IzC3OTI dInWJUlBLndQFJCIAkMkrz4NpgEXyJUVZKmJcR6BAhnoLUotzMElT5V4ziHIxKwryzQKbwZOa VwE1/BbSYCWix611lkMUliQgpqQZGhYa5HYqnLL+FHj+8PPfatgQl6TmNE+882/h51TeLvwHW pxZX5dk8Pmhp/aP0/MZNE99eUPxq3j/3mvtdVg2tkFjL6dV2wdvc1Cz8EsP11Jb8z990rGC+y gnmng0VF4/GJm3ZtVReJn9fYQWrZwDr7LdzWuOPqUxmvDZReO6OR/vmFd/YkltnqMRSnJFoqM VcVJwIAL7At+fbAgAA X-Env-Sender: stwiss.opensource@diasemi.com X-Msg-Ref: server-14.tower-179.messagelabs.com!1495542707!90254920!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked From: Steve Twiss Date: Tue, 23 May 2017 13:17:26 +0100 Subject: [PATCH V1] serial: imx: revert setup DCEDTE early and ensure DCD and RI irqs to be off To: Greg Kroah-Hartman , Jiri Slaby , LINUX-KERNEL , LINUX-SERIAL , Lucas Stach , "Uwe Kleine-Konig" CC: Support Opensource Message-ID: <20170523123145.E268B3FAD4@swsrvapps-01.diasemi.com> MIME-Version: 1.0 Content-Type: text/plain X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 23/05/2017 11:12:00 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steve Twiss Revert the commit e61c38d85b7392e ("serial: imx: setup DCEDTE early and ensure DCD and RI irqs to be off") The patch submitted to setup DCEDTE early and ensure DCD and RI irqs to be off, causes a serial console display problem the i.MX6Q SABRESD board. The console becomes unreadable and unwritable. Tested-by: Steve Twiss Signed-off-by: Steve Twiss --- This patch applies against linux-next and v4.12-rc2 Hi, I have been seeing a problem with the serial output console on the i.MX6Q SABRESD, but not the i.MX6DL SABRESD. Everything was fine up to linux-mainline/v4.11 but changed after linux-next/next-20170501. Some bisection has pointed at the commit e61c38d85b7392e033ee03bca46f1d6006156175 which, once removed from my linux-next/v4.12-rc2 build allows the i.MX6Q board to display the console correctly again. This patch removes the original commit e61c38d85b7392e ("serial: imx: setup DCEDTE early and ensure DCD and RI irqs to be off") from linux-next v4.12-rc2 and fixes the serial problem seen in the i.MX6Q SABRESD board. Regards, Steve Twiss, Dialog Semiconductor Ltd. drivers/tty/serial/imx.c | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 33509b4..b4340b5 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1325,10 +1325,19 @@ static int imx_startup(struct uart_port *port) if (!is_imx1_uart(sport)) { temp = readl(sport->port.membase + UCR3); - temp |= UCR3_DTRDEN | UCR3_RI | UCR3_DCD; + /* + * The effect of RI and DCD differs depending on the UFCR_DCEDTE + * bit. In DCE mode they control the outputs, in DTE mode they + * enable the respective irqs. At least the DCD irq cannot be + * cleared on i.MX25 at least, so it's not usable and must be + * disabled. I don't have test hardware to check if RI has the + * same problem but I consider this likely so it's disabled for + * now, too. + */ + temp |= IMX21_UCR3_RXDMUXSEL | UCR3_ADNIMP | + UCR3_DTRDEN | UCR3_RI | UCR3_DCD; if (sport->dte_mode) - /* disable broken interrupts */ temp &= ~(UCR3_RI | UCR3_DCD); writel(temp, sport->port.membase + UCR3); @@ -1610,6 +1619,8 @@ static void imx_flush_buffer(struct uart_port *port) ufcr = readl(sport->port.membase + UFCR); ufcr = (ufcr & (~UFCR_RFDIV)) | UFCR_RFDIV_REG(div); + if (sport->dte_mode) + ufcr |= UFCR_DCEDTE; writel(ufcr, sport->port.membase + UFCR); writel(num, sport->port.membase + UBIR); @@ -2177,27 +2188,6 @@ static int serial_imx_probe(struct platform_device *pdev) UCR1_TXMPTYEN | UCR1_RTSDEN); writel_relaxed(reg, sport->port.membase + UCR1); - if (!is_imx1_uart(sport) && sport->dte_mode) { - /* - * The DCEDTE bit changes the direction of DSR, DCD, DTR and RI - * and influences if UCR3_RI and UCR3_DCD changes the level of RI - * and DCD (when they are outputs) or enables the respective - * irqs. So set this bit early, i.e. before requesting irqs. - */ - writel(UFCR_DCEDTE, sport->port.membase + UFCR); - - /* - * Disable UCR3_RI and UCR3_DCD irqs. They are also not - * enabled later because they cannot be cleared - * (confirmed on i.MX25) which makes them unusable. - */ - writel(IMX21_UCR3_RXDMUXSEL | UCR3_ADNIMP | UCR3_DSR, - sport->port.membase + UCR3); - - } else { - writel(0, sport->port.membase + UFCR); - } - clk_disable_unprepare(sport->clk_ipg); /* -- end-of-patch for PATCH V1