This is an automated email from Gerrit.

"Tomas Vanek <van...@fbl.cz>" just uploaded a new patch set to Gerrit, which 
you can find at https://review.openocd.org/c/openocd/+/8640

-- gerrit

commit bd37a7ac4983ec41d319df3da0aa3cba45599d7f
Author: Tomas Vanek <van...@fbl.cz>
Date:   Tue Dec 10 08:53:49 2024 +0100

    drivers/cmsis_dap_usb_bulk: allow waiting for bulk write
    
    No driver directly working with the USB hardware needs additional
    time to complete the write op, they always return transfer complete
    status immediately after submitting the transfer.
    
    Although there is implemented correct waiting path in cmsis_dap_usb_write()
    it was marked by error logs to catch any suspicious behaviour during
    debugging of asynchronous libusb transfers.
    
    However there are drivers which need waiting to finish write op:
    at least usbipd-win, IP tunnelled USB driver, was reported
    to flood the log with the related errors.
    
    Change LOG_ERROR to LOG_DEBUG_IO in the code waiting to finish write op.
    
    Reported-by: Quentis Ghyll <quenti...@gmail.com>
    Signed-off-by: Tomas Vanek <van...@fbl.cz>
    Change-Id: Iedf2c96d851f22e694efaf13a2d6a2a408cee1ad

diff --git a/src/jtag/drivers/cmsis_dap_usb_bulk.c 
b/src/jtag/drivers/cmsis_dap_usb_bulk.c
index 50d4a9f8d3..8fbcb029dd 100644
--- a/src/jtag/drivers/cmsis_dap_usb_bulk.c
+++ b/src/jtag/drivers/cmsis_dap_usb_bulk.c
@@ -532,7 +532,7 @@ static int cmsis_dap_usb_write(struct cmsis_dap *dap, int 
txlen, int timeout_ms)
        tr = &dap->bdata->command_transfers[dap->pending_fifo_put_idx];
 
        if (tr->status == CMSIS_DAP_TRANSFER_PENDING) {
-               LOG_ERROR("busy command USB transfer at %u", 
dap->pending_fifo_put_idx);
+               LOG_DEBUG_IO("busy command USB transfer at %u", 
dap->pending_fifo_put_idx);
                struct timeval tv = {
                        .tv_sec = timeout_ms / 1000,
                        .tv_usec = timeout_ms % 1000 * 1000
@@ -547,7 +547,7 @@ static int cmsis_dap_usb_write(struct cmsis_dap *dap, int 
txlen, int timeout_ms)
                tr->status = CMSIS_DAP_TRANSFER_IDLE;
        }
        if (tr->status == CMSIS_DAP_TRANSFER_COMPLETED) {
-               LOG_ERROR("USB write: late transfer competed");
+               LOG_DEBUG_IO("USB write: late transfer competed");
                tr->status = CMSIS_DAP_TRANSFER_IDLE;
        }
        if (tr->status != CMSIS_DAP_TRANSFER_IDLE) {

-- 

Reply via email to