[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] PCI Passthru: fn0 exported but not fn1



>> Very odd. The tracing you provide clearly shows that the kernel is *not*
>> scanning every fn. It is only scanning every fn==0.
>> 
>> The function of interest here is, I think,
>> linux/drivers/pci/probe.c:pci_scan_slot(). Notice how it iterates on every
>> fn but bails early if no device is found at fn 0 and !scan_all_fns. I
>> suggest you add some tracing to that function to check that:
>>  A. It is being called; and
>>  B. Exactly how it is bailing without checking fns != 0, if it ireally is
>> the case that scan_all_fns==1.


This is the broad outline of a fix.

--- ws1/xen-3.1.0-src/linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/pci.h
2007-08-29 07:22:52.000000000 -0400
+++ ws/xen-3.1.0-src/linux-2.6.18-xen/include/asm-x86_64/mach-xen/asm/pci.h
2007-08-30 05:37:46.000000000 -0400
@@ -16,7 +16,9 @@
 #else
 #define pcibios_assign_all_busses()    0
 #endif
+
 #define pcibios_scan_all_fns(a, b)     1
+#define HAVE_PCIBIOS_SCAN_ALL_FNS

 extern unsigned long pci_mem_start;
 #define PCIBIOS_MIN_IO         0x1000
--- ws1/xen-3.1.0-src/linux-2.6.18-xen/include/asm-generic/pci.h        
2006-09-19
23:42:06.000000000 -0400
+++ ws/xen-3.1.0-src/linux-2.6.18-xen/include/asm-generic/pci.h 2007-08-30
05:37:03.000000000 -0400
@@ -43,7 +43,11 @@
        return root;
 }

+
+#ifndef HAVE_PCIBIOS_SCAN_ALL_FNS
+#error "Fix not OK"
 #define pcibios_scan_all_fns(a, b)     0
+#endif

 #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
 static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)



Compiler log below justifies the above fix.

In file included from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/include/linux/pci.h:691,
                 from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:13:
include2/asm/mach-xen/asm/pci.h:21:2: error: #error "Including this definition"
In file included from include2/asm/mach-xen/asm/pci.h:167,
                 from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/include/linux/pci.h:691,
                 from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:13:
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/include/asm-generic/pci.h:46:1:
warning: "pcibios_scan_all_fns" redefined
In file included from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/include/linux/pci.h:691,
                 from
/root/src/ws/xen-3.1.0-src/linux-2.6.18-xen/arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:13:
include2/asm/mach-xen/asm/pci.h:22:1: warning: this is the location of the
previous definition

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.