History

Merge tag 'ata-ata-6.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux

Pull ata fixes from Damien Le Moal: - Fix a regression affecting old IDE/PATA device scan and introduced by the recent link power management cleanups & fixes. The regression prevented devices from being properly detected (me) - Fix command duration limits (CDL) feature control: attempting to enable the feature while NCQ commands are being executed resulted in a silent failure to enable CDL when needed (Igor) * tag 'ata-ata-6.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux: ata: libata-scsi: Fix CDL control ata: libata-eh: Fix link state check for IDE/PATA ports

Linus Torvalds committed 1 year ago

Commit 90d970c2 parents c5f3e78 58768b02 files · +10 −10Browse files

Unified · Split

2 files
  1. drivers/ata/libata-eh.c +7 −2
  2. drivers/ata/libata-scsi.c +3 −8
drivers/ata/libata-eh.c+7−2
@@ -2075,7 +2075,7 @@ out: · 2074 unmodified lines
20752075 * Check if a link is established. This is a relaxed version of
20762076 * ata_phys_link_online() which accounts for the fact that this is potentially
20772077 * called after changing the link power management policy, which may not be
2078− * reflected immediately in the SSTAUS register (e.g., we may still be seeing
2078+ * reflected immediately in the SStatus register (e.g., we may still be seeing
20792079 * the PHY in partial, slumber or devsleep Partial power management state.
20802080 * So check that:
20812081 * - A device is still present, that is, DET is 1h (Device presence detected
@@ -2089,8 +2089,13 @@ static bool ata_eh_link_established(struct ata_link *link) · 7 unmodified lines
20892089 u32 sstatus;
20902090 u8 det, ipm;
20912091
2092+ /*
2093+ * For old IDE/PATA adapters that do not have a valid scr_read method,
2094+ * or if reading the SStatus register fails, assume that the device is
2095+ * present. Device probe will determine if that is really the case.
2096+ */
20922097 if (sata_scr_read(link, SCR_STATUS, &sstatus))
2093− return false;
2098+ return true;
20942099
20952100 det = sstatus & 0x0f;
20962101 ipm = (sstatus >> 8) & 0x0f;
drivers/ata/libata-scsi.c+3−8
@@ -3904,21 +3904,16 @@ static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc, · 3903 unmodified lines
39043904 /* Check cdl_ctrl */
39053905 switch (buf[0] & 0x03) {
39063906 case 0:
3907− /* Disable CDL if it is enabled */
3908− if (!(dev->flags & ATA_DFLAG_CDL_ENABLED))
3909− return 0;
3907+ /* Disable CDL */
39103908 ata_dev_dbg(dev, "Disabling CDL\n");
39113909 cdl_action = 0;
39123910 dev->flags &= ~ATA_DFLAG_CDL_ENABLED;
39133911 break;
39143912 case 0x02:
39153913 /*
3916− * Enable CDL if not already enabled. Since this is mutually
3917− * exclusive with NCQ priority, allow this only if NCQ priority
3918− * is disabled.
3914+ * Enable CDL. Since CDL is mutually exclusive with NCQ
3915+ * priority, allow this only if NCQ priority is disabled.
39193916 */
3920− if (dev->flags & ATA_DFLAG_CDL_ENABLED)
3921− return 0;
39223917 if (dev->flags & ATA_DFLAG_NCQ_PRIO_ENABLED) {
39233918 ata_dev_err(dev,
39243919 "NCQ priority must be disabled to enable CDL\n");