Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147318463
D7914.id20634.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
902 B
Referenced Files
None
Subscribers
None
D7914.id20634.diff
View Options
Index: sys/dev/pci/pci.c
===================================================================
--- sys/dev/pci/pci.c
+++ sys/dev/pci/pci.c
@@ -5000,6 +5000,7 @@
struct resource_list *rl = &dinfo->resources;
struct resource *res;
struct pci_map *pm;
+ uint16_t cmd;
pci_addr_t map, testval;
int mapsize;
@@ -5089,8 +5090,17 @@
device_printf(child,
"Lazy allocation of %#jx bytes rid %#x type %d at %#jx\n",
count, *rid, type, rman_get_start(res));
+
+ /* Disable decoding via the CMD register before updating the BAR */
+ cmd = pci_read_config(child, PCIR_COMMAND, 2);
+ pci_write_config(child, PCIR_COMMAND,
+ cmd & ~(PCI_BAR_MEM(map) ? PCIM_CMD_MEMEN : PCIM_CMD_PORTEN), 2);
+
map = rman_get_start(res);
pci_write_bar(child, pm, map);
+
+ /* Restore the original value of the CMD register */
+ pci_write_config(child, PCIR_COMMAND, cmd, 2);
out:
return (res);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 10, 10:31 PM (20 m, 56 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29516276
Default Alt Text
D7914.id20634.diff (902 B)
Attached To
Mode
D7914: Clear the MEM/PORT_EN bit when updating PCI BAR
Attached
Detach File
Event Timeline
Log In to Comment