From patchwork Mon Aug 27 07:36:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 1376621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id EF99DDF215 for ; Mon, 27 Aug 2012 07:39:51 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T5tsi-0005O2-6p; Mon, 27 Aug 2012 07:37:08 +0000 Received: from smtp2-v.fe.bosch.de ([139.15.237.6]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T5tsd-0005MW-Rv for linux-arm-kernel@lists.infradead.org; Mon, 27 Aug 2012 07:37:05 +0000 Received: from vsmta14.fe.internet.bosch.com (unknown [10.4.98.30]) by imta24.fe.bosch.de (Postfix) with ESMTP id A5F20B0022B for ; Mon, 27 Aug 2012 09:37:00 +0200 (CEST) Received: from localhost (vsgw4.fe.internet.bosch.com [10.4.98.12]) by vsmta14.fe.internet.bosch.com (Postfix) with SMTP id 9A3571B402F7 for ; Mon, 27 Aug 2012 09:37:00 +0200 (CEST) Received: from FE-HUB1000.de.bosch.com (10.4.103.107) by si-hub07.de.bosch.com (10.3.153.132) with Microsoft SMTP Server (TLS) id 8.3.264.0; Mon, 27 Aug 2012 09:36:57 +0200 Received: from hi-z5661.hi.de.bosch.com (10.34.219.178) by FE-HUB1000.de.bosch.com (10.4.103.107) with Microsoft SMTP Server id 14.2.309.2; Mon, 27 Aug 2012 09:36:57 +0200 Received: from localhost.localdomain (localhost [127.0.0.1]) by hi-z5661.hi.de.bosch.com (Postfix) with ESMTP id C8C75401AC; Mon, 27 Aug 2012 09:36:56 +0200 (CEST) From: Dirk Behme To: , Subject: [PATCH 0/2] tty: serial: imx: fix lockup and garbage on SMP Date: Mon, 27 Aug 2012 09:36:50 +0200 Message-ID: <1346053012-25686-1-git-send-email-dirk.behme@de.bosch.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [139.15.237.6 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Greg Kroah-Hartman , Dirk Behme , kernel@pengutronix.de, Alan Cox X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The following two patches are a port from Freescale's patch http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/drivers/tty/serial/imx.c?h=imx_3.0.15_android&id=80e525d66d1818722db18e21dc7f1dc41f314156 Using a 3.6-rc3 kernel on a i.MX6 SabreLite board and increasing the verbosity of the kernel's serial console output with some debug printk like [1] results in two issues: 1. After some time the kernel output hangs [2]. The debugger tells us that it hangs in drivers/tty/serial/imx.c at ... /* * Finally, wait for transmitter to become empty * and restore UCR1/2/3 */ while (!(readl(sport->port.membase + USR2) & USR2_TXDC)); ... with permanently reading 0x1000 from USR2 while it waits for bit USR2_TXDC (0x8). 2. Even after applying the first patch, there happens to be some garbage in the output [3]. Both issues are gone applying these two patches. Note: If these patches are fine, they should go to stable, too. Best regards Dirk [1] [2] ... => mmap_region: start: 0x76DBC000 end: 0x76DBE000 len: 8192 => mmap_region: start: 0x76DBE000 end: 0x76DC0000 len: 8192 => mmap_region: start: 0x76D5C000 end: 0x76DA0000 ÿ [3] ... => mmap_region: start: 0x0011C000 end: 0x0011D000 len: 4096 => mmap_region: start: 0x00008000 end: 0x000B500fè#.Æ ÄRèérêòjµ…Á}ɝ¥½¹é start: 0x000BD000 end: 0x000BE000 len: 4096 => mmap_region: start: 0x000BD000 end: 0x000BE000 len: 4096 ... Index: a/mm/mmap.c =================================================================== --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1290,6 +1290,9 @@ munmap_back: vma->vm_pgoff = pgoff; INIT_LIST_HEAD(&vma->anon_vma_chain); + printk(" => mmap_region: start: 0x%08X end: 0x%08X len: %d\n", + (unsigned int)vma->vm_start, (unsigned int)vma->vm_end, (int)len); + error = -EINVAL; /* when rejecting VM_GROWSDOWN|VM_GROWSUP */ if (file) {