2007-05-23 07:02:17

by Stephen Rothwell

[permalink] [raw]
Subject: [PATCH] Introduce CONFIG_VIRT_TO_BUS

Make some offending drivers depend on it and set
CONFIG_ARCH_NO_VIRT_TO_BUS for ppc64 so that we don't build those drivers.

Signed-off-by: Stephen Rothwell <[email protected]>
---
arch/powerpc/Kconfig | 3 +++
drivers/atm/Kconfig | 8 ++++----
drivers/block/Kconfig | 2 +-
drivers/message/i2o/Kconfig | 2 +-
drivers/net/wan/Kconfig | 2 +-
drivers/scsi/Kconfig | 2 +-
mm/Kconfig | 4 ++++
sound/oss/Kconfig | 6 +++---
8 files changed, 18 insertions(+), 11 deletions(-)

This gets PowerPC allmodconfig and allyesconfig much closer to building.
--
Cheers,
Stephen Rothwell [email protected]

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 56d3c0d..6d6c5ca 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -66,6 +66,9 @@ config GENERIC_FIND_NEXT_BIT
bool
default y

+config ARCH_NO_VIRT_TO_BUS
+ def_bool PPC64
+
config PPC
bool
default y
diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig
index f5a47a4..11c2741 100644
--- a/drivers/atm/Kconfig
+++ b/drivers/atm/Kconfig
@@ -142,7 +142,7 @@ config ATM_ENI_BURST_RX_2W

config ATM_FIRESTREAM
tristate "Fujitsu FireStream (FS50/FS155) "
- depends on PCI
+ depends on PCI && VIRT_TO_BUS
help
Driver for the Fujitsu FireStream 155 (MB86697) and
FireStream 50 (MB86695) ATM PCI chips.
@@ -152,7 +152,7 @@ config ATM_FIRESTREAM

config ATM_ZATM
tristate "ZeitNet ZN1221/ZN1225"
- depends on PCI
+ depends on PCI && VIRT_TO_BUS
help
Driver for the ZeitNet ZN1221 (MMF) and ZN1225 (UTP-5) 155 Mbps ATM
adapters.
@@ -240,7 +240,7 @@ config ATM_IDT77252_USE_SUNI

config ATM_AMBASSADOR
tristate "Madge Ambassador (Collage PCI 155 Server)"
- depends on PCI
+ depends on PCI && VIRT_TO_BUS
select BITREVERSE
help
This is a driver for ATMizer based ATM card produced by Madge
@@ -265,7 +265,7 @@ config ATM_AMBASSADOR_DEBUG

