summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-07-16 13:36:02 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-07-16 13:37:14 -0400
commit9c53fa1b0ad35c314c5b18775856032fb200bcbb (patch)
tree0c28331007fc7c44441d7bce782e7f10c221bbfa
parenta6f0044d4078cb6be44d271fb618e8d8e7ce5bb7 (diff)
downloadrockbox-9c53fa1b0a.tar.gz
rockbox-9c53fa1b0a.zip
pp5020: It's okay to use DMA reads on non-SSDs
Fixes a regression introduced in 4b423e21f697af Change-Id: Ief4a4a562840524b98ad5988999bac87586dec41
-rw-r--r--firmware/target/arm/pp/ata-pp5020.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/firmware/target/arm/pp/ata-pp5020.c b/firmware/target/arm/pp/ata-pp5020.c
index 176e74993c..f247a44171 100644
--- a/firmware/target/arm/pp/ata-pp5020.c
+++ b/firmware/target/arm/pp/ata-pp5020.c
@@ -175,11 +175,12 @@ bool ata_dma_setup(void *addr, unsigned long bytes, bool write) {
/* Writes only need to be word-aligned, but by default DMA
* is not used for writing on non-SSDs as it appears to be slower.
*/
- if (!ata_disk_isssd())
- return false;
-
- if (write && ((unsigned long)addr & 3))
- return false;
+ if (write) {
+ if ((unsigned long)addr & 3)
+ return false;
+ if (!ata_disk_isssd())
+ return false;
+ }
#if ATA_MAX_UDMA > 2
if (dma_needs_boost && !dma_boosted) {