lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 8 Jul 2014 14:12:59 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:	"Li, Aubrey" <aubrey.li@...ux.intel.com>,
	"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
Subject: Re: [PATCH] GPIO button wth wakeup attribute is supposed to wake the
 system up

On Tue, Jul 08, 2014 at 11:06:17PM +0200, Rafael J. Wysocki wrote:
> On Tuesday, July 08, 2014 01:45:30 PM Dmitry Torokhov wrote:
> > On Tue, Jul 08, 2014 at 10:52:52PM +0200, Rafael J. Wysocki wrote:
> > > On Thursday, June 19, 2014 08:51:25 AM Li, Aubrey wrote:
> > > > When the wakeup attribute is set, the GPIO button is capable of
> > > > waking up the system from sleep states, including the "freeze"
> > > > sleep state.  For that to work, its driver needs to pass the
> > > > IRQF_NO_SUSPEND flag to devm_request_any_context_irq(), or the
> > > > interrupt will be disabled by suspend_device_irqs() and the
> > > > system won't be woken up by it from the "freeze" sleep state.
> > > > 
> > > > The suspend_device_irqs() routine is a workaround for drivers
> > > > that mishandle interrupts triggered when the devices handled
> > > > by them are suspended, so it is safe to use IRQF_NO_SUSPEND in
> > > > all drivers that don't have that problem.
> > > > 
> > > > The affected/tested machines include Dell Venue 11 Pro and Asus T100TA.
> > > > 
> > > > Signed-off-by: Aubrey Li <aubrey.li@...ux.intel.com>
> > > > Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> > > 
> > > OK
> > > 
> > > Due to the lack of response (ie. no objections) and because the issue
> > > addressed by this patch is real, I'm queuing it up as a PM-related fix
> > > for 3.17.
> > 
> > Please do not. The response is till the same: board code should make sure
> > that enable_irq_wake() does the right thing and keeps interrupts enabled.
> 
> Which board code?  That's nothing like that for the platforms in question.

Then it needs to be written.

> 
> > It is wrong to patch drivers for this.
> 
> Why is it?  Only drivers know if they can handle incoming interrupts after
> having suspended their devices.

The driver correctly used enable_irq_wake() to indicate that interrupt should
be a wakeup source, the now the core/board needs to make sure the interrupt
gets delivered to the driver properly. We should not be patching every driver
that uses enable_irq_wake() with IRQF_NO_SUSPEND. If you look at the earlier
patch discussion Tegra folks managed to implement this behavior just fine.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