pp5020: It's okay to use DMA reads on non-SSDs

Fixes a regression introduced in 4b423e21f6

Change-Id: Ief4a4a562840524b98ad5988999bac87586dec41
This commit is contained in:
Solomon Peachy 2024-07-16 13:36:02 -04:00
parent a6f0044d40
commit 9c53fa1b0a

View file

@ -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 /* 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. * is not used for writing on non-SSDs as it appears to be slower.
*/ */
if (!ata_disk_isssd()) if (write) {
return false; if ((unsigned long)addr & 3)
return false;
if (write && ((unsigned long)addr & 3)) if (!ata_disk_isssd())
return false; return false;
}
#if ATA_MAX_UDMA > 2 #if ATA_MAX_UDMA > 2
if (dma_needs_boost && !dma_boosted) { if (dma_needs_boost && !dma_boosted) {