Re: [PATCH] iomap: make PCI iomap stuff excluded when PCI isn't configured

2007-02-11 Thread Al Viro
On Sun, Feb 11, 2007 at 05:45:33PM +0100, Martin Schwidefsky wrote:
> On Sat, 2007-02-10 at 23:55 +, Al Viro wrote: 
> > FWIW, the current picture wrt io-related stuff looks so:
> > 
> > s390: no ioport_map, no ioread*/iowrite*, no port IO except for 
> > (in|out)b(_p|)
> 
> s390 does not even need (in|out)b(_p|). I wondered what else from io.h
> do we not need. The answer is: almost nothing. With the devres patch
> from Al and the dma-mapping patch from Heiko we can get rid of iomem and
> all associated definitions.

Then we'll just need to replace NO_IOPORT with NO_IOMEM in Kconfig and
kill arch/s390/mm/ioremap.c.

BTW, there's an annoying bit of junk in there - IO_SPACE_LIMIT.  We
only need it for /proc/ioports, which AFAICS shouldn't even be there
on s390 (or uml).  OTOH, removing that thing would mean a user-visible
change - we go from "empty file in /proc" to "no such file in /proc"...

Anyway, switch to NO_IOMEM follows (on top of patches mentioned above).

>From cb57d59e45f97f1134c65f77e8dd6423e5ed9a47 Mon Sep 17 00:00:00 2001
From: Al Viro <[EMAIL PROTECTED]>
Date: Sun, 11 Feb 2007 13:10:19 -0500
Subject: [PATCH] s390 has no iomem

Signed-off-by: Al Viro <[EMAIL PROTECTED]>
---
 arch/s390/Kconfig  |2 +-
 arch/s390/mm/Makefile  |2 +-
 arch/s390/mm/ioremap.c |   58 --
 include/asm-s390/io.h  |   65 
 4 files changed, 2 insertions(+), 125 deletions(-)
 delete mode 100644 arch/s390/mm/ioremap.c

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index c4366aa..1013808 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -37,7 +37,7 @@ config GENERIC_HWEIGHT
 config GENERIC_TIME
def_bool y
 
-config NO_IOPORT
+config NO_IOMEM
def_bool y
 
 mainmenu "Linux Kernel Configuration"
diff --git a/arch/s390/mm/Makefile b/arch/s390/mm/Makefile
index 8e09db1..f95449b 100644
--- a/arch/s390/mm/Makefile
+++ b/arch/s390/mm/Makefile
@@ -2,6 +2,6 @@
 # Makefile for the linux s390-specific parts of the memory manager.
 #
 
-obj-y   := init.o fault.o ioremap.o extmem.o mmap.o vmem.o
+obj-y   := init.o fault.o extmem.o mmap.o vmem.o
 obj-$(CONFIG_CMM) += cmm.o
 
diff --git a/arch/s390/mm/ioremap.c b/arch/s390/mm/ioremap.c
deleted file mode 100644
index 3d2100a..000
--- a/arch/s390/mm/ioremap.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *  arch/s390/mm/ioremap.c
- *
- *  S390 version
- *Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
- *Author(s): Hartmut Penner ([EMAIL PROTECTED])
- *
- *  Derived from "arch/i386/mm/extable.c"
- *(C) Copyright 1995 1996 Linus Torvalds
- *
- * Re-map IO memory to kernel address space so that we can access it.
- * This is needed for high PCI addresses that aren't mapped in the
- * 640k-1MB IO memory area on PC's
- */
-
-#include 
-#include 
-#include 
-#include 
-
-/*
- * Generic mapping function (not visible outside):
- */
-
-/*
- * Remap an arbitrary physical address space into the kernel virtual
- * address space. Needed when the kernel wants to access high addresses
- * directly.
- */
-void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long 
flags)
-{
-   void * addr;
-   struct vm_struct * area;
-
-   if (phys_addr < virt_to_phys(high_memory))
-   return phys_to_virt(phys_addr);
-   if (phys_addr & ~PAGE_MASK)
-   return NULL;
-   size = PAGE_ALIGN(size);
-   if (!size || size > phys_addr + size)
-   return NULL;
-   area = get_vm_area(size, VM_IOREMAP);
-   if (!area)
-   return NULL;
-   addr = area->addr;
-   if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size,
-  phys_addr, __pgprot(flags))) {
-   vfree(addr);
-   return NULL;
-   }
-   return addr;
-}
-
-void iounmap(void *addr)
-{
-   if (addr > high_memory)
-   vfree(addr);
-}
diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h
index a4c2d55..dca6a6c 100644
--- a/include/asm-s390/io.h
+++ b/include/asm-s390/io.h
@@ -13,7 +13,6 @@
 
 #ifdef __KERNEL__
 
