Patchwork [v10,07/10] libata: expose pm qos flags to user space for ata device

login
register
mail settings
Submitter Aaron Lu
Date Nov. 21, 2012, 11:50 a.m.
Message ID <1353498639-27631-8-git-send-email-aaron.lu@intel.com>
Download mbox | patch
Permalink /patch/200658/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Aaron Lu - Nov. 21, 2012, 11:50 a.m.
Expose pm qos flags to user space so that user has a chance to disable
pm features like power off, if he/she has a broken platform or devices
or simply does not like this pm feature.

This flag is exposed to user space only for ata device or atapi device
that is zero power capable. For normal atapi device, it will never be
powered off.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
---
 drivers/ata/libata-acpi.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 3a82177..27a84de 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -1025,6 +1025,8 @@  void ata_acpi_bind(struct ata_device *dev)
 	ata_acpi_register_power_resource(dev);
 	dev_pm_qos_add_request(&dev->sdev->sdev_gendev, &dev->pm_qos_req,
 			       DEV_PM_QOS_FLAGS, value);
+	if (dev->class == ATA_DEV_ATA || zpodd_dev_enabled(dev))
+		dev_pm_qos_expose_flags(&dev->sdev->sdev_gendev, 0);
 }
 
 void ata_acpi_unbind(struct ata_device *dev)