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

Changed files
+10 -10
drivers
+7 -2
drivers/ata/libata-eh.c
··· 2075 2075 * Check if a link is established. This is a relaxed version of 2076 2076 * ata_phys_link_online() which accounts for the fact that this is potentially 2077 2077 * 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 2079 2079 * the PHY in partial, slumber or devsleep Partial power management state. 2080 2080 * So check that: 2081 2081 * - A device is still present, that is, DET is 1h (Device presence detected ··· 2089 2089 u32 sstatus; 2090 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 2097 if (sata_scr_read(link, SCR_STATUS, &sstatus)) 2093 - return false; 2098 + return true; 2094 2099 2095 2100 det = sstatus & 0x0f; 2096 2101 ipm = (sstatus >> 8) & 0x0f;
+3 -8
drivers/ata/libata-scsi.c
··· 3904 3904 /* Check cdl_ctrl */ 3905 3905 switch (buf[0] & 0x03) { 3906 3906 case 0: 3907 - /* Disable CDL if it is enabled */ 3908 - if (!(dev->flags & ATA_DFLAG_CDL_ENABLED)) 3909 - return 0; 3907 + /* Disable CDL */ 3910 3908 ata_dev_dbg(dev, "Disabling CDL\n"); 3911 3909 cdl_action = 0; 3912 3910 dev->flags &= ~ATA_DFLAG_CDL_ENABLED; 3913 3911 break; 3914 3912 case 0x02: 3915 3913 /* 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. 3919 3916 */ 3920 - if (dev->flags & ATA_DFLAG_CDL_ENABLED) 3921 - return 0; 3922 3917 if (dev->flags & ATA_DFLAG_NCQ_PRIO_ENABLED) { 3923 3918 ata_dev_err(dev, 3924 3919 "NCQ priority must be disabled to enable CDL\n");