From patchwork Mon Mar 20 15:38:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 9634409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D541C601E9 for ; Mon, 20 Mar 2017 15:38:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5F4E27DA4 for ; Mon, 20 Mar 2017 15:38:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BACAA27F89; Mon, 20 Mar 2017 15:38:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 52A3827DA4 for ; Mon, 20 Mar 2017 15:38:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UiQawd5KZuVMsCfICk+e9x2L3Xwi1tovFuHCCBurCtg=; b=W2Ntkoj+XbOoUG cZ7d71bjSqySetiikRaPLFUblrWLB2Cn112iilZCLJ/rM0yFNurPtzTjFgQYl7cnAn/30zQ5BQJH5 jNwVZ2+xsG1IuuQ+mqyRSEWaDHWD65JMBajKMdAdi51NukRwHLuecfqp3VdWlJcY5LY06wJ/Q4y2E f5cxMbWZM5KohyGJtBGeP944zfBzcmHPWrtDGuWCzc59KPOH/9yV/L5aYLWRgiZ85zJUf16cjL2rO cO+stRmXhibNBa4iLZS+JJJKW9LZnxbLXrXRAxJplDhUGfLCHWTPT9FwhKa3gnx5nFm/nOxJHbHPb JlS4ijovA2JUU/qpTIpQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cpzOW-0000ET-0p; Mon, 20 Mar 2017 15:38:52 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cpzOR-0000Aw-V1 for linux-arm-kernel@lists.infradead.org; Mon, 20 Mar 2017 15:38:49 +0000 X-IronPort-AV: E=Sophos;i="5.36,194,1486450800"; d="scan'208";a="310982" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA; 20 Mar 2017 08:38:23 -0700 Received: from tenerife.corp.atmel.com (10.10.76.4) by chn-sv-exch04.mchp-main.com (10.10.76.105) with Microsoft SMTP Server id 14.3.181.6; Mon, 20 Mar 2017 08:38:18 -0700 From: Nicolas Ferre To: Greg Kroah-Hartman , Subject: [PATCH] tty/serial: atmel: fix TX path in atmel_console_write() Date: Mon, 20 Mar 2017 16:38:57 +0100 Message-ID: <20170320153857.28933-1-nicolas.ferre@microchip.com> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170320_083848_336078_9B8D130B X-CRM114-Status: UNSURE ( 7.87 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Genoud , "stable #4 . 4+" , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP A side effect of 89d8232411a8 ("tty/serial: atmel_serial: BUG: stop DMA from transmitting in stop_tx") is that the console can be called with TX path disabled. Then the system would hang trying to push charecters out in atmel_console_putchar(). Signed-off-by: Nicolas Ferre Fixes: 89d8232411a8 ("tty/serial: atmel_serial: BUG: stop DMA from transmitting in stop_tx") Cc: stable #4.4+ Acked-by: Richard Genoud --- Hi, I resend this patch removing the "RFC" tag and adding the Acked-by: Richard. Best regards, drivers/tty/serial/atmel_serial.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index d9c05e05d896..2a03ad99d219 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -2486,6 +2486,9 @@ static void atmel_console_write(struct console *co, const char *s, u_int count) pdc_tx = atmel_uart_readl(port, ATMEL_PDC_PTSR) & ATMEL_PDC_TXTEN; atmel_uart_writel(port, ATMEL_PDC_PTCR, ATMEL_PDC_TXTDIS); + /* Make sure that tx path is actually able to send characters */ + atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN); + uart_console_write(port, s, count, atmel_console_putchar); /*