Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756298AbbESPJf (ORCPT ); Tue, 19 May 2015 11:09:35 -0400 Received: from muru.com ([72.249.23.125]:52105 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755022AbbESPJb (ORCPT ); Tue, 19 May 2015 11:09:31 -0400 Date: Tue, 19 May 2015 08:09:27 -0700 From: Tony Lindgren To: "Rafael J. Wysocki" Cc: Felipe Balbi , "Rafael J. Wysocki" , Alan Stern , Andreas Fenkart , Greg Kroah-Hartman , Huiquan Zhong , Kevin Hilman , NeilBrown , Mika Westerberg , Nishanth Menon , Peter Hurley , Sebastian Andrzej Siewior , Ulf Hansson , Thomas Gleixner , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-omap@vger.kernel.org Subject: Re: [PATCH 2/5] PM / Wakeirq: Add automated device wake IRQ handling Message-ID: <20150519150926.GP10274@atomide.com> References: <1431560196-5722-1-git-send-email-tony@atomide.com> <20150518234400.GN10274@atomide.com> <3554198.gIGuGWK14O@vostro.rjw.lan> <3371662.LPKmgz3rb9@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3371662.LPKmgz3rb9@vostro.rjw.lan> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1929 Lines: 67 * Rafael J. Wysocki [150519 07:02]: > On Tuesday, May 19, 2015 04:04:43 PM Rafael J. Wysocki wrote: > > On Monday, May 18, 2015 04:44:01 PM Tony Lindgren wrote: > > > > > > For most drivers, we should be able to drop the following > > > boilerplate code from runtime_suspend and runtime_resume > > > functions: > > > > > > ... > > > device_init_wakeup(dev, true); > > > ... > > > if (device_may_wakeup(dev) > > > enable_irq_wake(irq); > > > ... > > > if (device_may_wakeup(dev) > > > enable_irq_wake(irq); > > > > Closing parens are missin in the above two if () statements. > > > > Also, should the second one be disable_irq_wake(irq)? Thanks yeah it should disable_irq_wake :) Will fix. > > > ... > > > device_init_wakeup(dev, false); > > > ... > > > > > > We can replace it with just the following init and exit > > > time code: > > > > > > ... > > > device_init_wakeup(dev, true); > > > dev_pm_set_wake_irq(dev, irq); > > > ... > > > dev_pm_clear_wake_irq(dev); > > > device_init_wakeup(dev, false); > > > ... > > > > > > And for hardware with dedicated wake-up interrupts: > > > > > > ... > > > device_init_wakeup(dev, true); > > > dev_pm_set_dedicated_wake_irq(dev, irq); > > > ... > > > dev_pm_clear_wake_irq(dev); > > > device_init_wakeup(dev, false); > > > ... > > > > > > For now, let's only enable it for select PM_WAKEIRQ. > > > > Why? What would be wrong with doing that unconditionally? No reason to make it conditional any longer. it's there from the earlier version that only handled the dedicated wake IRQS. > I mean, what about making it depend on CONFIG_PM directly? OK let's do that. Regards, Tony -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/