From bca8df7d65bc90bf9ac9dab4c5d5079a71aeb61d Mon Sep 17 00:00:00 2001 From: Takeyoshi Kikuchi Date: Sat, 20 Jan 2024 13:28:16 +0900 Subject: [PATCH] arm: sama5: sam_ehci: fix transfer cancellation process. The logic of the conditional expression that determines whether the QH is a target QH or not is reversed in the process of canceling a transfer in INPROGRESS state. Therefore, the QH in INPROGRESS state is not released and subsequent communication is not successful. Checked with CDC-ACM driver and cu command. Signed-off-by: Takeyoshi Kikuchi --- arch/arm/src/sama5/sam_ehci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/sama5/sam_ehci.c b/arch/arm/src/sama5/sam_ehci.c index cc689589f3d..7331a0678f6 100644 --- a/arch/arm/src/sama5/sam_ehci.c +++ b/arch/arm/src/sama5/sam_ehci.c @@ -2719,7 +2719,7 @@ static int sam_qh_cancel(struct sam_qh_s *qh, uint32_t **bp, void *arg) /* Check if this is the QH that we are looking for */ - if (qh->epinfo == epinfo) + if (qh->epinfo != epinfo) { /* No... keep looking */ @@ -4441,7 +4441,7 @@ static int sam_cancel(struct usbhost_driver_s *drvr, usbhost_ep_t ep) * head. */ - if (qh && qh != &g_asynchead) + if (qh && qh == &g_asynchead) { /* Claim that we successfully cancelled the transfer */