Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107368952
D26913.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
D26913.diff
View Options
Index: head/sys/dev/usb/controller/xhci_pci.c
===================================================================
--- head/sys/dev/usb/controller/xhci_pci.c
+++ head/sys/dev/usb/controller/xhci_pci.c
@@ -277,21 +277,29 @@
rid = 0;
if (xhci_use_msix && (msix_table = pci_msix_table_bar(self)) >= 0) {
- sc->sc_msix_res = bus_alloc_resource_any(self, SYS_RES_MEMORY,
- &msix_table, RF_ACTIVE);
- if (sc->sc_msix_res == NULL) {
- /* May not be enabled */
- device_printf(self,
- "Unable to map MSI-X table \n");
+ if (msix_table == PCI_XHCI_CBMEM) {
+ sc->sc_msix_res = sc->sc_io_res;
} else {
+ sc->sc_msix_res = bus_alloc_resource_any(self,
+ SYS_RES_MEMORY, &msix_table, RF_ACTIVE);
+ if (sc->sc_msix_res == NULL) {
+ /* May not be enabled */
+ device_printf(self,
+ "Unable to map MSI-X table\n");
+ }
+ }
+ if (sc->sc_msix_res != NULL) {
count = 1;
if (pci_alloc_msix(self, &count) == 0) {
if (bootverbose)
device_printf(self, "MSI-X enabled\n");
rid = 1;
} else {
- bus_release_resource(self, SYS_RES_MEMORY,
- msix_table, sc->sc_msix_res);
+ if (sc->sc_msix_res != sc->sc_io_res) {
+ bus_release_resource(self,
+ SYS_RES_MEMORY,
+ msix_table, sc->sc_msix_res);
+ }
sc->sc_msix_res = NULL;
}
}
@@ -387,15 +395,15 @@
sc->sc_irq_res = NULL;
pci_release_msi(self);
}
+ if (sc->sc_msix_res != NULL && sc->sc_msix_res != sc->sc_io_res) {
+ bus_release_resource(self, SYS_RES_MEMORY,
+ rman_get_rid(sc->sc_msix_res), sc->sc_msix_res);
+ sc->sc_msix_res = NULL;
+ }
if (sc->sc_io_res) {
bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM,
sc->sc_io_res);
sc->sc_io_res = NULL;
- }
- if (sc->sc_msix_res) {
- bus_release_resource(self, SYS_RES_MEMORY,
- rman_get_rid(sc->sc_msix_res), sc->sc_msix_res);
- sc->sc_msix_res = NULL;
}
xhci_uninit(sc);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 14, 3:59 AM (21 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15790800
Default Alt Text
D26913.diff (1 KB)
Attached To
Mode
D26913: xhci: Handle the case when MSI-X BAR is same as IO BAR.
Attached
Detach File
Event Timeline
Log In to Comment