]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/dwc2/hcd_ddma.c
Merge branch 'x86-trace-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[~andy/linux] / drivers / staging / dwc2 / hcd_ddma.c
index 69070f4442a81ad9c7e77cc2b1d1eac0ed5c4bc2..c7d434519776eb4fdf42fa69a5566639dc6a7e06 100644 (file)
@@ -271,10 +271,14 @@ static void dwc2_release_channel_ddma(struct dwc2_hsotg *hsotg,
 {
        struct dwc2_host_chan *chan = qh->channel;
 
-       if (dwc2_qh_is_non_per(qh))
-               hsotg->non_periodic_channels--;
-       else
+       if (dwc2_qh_is_non_per(qh)) {
+               if (hsotg->core_params->uframe_sched > 0)
+                       hsotg->available_host_channels++;
+               else
+                       hsotg->non_periodic_channels--;
+       } else {
                dwc2_update_frame_list(hsotg, qh, 0);
+       }
 
        /*
         * The condition is added to prevent double cleanup try in case of
@@ -370,7 +374,8 @@ void dwc2_hcd_qh_free_ddma(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
 
        if ((qh->ep_type == USB_ENDPOINT_XFER_ISOC ||
             qh->ep_type == USB_ENDPOINT_XFER_INT) &&
-           !hsotg->periodic_channels && hsotg->frame_list) {
+           (hsotg->core_params->uframe_sched > 0 ||
+            !hsotg->periodic_channels) && hsotg->frame_list) {
                dwc2_per_sched_disable(hsotg);
                dwc2_frame_list_free(hsotg);
        }