config ATM_HORIZON
tristate "Madge Horizon [Ultra] (Collage PCI 25 and Collage PCI 155 Client)"
- depends on PCI
+ depends on PCI && VIRT_TO_BUS
help
This is a driver for the Horizon chipset ATM adapter cards once
produced by Madge Networks Ltd. Say Y (or M to compile as a module
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index b4c8319..0c16f84 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -141,7 +141,7 @@ source "drivers/block/paride/Kconfig"

config BLK_CPQ_DA
tristate "Compaq SMART2 support"
- depends on PCI
+ depends on PCI && VIRT_TO_BUS
help
This is the driver for Compaq Smart Array controllers. Everyone
using these boards should say Y here. See the file
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig
index f4ac21e..01379ae 100644
--- a/drivers/message/i2o/Kconfig
+++ b/drivers/message/i2o/Kconfig
@@ -57,7 +57,7 @@ config I2O_EXT_ADAPTEC_DMA64

config I2O_CONFIG
tristate "I2O Configuration support"
- depends on I2O
+ depends on I2O && VIRT_TO_BUS
---help---
Say Y for support of the configuration interface for the I2O adapters.
If you have a RAID controller from Adaptec and you want to use the
diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
index 4fc8681..a3df09e 100644
--- a/drivers/net/wan/Kconfig
+++ b/drivers/net/wan/Kconfig
@@ -61,7 +61,7 @@ config COSA
#
config LANMEDIA
tristate "LanMedia Corp. SSI/V.35, T1/E1, HSSI, T3 boards"
- depends on PCI
+ depends on PCI && VIRT_TO_BUS
---help---
Driver for the following Lan Media family of serial boards:

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index d28c14e..2c2b7ac 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -539,7 +539,7 @@ config SCSI_HPTIOP

config SCSI_BUSLOGIC
tristate "BusLogic SCSI support"
- depends on (PCI || ISA || MCA) && SCSI && ISA_DMA_API
+ depends on (PCI || ISA || MCA) && SCSI && ISA_DMA_API && VIRT_TO_BUS
---help---
This is support for BusLogic MultiMaster and FlashPoint SCSI Host
Adapters. Consult the SCSI-HOWTO, available from
diff --git a/mm/Kconfig b/mm/Kconfig
index 8ac412b..40559cf 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -168,3 +168,7 @@ config NR_QUICK
depends on QUICKLIST
default "2" if (SUPERH && !SUPERH64)
default "1"
+
+config VIRT_TO_BUS
+ def_bool y
+ depends on !ARCH_NO_VIRT_TO_BUS
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index 4b30ae6..be5801f 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -348,7 +348,7 @@ config MSND_FIFOSIZE

config SOUND_VIA82CXXX
tristate "VIA 82C686 Audio Codec"
- depends on SOUND_PRIME && PCI && OSS_OBSOLETE
+ depends on SOUND_PRIME && PCI && OSS_OBSOLETE && VIRT_TO_BUS
help
Say Y here to include support for the audio codec found on VIA
82Cxxx-based chips. Typically these are built into a motherboard.
@@ -368,7 +368,7 @@ config MIDI_VIA82CXXX

config SOUND_OSS
tristate "OSS sound modules"
- depends on SOUND_PRIME && ISA_DMA_API
+ depends on SOUND_PRIME && ISA_DMA_API && VIRT_TO_BUS
help
OSS is the Open Sound System suite of sound card drivers. They make
sound programming easier since they provide a common API. Say Y or
@@ -416,7 +416,7 @@ config SOUND_CS4232

config SOUND_SSCAPE
tristate "Ensoniq SoundScape support"
- depends on SOUND_OSS
+ depends on SOUND_OSS && VIRT_TO_BUS
help
Answer Y if you have a sound card based on the Ensoniq SoundScape
chipset. Such cards are being manufactured at least by Ensoniq, Spea
--
1.5.1.4


2007-05-23 07:05:05

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH] Introduce CONFIG_VIRT_TO_BUS

On Wed, May 23, 2007 at 05:01:55PM +1000, Stephen Rothwell wrote:
> Make some offending drivers depend on it and set
> CONFIG_ARCH_NO_VIRT_TO_BUS for ppc64 so that we don't build those drivers.

Seeing how few targets _do_ have that, I'd invert the that. I.e. have
HAS_VIRT_TO_BUS in arch/*/Kconfig for the few architectures that have
that stuff.

2007-05-23 07:16:19

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] Introduce CONFIG_VIRT_TO_BUS

From: Stephen Rothwell <[email protected]>
Date: Wed, 23 May 2007 17:01:55 +1000

> Make some offending drivers depend on it and set
> CONFIG_ARCH_NO_VIRT_TO_BUS for ppc64 so that we don't build those drivers.
>
> Signed-off-by: Stephen Rothwell <[email protected]>

Acked-by: David S. Miller <[email protected]>

Thank you, feel free to set it on sparc64 too.

2007-05-23 07:16:32

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] Introduce CONFIG_VIRT_TO_BUS

From: Al Viro <[email protected]>
Date: Wed, 23 May 2007 08:04:50 +0100

> On Wed, May 23, 2007 at 05:01:55PM +1000, Stephen Rothwell wrote:
> > Make some offending drivers depend on it and set
> > CONFIG_ARCH_NO_VIRT_TO_BUS for ppc64 so that we don't build those drivers.
>
> Seeing how few targets _do_ have that, I'd invert the that. I.e. have
> HAS_VIRT_TO_BUS in arch/*/Kconfig for the few architectures that have
> that stuff.

Great idea.

2007-05-23 07:24:31

by Stephen Rothwell

[permalink] [raw]
Subject: Re: [PATCH] Introduce CONFIG_VIRT_TO_BUS

Hi Al,