-#include 
 #include 
 
 #define IO_SPACE_LIMIT 0x
@@ -41,70 +40,6 @@ static inline void * phys_to_virt(unsigned long address)
 return __io_virt(address);
 }
 
-extern void * __ioremap(unsigned long offset, unsigned long size, unsigned 
long flags);
-
-static inline void * ioremap (unsigned long offset, unsigned long size)
-{
-return __ioremap(offset, size, 0);
-}
-
-/*
- * This one maps high address device memory and turns off caching for that 
area.
- * it's useful if some control registers are in such an area and write 
combining
- * or read caching is not desirable:
- */
-static inline void * ioremap_nocache (unsigned long offset, unsigned long size)
-{
-return __ioremap(offset, size, 0);
-}
-
-extern void iounmap(void *addr);
-
-/*
- * IO bus memory addresses are also 1:1 with the ph

Re: [PATCH] iomap: make PCI iomap stuff excluded when PCI isn't configured

2007-02-11 Thread Martin Schwidefsky
On Sat, 2007-02-10 at 23:55 +, Al Viro wrote: 
> FWIW, the current picture wrt io-related stuff looks so:
> 
> s390: no ioport_map, no ioread*/iowrite*, no port IO except for (in|out)b(_p|)

s390 does not even need (in|out)b(_p|). I wondered what else from io.h
do we not need. The answer is: almost nothing. With the devres patch
from Al and the dma-mapping patch from Heiko we can get rid of iomem and
all associated definitions.

-- 
blue skies,
  Martin.

Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH

"Reality continues to ruin my life." - Calvin.

--
From: Martin Schwidefsky <[EMAIL PROTECTED]>

[S390] cleanup io.h

Remove code to access I/O memory. There is no such thing on s390.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/Kconfig  |3 ++
 arch/s390/mm/Makefile  |2 -
 arch/s390/mm/ioremap.c |   58 
 include/asm-s390/io.h  |   64 -
 4 files changed, 5 insertions(+), 122 deletions(-)

diff -urpN linux-2.6/arch/s390/Kconfig linux-2.6-patched/arch/s390/Kconfig
--- linux-2.6/arch/s390/Kconfig 2007-02-11 17:24:37.0 +0100
+++ linux-2.6-patched/arch/s390/Kconfig 2007-02-11 17:25:30.0 +0100
@@ -40,6 +40,9 @@ config GENERIC_TIME
 config NO_IOPORT
def_bool y
 
+config NO_IOMEM
+   def_bool y
+
 mainmenu "Linux Kernel Configuration"
 
 config S390
diff -urpN linux-2.6/arch/s390/mm/ioremap.c 
linux-2.6-patched/arch/s390/mm/ioremap.c
--- linux-2.6/arch/s390/mm/ioremap.c2006-12-09 21:08:18.0 +0100
+++ linux-2.6-patched/arch/s390/mm/ioremap.c1970-01-01 01:00:00.0 
+0100
@@ -1,58 +0,0 @@
-/*
- *  arch/s390/mm/ioremap.c
- *
- *  S390 version
- *Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
- *Author(s): Hartmut Penner ([EMAIL PROTECTED])
- *
- *  Derived from "arch/i386/mm/extable.c"
- *(C) Copyright 1995 1996 Linus Torvalds
- *
- * Re-map IO memory to kernel address space so that we can access it.
- * This is needed for high PCI addresses that aren't mapped in the
- * 640k-1MB IO memory area on PC's
- */
-
-#include 
-#include 
-#include 
-#include 
-
-/*
- * Generic mapping function (not visible outside):
- */
-
-/*
- * Remap an arbitrary physical address space into the kernel virtual
- * address space. Needed when the kernel wants to access high addresses
- * directly.
- */
-void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long 
flags)
-{
-   void * addr;
-   struct vm_struct * area;
-
-   if (phys_addr < virt_to_phys(high_memory))
-   return phys_to_virt(phys_addr);
-   if (phys_addr & ~PAGE_MASK)
-   return NULL;
-   size = PAGE_ALIGN(size);
-   if (!size || size > phys_addr + size)
-   return NULL;
-   area = get_vm_area(size, VM_IOREMAP);
-   if (!area)
-   return NULL;
-   addr = area->addr;
-   if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size,
-  phys_addr, __pgprot(flags))) {
-   vfree(addr);
-   return NULL;
-   }
-   return addr;
-}
-
-void iounmap(void *addr)
-{
-   if (addr > high_memory)
-   vfree(addr);
-}
diff -urpN linux-2.6/arch/s390/mm/Makefile 
linux-2.6-patched/arch/s390/mm/Makefile
--- linux-2.6/arch/s390/mm/Makefile 2006-12-09 21:08:18.0 +0100
+++ linux-2.6-patched/arch/s390/mm/Makefile 2007-02-11 17:23:02.0 
+0100
@@ -2,6 +2,6 @@
 # Makefile for the linux s390-specific parts of the memory manager.
 #
 
