summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-06-14 10:52:13 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-06-14 10:56:23 -0400
commitae25a425b6dc1689f35afd77e8064912e4b30a60 (patch)
treec51be49957f0fe7daadda1427febcd040df5e4d3 /firmware/drivers/ata.c
parentde4a08f3190eb3eb912e6d1dfbd46afe59d62555 (diff)
downloadrockbox-ae25a425b6dc1689f35afd77e8064912e4b30a60.tar.gz
rockbox-ae25a425b6dc1689f35afd77e8064912e4b30a60.zip
ATA: Fix regression when trying to set power management mode with CF cards
Some CF cards claim to support Advanced Power Management, but error out when the command is issued. There is a special case in the code that ignored errors when issuing the APM command, but was referenced against a specific index in the feature table. When the tagle was reorganized, the index was wrong depending on if ATA_DMA was enabled or not. The fix is to test against the specific subcommand ID instead of the table index. Change-Id: I2ef7a05b2d70675c38e41d70b5189b394056cb74
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r--firmware/drivers/ata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index bb87357a1a..b245cbc09e 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -1151,7 +1151,7 @@ static int set_features(void)
1151 return -10 - i; 1151 return -10 - i;
1152 } 1152 }
1153 1153
1154 if((ATA_IN8(ATA_ALT_STATUS) & STATUS_ERR) && (i != 1)) { 1154 if((ATA_IN8(ATA_ALT_STATUS) & STATUS_ERR) && (features[i].subcommand != 0x05)) {
1155 /* some CF cards don't like advanced powermanagement 1155 /* some CF cards don't like advanced powermanagement
1156 even if they mark it as supported - go figure... */ 1156 even if they mark it as supported - go figure... */
1157 if(ATA_IN8(ATA_ERROR) & ERROR_ABRT) { 1157 if(ATA_IN8(ATA_ERROR) & ERROR_ABRT) {