On Wed, 23 May 2007 08:04:50 +0100 Al Viro <[email protected]> wrote:
>
> On Wed, May 23, 2007 at 05:01:55PM +1000, Stephen Rothwell wrote:
> > Make some offending drivers depend on it and set
> > CONFIG_ARCH_NO_VIRT_TO_BUS for ppc64 so that we don't build those drivers.
>
> Seeing how few targets _do_ have that, I'd invert the that. I.e. have
> HAS_VIRT_TO_BUS in arch/*/Kconfig for the few architectures that have
> that stuff.

NAK :-)

I did a quick look and many architecture have some definition of
virt_to_bus ...

$ grep -w virt_to_bus include/asm*/io.h
include/asm-alpha/io.h:static inline unsigned long virt_to_bus(void *address)
include/asm-alpha/io.h:#define isa_virt_to_bus virt_to_bus
include/asm-avr32/io.h:#define virt_to_bus virt_to_phys
include/asm-blackfin/io.h:#define virt_to_bus virt_to_phys
include/asm-cris/io.h:#define virt_to_bus virt_to_phys
include/asm-h8300/io.h:#define virt_to_bus virt_to_phys
include/asm-i386/io.h:#define virt_to_bus virt_to_phys
include/asm-ia64/io.h:#define virt_to_bus virt_to_phys
include/asm-m32r/io.h:#define virt_to_bus virt_to_phys
include/asm-m68knommu/io.h:#define virt_to_bus virt_to_phys
include/asm-mips/io.h:#define virt_to_bus virt_to_phys
include/asm-parisc/io.h:#define virt_to_bus virt_to_phys
include/asm-powerpc/io.h: * 32 bits still uses virt_to_bus() for it's implementation of DMA
include/asm-powerpc/io.h:static inline unsigned long virt_to_bus(volatile void * address)
include/asm-ppc/io.h:extern inline unsigned long virt_to_bus(volatile void * address)
include/asm-sh64/io.h:#define virt_to_bus virt_to_phys
include/asm-sh/io.h:#define virt_to_bus virt_to_phys
include/asm-sparc64/io.h:#define virt_to_bus virt_to_bus_not_defined_use_pci_map
include/asm-x86_64/io.h:#define virt_to_bus virt_to_phys
include/asm-xtensa/io.h: * virt_to_bus and bus_to_virt are deprecated.
include/asm-xtensa/io.h:#define virt_to_bus(x) virt_to_phys(x)

and I am not in a position to tell whether each architecture wants it or
not. At least the way I have it, each architecture maintainer can turn
it off as they want to. Otherwise I have to edit every architecture's
Kconfig and add HAS_VIRT_TO_BUS to each one.

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (2.25 kB)
(No filename) (189.00 B)
Download all attachments

2007-05-24 21:40:19

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] Introduce CONFIG_VIRT_TO_BUS

On Wednesday 23 May 2007, Al Viro wrote:
>
> On Wed, May 23, 2007 at 05:01:55PM +1000, Stephen Rothwell wrote:
> > Make some offending drivers depend on it and set
> > CONFIG_ARCH_NO_VIRT_TO_BUS for ppc64 so that we don't build those drivers.
>
> Seeing how few targets _do_ have that, I'd invert the that. ?I.e. have
> HAS_VIRT_TO_BUS in arch/*/Kconfig for the few architectures that have
> that stuff.

Currently, that would mark x86_64 as HAS_VIRT_TO_BUS, while 64 bit powerpc
would be NO_VIRT_TO_BUS. I think they really should be the same, probably
like the other 64 bit targets, which means:

* If CONFIG_IOMMU is disabled, provide a __deprecated inline function that
maps virt_to_bus to virt_to_phys, and allow building drivers that use it.

* If we build with CONFIG_IOMMU enabled, but don't support disabling the
iommu, have no declaration for virt_to_bus at all, and disable the users
in Kconfig

* If the usage of the iommu is determined at run time, warn about users
of virt_to_bus at run time if it is enabled.

It could look like this

/* mm/memory.c or somewhere */
#if defined(CONFIG_HAS_VIRT_TO_BUS) && defined(CONFIG_IOMMU)
unsigned long virt_to_bus(void *virt)
{
WARN_ON(iommu_enabled);
return __virt_to_bus(virt);
}
#endif

/* include/linux/io.h */

#ifndef __virt_to_bus
#define __virt_to_bus virt_to_phys /* some architectures need
their own __virt_to_bus */
#endif

#ifdef CONFIG_HAS_VIRT_TO_BUS
#ifdef CONFIG_IOMMU
extern __deprecated unsigned long virt_to_bus(void *);
#else
static inline __deprecated unsigned long virt_to_bus(void *virt)
{
return __virt_to_bus(virt);
}
#endif
#endif

Arnd <><