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
2075 * Check if a link is established. This is a relaxed version of2075 * Check if a link is established. This is a relaxed version of
2076 * ata_phys_link_online() which accounts for the fact that this is potentially2076 * ata_phys_link_online() which accounts for the fact that this is potentially
2077 * called after changing the link power management policy, which may not be2077 * 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 seeing2078 * reflected immediately in the SStatus register (e.g., we may still be seeing
2079 * the PHY in partial, slumber or devsleep Partial power management state.2079 * the PHY in partial, slumber or devsleep Partial power management state.
2080 * So check that:2080 * So check that:
2081 * - A device is still present, that is, DET is 1h (Device presence detected2081 * - 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
2089 u32 sstatus;2089 u32 sstatus;
2090 u8 det, ipm;2090 u8 det, ipm;
2091 2091
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 */
2092 if (sata_scr_read(link, SCR_STATUS, &sstatus))2097 if (sata_scr_read(link, SCR_STATUS, &sstatus))
2093 return false;2098 return true;
2094 2099
2095 det = sstatus & 0x0f;2100 det = sstatus & 0x0f;
2096 ipm = (sstatus >> 8) & 0x0f;2101 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
3904 /* Check cdl_ctrl */3904 /* Check cdl_ctrl */
3905 switch (buf[0] & 0x03) {3905 switch (buf[0] & 0x03) {
3906 case 0:3906 case 0:
3907 /* Disable CDL if it is enabled */3907 /* Disable CDL */
3908 if (!(dev->flags & ATA_DFLAG_CDL_ENABLED))
3909 return 0;
3910 ata_dev_dbg(dev, "Disabling CDL\n");3908 ata_dev_dbg(dev, "Disabling CDL\n");
3911 cdl_action = 0;3909 cdl_action = 0;
3912 dev->flags &= ~ATA_DFLAG_CDL_ENABLED;3910 dev->flags &= ~ATA_DFLAG_CDL_ENABLED;
3913 break;3911 break;
3914 case 0x02:3912 case 0x02:
3915 /*3913 /*
3916 * Enable CDL if not already enabled. Since this is mutually3914 * Enable CDL. Since CDL is mutually exclusive with NCQ
3917 * exclusive with NCQ priority, allow this only if NCQ priority3915 * priority, allow this only if NCQ priority is disabled.
3918 * is disabled.
3919 */3916 */
3920 if (dev->flags & ATA_DFLAG_CDL_ENABLED)
3921 return 0;
3922 if (dev->flags & ATA_DFLAG_NCQ_PRIO_ENABLED) {3917 if (dev->flags & ATA_DFLAG_NCQ_PRIO_ENABLED) {
3923 ata_dev_err(dev,3918 ata_dev_err(dev,
3924 "NCQ priority must be disabled to enable CDL\n");3919 "NCQ priority must be disabled to enable CDL\n");