From patchwork Thu Sep 6 12:45:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1414311 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B44E4DFFCF for ; Thu, 6 Sep 2012 12:52:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755677Ab2IFMvF (ORCPT ); Thu, 6 Sep 2012 08:51:05 -0400 Received: from na3sys009aog117.obsmtp.com ([74.125.149.242]:56472 "EHLO na3sys009aog117.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755641Ab2IFMu7 (ORCPT ); Thu, 6 Sep 2012 08:50:59 -0400 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]) (using TLSv1) by na3sys009aob117.postini.com ([74.125.148.12]) with SMTP ID DSNKUEicMjjrZk3mQ1DaplSfEvCVDhWxS460@postini.com; Thu, 06 Sep 2012 05:50:59 PDT Received: by lagy9 with SMTP id y9so1063521lag.19 for ; Thu, 06 Sep 2012 05:50:57 -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=yE4yHCzhVoADmo/PbY+bhtDsJHB8+Uo9IhJpzYd4OL8=; b=ArP+NxHTYBXqvvle0V27G5RW+7yug5e3dzuoLD6D+6lpLzpJxfHGWEsQcg2C3azEL/ QgYSgdEw5b4G+791Kf1TsEXGh/2kfh4VIKrMMkL9r6UdIKexGqwizzvRkiCpcXVjL/cc G8haA7byewC4koxT5WYQinjYeaZPyDi2AMHyMfK7fOk/Q3LgG+icRK/8qfpwAe3KQKoy /nGjQ/3WpFCrYqAOGcKwGg3VI3vDVGEiLmBJVyUK0isAhSvw9u0e0v3LqglC22sN1Q9F 37nz6fwW9jxykSuI2l5Tc1CQom/bViTDuyFc5zAIaPDn6u6MOsZkFgtwBMTUAsm8VpVX jjUA== Received: by 10.152.108.144 with SMTP id hk16mr1903616lab.2.1346935857038; Thu, 06 Sep 2012 05:50:57 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id j3sm568360lbh.0.2012.09.06.05.50.54 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 05:50:55 -0700 (PDT) From: Felipe Balbi To: Greg KH Cc: alan@linux.intel.com, 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 v4 15/21] serial: omap: unlock the port lock Date: Thu, 6 Sep 2012 15:45:34 +0300 Message-Id: <1346935540-1792-16-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <1346935540-1792-1-git-send-email-balbi@ti.com> References: <20120906122948.GC29202@arwen.pp.htv.fi> <1346935540-1792-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQnpHgBSPE+6drW7AvafWm63R64A42ccGZf0hSt6wQWMNYs3p4FgcikLgNweu9BSRGtWQXXP 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 d244163..9e4419c 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -224,8 +224,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);