Lastest ATA checkings make my driver fail
Søren Schmidt
sos at DeepCore.dk
Tue Apr 13 10:20:06 PDT 2004
Sean McNeil wrote:
> I have two disks that I use in a software raid (because my hardware raid
> controller isn't recognized). All was working great until the latest
> checkin. Now,
This is partly because of the pci code changes, you need this patch to
make it work:
--
-Søren
-------------- next part --------------
Index: pci.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/pci/pci.c,v
retrieving revision 1.240
diff -u -r1.240 pci.c
--- pci.c 11 Apr 2004 07:02:49 -0000 1.240
+++ pci.c 13 Apr 2004 07:26:05 -0000
@@ -1464,17 +1464,21 @@
* Weed out the bogons, and figure out how large the BAR/map is.
*/
map = pci_read_config(child, *rid, 4);
- if (pci_maptype(map) & PCI_MAPMEM) {
- if (type != SYS_RES_MEMORY) {
- device_printf(child, "rid %#x says memory, driver wants %d failed.\n", *rid, type);
- return (NULL);
- }
- } else {
- if (type != SYS_RES_IOPORT) {
- device_printf(child, "rid %#x says ioport, driver wants %d failed.\n", *rid, type);
- return (NULL);
+ if (map) {
+ if (pci_maptype(map) & PCI_MAPMEM) {
+ if (type != SYS_RES_MEMORY) {
+ device_printf(child, "rid %#x says memory, driver wants %d failed.\n", *rid, type);
+ return (NULL);
+ }
+ } else {
+ if (type != SYS_RES_IOPORT) {
+ device_printf(child, "rid %#x says ioport, driver wants %d failed.\n", *rid, type);
+ return (NULL);
+ }
}
}
+ else
+ device_printf(child, "NULL BAR ignored, using supplied values\n");
pci_write_config(child, *rid, 0xffffffff, 4);
testval = pci_read_config(child, *rid, 4);
@@ -1483,10 +1487,12 @@
* appropriate bar for that resource (this is the part
* I'm not sure is good for 64-bit bars).
*/
- mapsize = pci_mapsize(testval);
- count = 1 << mapsize;
- if (RF_ALIGNMENT(flags) < mapsize)
- flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
+ if (testval) {
+ mapsize = pci_mapsize(testval);
+ count = 1 << mapsize;
+ if (RF_ALIGNMENT(flags) < mapsize)
+ flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
+ }
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid,
start, end, count, flags);
if (res == NULL) {
More information about the freebsd-current
mailing list