@@ -2402,36 +2402,32 @@ int32_t dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num)
24022402 * split transactions and do it ourselves.
24032403 */
24042404 if (hc -> ep_type == UE_INTERRUPT ) {
2405- if (hc -> ep_is_in ) {
2406- if (hcint .b .nak ) {
2405+ if (hcint .b .nak ) {
24072406 handle_hc_nak_intr (hcd , hc , hc_regs , qtd );
2407+ } else if (hc -> ep_is_in ) {
2408+ int len ;
2409+ len = dwc_otg_fiq_unsetup_per_dma (hcd , hc -> qh , qtd , num );
2410+ //printk(KERN_NOTICE "FIQ Transaction: hc=%d len=%d urb_len = %d\n", num, len, qtd->urb->length);
2411+ qtd -> urb -> actual_length += len ;
2412+ if (qtd -> urb -> actual_length >= qtd -> urb -> length ) {
2413+ qtd -> urb -> status = 0 ;
2414+ hcd -> fops -> complete (hcd , qtd -> urb -> priv , qtd -> urb , qtd -> urb -> status );
2415+ release_channel (hcd , hc , qtd , DWC_OTG_HC_XFER_URB_COMPLETE );
24082416 } else {
2409- int len ;
2410- len = dwc_otg_fiq_unsetup_per_dma (hcd , hc -> qh , qtd , num );
2411- //printk(KERN_NOTICE "FIQ Transaction: hc=%d len=%d urb_len = %d\n", num, len, qtd->urb->length);
2412- qtd -> urb -> actual_length += len ;
2413- if (qtd -> urb -> actual_length >= qtd -> urb -> length ) {
2417+ /* Interrupt transfer not complete yet - is it a short read? */
2418+ if (len < hc -> max_packet ) {
2419+ /* Interrupt transaction complete */
24142420 qtd -> urb -> status = 0 ;
24152421 hcd -> fops -> complete (hcd , qtd -> urb -> priv , qtd -> urb , qtd -> urb -> status );
24162422 release_channel (hcd , hc , qtd , DWC_OTG_HC_XFER_URB_COMPLETE );
24172423 } else {
2418- /* Interrupt transfer not complete yet - is it a short read? */
2419- if (len < hc -> max_packet ) {
2420- /* Interrupt transaction complete */
2421- qtd -> urb -> status = 0 ;
2422- hcd -> fops -> complete (hcd , qtd -> urb -> priv , qtd -> urb , qtd -> urb -> status );
2423- release_channel (hcd , hc , qtd , DWC_OTG_HC_XFER_URB_COMPLETE );
2424- } else {
2425- /* Further transactions required */
2426- release_channel (hcd , hc , qtd , DWC_OTG_HC_XFER_COMPLETE );
2427- }
2428-
2424+ /* Further transactions required */
2425+ release_channel (hcd , hc , qtd , DWC_OTG_HC_XFER_COMPLETE );
24292426 }
2430-
24312427 }
2432-
24332428 } else {
24342429 /* Interrupt OUT complete. */
2430+ dwc_otg_hcd_save_data_toggle (hc , hc_regs , qtd );
24352431 qtd -> urb -> actual_length += hc -> xfer_len ;
24362432 if (qtd -> urb -> actual_length >= qtd -> urb -> length ) {
24372433 qtd -> urb -> status = 0 ;
@@ -2524,6 +2520,8 @@ int32_t dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num)
25242520 * TODO: need to issue a reset to the hub port. */
25252521 qtd -> error_count += 3 ;
25262522 handle_hc_xacterr_intr (hcd , hc , hc_regs , qtd );
2523+ } else if (hcint .b .stall ) {
2524+ handle_hc_stall_intr (hcd , hc , hc_regs , qtd );
25272525 } else {
25282526 printk_ratelimited (KERN_INFO "Transfer to device %d endpoint 0x%x failed "
25292527 "- FIQ reported FSM=%d. Data may have been lost.\n" ,
0 commit comments