summaryrefslogtreecommitdiffstats
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
parentde4a08f3190eb3eb912e6d1dfbd46afe59d62555 (diff)
downloadrockbox-ae25a425b6.tar.gz
rockbox-ae25a425b6.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
-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)
return -10 - i;
}
- if((ATA_IN8(ATA_ALT_STATUS) & STATUS_ERR) && (i != 1)) {
+ if((ATA_IN8(ATA_ALT_STATUS) & STATUS_ERR) && (features[i].subcommand != 0x05)) {
/* some CF cards don't like advanced powermanagement
even if they mark it as supported - go figure... */
if(ATA_IN8(ATA_ERROR) & ERROR_ABRT) {