-obj-y   := init.o fault.o ioremap.o extmem.o mmap.o vmem.o
+obj-y   := init.o fault.o extmem.o mmap.o vmem.o
 obj-$(CONFIG_CMM) += cmm.o
 
diff -urpN linux-2.6/include/asm-s390/io.h 
linux-2.6-patched/include/asm-s390/io.h
--- linux-2.6/include/asm-s390/io.h 2007-02-07 15:42:46.0 +0100
+++ linux-2.6-patched/include/asm-s390/io.h 2007-02-11 17:19:32.0 
+0100
@@ -18,8 +18,6 @@
 
 #define IO_SPACE_LIMIT 0x
 
-#define __io_virt(x)((void *)(PAGE_OFFSET | (unsigned long)(x)))
-
 /*
  * Change virtual addresses to physical addresses and vv.
  * These are pretty trivial
@@ -38,28 +36,9 @@ static inline unsigned long virt_to_phys
 
 static inline void * phys_to_virt(unsigned long address)
 {
-return __io_virt(address);
-}
-
-extern void * __ioremap(unsigned long offset, unsigned long size, unsigned 
long flags);
-
-static inline void * ioremap (unsigned long offset, unsigned long size)
-{
-return __ioremap(offset, size, 0);
-}
-
-/*
- * This one maps high address device memory and turns off caching for that 
area.
- * it's useful if some control registers are in such an area and write 
combining
- * or read caching is not desirable:
- */
-static inline void * ioremap_nocache (unsigned long offset, unsigned long size)
-{
-return __ioremap(offset, size,

Re: [PATCH] iomap: make PCI iomap stuff excluded when PCI isn't configured

2007-02-10 Thread Al Viro
On Sat, Feb 10, 2007 at 05:14:13PM -0500, Tejun Heo wrote:
> Heiko Carstens wrote:
> >On Sat, Feb 10, 2007 at 12:43:16PM -0500, Tejun Heo wrote:
> \>> Heiko, how about this?  Does it fix s390?
> >
> >Unfortunately not. Now I get
> >
> >  CC  lib/iomap.o
> >lib/iomap.c: In function 'devm_ioport_map_release':
> >lib/iomap.c:270: warning: implicit declaration of function 'ioport_unmap'
> >lib/iomap.c: In function 'devm_ioport_map':
> >lib/iomap.c:297: warning: implicit declaration of function 'ioport_map'
> >lib/iomap.c:297: warning: assignment makes pointer from integer without a 
> >cast
> 
> I think an arch needs to support ioport_map/unmap and noncoherent dma 
> (just alias to coherent interface on x86/amd64) interface whether PCI is 
> implemented or not.  No?

Another source of breakage: you get devm_request_irq() only if you have
GENERIC_HARDIRQS.  Otherwise kernel/irq/ is simply not built.  Again,
you are mixing default implementation of primitives with the
implementation-agnostic stuff around those primitives.  I'd split
kernel/irq/manage.c in two files and have the places providing
alternative implementations (e.g. arch/sparc/kernel) refer to new
file in their makefiles...

I'm mostly done with that stuff, modulo noncoherent_dma breakage.  Will
send patch once the irq crap is dealt with...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] iomap: make PCI iomap stuff excluded when PCI isn't configured

2007-02-10 Thread Randy Dunlap
On Sat, 10 Feb 2007 12:43:16 -0500 Tejun Heo wrote:

> devres iomap made lib/iomap.c always built and added several
> arch-indep PCI routines to include/linux/io.h and lib/iomap.c without
> wrapping them inside CONFIG_PCI.  This breaks configurations where PCI
> is not configured.  Wrap pci_iomap() in CONFIG_PCI and move managed
> PCI iomap functions into include/linux/pci.h and drivers/pci/pci.c.
> 
> Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
> Cc: Heiko Carstens <[EMAIL PROTECTED]>
> ---
> Heiko, how about this?  Does it fix s390?

At least it fixes allnoconfig on x86_64, which was also broken
by this.  


> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 8b44cff..d6ec47a 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1314,6 +1314,158 @@ int pci_select_bars(struct pci_dev *dev, unsigned 
> long flags)
>   return bars;
>  }
>  
> +/*
> + * PCI iomap devres
> + */
> +#define PCIM_IOMAP_MAX   PCI_ROM_RESOURCE
> +
> +struct pcim_iomap_devres {
> + void __iomem *table[PCIM_IOMAP_MAX];
> +};
> +
> +static void pcim_iomap_release(struct device *gendev, void *res)
> +{
> + struct pci_dev *dev = container_of(gendev, struct pci_dev, dev);
> + struct pcim_iomap_devres *this = res;
> + int i;
> +
> + for (i = 0; i < PCIM_IOMAP_MAX; i++)
> + if (this->table[i])
> + pci_iounmap(dev, this->table[i]);
> +}
> +
> +/**
> + * pcim_iomap_table - access iomap allocation table
> + * @pdev: PCI device to access iomap table for
> + *
> + * Access iomap allocation table for @dev.  If iomap table doesn't
> + * exist and @pdev is managed, it will be allocated.  All iomaps
> + * recorded in the iomap table are automatically unmapped on driver
> + * detach.
> + *
> + * This function might sleep when the table is first allocated but can
> + * be safely called without context and guaranteed to succed once
> + * allocated.
> + */
> +void __iomem * const * pcim_iomap_table(struct pci_dev *pdev)
> +{
> + struct pcim_iomap_devres *dr, *new_dr;
> +
> + dr = devres_find(&pdev->dev, pcim_iomap_release, NULL, NULL);
> + if (dr)
> + return dr->table;
> +
> + new_dr = devres_alloc(pcim_iomap_release, sizeof(*new_dr), GFP_KERNEL);
> + if (!new_dr)
> + return NULL;
> + dr = devres_get(&pdev->dev, new_dr, NULL, NULL);
> + return dr->table;
> +}
> +EXPORT_SYMBOL(pcim_iomap_table);
> +
> +/**
> + * pcim_iomap - Managed pcim_iomap()
> + * @pdev: PCI device to iomap for
> + * @bar: BAR to iomap
> + * @maxlen: Maximum length of iomap
> + *
> + * Managed pci_iomap().  Map is automatically unmapped on driver
> + * detach.
> + */
> +void __iomem * pcim_iomap(struct pci_dev *pdev, int bar, unsigned long 
> maxlen)
> +{
> + void __iomem **tbl;
> +
> + BUG_ON(bar >= PCIM_IOMAP_MAX);
> +
> + tbl = (void __iomem **)pcim_iomap_table(pdev);
> + if (!tbl || tbl[bar])   /* duplicate mappings not allowed */
> + return NULL;
> +
> + tbl[bar] = pci_iomap(pdev, bar, maxlen);
> + return tbl[bar];
> +}
> +EXPORT_SYMBOL(pcim_iomap);
> +
> +/**
> + * pcim_iounmap - Managed pci_iounmap()
> + * @pdev: PCI device to iounmap for
> + * @addr: Address to unmap
> + *
> + * Managed pci_iounmap().  @addr must have been mapped using pcim_iomap().
> + */
> +void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr)
> +{
> + void __iomem **tbl;
> + int i;
> +
> + pci_iounmap(pdev, addr);
> +
> + tbl = (void __iomem **)pcim_iomap_table(pdev);
> + BUG_ON(!tbl);
> +
> + for (i = 0; i < PCIM_IOMAP_MAX; i++)
> + if (tbl[i] == addr) {
> + tbl[i] = NULL;
> + return;
> + }
> + WARN_ON(1);
> +}
> +EXPORT_SYMBOL(pcim_iounmap);
> +
> +/**
> + * pcim_iomap_regions - Request and iomap PCI BARs
> + * @pdev: PCI device to map IO resources for
> + * @mask: Mask of BARs to request and iomap
> + * @name: Name used when requesting regions
> + *
> + * Request and iomap regions specified by @mask.
> + */
> +int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name)
> +{
> + void __iomem * const *iomap;
> + int i, rc;
> +
> + iomap = pcim_iomap_table(pdev);
> + if (!iomap)
> + return -ENOMEM;
> +
> + for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
> + unsigned long len;
> +
> + if (!(mask & (1 << i)))
> + continue;
> +
> + rc = -EINVAL;
> + len = pci_resource_len(pdev, i);
> + if (!len)
> + goto err_inval;
> +
> + rc = pci_request_region(pdev, i, name);
> + if (rc)
> + goto err_region;
> +
> + rc = -ENOMEM;
> + if (!pcim_iomap(pdev, i, 0))
> + goto err_iomap;
> + }
> +
> + return 0;
> +
> + err_iomap:
> + pcim_iounmap(pdev, iomap[i]);
> + err_region:
> + pci_release_region(pdev, i);
> + err_inv

