From patchwork Sat Aug 20 19:33:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 1082912 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7KJVmh4007044 for ; Sat, 20 Aug 2011 19:31:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755249Ab1HTTbo (ORCPT ); Sat, 20 Aug 2011 15:31:44 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:54793 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755090Ab1HTTbh (ORCPT ); Sat, 20 Aug 2011 15:31:37 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id D3A491B9797; Sat, 20 Aug 2011 20:51:46 +0200 (CEST) Received: from ogre.sisk.pl ([127.0.0.1]) by localhost (ogre.sisk.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18545-05; Sat, 20 Aug 2011 20:51:33 +0200 (CEST) Received: from ferrari.rjw.lan (220-bem-13.acn.waw.pl [82.210.184.220]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id 705E81B9857; Sat, 20 Aug 2011 20:51:33 +0200 (CEST) From: "Rafael J. Wysocki" To: linux-sh@vger.kernel.org Subject: [PATCH 2/2] sh-sci / PM: Use power.irq_safe Date: Sat, 20 Aug 2011 21:33:09 +0200 User-Agent: KMail/1.13.6 (Linux/3.1.0-rc2+; KDE/4.6.0; x86_64; ; ) Cc: Linux PM mailing list , LKML , Magnus Damm References: <201108202131.19479.rjw@sisk.pl> In-Reply-To: <201108202131.19479.rjw@sisk.pl> MIME-Version: 1.0 Message-Id: <201108202133.09222.rjw@sisk.pl> X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 20 Aug 2011 19:31:49 +0000 (UTC) From: Rafael J. Wysocki Since sci_port_enable() and sci_port_disable() may be run with interrupts off and they execute pm_runtime_get_sync() and pm_runtime_put_sync(), respectively, the SCI device's power.irq_safe flags has to be used to indicate that it is safe to execute runtime PM callbacks for this device with interrupts off. Signed-off-by: Rafael J. Wysocki --- drivers/tty/serial/sh-sci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux/drivers/tty/serial/sh-sci.c =================================================================== --- linux.orig/drivers/tty/serial/sh-sci.c +++ linux/drivers/tty/serial/sh-sci.c @@ -1582,11 +1582,15 @@ static int sci_startup(struct uart_port dev_dbg(port->dev, "%s(%d)\n", __func__, port->line); + pm_runtime_irq_safe(port->dev); + sci_port_enable(s); ret = sci_request_irq(s); - if (unlikely(ret < 0)) + if (unlikely(ret < 0)) { + pm_runtime_irq_unsafe(port->dev); return ret; + } sci_request_dma(port); @@ -1609,6 +1613,8 @@ static void sci_shutdown(struct uart_por sci_free_irq(s); sci_port_disable(s); + + pm_runtime_irq_unsafe(port->dev); } static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps,