From edbb05368d3272f8ded2d0750bb24c595031e7b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 27 Nov 2024 11:37:35 +0100 Subject: [PATCH] drivers: udc_dwc2: Queue next packet on incomplete iso IN interrupt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When handling incomplete iso IN interrupt mark current transfer as complete and program the endpoint with any subsequently queued packet. Program the endpoint directly in interrupt handler because the data must be programmed before SOF (by the time incomplete iso IN interrupt is raised there is less than 20% * 125 us = 25 us before SOF). Signed-off-by: Tomasz Moń --- drivers/usb/udc/udc_dwc2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 2ecf230baafa2c..da9faf22fa4d0a 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -2572,7 +2572,11 @@ static void dwc2_handle_incompisoin(const struct device *dev) buf = udc_buf_get(dev, cfg->addr); if (buf) { + /* Data is no longer relevant */ udc_submit_ep_event(dev, buf, 0); + + /* Try to queue next packet before SOF */ + dwc2_handle_xfer_next(dev, cfg); } } }