pp5020: ata: do not yield in ata_wait_intrq()

Confirmed on iFlash-modded ipodvideo, USB mass storage connections
frequently fail with bus resets during mount on macOS, and trigger
"reset high-speed USB device" errors on Linux during sequential
reads.

The root cause is: storage_read_sectors() calls yield() via
ata_wait_intrq(), which switches to the main thread running
handle_usb_events() loop. This calls send_event(GUI_EVENT_ACTIONUPDATE),
triggering LCD redraw that takes approximately 110ms. This stalls the
ATA DMA completion, causing the USB bulk transfer to time out from the
host's perspective.

This commit removes the yield to prevent the reading thread from being
preempted by the lengthy LCD redraw during DMA completion.

This also improves sequential read throughput from ~13MB/s to ~18MB/s.

Change-Id: Ia552f97aa0169c93c4f21e250d13dc3a626661d4
This commit is contained in:
mojyack 2026-03-04 10:24:19 +09:00
parent f68bfadb56
commit e13befb925

View file

@ -154,7 +154,6 @@ static ICODE_ATTR int ata_wait_intrq(void)
if (IDE0_CFG & IDE_CFG_INTRQ)
return 1;
ata_keep_active();
yield();
} while (TIME_BEFORE(current_tick, timeout));
return 0; /* timeout */