From c68534f1d5bab4ad466384c4fb9bb2956811e8b9 Mon Sep 17 00:00:00 2001 From: Scott Long Date: Mon, 12 Aug 2013 23:30:01 +0000 Subject: Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day --- sys/dev/mn/if_mn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/mn/if_mn.c') diff --git a/sys/dev/mn/if_mn.c b/sys/dev/mn/if_mn.c index 239aa0fc2b82..63ae5f602eb7 100644 --- a/sys/dev/mn/if_mn.c +++ b/sys/dev/mn/if_mn.c @@ -1346,9 +1346,9 @@ mn_attach (device_t self) return(ENXIO); } - u = pci_read_config(self, PCIR_COMMAND, 1); + u = pci_read_config(self, PCIR_COMMAND, 2); printf("%x\n", u); - pci_write_config(self, PCIR_COMMAND, u | PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN, 1); + pci_write_config(self, PCIR_COMMAND, u | PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN, 2); #if 0 pci_write_config(self, PCIR_COMMAND, 0x02800046, 4); #endif -- cgit v1.2.3