From patchwork Fri Dec 3 11:20:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Govindraj R X-Patchwork-Id: 377361 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB3BLAt5017294 for ; Fri, 3 Dec 2010 11:21:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757401Ab0LCLVH (ORCPT ); Fri, 3 Dec 2010 06:21:07 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:37697 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756156Ab0LCLVE convert rfc822-to-8bit (ORCPT ); Fri, 3 Dec 2010 06:21:04 -0500 Received: by wyb28 with SMTP id 28so9315453wyb.19 for ; Fri, 03 Dec 2010 03:21:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=sGFZk4Imm/SS+mmN5LavXhb90p6I8i6zXtuLl+TdQZw=; b=NvwT9c6lKtvlgGYdwwHKvXBE2RYr5OaZ99/G4KzBKbMbBmQh/yj3jqsmXHanu8n/Yl f8N5YV6vxWs3dVM6UnronmHo3+lF2AdFQku53KcIU5duFBq0yrxQIgecFHL6MAnOictj Gx8EoEVOp6J0MB/JATEtep4u0AAJ8LkxNZLuk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=DgzifqXjltVhdz1B9Xj1QAPxY7rlXb0etieh1uozMQWvIwrJ+lrUfSDGiOSgzmJiDD VKbQo8UOMEZBu02mhjXmQ/eEXkKvseZJmTpzhN9SxyCfuPvgQFas9ljqvzxq/NTfHXvg mFJLcVpnUgMmD/VehyC7yNpIAXu+zzsd83umM= Received: by 10.216.51.21 with SMTP id a21mr1459481wec.50.1291375263006; Fri, 03 Dec 2010 03:21:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.16.145 with HTTP; Fri, 3 Dec 2010 03:20:42 -0800 (PST) In-Reply-To: References: <1c6ea016b8c01ee8b470e95fdcae4ee0@mail.gmail.com> From: Govindraj Date: Fri, 3 Dec 2010 16:50:42 +0530 Message-ID: Subject: Re: Unbalanced IRQ wake disable during resume from static suspend To: Santosh Shilimkar Cc: Paul Walmsley , linux-omap@vger.kernel.org, khilman@deeprootsystems.com Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Dec 2010 11:21:11 +0000 (UTC) diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index cd85112..0466815 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -1990,7 +1990,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) tty_dev = device_find_child(uport->dev, &match, serial_match_port); if (device_may_wakeup(tty_dev)) { - enable_irq_wake(uport->irq); + if (!enable_irq_wake(uport->irq)) + uport->irq_wake = 1; put_device(tty_dev); mutex_unlock(&port->mutex); return 0; @@ -2056,7 +2057,8 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) tty_dev = device_find_child(uport->dev, &match, serial_match_port); if (!uport->suspended && device_may_wakeup(tty_dev)) { - disable_irq_wake(uport->irq); + if (uport->irq_wake) + disable_irq_wake(uport->irq); mutex_unlock(&port->mutex); return 0; } diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 295e898..88e73c3 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -359,6 +359,7 @@ struct uart_port { struct device *dev; /* parent device */ unsigned char hub6; /* this should be in the 8250 driver */ unsigned char suspended; + unsigned char irq_wake; /* Irq_wakeup Available */ unsigned char unused[2]; void *private_data; /* generic platform data pointer */ };