Re: [PATCH] iomap: make PCI iomap stuff excluded when PCI isn't configured

2007-02-10 Thread Heiko Carstens
On Sat, Feb 10, 2007 at 05:14:13PM -0500, Tejun Heo wrote:
> Heiko Carstens wrote:
> >On Sat, Feb 10, 2007 at 12:43:16PM -0500, Tejun Heo wrote:
> \>> Heiko, how about this?  Does it fix s390?
> >Unfortunately not. Now I get
> >  CC  lib/iomap.o
> >lib/iomap.c: In function 'devm_ioport_map_release':
> >lib/iomap.c:270: warning: implicit declaration of function 'ioport_unmap'
> >lib/iomap.c: In function 'devm_ioport_map':
> >lib/iomap.c:297: warning: implicit declaration of function 'ioport_map'
> >lib/iomap.c:297: warning: assignment makes pointer from integer without a 
> >cast
> 
> I think an arch needs to support ioport_map/unmap and noncoherent dma
> (just alias to coherent interface on x86/amd64) interface whether PCI is
> implemented or not.  No?

I sent a patch earlier which "fixes" at least the dma stuff by adding some
more defines to asm-generic/dma-mapping-broken.h
The patch below (on top of your latest one) makes sure s390 builds at
least again until all this got sorted out.
---

