From patchwork Thu Aug 23 10:32:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1365781 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 156B340B17 for ; Thu, 23 Aug 2012 10:41:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933927Ab2HWKj6 (ORCPT ); Thu, 23 Aug 2012 06:39:58 -0400 Received: from na3sys009aog137.obsmtp.com ([74.125.149.18]:34884 "EHLO na3sys009aog137.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933873Ab2HWKhz (ORCPT ); Thu, 23 Aug 2012 06:37:55 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]) (using TLSv1) by na3sys009aob137.postini.com ([74.125.148.12]) with SMTP ID DSNKUDYH/1YUcJ3QTqC4bFAnktwJvSdkMMsg@postini.com; Thu, 23 Aug 2012 03:37:52 PDT Received: by lbbgg6 with SMTP id gg6so358241lbb.31 for ; Thu, 23 Aug 2012 03:37:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=cAdoMVZ5hlva0CUu9ZD595CMR2TXbdidZbe/3denl4Q=; b=oGWXbv0OQEGPv1TXsv7wiYddzhcCvAmx6GQ/dvl6RmumiiuomJoW3i0ApLSflExsgV U/gDUpnIKYjGF4UTcMw91EloipgutN4lw6BDuFYh1apm7fvKcg8Sps86uvfjVo8ULCFR 7MxbPlm22QCFydkfUqc2yUVfYs5zRsrJFcthZg3xEYKvfioo9uq+8xvPJG5SlHe5T66h HkV5HYk/Avj0ULYK26yIN6I2ljZgQ8xj1yGQA/jiSLcTnTcfKspx+UQ54fTplrPB3kBG jTY/3S2HMfkYBuZ5Vq/80sko3YKJEoom654emAsrZrQHj/UAwhMVAwTM2PgA3XGYkifz OqSg== Received: by 10.152.122.9 with SMTP id lo9mr1189832lab.41.1345718269919; Thu, 23 Aug 2012 03:37:49 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id n7sm1781469lbk.10.2012.08.23.03.37.48 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Aug 2012 03:37:49 -0700 (PDT) From: Felipe Balbi To: alan@linux.intel.com Cc: Tony Lindgren , Kevin Hilman , Linux OMAP Mailing List , Linux ARM Kernel Mailing List , linux-serial@vger.kernel.org, Linux Kernel Mailing List , Santosh Shilimkar , Shubhrajyoti Datta , Sourav Poddar , Ruchika Kharwar , Pavan Savoy , Vijay Badawadagi , Felipe Balbi Subject: [PATCH v3 17/23] serial: omap: unlock the port lock Date: Thu, 23 Aug 2012 13:32:57 +0300 Message-Id: <1345717983-18179-18-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <1345717983-18179-1-git-send-email-balbi@ti.com> References: <1345717983-18179-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQltikuKqDD5FZZPtoJasKREXEECTWSG3top2hkO0mxqV3m7hHl0QP4+aGxj8sohEZ2PsGeN Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Ruchika Kharwar This patch unlocks the port lock before calling a serial_core API and re-acquires the port lock after calling it. This patch fixes a system freeze issue seen when the serial_core API uart_write_wakeup() eventually attempts to acquire the port lock already acquired by omap serial interrupt handler. Tested-by: Shubhrajyoti D Signed-off-by: Ruchika Kharwar Signed-off-by: Pavan Savoy Signed-off-by: Vijay Badawadagi Signed-off-by: Felipe Balbi --- drivers/tty/serial/omap-serial.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index ba22247..e871635 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -223,8 +223,11 @@ static void transmit_chars(struct uart_omap_port *up, unsigned int lsr) break; } while (--count > 0); - if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) { + spin_unlock(&up->port.lock); uart_write_wakeup(&up->port); + spin_lock(&up->port.lock); + } if (uart_circ_empty(xmit)) serial_omap_stop_tx(&up->port);