summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorP33M <p33m@github.com>2017-05-15 14:51:42 +0100
committerpopcornmix <popcornmix@gmail.com>2017-05-15 16:23:14 +0100
commit1423ac8bfbfb2a9d092b604c676e7a58a5fa3367 (patch)
tree9f5c07ae8d8c76a39e7b10e995f472cce69624a6
parent26cf563fe91ad48513a7f21158b8af977b07067d (diff)
dwc_otg: remove unnecessary dma-mode channel halts on disconnect interruptraspberrypi-kernel_1.20170515-1
Host channels are already halted in kill_urbs_in_qh_list() with the subsequent interrupt processing behaving as if the URB was dequeued via HCD callback. There's no need to clobber the host channel registers a second time as this exposes races between the driver and host channel resulting in hcd->free_hc_list becoming corrupted.
-rw-r--r--drivers/usb/host/dwc_otg/dwc_otg_hcd.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
index 5ec991624c78..a2dc6337836b 100644
--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
@@ -200,8 +200,6 @@ static void kill_urbs_in_qh_list(dwc_otg_hcd_t * hcd, dwc_list_link_t * qh_list)
dwc_otg_hc_halt(hcd->core_if, qh->channel,
DWC_OTG_HC_XFER_URB_DEQUEUE);
}
- if(microframe_schedule)
- hcd->available_host_channels++;
qh->channel = NULL;
}
dwc_otg_hcd_qh_remove(hcd, qh);
@@ -369,39 +367,11 @@ static int32_t dwc_otg_hcd_disconnect_cb(void *p)
}
}
- for (i = 0; i < num_channels; i++) {
- channel = dwc_otg_hcd->hc_ptr_array[i];
- if (DWC_CIRCLEQ_EMPTY_ENTRY(channel, hc_list_entry)) {
- hc_regs =
- dwc_otg_hcd->core_if->host_if->hc_regs[i];
- hcchar.d32 = DWC_READ_REG32(&hc_regs->hcchar);
- if (hcchar.b.chen) {
- /* Halt the channel. */
- hcchar.b.chdis = 1;
- DWC_WRITE_REG32(&hc_regs->hcchar,
- hcchar.d32);
- }
-
- dwc_otg_hc_cleanup(dwc_otg_hcd->core_if,
- channel);
- DWC_CIRCLEQ_INSERT_TAIL
- (&dwc_otg_hcd->free_hc_list, channel,
- hc_list_entry);
- /*
- * Added for Descriptor DMA to prevent channel double cleanup
- * in release_channel_ddma(). Which called from ep_disable
- * when device disconnect.
- */
- if (dwc_otg_hcd->core_if->dma_desc_enable)
- channel->qh = NULL;
- }
- }
if(fiq_fsm_enable) {
for(i=0; i < 128; i++) {
dwc_otg_hcd->hub_port[i] = 0;
}
}
-
}
if(fiq_enable) {