usb: cdnsp: Fixed setting last_trb incorrectly
authorJing Leng <jleng@ambarella.com>
Thu, 9 Jun 2022 02:11:34 +0000 (10:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jun 2022 12:22:03 +0000 (14:22 +0200)
commit492d82d5ffcda0b5348267d96f6c5074342ae86c
tree7df7e6f2f395dbe7a3c5ef36f01fce0c348b76c4
parent701d8ec01e0f229d4db6f43d3d64ee479120cbeb
usb: cdnsp: Fixed setting last_trb incorrectly

commit 5c7578c39c3fffe85b7d15ca1cf8cf7ac38ec0c1 upstream.

When ZLP occurs in bulk transmission, currently cdnsp will set last_trb
for the last two TRBs, it will trigger an error "ERROR Transfer event TRB
DMA ptr not part of current TD ...".

Fixes: e913aada0683 ("usb: cdnsp: Fixed issue with ZLP")
Cc: stable <stable@kernel.org>
Acked-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Jing Leng <jleng@ambarella.com>
Link: https://lore.kernel.org/r/20220609021134.1606-1-3090101217@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/cdns3/cdnsp-ring.c