pp5020: ata: do not yield in ata_wait_intrq()

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit e13befb9258391056891b332955ca01e1714c834
Author: mojyack <[email protected]>
Date:   Wed Mar 4 10:24:19 2026 +0900

    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

diff --git a/firmware/target/arm/pp/ata-pp5020.c b/firmware/target/arm/pp/ata-pp5020.c
index 7351215693..3850f34fb1 100644
--- a/firmware/target/arm/pp/ata-pp5020.c
+++ b/firmware/target/arm/pp/ata-pp5020.c
@@ -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 */
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.