Hack to make s390 build again.

Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 include/asm-s390/io.h |   14 ++
 1 file changed, 14 insertions(+)

Index: linux-2.6/include/asm-s390/io.h
===
--- linux-2.6.orig/include/asm-s390/io.h
+++ linux-2.6/include/asm-s390/io.h
@@ -61,6 +61,20 @@ static inline void * ioremap_nocache (un
 extern void iounmap(void *addr);
 
 /*
+ * FIXME: remove ioport stuff asap again.
+ */
+static inline void __iomem *ioport_map(unsigned long port, unsigned int size)
+{
+   BUG();
+   return NULL;
+}
+
+static inline void ioport_unmap(void __iomem *addr)
+{
+   BUG();
+}
+
+/*
  * IO bus memory addresses are also 1:1 with the physical address
  */
 #define virt_to_bus virt_to_phys
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] iomap: make PCI iomap stuff excluded when PCI isn't configured

2007-02-10 Thread Al Viro
On Sat, Feb 10, 2007 at 10:50:33PM +, Al Viro wrote:
> We don't even require ioremap().  What the hell could it possibly mean on
> e.g. UML?  The same goes for DMA.  And yes, of course it means that a lot
> of drivers are not buildable on it - hardly a surprise, that...

FWIW, the current picture wrt io-related stuff looks so:

alpha frv i386 ia64 mips parisc powerpc sparc64 x86_64: full set
s390: no ioport_map, no ioread*/iowrite*, no port IO except for (in|out)b(_p|)
sparc: insl() and friends are not there unless we have PCI, ioremap() is
not exported unless on PCI.
um: odd stubs for inb()/outb(), no other port IO; no ioremap(), no
memcpy_..io(), for some reason read[bwlq]()/write[bwlq]() are there,
but never used.  No ioread*/iowrite*.
arm: depends on subarchitecture.  E.g. 32bit port access might be a sham
(causes fun problems with e.g. modular ide-core on some subarchitectures -
it doesn't _use_ insl(), but the reference is there no matter what, so the
lack of export => missing symbol).
m68k: as if.  No ioread/iowrite, ioremap() only for hp300, availability of
any IO accessor depends on config in rather weird ways.
m32r: no ioread/iowrite/ioport_map
the rest of embedded stuff: no idea, never played with those targets.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] iomap: make PCI iomap stuff excluded when PCI isn't configured

