aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-21 21:16:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-21 21:16:08 -0500
commitfbd918a2026d0464ce9c23f57b7de4bcfccdc2e6 (patch)
tree5450f3ae050870b48ad8612d0007eacf0b30d9c7 /drivers/ata/libata-scsi.c
parentf075e0f6993f41c72dbb1d3e7a2d7740f14e89e2 (diff)
parentb7db4f2e15603c394da56a0536a33669f4c87c4f (diff)
Merge branch 'for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
Pull libata updates from Tejun Heo: "Support for some new embedded controllers. A couple late (<= a week) fixes have stable cc'd and one patch ("SATA: MV: Add support for the optional PHYs") got committed yesterday because otherwise the resulting kernel would fail boot on an embedded board due to interdependent changes in its platform tree. Other than that, nothing too noteworthy" * 'for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: SATA: MV: Add support for the optional PHYs sata-highbank: Remove unnecessary ahci_platform.h include libata: disable LPM for some WD SATA-I devices ARM: mvebu: update the SATA compatible string for Armada 370/XP ata: sata_mv: fix disk hotplug for Armada 370/XP SoCs ata: sata_mv: introduce compatible string "marvell, armada-370-sata" ata: pata_samsung_cf: Remove unused macros ata: pata_samsung_cf: Use devm_ioremap_resource() ata: pata_samsung_cf: Merge pata_samsung_cf.h into pata_samsung_cf.c ata: pata_samsung_cf: Move plat/regs-ata.h to drivers/ata drivers: ata: Mark the function as static in libahci.c drivers: ata: Mark the function ahci_init_interrupts() as static in ahci.c ahci: imx: fix the error handling in imx_ahci_probe() ahci: imx: ahci_imx_softreset() can be static ahci: imx: Add i.MX53 support ahci: imx: Pull out the clock enable/disable calls libata, dt: Document sata_rcar bindings sata_rcar: Add R-Car Gen2 SATA PHY support ahci: mcp89: enter AHCI mode under Apple BIOS emulation ata: libata-eh: Remove unnecessary snprintf arithmetic
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 377eb889f555..ef8567de6a75 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -111,12 +111,14 @@ static const char *ata_lpm_policy_names[] = {
111 [ATA_LPM_MIN_POWER] = "min_power", 111 [ATA_LPM_MIN_POWER] = "min_power",
112}; 112};
113 113
114static ssize_t ata_scsi_lpm_store(struct device *dev, 114static ssize_t ata_scsi_lpm_store(struct device *device,
115 struct device_attribute *attr, 115 struct device_attribute *attr,
116 const char *buf, size_t count) 116 const char *buf, size_t count)
117{ 117{
118 struct Scsi_Host *shost = class_to_shost(dev); 118 struct Scsi_Host *shost = class_to_shost(device);
119 struct ata_port *ap = ata_shost_to_port(shost); 119 struct ata_port *ap = ata_shost_to_port(shost);
120 struct ata_link *link;
121 struct ata_device *dev;
120 enum ata_lpm_policy policy; 122 enum ata_lpm_policy policy;
121 unsigned long flags; 123 unsigned long flags;
122 124
@@ -132,10 +134,20 @@ static ssize_t ata_scsi_lpm_store(struct device *dev,
132 return -EINVAL; 134 return -EINVAL;
133 135
134 spin_lock_irqsave(ap->lock, flags); 136 spin_lock_irqsave(ap->lock, flags);
137
138 ata_for_each_link(link, ap, EDGE) {
139 ata_for_each_dev(dev, &ap->link, ENABLED) {
140 if (dev->horkage & ATA_HORKAGE_NOLPM) {
141 count = -EOPNOTSUPP;
142 goto out_unlock;
143 }
144 }
145 }
146
135 ap->target_lpm_policy = policy; 147 ap->target_lpm_policy = policy;
136 ata_port_schedule_eh(ap); 148 ata_port_schedule_eh(ap);
149out_unlock:
137 spin_unlock_irqrestore(ap->lock, flags); 150 spin_unlock_irqrestore(ap->lock, flags);
138
139 return count; 151 return count;
140} 152}
141 153