MLK-23809-2 usb: cdns3: gadget: delete useless parameter 'is_short'
In cdns3_transfer_completed, it uses is_short to judge if current request is short transfer to calculate req->actual correctly, but is_short variable may for previous transfer, it causes req->actual calculation wrong for current transfer. Eg, the previous transfer is non-short tranfer, and the current one is short transfer, the req->actual will accumulate the non-transfered TRB's length. In fact, below condition already stands for short trasnfer for scatter list: if (priv_req->num_of_trb > 1 && le32_to_cpu(trb->control) & TRB_SMM) So we could (need) to delete the parameter 'is_short' Reviewed-by: Jun Li <jun.li@nxp.com> Reported-by: Faqiang Zhu <faqiang.zhu@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
5435fea4a1
commit
bf26d9822c
|
@ -928,8 +928,7 @@ finish:
|
|||
}
|
||||
|
||||
static void cdns3_transfer_completed(struct cdns3_device *priv_dev,
|
||||
struct cdns3_endpoint *priv_ep,
|
||||
bool is_short)
|
||||
struct cdns3_endpoint *priv_ep)
|
||||
{
|
||||
struct cdns3_request *priv_req;
|
||||
struct usb_request *request;
|
||||
|
@ -965,7 +964,7 @@ static void cdns3_transfer_completed(struct cdns3_device *priv_dev,
|
|||
request->actual +=
|
||||
TRB_LEN(le32_to_cpu(trb->length));
|
||||
|
||||
if (is_short && priv_req->num_of_trb > 1 &&
|
||||
if (priv_req->num_of_trb > 1 &&
|
||||
le32_to_cpu(trb->control) & TRB_SMM)
|
||||
transfer_end = true;
|
||||
|
||||
|
@ -1083,7 +1082,7 @@ static int cdns3_check_ep_interrupt_proceed(struct cdns3_endpoint *priv_ep)
|
|||
*/
|
||||
if (priv_ep->type == USB_ENDPOINT_XFER_ISOC &&
|
||||
!priv_ep->wa1_set)
|
||||
cdns3_transfer_completed(priv_dev, priv_ep, false);
|
||||
cdns3_transfer_completed(priv_dev, priv_ep);
|
||||
else
|
||||
cdns3_rearm_transfer(priv_ep, priv_ep->wa1_set);
|
||||
}
|
||||
|
@ -1098,7 +1097,7 @@ static int cdns3_check_ep_interrupt_proceed(struct cdns3_endpoint *priv_ep)
|
|||
priv_ep->flags &= ~EP_QUIRK_END_TRANSFER;
|
||||
}
|
||||
|
||||
cdns3_transfer_completed(priv_dev, priv_ep, is_short);
|
||||
cdns3_transfer_completed(priv_dev, priv_ep);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue