All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390: provide default ioremap and iounmap declaration
@ 2017-05-25 15:43 Logan Gunthorpe
  2017-05-26 12:38 ` Heiko Carstens
  0 siblings, 1 reply; 4+ messages in thread
From: Logan Gunthorpe @ 2017-05-25 15:43 UTC (permalink / raw)
  To: linux-kernel, linux-s390
  Cc: Logan Gunthorpe, Martin Schwidefsky, Heiko Carstens, Al Viro

Add a default ioremap function which was not provided in all
circumstances. (Only when CONFIG_PCI was set).

I have designs to use them in scatterlist.c where they'd likely never
be called without CONFIG_PCI set, but it is needed to compile. Thus,
if the function is ever hit it returns NULL.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
---

Thanks to Al Viro for pointing out this corner case in s390.

 arch/s390/include/asm/io.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h
index 437e9af..f4140d4 100644
--- a/arch/s390/include/asm/io.h
+++ b/arch/s390/include/asm/io.h
@@ -73,6 +73,17 @@ static inline void ioport_unmap(void __iomem *p)
 #define __raw_writel	zpci_write_u32
 #define __raw_writeq	zpci_write_u64

+#else
+
+static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
+{
+	return NULL;
+}
+
+static inline void iounmap(void __iomem *addr)
+{
+}
+
 #endif /* CONFIG_PCI */

 #include <asm-generic/io.h>
--
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] s390: provide default ioremap and iounmap declaration
  2017-05-25 15:43 [PATCH] s390: provide default ioremap and iounmap declaration Logan Gunthorpe
@ 2017-05-26 12:38 ` Heiko Carstens
  2017-05-26 16:52   ` Logan Gunthorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Heiko Carstens @ 2017-05-26 12:38 UTC (permalink / raw)
  To: Logan Gunthorpe, Sebastian Ott
  Cc: linux-kernel, linux-s390, Martin Schwidefsky, Al Viro

On Thu, May 25, 2017 at 09:43:48AM -0600, Logan Gunthorpe wrote:
> Add a default ioremap function which was not provided in all
> circumstances. (Only when CONFIG_PCI was set).
> 
> I have designs to use them in scatterlist.c where they'd likely never
> be called without CONFIG_PCI set, but it is needed to compile. Thus,
> if the function is ever hit it returns NULL.
> 
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: Al Viro <viro@ZenIV.linux.org.uk>
> ---
> 
> Thanks to Al Viro for pointing out this corner case in s390.
> 
>  arch/s390/include/asm/io.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h
> index 437e9af..f4140d4 100644
> --- a/arch/s390/include/asm/io.h
> +++ b/arch/s390/include/asm/io.h
> @@ -73,6 +73,17 @@ static inline void ioport_unmap(void __iomem *p)
>  #define __raw_writel	zpci_write_u32
>  #define __raw_writeq	zpci_write_u64
> 
> +#else
> +
> +static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
> +{
> +	return NULL;
> +}
> +
> +static inline void iounmap(void __iomem *addr)
> +{
> +}
> +
>  #endif /* CONFIG_PCI */

I'd rather move the #ifdef CONFIG_PCI than implementing this yet another
time (see patch below). But I'll leave that up to Sebastian.

diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h
index 437e9af96688..904e4b3af95d 100644
--- a/arch/s390/include/asm/io.h
+++ b/arch/s390/include/asm/io.h
@@ -25,8 +25,6 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
 
 #define IO_SPACE_LIMIT 0
 
-#ifdef CONFIG_PCI
-
 #define ioremap_nocache(addr, size)	ioremap(addr, size)
 #define ioremap_wc			ioremap_nocache
 #define ioremap_wt			ioremap_nocache
@@ -49,6 +47,8 @@ static inline void ioport_unmap(void __iomem *p)
 {
 }
 
+#ifdef CONFIG_PCI
+
 /*
  * s390 needs a private implementation of pci_iomap since ioremap with its
  * offset parameter isn't sufficient. That's because BAR spaces are not

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] s390: provide default ioremap and iounmap declaration
  2017-05-26 12:38 ` Heiko Carstens
@ 2017-05-26 16:52   ` Logan Gunthorpe
  2017-05-29 16:07     ` Sebastian Ott
  0 siblings, 1 reply; 4+ messages in thread
From: Logan Gunthorpe @ 2017-05-26 16:52 UTC (permalink / raw)
  To: Heiko Carstens, Sebastian Ott
  Cc: linux-kernel, linux-s390, Martin Schwidefsky, Al Viro



On 26/05/17 06:38 AM, Heiko Carstens wrote:
> On Thu, May 25, 2017 at 09:43:48AM -0600, Logan Gunthorpe wrote:
> I'd rather move the #ifdef CONFIG_PCI than implementing this yet another
> time (see patch below). But I'll leave that up to Sebastian.

I'd be more than happy with this change. Let me know if you want me to
resubmit a patch that looks like that.

Thanks,

Logan

> diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h
> index 437e9af96688..904e4b3af95d 100644
> --- a/arch/s390/include/asm/io.h
> +++ b/arch/s390/include/asm/io.h
> @@ -25,8 +25,6 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
>  
>  #define IO_SPACE_LIMIT 0
>  
> -#ifdef CONFIG_PCI
> -
>  #define ioremap_nocache(addr, size)	ioremap(addr, size)
>  #define ioremap_wc			ioremap_nocache
>  #define ioremap_wt			ioremap_nocache
> @@ -49,6 +47,8 @@ static inline void ioport_unmap(void __iomem *p)
>  {
>  }
>  
> +#ifdef CONFIG_PCI
> +
>  /*
>   * s390 needs a private implementation of pci_iomap since ioremap with its
>   * offset parameter isn't sufficient. That's because BAR spaces are not
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] s390: provide default ioremap and iounmap declaration
  2017-05-26 16:52   ` Logan Gunthorpe
@ 2017-05-29 16:07     ` Sebastian Ott
  0 siblings, 0 replies; 4+ messages in thread
From: Sebastian Ott @ 2017-05-29 16:07 UTC (permalink / raw)
  To: Logan Gunthorpe
  Cc: Heiko Carstens, linux-kernel, linux-s390, Martin Schwidefsky, Al Viro

Hi,

On Fri, 26 May 2017, Logan Gunthorpe wrote:
> On 26/05/17 06:38 AM, Heiko Carstens wrote:
> > On Thu, May 25, 2017 at 09:43:48AM -0600, Logan Gunthorpe wrote:
> > I'd rather move the #ifdef CONFIG_PCI than implementing this yet another
> > time (see patch below). But I'll leave that up to Sebastian.

Yes I've had prepared the same patch because of build failures in
linux-next due to this commit (linux-next commit id)
	db1534d linux/io.h: Add pci_remap_cfgspace() interface

But I'd never send it because this commit was changed to add
#ifdef CONFIG_PCI.

> I'd be more than happy with this change. Let me know if you want me to
> resubmit a patch that looks like that.

Yes please do. I'll Ack it.

Thanks,
Sebastian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-29 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-25 15:43 [PATCH] s390: provide default ioremap and iounmap declaration Logan Gunthorpe
2017-05-26 12:38 ` Heiko Carstens
2017-05-26 16:52   ` Logan Gunthorpe
2017-05-29 16:07     ` Sebastian Ott

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.