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:	Fri, 4 May 2012 23:00:33 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	Huang Ying <ying.huang@...el.com>, ming.m.lin@...el.com,
	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
	Zheng Yan <zheng.z.yan@...el.com>,
	Lan Tianyu <tianyu.lan@...el.com>
Subject: Re: [RFC v2 2/5] PM, Add sysfs file power_off to control device power off policy

On Friday, May 04, 2012, Bjorn Helgaas wrote:
> On Fri, May 4, 2012 at 2:13 AM, Huang Ying <ying.huang@...el.com> wrote:
> > From: Lan Tianyu <tianyu.lan@...el.com>
> >
> > Some devices can be powered off to save more power via some platform
> > mechanism, e.g., ACPI.  But that may not work as expected for some
> > device or platform.  So, this patch adds a sysfs file named power_off
> > under <device>/power directory to provide a mechanism for user to control
> > whether to allow the device to be power off.
> >
> > power_off => "enabled" means allowing the device to be powered off if
> > possible.
> >
> > power_off => "disabled" means the device must be power on anytime.
> >
> > Also add flag power_off_user to struct dev_pm_info to record users'
> > choice. The bus layer can use this field to determine whether to
> > power off the device.
> 
> My first thought was that writing to "power_off" would actually turn
> the power off, which isn't true.  Maybe something like
> "poweroff_allowed" would work.
> 
> I think there's only one use of this new field, in
> pci_pm_runtime_suspend().  Maybe you could pull out that hunk from
> patch 5, combine it with this one, and move it to after patch 5?

Well, please see my comment.

First, it doesn't make sense to export a sysfs file to control a feature that
the given device doesn't have.

Second, if such a file is exported _at_ _this_ _level_, the sysfs setting
should affect every situation in which power may be removed from devices, not
just the PCIe D3cold damned thing.

If this is going to be PCIe-specific, the flag should go into struct pci_dev,
and the sysfs file accordingly.

Thanks,
Rafael
--
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