Skip to content

Commit 73c9007

Browse files
committed
Merge tag 'ata-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux
Pull ata fixes from Damien Le Moal: - A set of fixes for link power management as the recent changes/fixes introduced regressions with ATAPI devices and with adapters that have DUMMY ports, preventing an adapter to fully reach a low power state and thus preventing the system CPU from reaching low power C-states (from Niklas) * tag 'ata-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux: ata: libata: Print features also for ATAPI devices ata: libata: Add DIPM and HIPM to ata_dev_print_features() early return ata: libata: Add cpr_log to ata_dev_print_features() early return ata: libata-sata: Improve link_power_management_supported sysfs attribute ata: libata: Call ata_dev_config_lpm() for ATAPI devices ata: ahci: Do not read the per port area for unimplemented ports
2 parents 24d479d + c8c6fb8 commit 73c9007

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

drivers/ata/ahci.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,13 +2094,13 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
20942094
if (ap->flags & ATA_FLAG_EM)
20952095
ap->em_message_type = hpriv->em_msg_type;
20962096

2097-
ahci_mark_external_port(ap);
2098-
2099-
ahci_update_initial_lpm_policy(ap);
2100-
21012097
/* disabled/not-implemented port */
2102-
if (!(hpriv->port_map & (1 << i)))
2098+
if (!(hpriv->port_map & (1 << i))) {
21032099
ap->ops = &ata_dummy_port_ops;
2100+
} else {
2101+
ahci_mark_external_port(ap);
2102+
ahci_update_initial_lpm_policy(ap);
2103+
}
21042104
}
21052105

21062106
/* apply workaround for ASUS P5W DH Deluxe mainboard */

drivers/ata/libata-core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2872,7 +2872,8 @@ static void ata_dev_config_lpm(struct ata_device *dev)
28722872

28732873
static void ata_dev_print_features(struct ata_device *dev)
28742874
{
2875-
if (!(dev->flags & ATA_DFLAG_FEATURES_MASK))
2875+
if (!(dev->flags & ATA_DFLAG_FEATURES_MASK) && !dev->cpr_log &&
2876+
!ata_id_has_hipm(dev->id) && !ata_id_has_dipm(dev->id))
28762877
return;
28772878

28782879
ata_dev_info(dev,
@@ -3116,6 +3117,11 @@ int ata_dev_configure(struct ata_device *dev)
31163117
ata_mode_string(xfer_mask),
31173118
cdb_intr_string, atapi_an_string,
31183119
dma_dir_string);
3120+
3121+
ata_dev_config_lpm(dev);
3122+
3123+
if (print_info)
3124+
ata_dev_print_features(dev);
31193125
}
31203126

31213127
/* determine max_sectors */

drivers/ata/libata-sata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ static bool ata_scsi_lpm_supported(struct ata_port *ap)
909909
struct ata_link *link;
910910
struct ata_device *dev;
911911

912-
if (ap->flags & ATA_FLAG_NO_LPM)
912+
if ((ap->flags & ATA_FLAG_NO_LPM) || !ap->ops->set_lpm)
913913
return false;
914914

915915
ata_for_each_link(link, ap, EDGE) {

0 commit comments

Comments
 (0)