From patchwork Mon Feb 17 14:08:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frieder Schrempf X-Patchwork-Id: 231180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D987EC34022 for ; Mon, 17 Feb 2020 14:08:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AEC56206F4 for ; Mon, 17 Feb 2020 14:08:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728162AbgBQOIE (ORCPT ); Mon, 17 Feb 2020 09:08:04 -0500 Received: from skedge04.snt-world.com ([91.208.41.69]:47624 "EHLO skedge04.snt-world.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728104AbgBQOID (ORCPT ); Mon, 17 Feb 2020 09:08:03 -0500 Received: from sntmail11s.snt-is.com (unknown [10.203.32.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by skedge04.snt-world.com (Postfix) with ESMTPS id E80A467A879; Mon, 17 Feb 2020 15:08:00 +0100 (CET) Received: from sntmail12r.snt-is.com (10.203.32.182) by sntmail11s.snt-is.com (10.203.32.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Mon, 17 Feb 2020 15:08:00 +0100 Received: from sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305]) by sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305%3]) with mapi id 15.01.1913.005; Mon, 17 Feb 2020 15:08:00 +0100 From: Schrempf Frieder To: "u.kleine-koenig@pengutronix.de" , "gregkh@linuxfoundation.org" , "stable@vger.kernel.org" CC: "shawnguo@kernel.org" , Schrempf Frieder , "linux-kernel@vger.kernel.org" , "linux-serial@vger.kernel.org" Subject: [PATCH 0/2] serial: imx: Backport fixes for irq handling to v4.14 Thread-Topic: [PATCH 0/2] serial: imx: Backport fixes for irq handling to v4.14 Thread-Index: AQHV5ZuphrtwteBzhkWCeOYI46C5sw== Date: Mon, 17 Feb 2020 14:08:00 +0000 Message-ID: <20200217140740.29743-1-frieder.schrempf@kontron.de> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-originating-ip: [172.25.9.193] x-c2processedorg: 51b406b7-48a2-4d03-b652-521f56ac89f3 Content-ID: <2EB2326F2D33094BA6652B3B5DC2A7BA@snt-world.com> MIME-Version: 1.0 X-SnT-MailScanner-Information: Please contact the ISP for more information X-SnT-MailScanner-ID: E80A467A879.AFDD3 X-SnT-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-SnT-MailScanner-SpamCheck: X-SnT-MailScanner-From: frieder.schrempf@kontron.de X-SnT-MailScanner-To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, shawnguo@kernel.org, stable@vger.kernel.org, u.kleine-koenig@pengutronix.de Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Frieder Schrempf A customer of ours has problems with RS485 on i.MX6UL with the latest v4.14 kernel. They get an exception like below from time to time (the trace is from an older kernel, but the problem also exists in v4.14.170). As the cpuidle state 2 causes large delays for the interrupt that controls the RS485 RTS signal (which can lead to collisions on the bus), cpuidle state 2 was disabled on this system. This aspect might cause the exception happening more often on this system than on other systems with default cpuidle settings. Looking for solutions I found Uwe's patches that were applied in v4.17 being mentioned here [1] and here [2]. In [1] Uwe notes that backporting these fixes to v4.14 might not be trivial, but I tried and in my opinion found it not to be too problematic either. With the backported patches applied, our customer reports that the exceptions stopped occuring. Given this and the fact that the problem seems to be known and quite common, it would be nice to get this into the v4.14 stable tree. [1] https://patchwork.kernel.org/patch/11342831/ [2] https://community.nxp.com/thread/481000 Stack trace: Unhandled fault: external abort on non-linefetch (0x1008) at 0x90928000 pgd = 8ce1c000 [90928000] *pgd=8d806811, *pte=021ec653, *ppte=021ec453 Internal error: : 1008 [#1] PREEMPT SMP ARM Modules linked in: usb_f_ecm g_ether usb_f_rndis u_ether libcomposite xt_tcpudp iptable_filter ip_tables x_tables spidev CPU: 0 PID: 277 Comm: mtiosSys5.elf Not tainted 4.14.89-exceet #4015 Hardware name: Freescale i.MX6 Ultralite (Device Tree) task: 8da9de00 task.stack: 8cd50000 PC is at imx_rxint+0x58/0x298 LR is at _raw_spin_lock_irqsave+0x18/0x5c pc : [<8044fa08>] lr : [<80711208>] psr: 20070193 sp : 8cd51ce0 ip : 8d400234 fp : 8da94010 r10: 80957900 r9 : 80c3e7ed r8 : 00000004 r7 : 80c02d00 r6 : 00000000 r5 : 8dae49f0 r4 : 00000001 r3 : 0000e38e r2 : 00021500 r1 : 90928000 r0 : 40070193 Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none Control: 10c5387d Table: 8ce1c06a DAC: 00000051 Process mtiosSys5.elf (pid: 277, stack limit = 0x8cd50210) Stack: (0x8cd51ce0 to 0x8cd52000) [...] [<8044fa08>] (imx_rxint) from [<80450c1c>] (imx_int+0x124/0x20c) [<80450c1c>] (imx_int) from [<8015ea94>] (__handle_irq_event_percpu+0x50/0x11c) [<8015ea94>] (__handle_irq_event_percpu) from [<8015eb7c>] (handle_irq_event_percpu+0x1c/0x58) [<8015eb7c>] (handle_irq_event_percpu) from [<8015ebf0>] (handle_irq_event+0x38/0x5c) [<8015ebf0>] (handle_irq_event) from [<801621d4>] (handle_fasteoi_irq+0xb8/0x16c) [<801621d4>] (handle_fasteoi_irq) from [<8015dd98>] (generic_handle_irq+0x24/0x34) [<8015dd98>] (generic_handle_irq) from [<8015e2c0>] (__handle_domain_irq+0x7c/0xec) [<8015e2c0>] (__handle_domain_irq) from [<80101448>] (gic_handle_irq+0x4c/0x90) [<80101448>] (gic_handle_irq) from [<8010bf4c>] (__irq_svc+0x6c/0xa8) [...] [<8010bf4c>] (__irq_svc) from [<80711580>] (_raw_spin_unlock_irqrestore+0x20/0x54) [<80711580>] (_raw_spin_unlock_irqrestore) from [<8044baf4>] (uart_write+0x110/0x178) [<8044baf4>] (uart_write) from [<804339b8>] (n_tty_write+0x350/0x440) [<804339b8>] (n_tty_write) from [<8042fbe8>] (tty_write+0x180/0x354) [<8042fbe8>] (tty_write) from [<801f93bc>] (__vfs_write+0x1c/0x120) [<801f93bc>] (__vfs_write) from [<801f9634>] (vfs_write+0xa4/0x168) [<801f9634>] (vfs_write) from [<801f97f8>] (SyS_write+0x3c/0x90) [<801f97f8>] (SyS_write) from [<80107900>] (ret_fast_syscall+0x0/0x54) Code: e59b2074 e59b1008 e2822001 e58b2074 (e591a000) Uwe Kleine-König (2): serial: imx: ensure that RX irqs are off if RX is off serial: imx: Only handle irqs that are actually enabled drivers/tty/serial/imx.c | 169 +++++++++++++++++++++++++++------------ 1 file changed, 117 insertions(+), 52 deletions(-) -- 2.17.1