Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109432646
D38816.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38816.diff
View Options
diff --git a/sys/dev/usb/controller/dwc3.c b/sys/dev/usb/controller/dwc3.c
--- a/sys/dev/usb/controller/dwc3.c
+++ b/sys/dev/usb/controller/dwc3.c
@@ -103,6 +103,17 @@
#define IS_DMA_32B 1
+static void
+xhci_interrupt_poll(void *_sc)
+{
+ struct xhci_softc *sc = _sc;
+
+ USB_BUS_UNLOCK(&sc->sc_bus);
+ xhci_interrupt(sc);
+ USB_BUS_LOCK(&sc->sc_bus);
+ usb_callout_reset(&sc->sc_callout, 1, (void *)&xhci_interrupt_poll, sc);
+}
+
static int
snps_dwc3_attach_xhci(device_t dev)
{
@@ -133,12 +144,14 @@
sprintf(sc->sc_vendor, "Synopsys");
device_set_desc(sc->sc_bus.bdev, "Synopsys");
- err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
- NULL, (driver_intr_t *)xhci_interrupt, sc, &sc->sc_intr_hdl);
- if (err != 0) {
- device_printf(dev, "Failed to setup IRQ, %d\n", err);
- sc->sc_intr_hdl = NULL;
- return (err);
+ if (xhci_use_polling() == 0) {
+ err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
+ NULL, (driver_intr_t *)xhci_interrupt, sc, &sc->sc_intr_hdl);
+ if (err != 0) {
+ device_printf(dev, "Failed to setup IRQ, %d\n", err);
+ sc->sc_intr_hdl = NULL;
+ return (err);
+ }
}
err = xhci_init(sc, dev, IS_DMA_32B);
@@ -147,6 +160,15 @@
return (ENXIO);
}
+ usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0);
+
+ if (xhci_use_polling() != 0) {
+ device_printf(dev, "Interrupt polling at %dHz\n", hz);
+ USB_BUS_LOCK(&sc->sc_bus);
+ xhci_interrupt_poll(sc);
+ USB_BUS_UNLOCK(&sc->sc_bus);
+ }
+
err = xhci_start_controller(sc);
if (err != 0) {
device_printf(dev, "Failed to start XHCI controller, with error %d\n", err);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Feb 6, 12:01 AM (21 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16483192
Default Alt Text
D38816.diff (1 KB)
Attached To
Mode
D38816: usb: dwc3: implement hw.usb.xhci.use_polling
Attached
Detach File
Event Timeline
Log In to Comment