Skip to contentSkip to conversation

Patch "parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled" has been added to the 5.14-stable tree

DISCUSSION Helge Deller 1 participant 1 message Sep 20, 2021 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 8 lines · On 9/20/21 10:17 AM, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled

to the 5.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 6 lines

The filename of the patch is:
parisc-declare-pci_iounmap-parisc-version-only-when-config_pci-enabled.patch
and it can be found in the queue-5.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

No, please don't add it to any stable tree yet.
This patch was applied by Linus in order to fix build errors on the alpha architecture, but it triggers build errors on arm64 (and maybe other arches). The whole issue is still being analyzed, as visible in e.g. this commit:

316e8d79a0959c302b0c462ab64b069599f10eef

Author: Linus Torvalds <[email protected]>
Date:   Sun Sep 19 17:13:35 2021 -0700

pci_iounmap'2: Electric Boogaloo: try to make sense of it all

Helge

Quoted 102 lines

From 9caea0007601d3bc6debec04f8b4cd6f4c2394be Mon Sep 17 00:00:00 2001
From: Helge Deller <[email protected]>
Date: Sun, 19 Sep 2021 10:36:09 -0700
Subject: parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled

From: Helge Deller <[email protected]>

commit 9caea0007601d3bc6debec04f8b4cd6f4c2394be upstream.

Linus noticed odd declaration rules for pci_iounmap() in iomap.h and pci_iomap.h, where it dependend on either NO_GENERIC_PCI_IOPORT_MAP or GENERIC_IOMAP when CONFIG_PCI was disabled.

Testing on parisc seems to indicate that we need pci_iounmap() only when CONFIG_PCI is enabled, so the declaration of pci_iounmap() can be moved cleanly into pci_iomap.h in sync with the declarations of pci_iomap().

Fixes 97a29d59fc22 ("[PARISC] fix compile break caused by iomap: make IOPORT/PCI mapping functions conditional")
Cc Arnd Bergmann <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Ulrich Teichert <[email protected]>
Cc James Bottomley <[email protected]>
---
  arch/parisc/lib/iomap.c         |    4 +++-
  include/asm-generic/iomap.h     |   10 ----------
  include/asm-generic/pci_iomap.h |    3 +++
  3 files changed, 6 insertions(+), 11 deletions(-)
arch/parisc/lib/iomap.c +3 -1
@@ -513,12 +513,15 @@ void ioport_unmap(void __iomem *addr)
  	}
  }
 
+#ifdef CONFIG_PCI
  void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
  {
  	if (!INDIRECT_ADDR(addr)) {
  		iounmap(addr);
  	}
  }
+EXPORT_SYMBOL(pci_iounmap);
+#endif
 
  EXPORT_SYMBOL(ioread8);
  EXPORT_SYMBOL(ioread16);
@@ -544,4 +547,3 @@ EXPORT_SYMBOL(iowrite16_rep);
  EXPORT_SYMBOL(iowrite32_rep);
  EXPORT_SYMBOL(ioport_map);
  EXPORT_SYMBOL(ioport_unmap);
-EXPORT_SYMBOL(pci_iounmap);
include/asm-generic/iomap.h +0 -10
@@ -110,16 +110,6 @@ static inline void __iomem *ioremap_np(p
  }
  #endif
 
-#ifdef CONFIG_PCI
-/* Destroy a virtual mapping cookie for a PCI BAR (memory or IO) */
-struct pci_dev;
-extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
-#elif defined(CONFIG_GENERIC_IOMAP)
-struct pci_dev;
-static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
-{ }
-#endif
-
  #include <asm-generic/pci_iomap.h>
 
  #endif
include/asm-generic/pci_iomap.h +3 -0
@@ -18,6 +18,7 @@ extern void __iomem *pci_iomap_range(str
  extern void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar,
  					unsigned long offset,
  					unsigned long maxlen);
+extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
  /* Create a virtual mapping cookie for a port on a given PCI device.
   * Do not call this directly, it exists to make it easier for architectures
   * to override */
@@ -50,6 +51,8 @@ static inline void __iomem *pci_iomap_wc
  {
  	return NULL;
  }
+static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
+{ }
  #endif
 
  #endif /* __ASM_GENERIC_IO_H */

Patches currently in stable-queue which might be from [email protected] are

queue-5.14/parisc-declare-pci_iounmap-parisc-version-only-when-config_pci-enabled.patch