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, 15 Nov 2011 10:29:10 -0800
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	oskar.andero@...yericsson.com
Cc:	"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"jic23@....ac.uk" <jic23@....ac.uk>,
	"aghayal@...eaurora.org" <aghayal@...eaurora.org>,
	"Cavin, Courtney" <Courtney.Cavin@...yericsson.com>
Subject: Re: [PATCH v3] input: add driver support for Sharp gp2ap002a00f
 proximity sensor

On Tue, Nov 15, 2011 at 01:53:52PM +0100, oskar.andero@...yericsson.com wrote:
> On 10:43 Tue 15 Nov     , Dmitry Torokhov wrote:
> > On Tue, Nov 15, 2011 at 10:26:00AM +0100, oskar.andero@...yericsson.com wrote:
> > > From: Courtney Cavin <courtney.cavin@...yericsson.com>
> > > +
> > > +#ifdef CONFIG_PM_SLEEP
> > > +static int gp2a_suspend(struct device *dev)
> > > +{
> > > +	struct i2c_client *client = to_i2c_client(dev);
> > > +	struct gp2a_data *dt = i2c_get_clientdata(client);
> > > +	int error;
> > > +
> > > +	mutex_lock(&dt->device->mutex);
> > > +
> > > +	if (dt->device->users) {
> > > +		if (device_may_wakeup(&client->dev)) {
> > > +			enable_irq_wake(client->irq);
> > 
> > I think this part should happen regardless of whether device has users,
> > only non wakeup source case needs it.
> 
> Hmm.. why would one want to enable irq_wake when there are no users?
> Wouldn't this cause the device to wakeup at every irq and report an
> switch event that no one listens to?

You are suspending the system and want to have this device as a wakeup
source. Note: not wake up _device_ at every IRQ but wake up the whole
_system_ when device generates an IRQ while system is asleep.
It does not matter whether there are users for the events; you
want the system to wake up.

At least this is the usual semantics.

-- 
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