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]
Message-ID: <20111115131636.GA31028@sirena.org.uk>
Date:	Tue, 15 Nov 2011 13:16:37 +0000
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Patrick Combes <p-combes@...com>
Cc:	grant.likely@...retlab.ca, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, Hugo Dupras <h-dupras@...com>
Subject: Re: [RFC][PATCH] gpiolib: add irq_wake (power-management) sysfs
 file

On Fri, Nov 11, 2011 at 10:40:06AM +0100, Patrick Combes wrote:

> By calling poll() on the /sys/class/gpio/gpioN/value sysfs file, usermode
> application can take benefit of gpio interrupts.
> However, depending on the power state reached, this interrupt may not wake-up
> the CPU.
> This patch creates a new sysfs file /sys/class/gpio/gpioN/irq_wake to enable
> usermode application to set the wake properties of a gpio IRQ.
> This option can be set or not for each gpio to preserve power consumption (e.g
> embedded systems).

There's already device global control for this in sysfs via the power
framework - 

Also...

> +	else if (sysfs_streq(buf, "enable") || sysfs_streq(buf, "1"))
> +		status = enable_irq_wake(gpio_to_irq(gpio));
> +	else if (sysfs_streq(buf, "disable") || sysfs_streq(buf, "0"))
> +		status = disable_irq_wake(gpio_to_irq(gpio));
> +	else
> +		status = -EINVAL;

...this doesn't do anything to stop userspace doing multiple enables and
disables.

> +	if (gpio_irq_data)
> +		status = sprintf(buf, " Wakeup %s\n",
> +					irqd_is_wakeup_set(gpio_irq_data)
> +					? " enable" : "disable");

This is *really* non-idiomatic for sysfs output, you'd expect the sysfs
output to look like the input.  It's supposed to machine parsable...
--
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