From patchwork Thu Sep 6 12:45:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1414491 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 647A93FC71 for ; Thu, 6 Sep 2012 12:54:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754934Ab2IFMyL (ORCPT ); Thu, 6 Sep 2012 08:54:11 -0400 Received: from na3sys009aog113.obsmtp.com ([74.125.149.209]:33151 "EHLO na3sys009aog113.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755482Ab2IFMun (ORCPT ); Thu, 6 Sep 2012 08:50:43 -0400 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]) (using TLSv1) by na3sys009aob113.postini.com ([74.125.148.12]) with SMTP ID DSNKUEicIVcxG/VrjeCSsv/2b2s7mXZA1oM6@postini.com; Thu, 06 Sep 2012 05:50:42 PDT Received: by lagy9 with SMTP id y9so1063321lag.19 for ; Thu, 06 Sep 2012 05:50:40 -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=fo3ZyUh25gVlygonilebj6aS9fJB8hbWJ3JTi4L8eKY=; b=IA1E/YeVjhaxRFYDiUNqI9g5f8pzbzw/Fg02EepVhwd7uRHbrlx5SQIzc/vUnMvZJY nmTynJQvRei5XJlOSPXZteXNqGDgYSNhZMGrK+IcitEU0Z23CgOm4k2LWzok0TmAaZW7 hy0LPSlPneSTZXn9LJqW7DykAVS7rYrQav3aG6fjbPGacFDuP7Ero9yDNMQfaXy8Li85 hu32Il2IyJhz+7m6adnreypAWwHL5MUUQr8p83Z8CJsIopasM9bfHxSWKoAV18la+kOF S+zR5o2n0DEfAQhk4Rv3H3ZKLfAmH/qLXXvzFAgh5+8k99POkCL7yYgMYFqblrCDjzry reqg== Received: by 10.152.104.77 with SMTP id gc13mr1845142lab.31.1346935839832; Thu, 06 Sep 2012 05:50:39 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id hg4sm2058196lab.11.2012.09.06.05.50.37 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 05:50:38 -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 , Felipe Balbi Subject: [PATCH v4 11/21] serial: omap: don't save IRQ flags on hardirq Date: Thu, 6 Sep 2012 15:45:30 +0300 Message-Id: <1346935540-1792-12-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: ALoCoQka6/QLWAVXOBwyqQqiVnb4S6UOn1Ju276FMTiHOcSzOOv2aYkJXhcF/Cl7FBsf0iksobAs Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org When we're running our hardirq handler, there's not need to disable IRQs with spin_lock_irqsave() because IRQs are already disabled. It also makes no difference if we save or not IRQ flags. Switch over to simple spin_lock/spin_unlock and drop the "flags" variable. Tested-by: Shubhrajyoti D Signed-off-by: Felipe Balbi --- drivers/tty/serial/omap-serial.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 0ceca44..99042b0 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -351,11 +351,10 @@ static inline irqreturn_t serial_omap_irq(int irq, void *dev_id) struct tty_struct *tty = up->port.state->port.tty; unsigned int iir, lsr; unsigned int type; - unsigned long flags; irqreturn_t ret = IRQ_NONE; int max_count = 256; - spin_lock_irqsave(&up->port.lock, flags); + spin_lock(&up->port.lock); pm_runtime_get_sync(up->dev); do { @@ -394,7 +393,7 @@ static inline irqreturn_t serial_omap_irq(int irq, void *dev_id) } } while (!(iir & UART_IIR_NO_INT) && max_count--); - spin_unlock_irqrestore(&up->port.lock, flags); + spin_unlock(&up->port.lock); tty_flip_buffer_push(tty);