Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: host: fotg210: fix the actual_length of an iso packet

We should acquire the actual_length of an iso packet
from the iTD directly using FOTG210_ITD_LENGTH() macro.

Signed-off-by: Kelly Devilliv <kelly.devilliv@gmail.com>
Link: https://lore.kernel.org/r/20210627125747.127646-4-kelly.devilliv@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Kelly Devilliv and committed by
Greg Kroah-Hartman
091cb2f7 c2e89876

+2 -8
+2 -3
drivers/usb/host/fotg210-hcd.c
··· 4463 4463 4464 4464 /* HC need not update length with this error */ 4465 4465 if (!(t & FOTG210_ISOC_BABBLE)) { 4466 - desc->actual_length = 4467 - fotg210_itdlen(urb, desc, t); 4466 + desc->actual_length = FOTG210_ITD_LENGTH(t); 4468 4467 urb->actual_length += desc->actual_length; 4469 4468 } 4470 4469 } else if (likely((t & FOTG210_ISOC_ACTIVE) == 0)) { 4471 4470 desc->status = 0; 4472 - desc->actual_length = fotg210_itdlen(urb, desc, t); 4471 + desc->actual_length = FOTG210_ITD_LENGTH(t); 4473 4472 urb->actual_length += desc->actual_length; 4474 4473 } else { 4475 4474 /* URB was too late */
-5
drivers/usb/host/fotg210.h
··· 683 683 return fotg210_readl(fotg210, &fotg210->regs->frame_index); 684 684 } 685 685 686 - #define fotg210_itdlen(urb, desc, t) ({ \ 687 - usb_pipein((urb)->pipe) ? \ 688 - (desc)->length - FOTG210_ITD_LENGTH(t) : \ 689 - FOTG210_ITD_LENGTH(t); \ 690 - }) 691 686 /*-------------------------------------------------------------------------*/ 692 687 693 688 #endif /* __LINUX_FOTG210_H */