FAILED: patch "[PATCH] usb: cdns3: Fix issue for clear halt endpoint" failed to apply to 5.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b3fa25de31fb7e9afebe9599b8ff32eda13d7c94 Mon Sep 17 00:00:00 2001
From: Pawel Laszczak <[email protected]>
Date: Tue, 29 Mar 2022 10:46:05 +0200
Subject: [PATCH] usb: cdns3: Fix issue for clear halt endpoint
Path fixes bug which occurs during resetting endpoint in __cdns3_gadget_ep_clear_halt function. During resetting endpoint controller will change HW/DMA owned TRB. It set Abort flag in trb->control and will change trb->length field. If driver want to use the aborted trb it must update the changed field in TRB.
drivers/usb/cdns3/cdns3-gadget.c +5 -2
@@ -2684,6 +2684,7 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)struct usb_request *request;struct cdns3_request *priv_req;struct cdns3_trb *trb =NULL ; +struct cdns3_trb trb_tmp;int ret;int val;
@@ -2693,8 +2694,10 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)if (request) { priv_req =to_cdns3_request (request); trb = priv_req->trb; -if (trb) +if (trb) { + trb_tmp = *trb; trb->control = trb->control ^cpu_to_le32 (TRB_CYCLE ); + } }writel (EP_CMD_CSTALL |EP_CMD_EPRST , &priv_dev->regs->ep_cmd);
@@ -2709,7 +2712,7 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)if (request) {if (trb) - trb->control = trb->control ^cpu_to_le32 (TRB_CYCLE ); + *trb = trb_tmp;cdns3_rearm_transfer (priv_ep,1 ); }