2007-02-10 Thread Al Viro
On Sat, Feb 10, 2007 at 02:25:53PM -0800, Linus Torvalds wrote:
> 
> 
> On Sat, 10 Feb 2007, Tejun Heo wrote:
> > 
> > I think an arch needs to support ioport_map/unmap and noncoherent dma (just
> > alias to coherent interface on x86/amd64) interface whether PCI is 
> > implemented
> > or not.  No?
> 
> We haven't required ioport implementations in the past, afaik.

We don't even require ioremap().  What the hell could it possibly mean on
e.g. UML?  The same goes for DMA.  And yes, of course it means that a lot
of drivers are not buildable on it - hardly a surprise, that...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] iomap: make PCI iomap stuff excluded when PCI isn't configured

2007-02-10 Thread Linus Torvalds


On Sat, 10 Feb 2007, Tejun Heo wrote:
> 
> I think an arch needs to support ioport_map/unmap and noncoherent dma (just
> alias to coherent interface on x86/amd64) interface whether PCI is implemented
> or not.  No?

We haven't required ioport implementations in the past, afaik.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] iomap: make PCI iomap stuff excluded when PCI isn't configured

2007-02-10 Thread Tejun Heo

Heiko Carstens wrote:

On Sat, Feb 10, 2007 at 12:43:16PM -0500, Tejun Heo wrote:

\>> Heiko, how about this?  Does it fix s390?


Unfortunately not. Now I get

  CC  lib/iomap.o
lib/iomap.c: In function 'devm_ioport_map_release':
lib/iomap.c:270: warning: implicit declaration of function 'ioport_unmap'
lib/iomap.c: In function 'devm_ioport_map':
lib/iomap.c:297: warning: implicit declaration of function 'ioport_map'
lib/iomap.c:297: warning: assignment makes pointer from integer without a cast


I think an arch needs to support ioport_map/unmap and noncoherent dma 
(just alias to coherent interface on x86/amd64) interface whether PCI is 
implemented or not.  No?


--
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] iomap: make PCI iomap stuff excluded when PCI isn't configured

2007-02-10 Thread Heiko Carstens
On Sat, Feb 10, 2007 at 12:43:16PM -0500, Tejun Heo wrote:
> devres iomap made lib/iomap.c always built and added several
> arch-indep PCI routines to include/linux/io.h and lib/iomap.c without
> wrapping them inside CONFIG_PCI.  This breaks configurations where PCI
> is not configured.  Wrap pci_iomap() in CONFIG_PCI and move managed
> PCI iomap functions into include/linux/pci.h and drivers/pci/pci.c.
> 
> Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
> Cc: Heiko Carstens <[EMAIL PROTECTED]>
> ---
> Heiko, how about this?  Does it fix s390?

Unfortunately not. Now I get

  CC  lib/iomap.o
lib/iomap.c: In function 'devm_ioport_map_release':
lib/iomap.c:270: warning: implicit declaration of function 'ioport_unmap'
lib/iomap.c: In function 'devm_ioport_map':
lib/iomap.c:297: warning: implicit declaration of function 'ioport_map'
lib/iomap.c:297: warning: assignment makes pointer from integer without a cast

and

lib/built-in.o: In function `devm_ioport_unmap': undefined reference to 
`ioport_unmap'
lib/built-in.o: In function `devm_ioport_map_release':iomap.c:(.text+0xf20): 
undefined reference to `ioport_unmap'
lib/built-in.o: In function `devm_ioport_map': undefined reference to 
`ioport_map'
drivers/built-in.o: In function 
`dmam_noncoherent_release':dma-mapping.c:(.text+0x15238): undefined reference 
to `dma_free_noncoherent'
drivers/built-in.o: In function `dmam_free_noncoherent': undefined reference to 
`dma_free_noncoherent'
drivers/built-in.o: In function `dmam_alloc_noncoherent': undefined reference 
to `dma_alloc_noncoherent'
make: *** [.tmp_vmlinux1] Error 1
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/