Skip to content

Commit 381d43b

Browse files
floatiousdamien-lemoal
authored andcommitted
ata: libata-eh: Update DIPM comments to reflect reality
The comments describing which LPM policies that has DIPM enabled predates the introduction of the LPM policies ATA_LPM_MIN_POWER_WITH_PARTIAL and ATA_LPM_MED_POWER_WITH_DIPM. Update the DIPM comments to reflect reality. Also remove the sentence that claims that "Order device and link configurations such that the host always allows DIPM requests." This comment is written before 24e0e61 ("ata: libata: disallow dev-initiated LPM transitions to unsupported states"). Even though the set_lpm() call is done before enabling DIPM, the host will not always allow DIPM requests. For all LPM polcies where DIPM is enabled, only DIPM requests to LPM states that are supported by the HBA will be allowed. Signed-off-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent 3b0bca9 commit 381d43b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/ata/libata-eh.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,10 +3443,9 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
34433443
return 0;
34443444

34453445
/*
3446-
* DIPM is enabled only for MIN_POWER as some devices
3447-
* misbehave when the host NACKs transition to SLUMBER. Order
3448-
* device and link configurations such that the host always
3449-
* allows DIPM requests.
3446+
* DIPM is enabled only for ATA_LPM_MIN_POWER,
3447+
* ATA_LPM_MIN_POWER_WITH_PARTIAL, and ATA_LPM_MED_POWER_WITH_DIPM, as
3448+
* some devices misbehave when the host NACKs transition to SLUMBER.
34503449
*/
34513450
ata_for_each_dev(dev, link, ENABLED) {
34523451
bool hipm = ata_id_has_hipm(dev->id);
@@ -3505,7 +3504,11 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
35053504
if (ap && ap->slave_link)
35063505
ap->slave_link->lpm_policy = policy;
35073506

3508-
/* host config updated, enable DIPM if transitioning to MIN_POWER */
3507+
/*
3508+
* Host config updated, enable DIPM if transitioning to
3509+
* ATA_LPM_MIN_POWER, ATA_LPM_MIN_POWER_WITH_PARTIAL, or
3510+
* ATA_LPM_MED_POWER_WITH_DIPM.
3511+
*/
35093512
ata_for_each_dev(dev, link, ENABLED) {
35103513
if (policy >= ATA_LPM_MED_POWER_WITH_DIPM && !no_dipm &&
35113514
ata_id_has_dipm(dev->id)) {

0 commit comments

Comments
 (0)