Skip to content

Commit 90d970c

Browse files
committed
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
2 parents c5f3e78 + 58768b0 commit 90d970c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

drivers/ata/libata-eh.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,7 @@ static void ata_eh_get_success_sense(struct ata_link *link)
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)
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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3904,21 +3904,16 @@ static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc,
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");

0 commit comments

Comments
 (0)