Skip to contentSkip to conversation

(11/43) Kconfig fix (infiniband and PCI)

PATCH In review Al Viro 4 participants 9 messages Aug 23, 2005 – Aug 24, 2005 InfiniBand

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 (11/43) Kconfig fix (infiniband and PCI)

infiniband uses PCI helpers all over the place (including the core parts) and won't build without PCI.

----

drivers/infiniband/Kconfig +1 -0
diff -urN RC13-rc6-git13-m32r-pagealloc/drivers/infiniband/Kconfig RC13-rc6-git13-infiniband/drivers/infiniband/Kconfig
@@ -1,6 +1,7 @@
 menu "InfiniBand support"
 
 config INFINIBAND
+	depends on PCI || BROKEN
 	tristate "InfiniBand support"
 	---help---
 	  Core support for InfiniBand (IB).  Make sure to also select
#1 lore raw
Quoted 3 lines · Al Viro

infiniband uses PCI helpers all over the place (including the core parts) and won't build without PCI.
...

CONFIG_INFINIBAND=y and CONFIG_PCI=n compiles for me on i386.

Can you post the compile error you got?

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#2 lore raw
Quoted 9 lines · Adrian Bunk
Quoted 3 lines · Al Viro

infiniband uses PCI helpers all over the place (including the core parts) and won't build without PCI.
...

CONFIG_INFINIBAND=y and CONFIG_PCI=n compiles for me on i386.

Can you post the compile error you got?

On which platform? There's a lot of them on the architectures that do not have PCI at all - same situation as with firewire. Note that you won't get any low-level drivers on PCI-less config even on i386, so while I agree that more accurate dependency would be nice here (as well as for drivers/ieee1394), for all practical purposes the same dependency works here.

BTW, this is more general question - do we expect pci helpers to be present on all platforms and do we consider their use acceptable in code that does not depend on PCI?

Again, for infiniband and ieee1394 it's an academical question, since neither actually has any hardware it could talk to in .config without CONFIG_PCI...

#3 lore raw
Quoted 7 lines · Al Viro
Quoted 6 lines · Adrian Bunk
Quoted 3 lines · Al Viro

infiniband uses PCI helpers all over the place (including the core parts) and won't build without PCI.
...

Quoted 5 lines
Quoted 3 lines

CONFIG_INFINIBAND=y and CONFIG_PCI=n compiles for me on i386.

Can you post the compile error you got?

On which platform? There's a lot of them on the architectures that do not

As I said, on i386.

Quoted 10 lines

have PCI at all - same situation as with firewire. Note that you won't get any low-level drivers on PCI-less config even on i386, so while I agree that more accurate dependency would be nice here (as well as for drivers/ieee1394), for all practical purposes the same dependency works here.

BTW, this is more general question - do we expect pci helpers to be present on all platforms and do we consider their use acceptable in code that does not depend on PCI?
...

Are you talking about the ones that already have dummy functions for the PCI=n case in include/linux/pci.h, or about other functions?

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#4 lore raw
Quoted 1 line · Adrian Bunk

As I said, on i386.

Builds due to stubs being still present, doesn't do anything since it doesn't even try to look for any hardware in that case.

Quoted 6 lines
Quoted 6 lines

have PCI at all - same situation as with firewire. Note that you won't get any low-level drivers on PCI-less config even on i386, so while I agree that more accurate dependency would be nice here (as well as for drivers/ieee1394), for all practical purposes the same dependency works here.

Quoted 7 lines
Quoted 4 lines

BTW, this is more general question - do we expect pci helpers to be present on all platforms and do we consider their use acceptable in code that does not depend on PCI?
...

Are you talking about the ones that already have dummy functions for the PCI=n case in include/linux/pci.h, or about other functions?

pci_map.../pci_unmap..., for one thing.

#5 lore raw
In reply to Al Viro

Al> infiniband uses PCI helpers all over the place (including the Al> core parts) and won't build without PCI.

I don't think this is the right fix. The only PCI helpers used in code that is enabled with CONFIG_PCI=n are pci_unmap_addr_set() and pci_unmap_addr(). And they're only used because no one has added dma_unmap_addr_set() and dma_unmap_addr() -- the core code is properly using the general dma_xxx API wherever possible.

There actually is non-PCI InfiniBand hardware coming, so we'll have to fix this properly at some point.

- R.

#6 lore raw
Quoted 11 lines · Roland Dreier

Al> infiniband uses PCI helpers all over the place (including the Al> core parts) and won't build without PCI.

I don't think this is the right fix. The only PCI helpers used in code that is enabled with CONFIG_PCI=n are pci_unmap_addr_set() and pci_unmap_addr(). And they're only used because no one has added dma_unmap_addr_set() and dma_unmap_addr() -- the core code is properly using the general dma_xxx API wherever possible.

There actually is non-PCI InfiniBand hardware coming, so we'll have to fix this properly at some point.

I'm all for it and removing BROKEN from Kconfig when fixes happen is obviously not a problem at all ;-)

#7 lore raw
Quoted 10 lines · Al Viro
Quoted 9 lines · Roland Dreier

Al> infiniband uses PCI helpers all over the place (including the Al> core parts) and won't build without PCI.

I don't think this is the right fix. The only PCI helpers used in code that is enabled with CONFIG_PCI=n are pci_unmap_addr_set() and pci_unmap_addr(). And they're only used because no one has added dma_unmap_addr_set() and dma_unmap_addr() -- the core code is properly using the general dma_xxx API wherever possible.

Quoted 5 lines
Quoted 2 lines

There actually is non-PCI InfiniBand hardware coming, so we'll have to fix this properly at some point.

I'm all for it and removing BROKEN from Kconfig when fixes happen is obviously not a problem at all ;-)

PS: note that it's not
depends on PCI
it's

	depends on PCI || BROKEN

which
a) documents that something is wrong
b) leaves all setups usable now intact
c) prevents broken setups from being picked.

I certainly agree that proper fix is to switch to dma_... - no arguments here. BTW, another dubious thing is use of DECLARE_PCI_UNMAP_ADDR() in infiniband core - it's fine in PCI drivers (which is how it's used elsewhere), but not in generic data structures.

#8 lore raw

Al> PS: note that it's not depends on PCI it's depends on PCI || Al> BROKEN which a) documents that something is wrong b) leaves Al> all setups usable now intact c) prevents broken setups from Al> being picked.

Yes, I agree that this makes sense for now.

Al> I certainly agree that proper fix is to switch to dma_... - no Al> arguments here. BTW, another dubious thing is use of Al> DECLARE_PCI_UNMAP_ADDR() in infiniband core - it's fine in PCI Al> drivers (which is how it's used elsewhere), but not in generic Al> data structures.

Yes, I guess we want DECLARE_DMA_UNMAP_ADDR() as well. If I can untangle the maze of .h files well enough to see where dma_unmap_addr() et al. belong, I'll post a patch adding them.

- R.