@@ -1030,7 +1030,7 @@ const char *sata_spd_string(unsigned int spd)
10301030 return spd_str [spd - 1 ];
10311031}
10321032
1033- static int ata_dev_set_dipm (struct ata_device * dev , enum link_pm policy )
1033+ static int ata_dev_set_dipm (struct ata_device * dev , enum ata_lpm_policy policy )
10341034{
10351035 struct ata_link * link = dev -> link ;
10361036 struct ata_port * ap = link -> ap ;
@@ -1040,14 +1040,14 @@ static int ata_dev_set_dipm(struct ata_device *dev, enum link_pm policy)
10401040
10411041 /*
10421042 * disallow DIPM for drivers which haven't set
1043- * ATA_FLAG_IPM . This is because when DIPM is enabled,
1043+ * ATA_FLAG_LPM . This is because when DIPM is enabled,
10441044 * phy ready will be set in the interrupt status on
10451045 * state changes, which will cause some drivers to
10461046 * think there are errors - additionally drivers will
10471047 * need to disable hot plug.
10481048 */
1049- if (!(ap -> flags & ATA_FLAG_IPM ) || !ata_dev_enabled (dev )) {
1050- ap -> pm_policy = NOT_AVAILABLE ;
1049+ if (!(ap -> flags & ATA_FLAG_LPM ) || !ata_dev_enabled (dev )) {
1050+ ap -> lpm_policy = ATA_LPM_UNKNOWN ;
10511051 return - EINVAL ;
10521052 }
10531053
@@ -1066,8 +1066,8 @@ static int ata_dev_set_dipm(struct ata_device *dev, enum link_pm policy)
10661066 return rc ;
10671067
10681068 switch (policy ) {
1069- case MIN_POWER :
1070- /* no restrictions on IPM transitions */
1069+ case ATA_LPM_MIN_POWER :
1070+ /* no restrictions on LPM transitions */
10711071 scontrol &= ~(0x3 << 8 );
10721072 rc = sata_scr_write (link , SCR_CONTROL , scontrol );
10731073 if (rc )
@@ -1078,30 +1078,30 @@ static int ata_dev_set_dipm(struct ata_device *dev, enum link_pm policy)
10781078 err_mask = ata_dev_set_feature (dev ,
10791079 SETFEATURES_SATA_ENABLE , SATA_DIPM );
10801080 break ;
1081- case MEDIUM_POWER :
1082- /* allow IPM to PARTIAL */
1081+ case ATA_LPM_MED_POWER :
1082+ /* allow LPM to PARTIAL */
10831083 scontrol &= ~(0x1 << 8 );
10841084 scontrol |= (0x2 << 8 );
10851085 rc = sata_scr_write (link , SCR_CONTROL , scontrol );
10861086 if (rc )
10871087 return rc ;
10881088
10891089 /*
1090- * we don't have to disable DIPM since IPM flags
1090+ * we don't have to disable DIPM since LPM flags
10911091 * disallow transitions to SLUMBER, which effectively
10921092 * disable DIPM if it does not support PARTIAL
10931093 */
10941094 break ;
1095- case NOT_AVAILABLE :
1096- case MAX_PERFORMANCE :
1097- /* disable all IPM transitions */
1095+ case ATA_LPM_UNKNOWN :
1096+ case ATA_LPM_MAX_POWER :
1097+ /* disable all LPM transitions */
10981098 scontrol |= (0x3 << 8 );
10991099 rc = sata_scr_write (link , SCR_CONTROL , scontrol );
11001100 if (rc )
11011101 return rc ;
11021102
11031103 /*
1104- * we don't have to disable DIPM since IPM flags
1104+ * we don't have to disable DIPM since LPM flags
11051105 * disallow all transitions which effectively
11061106 * disable DIPM anyway.
11071107 */
@@ -1125,9 +1125,9 @@ static int ata_dev_set_dipm(struct ata_device *dev, enum link_pm policy)
11251125 * enabling Host Initiated Power management.
11261126 *
11271127 * Locking: Caller.
1128- * Returns: -EINVAL if IPM is not supported, 0 otherwise.
1128+ * Returns: -EINVAL if LPM is not supported, 0 otherwise.
11291129 */
1130- void ata_dev_enable_pm (struct ata_device * dev , enum link_pm policy )
1130+ void ata_dev_enable_pm (struct ata_device * dev , enum ata_lpm_policy policy )
11311131{
11321132 int rc = 0 ;
11331133 struct ata_port * ap = dev -> link -> ap ;
@@ -1141,9 +1141,9 @@ void ata_dev_enable_pm(struct ata_device *dev, enum link_pm policy)
11411141
11421142enable_pm_out :
11431143 if (rc )
1144- ap -> pm_policy = MAX_PERFORMANCE ;
1144+ ap -> lpm_policy = ATA_LPM_MAX_POWER ;
11451145 else
1146- ap -> pm_policy = policy ;
1146+ ap -> lpm_policy = policy ;
11471147 return /* rc */ ; /* hopefully we can use 'rc' eventually */
11481148}
11491149
@@ -1164,15 +1164,15 @@ static void ata_dev_disable_pm(struct ata_device *dev)
11641164{
11651165 struct ata_port * ap = dev -> link -> ap ;
11661166
1167- ata_dev_set_dipm (dev , MAX_PERFORMANCE );
1167+ ata_dev_set_dipm (dev , ATA_LPM_MAX_POWER );
11681168 if (ap -> ops -> disable_pm )
11691169 ap -> ops -> disable_pm (ap );
11701170}
11711171#endif /* CONFIG_PM */
11721172
1173- void ata_lpm_schedule (struct ata_port * ap , enum link_pm policy )
1173+ void ata_lpm_schedule (struct ata_port * ap , enum ata_lpm_policy policy )
11741174{
1175- ap -> pm_policy = policy ;
1175+ ap -> lpm_policy = policy ;
11761176 ap -> link .eh_info .action |= ATA_EH_LPM ;
11771177 ap -> link .eh_info .flags |= ATA_EHI_NO_AUTOPSY ;
11781178 ata_port_schedule_eh (ap );
@@ -1201,7 +1201,7 @@ static void ata_lpm_disable(struct ata_host *host)
12011201
12021202 for (i = 0 ; i < host -> n_ports ; i ++ ) {
12031203 struct ata_port * ap = host -> ports [i ];
1204- ata_lpm_schedule (ap , ap -> pm_policy );
1204+ ata_lpm_schedule (ap , ap -> lpm_policy );
12051205 }
12061206}
12071207#endif /* CONFIG_PM */
@@ -2564,7 +2564,7 @@ int ata_dev_configure(struct ata_device *dev)
25642564 if (dev -> flags & ATA_DFLAG_LBA48 )
25652565 dev -> max_sectors = ATA_MAX_SECTORS_LBA48 ;
25662566
2567- if (!(dev -> horkage & ATA_HORKAGE_IPM )) {
2567+ if (!(dev -> horkage & ATA_HORKAGE_LPM )) {
25682568 if (ata_id_has_hipm (dev -> id ))
25692569 dev -> flags |= ATA_DFLAG_HIPM ;
25702570 if (ata_id_has_dipm (dev -> id ))
@@ -2591,11 +2591,11 @@ int ata_dev_configure(struct ata_device *dev)
25912591 dev -> max_sectors = min_t (unsigned int , ATA_MAX_SECTORS_128 ,
25922592 dev -> max_sectors );
25932593
2594- if (ata_dev_blacklisted (dev ) & ATA_HORKAGE_IPM ) {
2595- dev -> horkage |= ATA_HORKAGE_IPM ;
2594+ if (ata_dev_blacklisted (dev ) & ATA_HORKAGE_LPM ) {
2595+ dev -> horkage |= ATA_HORKAGE_LPM ;
25962596
25972597 /* reset link pm_policy for this port to no pm */
2598- ap -> pm_policy = MAX_PERFORMANCE ;
2598+ ap -> lpm_policy = ATA_LPM_MAX_POWER ;
25992599 }
26002600
26012601 if (ap -> ops -> dev_config )
0 commit comments