Commit 73c9007d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 24d479d2 c8c6fb88
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -2094,13 +2094,13 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
		if (ap->flags & ATA_FLAG_EM)
			ap->em_message_type = hpriv->em_msg_type;

		ahci_mark_external_port(ap);

		ahci_update_initial_lpm_policy(ap);

		/* disabled/not-implemented port */
		if (!(hpriv->port_map & (1 << i)))
		if (!(hpriv->port_map & (1 << i))) {
			ap->ops = &ata_dummy_port_ops;
		} else {
			ahci_mark_external_port(ap);
			ahci_update_initial_lpm_policy(ap);
		}
	}

	/* apply workaround for ASUS P5W DH Deluxe mainboard */
+7 −1
Original line number Diff line number Diff line
@@ -2872,7 +2872,8 @@ static void ata_dev_config_lpm(struct ata_device *dev)

static void ata_dev_print_features(struct ata_device *dev)
{
	if (!(dev->flags & ATA_DFLAG_FEATURES_MASK))
	if (!(dev->flags & ATA_DFLAG_FEATURES_MASK) && !dev->cpr_log &&
	    !ata_id_has_hipm(dev->id) && !ata_id_has_dipm(dev->id))
		return;

	ata_dev_info(dev,
@@ -3116,6 +3117,11 @@ int ata_dev_configure(struct ata_device *dev)
				     ata_mode_string(xfer_mask),
				     cdb_intr_string, atapi_an_string,
				     dma_dir_string);

		ata_dev_config_lpm(dev);

		if (print_info)
			ata_dev_print_features(dev);
	}

	/* determine max_sectors */
+1 −1
Original line number Diff line number Diff line
@@ -909,7 +909,7 @@ static bool ata_scsi_lpm_supported(struct ata_port *ap)
	struct ata_link *link;
	struct ata_device *dev;

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

	ata_for_each_link(link, ap, EDGE) {