aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-09-01 11:50:06 -0400
committerJeff Garzik <jgarzik@redhat.com>2010-10-21 20:21:04 -0400
commit6b7ae9545ad9875a289f4191c0216b473e313cb9 (patch)
tree216b4db276202d727ba134d256144a6670497180 /drivers/ata/ahci.c
parent1152b2617a6e1943b6b82e07c962950e56f1000c (diff)
libata: reimplement link power management
The current LPM implementation has the following issues. * Operation order isn't well thought-out. e.g. HIPM should be configured after IPM in SControl is properly configured. Not the other way around. * Suspend/resume paths call ata_lpm_enable/disable() which must only be called from EH context directly. Also, ata_lpm_enable/disable() were called whether LPM was in use or not. * Implementation is per-port when it should be per-link. As a result, it can't be used for controllers with slave links or PMP. * LPM state isn't managed consistently. After a link reset for whatever reason including suspend/resume the actual LPM state would be reset leaving ap->lpm_policy inconsistent. * Generic/driver-specific logic boundary isn't clear. Currently, libahci has to mangle stuff which libata EH proper should be handling. This makes the implementation unnecessarily complex and fragile. * Tied to ALPM. Doesn't consider DIPM only cases and doesn't check whether the device allows HIPM. * Error handling isn't implemented. Given the extent of mismatch with the rest of libata, I don't think trying to fix it piecewise makes much sense. This patch reimplements LPM support. * The new implementation is per-link. The target policy is still port-wide (ap->target_lpm_policy) but all the mechanisms and states are per-link and integrate well with the rest of link abstraction and can work with slave and PMP links. * Core EH has proper control of LPM state. LPM state is reconfigured when and only when reconfiguration is necessary. It makes sure that LPM state is reset when probing for new device on the link. Controller agnostic logic is now implemented in libata EH proper and driver implementation only has to deal with controller specifics. * Proper error handling. LPM config failure is attributed to the device on the link and LPM is disabled for the link if it fails repeatedly. * ops->enable/disable_pm() are replaced with single ops->set_lpm() which takes @policy and @hints. This simplifies driver specific implementation. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 68f7b4216501..328826381a2d 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1208,9 +1208,6 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1208 ata_port_pbar_desc(ap, AHCI_PCI_BAR, 1208 ata_port_pbar_desc(ap, AHCI_PCI_BAR,
1209 0x100 + ap->port_no * 0x80, "port"); 1209 0x100 + ap->port_no * 0x80, "port");
1210 1210
1211 /* set initial link pm policy */
1212 ap->lpm_policy = ATA_LPM_UNKNOWN;
1213
1214 /* set enclosure management message type */ 1211 /* set enclosure management message type */
1215 if (ap->flags & ATA_FLAG_EM) 1212 if (ap->flags & ATA_FLAG_EM)
1216 ap->em_message_type = hpriv->em_msg_type; 1213 ap->em_message_type = hpriv->em_msg_type;