* [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig [not found] <cover.1322163031.git.mst@redhat.com> ` (3 preceding siblings ...) 2011-11-24 20:17 ` Michael S. Tsirkin @ 2011-11-24 20:15 ` Michael S. Tsirkin 2011-11-24 20:18 ` Michael S. Tsirkin ` (4 subsequent siblings) 9 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:15 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu define GENERIC_IOMAP in a central location instead of all architectures. This will be helpful for the follow-up patch which makes it select other configs. Code is also a bit shorter this way. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 4 ---- arch/cris/Kconfig | 5 +---- arch/hexagon/Kconfig | 4 +--- arch/ia64/Kconfig | 5 +---- arch/m68k/Kconfig | 4 +--- arch/openrisc/Kconfig | 3 --- arch/powerpc/platforms/Kconfig | 3 --- arch/score/Kconfig | 4 +--- arch/sh/Kconfig | 3 --- arch/unicore32/Kconfig | 4 +--- arch/x86/Kconfig | 4 +--- lib/Kconfig | 3 +++ 12 files changed, 10 insertions(+), 36 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3d74801..3636b11 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -70,10 +70,6 @@ config GENERIC_ISA_DMA bool default y -config GENERIC_IOMAP - bool - default n - source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 408b055..b3abfb0 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -19,10 +19,6 @@ config GENERIC_CMOS_UPDATE config ARCH_USES_GETTIMEOFFSET def_bool n -config GENERIC_IOMAP - bool - default y - config ARCH_HAS_ILOG2_U32 bool default n @@ -52,6 +48,7 @@ config CRIS select HAVE_IDE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP config HZ int diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 02513c2..9059e39 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -26,6 +26,7 @@ config HEXAGON select HAVE_ARCH_KGDB select HAVE_ARCH_TRACEHOOK select NO_IOPORT + select GENERIC_IOMAP # mostly generic routines, with some accelerated ones ---help--- Qualcomm Hexagon is a processor architecture designed for high @@ -73,9 +74,6 @@ config GENERIC_CSUM config GENERIC_IRQ_PROBE def_bool y -config GENERIC_IOMAP - def_bool y - #config ZONE_DMA # bool # default y diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 27489b6..2732e1b 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -29,6 +29,7 @@ config IA64 select GENERIC_IRQ_SHOW select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP default y help The Itanium Processor Family is Intel's 64-bit successor to @@ -102,10 +103,6 @@ config EFI bool default y -config GENERIC_IOMAP - bool - default y - config ARCH_CLOCKSOURCE_DATA def_bool y diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 361d540..973e686 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -38,9 +38,6 @@ config GENERIC_CALIBRATE_DELAY bool default y -config GENERIC_IOMAP - def_bool MMU - config TIME_LOW_RES bool default y @@ -73,6 +70,7 @@ source "kernel/Kconfig.freezer" config MMU bool "MMU-based Paged Memory Management Support" default y + select GENERIC_IOMAP help Select if you want MMU-based virtualised addressing space support by paged memory management. If unsure, say 'Y'. diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index e518a5a..081a54f 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -38,9 +38,6 @@ config RWSEM_XCHGADD_ALGORITHM config GENERIC_HWEIGHT def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT def_bool y diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 3fe6d92..100feed 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -175,9 +175,6 @@ config PPC_INDIRECT_MMIO config PPC_IO_WORKAROUNDS bool -config GENERIC_IOMAP - bool - source "drivers/cpufreq/Kconfig" menu "CPU Frequency drivers" diff --git a/arch/score/Kconfig b/arch/score/Kconfig index df169e8..455ce2d 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig @@ -4,6 +4,7 @@ config SCORE def_bool y select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP choice prompt "System type" @@ -33,9 +34,6 @@ endmenu config CPU_SCORE7 bool -config GENERIC_IOMAP - def_bool y - config NO_DMA bool default y diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5629e20..5aeab58 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -84,9 +84,6 @@ config GENERIC_GPIO config GENERIC_CALIBRATE_DELAY bool -config GENERIC_IOMAP - bool - config GENERIC_CLOCKEVENTS def_bool y diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index 942ed61..eeb8054 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig @@ -12,6 +12,7 @@ config UNICORE32 select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW select ARCH_WANT_FRAME_POINTERS + select GENERIC_IOMAP help UniCore-32 is 32-bit Instruction Set Architecture, including a series of low-power-consumption RISC chip @@ -30,9 +31,6 @@ config GENERIC_CLOCKEVENTS config GENERIC_CSUM def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cb9a104..08af645 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -75,6 +75,7 @@ config X86 select HAVE_BPF_JIT if (X86_64 && NET) select CLKEVT_I8253 select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP config INSTRUCTION_DECODER def_bool (KPROBES || PERF_EVENTS) @@ -140,9 +141,6 @@ config NEED_SG_DMA_LENGTH config GENERIC_ISA_DMA def_bool ISA_DMA_API -config GENERIC_IOMAP - def_bool y - config GENERIC_BUG def_bool y depends on BUG diff --git a/lib/Kconfig b/lib/Kconfig index 32f3e5a..0058927 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,6 +19,9 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_IOMAP + bool + config CRC_CCITT tristate "CRC-CCITT functions" help -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig @ 2011-11-24 20:15 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:15 UTC (permalink / raw) Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, Michael S. Tsirkin, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller define GENERIC_IOMAP in a central location instead of all architectures. This will be helpful for the follow-up patch which makes it select other configs. Code is also a bit shorter this way. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 4 ---- arch/cris/Kconfig | 5 +---- arch/hexagon/Kconfig | 4 +--- arch/ia64/Kconfig | 5 +---- arch/m68k/Kconfig | 4 +--- arch/openrisc/Kconfig | 3 --- arch/powerpc/platforms/Kconfig | 3 --- arch/score/Kconfig | 4 +--- arch/sh/Kconfig | 3 --- arch/unicore32/Kconfig | 4 +--- arch/x86/Kconfig | 4 +--- lib/Kconfig | 3 +++ 12 files changed, 10 insertions(+), 36 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3d74801..3636b11 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -70,10 +70,6 @@ config GENERIC_ISA_DMA bool default y -config GENERIC_IOMAP - bool - default n - source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 408b055..b3abfb0 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -19,10 +19,6 @@ config GENERIC_CMOS_UPDATE config ARCH_USES_GETTIMEOFFSET def_bool n -config GENERIC_IOMAP - bool - default y - config ARCH_HAS_ILOG2_U32 bool default n @@ -52,6 +48,7 @@ config CRIS select HAVE_IDE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP config HZ int diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 02513c2..9059e39 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -26,6 +26,7 @@ config HEXAGON select HAVE_ARCH_KGDB select HAVE_ARCH_TRACEHOOK select NO_IOPORT + select GENERIC_IOMAP # mostly generic routines, with some accelerated ones ---help--- Qualcomm Hexagon is a processor architecture designed for high @@ -73,9 +74,6 @@ config GENERIC_CSUM config GENERIC_IRQ_PROBE def_bool y -config GENERIC_IOMAP - def_bool y - #config ZONE_DMA # bool # default y diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 27489b6..2732e1b 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -29,6 +29,7 @@ config IA64 select GENERIC_IRQ_SHOW select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP default y help The Itanium Processor Family is Intel's 64-bit successor to @@ -102,10 +103,6 @@ config EFI bool default y -config GENERIC_IOMAP - bool - default y - config ARCH_CLOCKSOURCE_DATA def_bool y diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 361d540..973e686 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -38,9 +38,6 @@ config GENERIC_CALIBRATE_DELAY bool default y -config GENERIC_IOMAP - def_bool MMU - config TIME_LOW_RES bool default y @@ -73,6 +70,7 @@ source "kernel/Kconfig.freezer" config MMU bool "MMU-based Paged Memory Management Support" default y + select GENERIC_IOMAP help Select if you want MMU-based virtualised addressing space support by paged memory management. If unsure, say 'Y'. diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index e518a5a..081a54f 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -38,9 +38,6 @@ config RWSEM_XCHGADD_ALGORITHM config GENERIC_HWEIGHT def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT def_bool y diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 3fe6d92..100feed 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -175,9 +175,6 @@ config PPC_INDIRECT_MMIO config PPC_IO_WORKAROUNDS bool -config GENERIC_IOMAP - bool - source "drivers/cpufreq/Kconfig" menu "CPU Frequency drivers" diff --git a/arch/score/Kconfig b/arch/score/Kconfig index df169e8..455ce2d 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig @@ -4,6 +4,7 @@ config SCORE def_bool y select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP choice prompt "System type" @@ -33,9 +34,6 @@ endmenu config CPU_SCORE7 bool -config GENERIC_IOMAP - def_bool y - config NO_DMA bool default y diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5629e20..5aeab58 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -84,9 +84,6 @@ config GENERIC_GPIO config GENERIC_CALIBRATE_DELAY bool -config GENERIC_IOMAP - bool - config GENERIC_CLOCKEVENTS def_bool y diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index 942ed61..eeb8054 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig @@ -12,6 +12,7 @@ config UNICORE32 select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW select ARCH_WANT_FRAME_POINTERS + select GENERIC_IOMAP help UniCore-32 is 32-bit Instruction Set Architecture, including a series of low-power-consumption RISC chip @@ -30,9 +31,6 @@ config GENERIC_CLOCKEVENTS config GENERIC_CSUM def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cb9a104..08af645 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -75,6 +75,7 @@ config X86 select HAVE_BPF_JIT if (X86_64 && NET) select CLKEVT_I8253 select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP config INSTRUCTION_DECODER def_bool (KPROBES || PERF_EVENTS) @@ -140,9 +141,6 @@ config NEED_SG_DMA_LENGTH config GENERIC_ISA_DMA def_bool ISA_DMA_API -config GENERIC_IOMAP - def_bool y - config GENERIC_BUG def_bool y depends on BUG diff --git a/lib/Kconfig b/lib/Kconfig index 32f3e5a..0058927 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,6 +19,9 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_IOMAP + bool + config CRC_CCITT tristate "CRC-CCITT functions" help -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig @ 2011-11-24 20:15 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:15 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu define GENERIC_IOMAP in a central location instead of all architectures. This will be helpful for the follow-up patch which makes it select other configs. Code is also a bit shorter this way. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 4 ---- arch/cris/Kconfig | 5 +---- arch/hexagon/Kconfig | 4 +--- arch/ia64/Kconfig | 5 +---- arch/m68k/Kconfig | 4 +--- arch/openrisc/Kconfig | 3 --- arch/powerpc/platforms/Kconfig | 3 --- arch/score/Kconfig | 4 +--- arch/sh/Kconfig | 3 --- arch/unicore32/Kconfig | 4 +--- arch/x86/Kconfig | 4 +--- lib/Kconfig | 3 +++ 12 files changed, 10 insertions(+), 36 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3d74801..3636b11 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -70,10 +70,6 @@ config GENERIC_ISA_DMA bool default y -config GENERIC_IOMAP - bool - default n - source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 408b055..b3abfb0 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -19,10 +19,6 @@ config GENERIC_CMOS_UPDATE config ARCH_USES_GETTIMEOFFSET def_bool n -config GENERIC_IOMAP - bool - default y - config ARCH_HAS_ILOG2_U32 bool default n @@ -52,6 +48,7 @@ config CRIS select HAVE_IDE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP config HZ int diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 02513c2..9059e39 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -26,6 +26,7 @@ config HEXAGON select HAVE_ARCH_KGDB select HAVE_ARCH_TRACEHOOK select NO_IOPORT + select GENERIC_IOMAP # mostly generic routines, with some accelerated ones ---help--- Qualcomm Hexagon is a processor architecture designed for high @@ -73,9 +74,6 @@ config GENERIC_CSUM config GENERIC_IRQ_PROBE def_bool y -config GENERIC_IOMAP - def_bool y - #config ZONE_DMA # bool # default y diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 27489b6..2732e1b 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -29,6 +29,7 @@ config IA64 select GENERIC_IRQ_SHOW select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP default y help The Itanium Processor Family is Intel's 64-bit successor to @@ -102,10 +103,6 @@ config EFI bool default y -config GENERIC_IOMAP - bool - default y - config ARCH_CLOCKSOURCE_DATA def_bool y diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 361d540..973e686 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -38,9 +38,6 @@ config GENERIC_CALIBRATE_DELAY bool default y -config GENERIC_IOMAP - def_bool MMU - config TIME_LOW_RES bool default y @@ -73,6 +70,7 @@ source "kernel/Kconfig.freezer" config MMU bool "MMU-based Paged Memory Management Support" default y + select GENERIC_IOMAP help Select if you want MMU-based virtualised addressing space support by paged memory management. If unsure, say 'Y'. diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index e518a5a..081a54f 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -38,9 +38,6 @@ config RWSEM_XCHGADD_ALGORITHM config GENERIC_HWEIGHT def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT def_bool y diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 3fe6d92..100feed 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -175,9 +175,6 @@ config PPC_INDIRECT_MMIO config PPC_IO_WORKAROUNDS bool -config GENERIC_IOMAP - bool - source "drivers/cpufreq/Kconfig" menu "CPU Frequency drivers" diff --git a/arch/score/Kconfig b/arch/score/Kconfig index df169e8..455ce2d 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig @@ -4,6 +4,7 @@ config SCORE def_bool y select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP choice prompt "System type" @@ -33,9 +34,6 @@ endmenu config CPU_SCORE7 bool -config GENERIC_IOMAP - def_bool y - config NO_DMA bool default y diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5629e20..5aeab58 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -84,9 +84,6 @@ config GENERIC_GPIO config GENERIC_CALIBRATE_DELAY bool -config GENERIC_IOMAP - bool - config GENERIC_CLOCKEVENTS def_bool y diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index 942ed61..eeb8054 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig @@ -12,6 +12,7 @@ config UNICORE32 select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW select ARCH_WANT_FRAME_POINTERS + select GENERIC_IOMAP help UniCore-32 is 32-bit Instruction Set Architecture, including a series of low-power-consumption RISC chip @@ -30,9 +31,6 @@ config GENERIC_CLOCKEVENTS config GENERIC_CSUM def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cb9a104..08af645 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -75,6 +75,7 @@ config X86 select HAVE_BPF_JIT if (X86_64 && NET) select CLKEVT_I8253 select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP config INSTRUCTION_DECODER def_bool (KPROBES || PERF_EVENTS) @@ -140,9 +141,6 @@ config NEED_SG_DMA_LENGTH config GENERIC_ISA_DMA def_bool ISA_DMA_API -config GENERIC_IOMAP - def_bool y - config GENERIC_BUG def_bool y depends on BUG diff --git a/lib/Kconfig b/lib/Kconfig index 32f3e5a..0058927 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,6 +19,9 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_IOMAP + bool + config CRC_CCITT tristate "CRC-CCITT functions" help -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig @ 2011-11-24 20:15 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:15 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci define GENERIC_IOMAP in a central location instead of all architectures. This will be helpful for the follow-up patch which makes it select other configs. Code is also a bit shorter this way. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 4 ---- arch/cris/Kconfig | 5 +---- arch/hexagon/Kconfig | 4 +--- arch/ia64/Kconfig | 5 +---- arch/m68k/Kconfig | 4 +--- arch/openrisc/Kconfig | 3 --- arch/powerpc/platforms/Kconfig | 3 --- arch/score/Kconfig | 4 +--- arch/sh/Kconfig | 3 --- arch/unicore32/Kconfig | 4 +--- arch/x86/Kconfig | 4 +--- lib/Kconfig | 3 +++ 12 files changed, 10 insertions(+), 36 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3d74801..3636b11 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -70,10 +70,6 @@ config GENERIC_ISA_DMA bool default y -config GENERIC_IOMAP - bool - default n - source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 408b055..b3abfb0 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -19,10 +19,6 @@ config GENERIC_CMOS_UPDATE config ARCH_USES_GETTIMEOFFSET def_bool n -config GENERIC_IOMAP - bool - default y - config ARCH_HAS_ILOG2_U32 bool default n @@ -52,6 +48,7 @@ config CRIS select HAVE_IDE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP config HZ int diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 02513c2..9059e39 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -26,6 +26,7 @@ config HEXAGON select HAVE_ARCH_KGDB select HAVE_ARCH_TRACEHOOK select NO_IOPORT + select GENERIC_IOMAP # mostly generic routines, with some accelerated ones ---help--- Qualcomm Hexagon is a processor architecture designed for high @@ -73,9 +74,6 @@ config GENERIC_CSUM config GENERIC_IRQ_PROBE def_bool y -config GENERIC_IOMAP - def_bool y - #config ZONE_DMA # bool # default y diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 27489b6..2732e1b 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -29,6 +29,7 @@ config IA64 select GENERIC_IRQ_SHOW select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP default y help The Itanium Processor Family is Intel's 64-bit successor to @@ -102,10 +103,6 @@ config EFI bool default y -config GENERIC_IOMAP - bool - default y - config ARCH_CLOCKSOURCE_DATA def_bool y diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 361d540..973e686 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -38,9 +38,6 @@ config GENERIC_CALIBRATE_DELAY bool default y -config GENERIC_IOMAP - def_bool MMU - config TIME_LOW_RES bool default y @@ -73,6 +70,7 @@ source "kernel/Kconfig.freezer" config MMU bool "MMU-based Paged Memory Management Support" default y + select GENERIC_IOMAP help Select if you want MMU-based virtualised addressing space support by paged memory management. If unsure, say 'Y'. diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index e518a5a..081a54f 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -38,9 +38,6 @@ config RWSEM_XCHGADD_ALGORITHM config GENERIC_HWEIGHT def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT def_bool y diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 3fe6d92..100feed 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -175,9 +175,6 @@ config PPC_INDIRECT_MMIO config PPC_IO_WORKAROUNDS bool -config GENERIC_IOMAP - bool - source "drivers/cpufreq/Kconfig" menu "CPU Frequency drivers" diff --git a/arch/score/Kconfig b/arch/score/Kconfig index df169e8..455ce2d 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig @@ -4,6 +4,7 @@ config SCORE def_bool y select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP choice prompt "System type" @@ -33,9 +34,6 @@ endmenu config CPU_SCORE7 bool -config GENERIC_IOMAP - def_bool y - config NO_DMA bool default y diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5629e20..5aeab58 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -84,9 +84,6 @@ config GENERIC_GPIO config GENERIC_CALIBRATE_DELAY bool -config GENERIC_IOMAP - bool - config GENERIC_CLOCKEVENTS def_bool y diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index 942ed61..eeb8054 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig @@ -12,6 +12,7 @@ config UNICORE32 select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW select ARCH_WANT_FRAME_POINTERS + select GENERIC_IOMAP help UniCore-32 is 32-bit Instruction Set Architecture, including a series of low-power-consumption RISC chip @@ -30,9 +31,6 @@ config GENERIC_CLOCKEVENTS config GENERIC_CSUM def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cb9a104..08af645 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -75,6 +75,7 @@ config X86 select HAVE_BPF_JIT if (X86_64 && NET) select CLKEVT_I8253 select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP config INSTRUCTION_DECODER def_bool (KPROBES || PERF_EVENTS) @@ -140,9 +141,6 @@ config NEED_SG_DMA_LENGTH config GENERIC_ISA_DMA def_bool ISA_DMA_API -config GENERIC_IOMAP - def_bool y - config GENERIC_BUG def_bool y depends on BUG diff --git a/lib/Kconfig b/lib/Kconfig index 32f3e5a..0058927 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,6 +19,9 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_IOMAP + bool + config CRC_CCITT tristate "CRC-CCITT functions" help -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig @ 2011-11-24 20:15 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:15 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci define GENERIC_IOMAP in a central location instead of all architectures. This will be helpful for the follow-up patch which makes it select other configs. Code is also a bit shorter this way. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 4 ---- arch/cris/Kconfig | 5 +---- arch/hexagon/Kconfig | 4 +--- arch/ia64/Kconfig | 5 +---- arch/m68k/Kconfig | 4 +--- arch/openrisc/Kconfig | 3 --- arch/powerpc/platforms/Kconfig | 3 --- arch/score/Kconfig | 4 +--- arch/sh/Kconfig | 3 --- arch/unicore32/Kconfig | 4 +--- arch/x86/Kconfig | 4 +--- lib/Kconfig | 3 +++ 12 files changed, 10 insertions(+), 36 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3d74801..3636b11 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -70,10 +70,6 @@ config GENERIC_ISA_DMA bool default y -config GENERIC_IOMAP - bool - default n - source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 408b055..b3abfb0 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -19,10 +19,6 @@ config GENERIC_CMOS_UPDATE config ARCH_USES_GETTIMEOFFSET def_bool n -config GENERIC_IOMAP - bool - default y - config ARCH_HAS_ILOG2_U32 bool default n @@ -52,6 +48,7 @@ config CRIS select HAVE_IDE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP config HZ int diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 02513c2..9059e39 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -26,6 +26,7 @@ config HEXAGON select HAVE_ARCH_KGDB select HAVE_ARCH_TRACEHOOK select NO_IOPORT + select GENERIC_IOMAP # mostly generic routines, with some accelerated ones ---help--- Qualcomm Hexagon is a processor architecture designed for high @@ -73,9 +74,6 @@ config GENERIC_CSUM config GENERIC_IRQ_PROBE def_bool y -config GENERIC_IOMAP - def_bool y - #config ZONE_DMA # bool # default y diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 27489b6..2732e1b 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -29,6 +29,7 @@ config IA64 select GENERIC_IRQ_SHOW select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP default y help The Itanium Processor Family is Intel's 64-bit successor to @@ -102,10 +103,6 @@ config EFI bool default y -config GENERIC_IOMAP - bool - default y - config ARCH_CLOCKSOURCE_DATA def_bool y diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 361d540..973e686 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -38,9 +38,6 @@ config GENERIC_CALIBRATE_DELAY bool default y -config GENERIC_IOMAP - def_bool MMU - config TIME_LOW_RES bool default y @@ -73,6 +70,7 @@ source "kernel/Kconfig.freezer" config MMU bool "MMU-based Paged Memory Management Support" default y + select GENERIC_IOMAP help Select if you want MMU-based virtualised addressing space support by paged memory management. If unsure, say 'Y'. diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index e518a5a..081a54f 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -38,9 +38,6 @@ config RWSEM_XCHGADD_ALGORITHM config GENERIC_HWEIGHT def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT def_bool y diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 3fe6d92..100feed 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -175,9 +175,6 @@ config PPC_INDIRECT_MMIO config PPC_IO_WORKAROUNDS bool -config GENERIC_IOMAP - bool - source "drivers/cpufreq/Kconfig" menu "CPU Frequency drivers" diff --git a/arch/score/Kconfig b/arch/score/Kconfig index df169e8..455ce2d 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig @@ -4,6 +4,7 @@ config SCORE def_bool y select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP choice prompt "System type" @@ -33,9 +34,6 @@ endmenu config CPU_SCORE7 bool -config GENERIC_IOMAP - def_bool y - config NO_DMA bool default y diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5629e20..5aeab58 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -84,9 +84,6 @@ config GENERIC_GPIO config GENERIC_CALIBRATE_DELAY bool -config GENERIC_IOMAP - bool - config GENERIC_CLOCKEVENTS def_bool y diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index 942ed61..eeb8054 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig @@ -12,6 +12,7 @@ config UNICORE32 select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW select ARCH_WANT_FRAME_POINTERS + select GENERIC_IOMAP help UniCore-32 is 32-bit Instruction Set Architecture, including a series of low-power-consumption RISC chip @@ -30,9 +31,6 @@ config GENERIC_CLOCKEVENTS config GENERIC_CSUM def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cb9a104..08af645 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -75,6 +75,7 @@ config X86 select HAVE_BPF_JIT if (X86_64 && NET) select CLKEVT_I8253 select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP config INSTRUCTION_DECODER def_bool (KPROBES || PERF_EVENTS) @@ -140,9 +141,6 @@ config NEED_SG_DMA_LENGTH config GENERIC_ISA_DMA def_bool ISA_DMA_API -config GENERIC_IOMAP - def_bool y - config GENERIC_BUG def_bool y depends on BUG diff --git a/lib/Kconfig b/lib/Kconfig index 32f3e5a..0058927 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,6 +19,9 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_IOMAP + bool + config CRC_CCITT tristate "CRC-CCITT functions" help -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig @ 2011-11-24 20:15 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:15 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu define GENERIC_IOMAP in a central location instead of all architectures. This will be helpful for the follow-up patch which makes it select other configs. Code is also a bit shorter this way. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 4 ---- arch/cris/Kconfig | 5 +---- arch/hexagon/Kconfig | 4 +--- arch/ia64/Kconfig | 5 +---- arch/m68k/Kconfig | 4 +--- arch/openrisc/Kconfig | 3 --- arch/powerpc/platforms/Kconfig | 3 --- arch/score/Kconfig | 4 +--- arch/sh/Kconfig | 3 --- arch/unicore32/Kconfig | 4 +--- arch/x86/Kconfig | 4 +--- lib/Kconfig | 3 +++ 12 files changed, 10 insertions(+), 36 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3d74801..3636b11 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -70,10 +70,6 @@ config GENERIC_ISA_DMA bool default y -config GENERIC_IOMAP - bool - default n - source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 408b055..b3abfb0 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -19,10 +19,6 @@ config GENERIC_CMOS_UPDATE config ARCH_USES_GETTIMEOFFSET def_bool n -config GENERIC_IOMAP - bool - default y - config ARCH_HAS_ILOG2_U32 bool default n @@ -52,6 +48,7 @@ config CRIS select HAVE_IDE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP config HZ int diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 02513c2..9059e39 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -26,6 +26,7 @@ config HEXAGON select HAVE_ARCH_KGDB select HAVE_ARCH_TRACEHOOK select NO_IOPORT + select GENERIC_IOMAP # mostly generic routines, with some accelerated ones ---help--- Qualcomm Hexagon is a processor architecture designed for high @@ -73,9 +74,6 @@ config GENERIC_CSUM config GENERIC_IRQ_PROBE def_bool y -config GENERIC_IOMAP - def_bool y - #config ZONE_DMA # bool # default y diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 27489b6..2732e1b 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -29,6 +29,7 @@ config IA64 select GENERIC_IRQ_SHOW select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP default y help The Itanium Processor Family is Intel's 64-bit successor to @@ -102,10 +103,6 @@ config EFI bool default y -config GENERIC_IOMAP - bool - default y - config ARCH_CLOCKSOURCE_DATA def_bool y diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 361d540..973e686 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -38,9 +38,6 @@ config GENERIC_CALIBRATE_DELAY bool default y -config GENERIC_IOMAP - def_bool MMU - config TIME_LOW_RES bool default y @@ -73,6 +70,7 @@ source "kernel/Kconfig.freezer" config MMU bool "MMU-based Paged Memory Management Support" default y + select GENERIC_IOMAP help Select if you want MMU-based virtualised addressing space support by paged memory management. If unsure, say 'Y'. diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index e518a5a..081a54f 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -38,9 +38,6 @@ config RWSEM_XCHGADD_ALGORITHM config GENERIC_HWEIGHT def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT def_bool y diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 3fe6d92..100feed 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -175,9 +175,6 @@ config PPC_INDIRECT_MMIO config PPC_IO_WORKAROUNDS bool -config GENERIC_IOMAP - bool - source "drivers/cpufreq/Kconfig" menu "CPU Frequency drivers" diff --git a/arch/score/Kconfig b/arch/score/Kconfig index df169e8..455ce2d 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig @@ -4,6 +4,7 @@ config SCORE def_bool y select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW + select GENERIC_IOMAP choice prompt "System type" @@ -33,9 +34,6 @@ endmenu config CPU_SCORE7 bool -config GENERIC_IOMAP - def_bool y - config NO_DMA bool default y diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5629e20..5aeab58 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -84,9 +84,6 @@ config GENERIC_GPIO config GENERIC_CALIBRATE_DELAY bool -config GENERIC_IOMAP - bool - config GENERIC_CLOCKEVENTS def_bool y diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index 942ed61..eeb8054 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig @@ -12,6 +12,7 @@ config UNICORE32 select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW select ARCH_WANT_FRAME_POINTERS + select GENERIC_IOMAP help UniCore-32 is 32-bit Instruction Set Architecture, including a series of low-power-consumption RISC chip @@ -30,9 +31,6 @@ config GENERIC_CLOCKEVENTS config GENERIC_CSUM def_bool y -config GENERIC_IOMAP - def_bool y - config NO_IOPORT bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cb9a104..08af645 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -75,6 +75,7 @@ config X86 select HAVE_BPF_JIT if (X86_64 && NET) select CLKEVT_I8253 select ARCH_HAVE_NMI_SAFE_CMPXCHG + select GENERIC_IOMAP config INSTRUCTION_DECODER def_bool (KPROBES || PERF_EVENTS) @@ -140,9 +141,6 @@ config NEED_SG_DMA_LENGTH config GENERIC_ISA_DMA def_bool ISA_DMA_API -config GENERIC_IOMAP - def_bool y - config GENERIC_BUG def_bool y depends on BUG diff --git a/lib/Kconfig b/lib/Kconfig index 32f3e5a..0058927 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,6 +19,9 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_IOMAP + bool + config CRC_CCITT tristate "CRC-CCITT functions" help -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig 2011-11-24 20:15 ` Michael S. Tsirkin (?) @ 2011-11-25 8:41 ` Jesper Nilsson -1 siblings, 0 replies; 113+ messages in thread From: Jesper Nilsson @ 2011-11-25 8:41 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, Da [-- Attachment #1: Type: text/plain, Size: 495 bytes --] On Thu, Nov 24, 2011 at 09:15:42PM +0100, Michael S. Tsirkin wrote: > define GENERIC_IOMAP in a central location > instead of all architectures. This will be helpful > for the follow-up patch which makes it select > other configs. Code is also a bit shorter this way. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> For the CRIS part: Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> /^JN - Jesper Nilsson -- Jesper Nilsson -- jesper.nilsson@axis.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig @ 2011-11-25 8:41 ` Jesper Nilsson 0 siblings, 0 replies; 113+ messages in thread From: Jesper Nilsson @ 2011-11-25 8:41 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Nicolas Pitre, linux-mips@linux-mips.org, linux-m68k@vger.kernel.org, linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, linux@openrisc.net, linux-pci@vger.kernel.org, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux@vger.kernel.org, Guan Xuetao, Lennox Wu, Jonas Bonn, Russell King, linux-hexagon@vger.kernel.org, Helge Deller, x86@kernel.org, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch@vger.kernel.org, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux@itee.uq.edu.au, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel@lists.infradead.org, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc@vger.kernel.org, linux-cris-kernel, Paul Gortmaker, linux-kernel@vger.kernel.org, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha@vger.kernel.org, Olof Johansson, Andrew Morton, linuxppc-dev@lists.ozlabs.org, David S. Miller [-- Attachment #1: Type: text/plain, Size: 495 bytes --] On Thu, Nov 24, 2011 at 09:15:42PM +0100, Michael S. Tsirkin wrote: > define GENERIC_IOMAP in a central location > instead of all architectures. This will be helpful > for the follow-up patch which makes it select > other configs. Code is also a bit shorter this way. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> For the CRIS part: Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> /^JN - Jesper Nilsson -- Jesper Nilsson -- jesper.nilsson@axis.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig @ 2011-11-25 8:41 ` Jesper Nilsson 0 siblings, 0 replies; 113+ messages in thread From: Jesper Nilsson @ 2011-11-25 8:41 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86@kernel.org, Arnd Bergmann, Andrew Morton, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-cris-kernel, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@vger.kernel.org, microblaze-uclinux@itee.uq.edu.au, linux-mips@linux-mips.org, linux@openrisc.net, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, Jesse Barnes, linux-pci@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 495 bytes --] On Thu, Nov 24, 2011 at 09:15:42PM +0100, Michael S. Tsirkin wrote: > define GENERIC_IOMAP in a central location > instead of all architectures. This will be helpful > for the follow-up patch which makes it select > other configs. Code is also a bit shorter this way. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> For the CRIS part: Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> /^JN - Jesper Nilsson -- Jesper Nilsson -- jesper.nilsson@axis.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig 2011-11-24 20:15 ` Michael S. Tsirkin (?) (?) @ 2011-11-28 20:12 ` Richard Kuo -1 siblings, 0 replies; 113+ messages in thread From: Richard Kuo @ 2011-11-28 20:12 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt On Thu, Nov 24, 2011 at 10:15:42PM +0200, Michael S. Tsirkin wrote: > define GENERIC_IOMAP in a central location > instead of all architectures. This will be helpful > for the follow-up patch which makes it select > other configs. Code is also a bit shorter this way. For the Hexagon config, Acked-by: Richard Kuo <rkuo@codeaurora.org> -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig @ 2011-11-28 20:12 ` Richard Kuo 0 siblings, 0 replies; 113+ messages in thread From: Richard Kuo @ 2011-11-28 20:12 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux-sh, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller On Thu, Nov 24, 2011 at 10:15:42PM +0200, Michael S. Tsirkin wrote: > define GENERIC_IOMAP in a central location > instead of all architectures. This will be helpful > for the follow-up patch which makes it select > other configs. Code is also a bit shorter this way. For the Hexagon config, Acked-by: Richard Kuo <rkuo@codeaurora.org> -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig @ 2011-11-28 20:12 ` Richard Kuo 0 siblings, 0 replies; 113+ messages in thread From: Richard Kuo @ 2011-11-28 20:12 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt On Thu, Nov 24, 2011 at 10:15:42PM +0200, Michael S. Tsirkin wrote: > define GENERIC_IOMAP in a central location > instead of all architectures. This will be helpful > for the follow-up patch which makes it select > other configs. Code is also a bit shorter this way. For the Hexagon config, Acked-by: Richard Kuo <rkuo@codeaurora.org> -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig @ 2011-11-28 20:12 ` Richard Kuo 0 siblings, 0 replies; 113+ messages in thread From: Richard Kuo @ 2011-11-28 20:12 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci On Thu, Nov 24, 2011 at 10:15:42PM +0200, Michael S. Tsirkin wrote: > define GENERIC_IOMAP in a central location > instead of all architectures. This will be helpful > for the follow-up patch which makes it select > other configs. Code is also a bit shorter this way. For the Hexagon config, Acked-by: Richard Kuo <rkuo@codeaurora.org> -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ^ permalink raw reply [flat|nested] 113+ messages in thread
* [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP [not found] <cover.1322163031.git.mst@redhat.com> ` (3 preceding siblings ...) 2011-11-24 20:17 ` Michael S. Tsirkin @ 2011-11-24 20:17 ` Michael S. Tsirkin 2011-11-24 20:18 ` Michael S. Tsirkin ` (4 subsequent siblings) 9 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu Many architectures want a generic pci_iomap but not the rest of iomap.c. Split that to a separate .c file and add a new config symbol. select automatically by GENERIC_IOMAP. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- include/asm-generic/io.h | 5 +-- include/asm-generic/iomap.h | 7 +---- include/asm-generic/pci_iomap.h | 26 +++++++++++++++++++++ lib/Kconfig | 4 +++ lib/Makefile | 1 + lib/iomap.c | 38 +----------------------------- lib/pci_iomap.c | 48 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 85 insertions(+), 44 deletions(-) create mode 100644 include/asm-generic/pci_iomap.h create mode 100644 lib/pci_iomap.c diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 9120887..c8a67345 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -19,6 +19,8 @@ #include <asm-generic/iomap.h> #endif +#include <asm-generic/pci_iomap.h> + #ifndef mmiowb #define mmiowb() do {} while (0) #endif @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) #define __io_virt(x) ((void __force *) (x)) #ifndef CONFIG_GENERIC_IOMAP -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) { } diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 98dcd76..fdcddcb 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); #ifdef CONFIG_PCI /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); #else struct pci_dev; -static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - return NULL; -} static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { } #endif +#include <asm-generic/pci_iomap.h> + #endif diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h new file mode 100644 index 0000000..e08b3bd --- /dev/null +++ b/include/asm-generic/pci_iomap.h @@ -0,0 +1,26 @@ +/* Generic I/O port emulation, based on MN10300 code + * + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public Licence + * as published by the Free Software Foundation; either version + * 2 of the Licence, or (at your option) any later version. + */ +#ifndef __ASM_GENERIC_PCI_IOMAP_H +#define __ASM_GENERIC_PCI_IOMAP_H + +#ifdef CONFIG_PCI +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ +struct pci_dev; +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); +#else +struct pci_dev; +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) +{ + return NULL; +} +#endif + +#endif /* __ASM_GENERIC_IO_H */ diff --git a/lib/Kconfig b/lib/Kconfig index 0058927..36884b4 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,8 +19,12 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_PCI_IOMAP + bool + config GENERIC_IOMAP bool + select GENERIC_PCI_IOMAP config CRC_CCITT tristate "CRC-CCITT functions" diff --git a/lib/Makefile b/lib/Makefile index a4da283..609b2adc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -33,6 +33,7 @@ endif lib-$(CONFIG_HOTPLUG) += kobject_uevent.o obj-$(CONFIG_GENERIC_IOMAP) += iomap.o +obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o diff --git a/lib/iomap.c b/lib/iomap.c index 5dbcb4b..ada922a 100644 --- a/lib/iomap.c +++ b/lib/iomap.c @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); #endif /* CONFIG_HAS_IOPORT */ #ifdef CONFIG_PCI -/** - * pci_iomap - create a virtual mapping cookie for a PCI BAR - * @dev: PCI device that owns the BAR - * @bar: BAR number - * @maxlen: length of the memory to map - * - * Using this function you will get a __iomem address to your device BAR. - * You can access it using ioread*() and iowrite*(). These functions hide - * the details if this is a MMIO or PIO address space and will just do what - * you expect from them in the correct way. - * - * @maxlen specifies the maximum length to map. If you want to get access to - * the complete BAR without checking for its length first, pass %0 here. - * */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - +/* Hide the details if this is a MMIO or PIO address space and just do what + * you expect in the correct way. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { IO_COND(addr, /* nothing */, iounmap(addr)); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c new file mode 100644 index 0000000..40b26cb --- /dev/null +++ b/lib/pci_iomap.c @@ -0,0 +1,48 @@ +/* + * Implement the default iomap interfaces + * + * (C) Copyright 2004 Linus Torvalds + */ +#include <linux/pci.h> +#include <linux/io.h> + +#include <linux/module.h> + +#ifdef CONFIG_PCI +/** + * pci_iomap - create a virtual mapping cookie for a PCI BAR + * @dev: PCI device that owns the BAR + * @bar: BAR number + * @maxlen: length of the memory to map + * + * Using this function you will get a __iomem address to your device BAR. + * You can access it using ioread*() and iowrite*(). These functions hide + * the details if this is a MMIO or PIO address space and will just do what + * you expect from them in the correct way. + * + * @maxlen specifies the maximum length to map. If you want to get access to + * the complete BAR without checking for its length first, pass %0 here. + * */ +void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) +{ + resource_size_t start = pci_resource_start(dev, bar); + resource_size_t len = pci_resource_len(dev, bar); + unsigned long flags = pci_resource_flags(dev, bar); + + if (!len || !start) + return NULL; + if (maxlen && len > maxlen) + len = maxlen; + if (flags & IORESOURCE_IO) + return ioport_map(start, len); + if (flags & IORESOURCE_MEM) { + if (flags & IORESOURCE_CACHEABLE) + return ioremap(start, len); + return ioremap_nocache(start, len); + } + /* What? */ + return NULL; +} + +EXPORT_SYMBOL(pci_iomap); +#endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, Michael S. Tsirkin, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller Many architectures want a generic pci_iomap but not the rest of iomap.c. Split that to a separate .c file and add a new config symbol. select automatically by GENERIC_IOMAP. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- include/asm-generic/io.h | 5 +-- include/asm-generic/iomap.h | 7 +---- include/asm-generic/pci_iomap.h | 26 +++++++++++++++++++++ lib/Kconfig | 4 +++ lib/Makefile | 1 + lib/iomap.c | 38 +----------------------------- lib/pci_iomap.c | 48 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 85 insertions(+), 44 deletions(-) create mode 100644 include/asm-generic/pci_iomap.h create mode 100644 lib/pci_iomap.c diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 9120887..c8a67345 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -19,6 +19,8 @@ #include <asm-generic/iomap.h> #endif +#include <asm-generic/pci_iomap.h> + #ifndef mmiowb #define mmiowb() do {} while (0) #endif @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) #define __io_virt(x) ((void __force *) (x)) #ifndef CONFIG_GENERIC_IOMAP -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) { } diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 98dcd76..fdcddcb 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); #ifdef CONFIG_PCI /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); #else struct pci_dev; -static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - return NULL; -} static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { } #endif +#include <asm-generic/pci_iomap.h> + #endif diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h new file mode 100644 index 0000000..e08b3bd --- /dev/null +++ b/include/asm-generic/pci_iomap.h @@ -0,0 +1,26 @@ +/* Generic I/O port emulation, based on MN10300 code + * + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public Licence + * as published by the Free Software Foundation; either version + * 2 of the Licence, or (at your option) any later version. + */ +#ifndef __ASM_GENERIC_PCI_IOMAP_H +#define __ASM_GENERIC_PCI_IOMAP_H + +#ifdef CONFIG_PCI +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ +struct pci_dev; +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); +#else +struct pci_dev; +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) +{ + return NULL; +} +#endif + +#endif /* __ASM_GENERIC_IO_H */ diff --git a/lib/Kconfig b/lib/Kconfig index 0058927..36884b4 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,8 +19,12 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_PCI_IOMAP + bool + config GENERIC_IOMAP bool + select GENERIC_PCI_IOMAP config CRC_CCITT tristate "CRC-CCITT functions" diff --git a/lib/Makefile b/lib/Makefile index a4da283..609b2adc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -33,6 +33,7 @@ endif lib-$(CONFIG_HOTPLUG) += kobject_uevent.o obj-$(CONFIG_GENERIC_IOMAP) += iomap.o +obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o diff --git a/lib/iomap.c b/lib/iomap.c index 5dbcb4b..ada922a 100644 --- a/lib/iomap.c +++ b/lib/iomap.c @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); #endif /* CONFIG_HAS_IOPORT */ #ifdef CONFIG_PCI -/** - * pci_iomap - create a virtual mapping cookie for a PCI BAR - * @dev: PCI device that owns the BAR - * @bar: BAR number - * @maxlen: length of the memory to map - * - * Using this function you will get a __iomem address to your device BAR. - * You can access it using ioread*() and iowrite*(). These functions hide - * the details if this is a MMIO or PIO address space and will just do what - * you expect from them in the correct way. - * - * @maxlen specifies the maximum length to map. If you want to get access to - * the complete BAR without checking for its length first, pass %0 here. - * */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - +/* Hide the details if this is a MMIO or PIO address space and just do what + * you expect in the correct way. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { IO_COND(addr, /* nothing */, iounmap(addr)); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c new file mode 100644 index 0000000..40b26cb --- /dev/null +++ b/lib/pci_iomap.c @@ -0,0 +1,48 @@ +/* + * Implement the default iomap interfaces + * + * (C) Copyright 2004 Linus Torvalds + */ +#include <linux/pci.h> +#include <linux/io.h> + +#include <linux/module.h> + +#ifdef CONFIG_PCI +/** + * pci_iomap - create a virtual mapping cookie for a PCI BAR + * @dev: PCI device that owns the BAR + * @bar: BAR number + * @maxlen: length of the memory to map + * + * Using this function you will get a __iomem address to your device BAR. + * You can access it using ioread*() and iowrite*(). These functions hide + * the details if this is a MMIO or PIO address space and will just do what + * you expect from them in the correct way. + * + * @maxlen specifies the maximum length to map. If you want to get access to + * the complete BAR without checking for its length first, pass %0 here. + * */ +void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) +{ + resource_size_t start = pci_resource_start(dev, bar); + resource_size_t len = pci_resource_len(dev, bar); + unsigned long flags = pci_resource_flags(dev, bar); + + if (!len || !start) + return NULL; + if (maxlen && len > maxlen) + len = maxlen; + if (flags & IORESOURCE_IO) + return ioport_map(start, len); + if (flags & IORESOURCE_MEM) { + if (flags & IORESOURCE_CACHEABLE) + return ioremap(start, len); + return ioremap_nocache(start, len); + } + /* What? */ + return NULL; +} + +EXPORT_SYMBOL(pci_iomap); +#endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu Many architectures want a generic pci_iomap but not the rest of iomap.c. Split that to a separate .c file and add a new config symbol. select automatically by GENERIC_IOMAP. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- include/asm-generic/io.h | 5 +-- include/asm-generic/iomap.h | 7 +---- include/asm-generic/pci_iomap.h | 26 +++++++++++++++++++++ lib/Kconfig | 4 +++ lib/Makefile | 1 + lib/iomap.c | 38 +----------------------------- lib/pci_iomap.c | 48 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 85 insertions(+), 44 deletions(-) create mode 100644 include/asm-generic/pci_iomap.h create mode 100644 lib/pci_iomap.c diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 9120887..c8a67345 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -19,6 +19,8 @@ #include <asm-generic/iomap.h> #endif +#include <asm-generic/pci_iomap.h> + #ifndef mmiowb #define mmiowb() do {} while (0) #endif @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) #define __io_virt(x) ((void __force *) (x)) #ifndef CONFIG_GENERIC_IOMAP -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) { } diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 98dcd76..fdcddcb 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); #ifdef CONFIG_PCI /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); #else struct pci_dev; -static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - return NULL; -} static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { } #endif +#include <asm-generic/pci_iomap.h> + #endif diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h new file mode 100644 index 0000000..e08b3bd --- /dev/null +++ b/include/asm-generic/pci_iomap.h @@ -0,0 +1,26 @@ +/* Generic I/O port emulation, based on MN10300 code + * + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public Licence + * as published by the Free Software Foundation; either version + * 2 of the Licence, or (at your option) any later version. + */ +#ifndef __ASM_GENERIC_PCI_IOMAP_H +#define __ASM_GENERIC_PCI_IOMAP_H + +#ifdef CONFIG_PCI +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ +struct pci_dev; +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); +#else +struct pci_dev; +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) +{ + return NULL; +} +#endif + +#endif /* __ASM_GENERIC_IO_H */ diff --git a/lib/Kconfig b/lib/Kconfig index 0058927..36884b4 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,8 +19,12 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_PCI_IOMAP + bool + config GENERIC_IOMAP bool + select GENERIC_PCI_IOMAP config CRC_CCITT tristate "CRC-CCITT functions" diff --git a/lib/Makefile b/lib/Makefile index a4da283..609b2adc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -33,6 +33,7 @@ endif lib-$(CONFIG_HOTPLUG) += kobject_uevent.o obj-$(CONFIG_GENERIC_IOMAP) += iomap.o +obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o diff --git a/lib/iomap.c b/lib/iomap.c index 5dbcb4b..ada922a 100644 --- a/lib/iomap.c +++ b/lib/iomap.c @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); #endif /* CONFIG_HAS_IOPORT */ #ifdef CONFIG_PCI -/** - * pci_iomap - create a virtual mapping cookie for a PCI BAR - * @dev: PCI device that owns the BAR - * @bar: BAR number - * @maxlen: length of the memory to map - * - * Using this function you will get a __iomem address to your device BAR. - * You can access it using ioread*() and iowrite*(). These functions hide - * the details if this is a MMIO or PIO address space and will just do what - * you expect from them in the correct way. - * - * @maxlen specifies the maximum length to map. If you want to get access to - * the complete BAR without checking for its length first, pass %0 here. - * */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - +/* Hide the details if this is a MMIO or PIO address space and just do what + * you expect in the correct way. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { IO_COND(addr, /* nothing */, iounmap(addr)); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c new file mode 100644 index 0000000..40b26cb --- /dev/null +++ b/lib/pci_iomap.c @@ -0,0 +1,48 @@ +/* + * Implement the default iomap interfaces + * + * (C) Copyright 2004 Linus Torvalds + */ +#include <linux/pci.h> +#include <linux/io.h> + +#include <linux/module.h> + +#ifdef CONFIG_PCI +/** + * pci_iomap - create a virtual mapping cookie for a PCI BAR + * @dev: PCI device that owns the BAR + * @bar: BAR number + * @maxlen: length of the memory to map + * + * Using this function you will get a __iomem address to your device BAR. + * You can access it using ioread*() and iowrite*(). These functions hide + * the details if this is a MMIO or PIO address space and will just do what + * you expect from them in the correct way. + * + * @maxlen specifies the maximum length to map. If you want to get access to + * the complete BAR without checking for its length first, pass %0 here. + * */ +void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) +{ + resource_size_t start = pci_resource_start(dev, bar); + resource_size_t len = pci_resource_len(dev, bar); + unsigned long flags = pci_resource_flags(dev, bar); + + if (!len || !start) + return NULL; + if (maxlen && len > maxlen) + len = maxlen; + if (flags & IORESOURCE_IO) + return ioport_map(start, len); + if (flags & IORESOURCE_MEM) { + if (flags & IORESOURCE_CACHEABLE) + return ioremap(start, len); + return ioremap_nocache(start, len); + } + /* What? */ + return NULL; +} + +EXPORT_SYMBOL(pci_iomap); +#endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci Many architectures want a generic pci_iomap but not the rest of iomap.c. Split that to a separate .c file and add a new config symbol. select automatically by GENERIC_IOMAP. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- include/asm-generic/io.h | 5 +-- include/asm-generic/iomap.h | 7 +---- include/asm-generic/pci_iomap.h | 26 +++++++++++++++++++++ lib/Kconfig | 4 +++ lib/Makefile | 1 + lib/iomap.c | 38 +----------------------------- lib/pci_iomap.c | 48 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 85 insertions(+), 44 deletions(-) create mode 100644 include/asm-generic/pci_iomap.h create mode 100644 lib/pci_iomap.c diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 9120887..c8a67345 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -19,6 +19,8 @@ #include <asm-generic/iomap.h> #endif +#include <asm-generic/pci_iomap.h> + #ifndef mmiowb #define mmiowb() do {} while (0) #endif @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) #define __io_virt(x) ((void __force *) (x)) #ifndef CONFIG_GENERIC_IOMAP -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) { } diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 98dcd76..fdcddcb 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); #ifdef CONFIG_PCI /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); #else struct pci_dev; -static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - return NULL; -} static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { } #endif +#include <asm-generic/pci_iomap.h> + #endif diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h new file mode 100644 index 0000000..e08b3bd --- /dev/null +++ b/include/asm-generic/pci_iomap.h @@ -0,0 +1,26 @@ +/* Generic I/O port emulation, based on MN10300 code + * + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public Licence + * as published by the Free Software Foundation; either version + * 2 of the Licence, or (at your option) any later version. + */ +#ifndef __ASM_GENERIC_PCI_IOMAP_H +#define __ASM_GENERIC_PCI_IOMAP_H + +#ifdef CONFIG_PCI +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ +struct pci_dev; +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); +#else +struct pci_dev; +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) +{ + return NULL; +} +#endif + +#endif /* __ASM_GENERIC_IO_H */ diff --git a/lib/Kconfig b/lib/Kconfig index 0058927..36884b4 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,8 +19,12 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_PCI_IOMAP + bool + config GENERIC_IOMAP bool + select GENERIC_PCI_IOMAP config CRC_CCITT tristate "CRC-CCITT functions" diff --git a/lib/Makefile b/lib/Makefile index a4da283..609b2adc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -33,6 +33,7 @@ endif lib-$(CONFIG_HOTPLUG) += kobject_uevent.o obj-$(CONFIG_GENERIC_IOMAP) += iomap.o +obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o diff --git a/lib/iomap.c b/lib/iomap.c index 5dbcb4b..ada922a 100644 --- a/lib/iomap.c +++ b/lib/iomap.c @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); #endif /* CONFIG_HAS_IOPORT */ #ifdef CONFIG_PCI -/** - * pci_iomap - create a virtual mapping cookie for a PCI BAR - * @dev: PCI device that owns the BAR - * @bar: BAR number - * @maxlen: length of the memory to map - * - * Using this function you will get a __iomem address to your device BAR. - * You can access it using ioread*() and iowrite*(). These functions hide - * the details if this is a MMIO or PIO address space and will just do what - * you expect from them in the correct way. - * - * @maxlen specifies the maximum length to map. If you want to get access to - * the complete BAR without checking for its length first, pass %0 here. - * */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - +/* Hide the details if this is a MMIO or PIO address space and just do what + * you expect in the correct way. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { IO_COND(addr, /* nothing */, iounmap(addr)); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c new file mode 100644 index 0000000..40b26cb --- /dev/null +++ b/lib/pci_iomap.c @@ -0,0 +1,48 @@ +/* + * Implement the default iomap interfaces + * + * (C) Copyright 2004 Linus Torvalds + */ +#include <linux/pci.h> +#include <linux/io.h> + +#include <linux/module.h> + +#ifdef CONFIG_PCI +/** + * pci_iomap - create a virtual mapping cookie for a PCI BAR + * @dev: PCI device that owns the BAR + * @bar: BAR number + * @maxlen: length of the memory to map + * + * Using this function you will get a __iomem address to your device BAR. + * You can access it using ioread*() and iowrite*(). These functions hide + * the details if this is a MMIO or PIO address space and will just do what + * you expect from them in the correct way. + * + * @maxlen specifies the maximum length to map. If you want to get access to + * the complete BAR without checking for its length first, pass %0 here. + * */ +void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) +{ + resource_size_t start = pci_resource_start(dev, bar); + resource_size_t len = pci_resource_len(dev, bar); + unsigned long flags = pci_resource_flags(dev, bar); + + if (!len || !start) + return NULL; + if (maxlen && len > maxlen) + len = maxlen; + if (flags & IORESOURCE_IO) + return ioport_map(start, len); + if (flags & IORESOURCE_MEM) { + if (flags & IORESOURCE_CACHEABLE) + return ioremap(start, len); + return ioremap_nocache(start, len); + } + /* What? */ + return NULL; +} + +EXPORT_SYMBOL(pci_iomap); +#endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci Many architectures want a generic pci_iomap but not the rest of iomap.c. Split that to a separate .c file and add a new config symbol. select automatically by GENERIC_IOMAP. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- include/asm-generic/io.h | 5 +-- include/asm-generic/iomap.h | 7 +---- include/asm-generic/pci_iomap.h | 26 +++++++++++++++++++++ lib/Kconfig | 4 +++ lib/Makefile | 1 + lib/iomap.c | 38 +----------------------------- lib/pci_iomap.c | 48 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 85 insertions(+), 44 deletions(-) create mode 100644 include/asm-generic/pci_iomap.h create mode 100644 lib/pci_iomap.c diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 9120887..c8a67345 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -19,6 +19,8 @@ #include <asm-generic/iomap.h> #endif +#include <asm-generic/pci_iomap.h> + #ifndef mmiowb #define mmiowb() do {} while (0) #endif @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) #define __io_virt(x) ((void __force *) (x)) #ifndef CONFIG_GENERIC_IOMAP -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) { } diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 98dcd76..fdcddcb 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); #ifdef CONFIG_PCI /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); #else struct pci_dev; -static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - return NULL; -} static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { } #endif +#include <asm-generic/pci_iomap.h> + #endif diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h new file mode 100644 index 0000000..e08b3bd --- /dev/null +++ b/include/asm-generic/pci_iomap.h @@ -0,0 +1,26 @@ +/* Generic I/O port emulation, based on MN10300 code + * + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public Licence + * as published by the Free Software Foundation; either version + * 2 of the Licence, or (at your option) any later version. + */ +#ifndef __ASM_GENERIC_PCI_IOMAP_H +#define __ASM_GENERIC_PCI_IOMAP_H + +#ifdef CONFIG_PCI +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ +struct pci_dev; +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); +#else +struct pci_dev; +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) +{ + return NULL; +} +#endif + +#endif /* __ASM_GENERIC_IO_H */ diff --git a/lib/Kconfig b/lib/Kconfig index 0058927..36884b4 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,8 +19,12 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_PCI_IOMAP + bool + config GENERIC_IOMAP bool + select GENERIC_PCI_IOMAP config CRC_CCITT tristate "CRC-CCITT functions" diff --git a/lib/Makefile b/lib/Makefile index a4da283..609b2adc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -33,6 +33,7 @@ endif lib-$(CONFIG_HOTPLUG) += kobject_uevent.o obj-$(CONFIG_GENERIC_IOMAP) += iomap.o +obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o diff --git a/lib/iomap.c b/lib/iomap.c index 5dbcb4b..ada922a 100644 --- a/lib/iomap.c +++ b/lib/iomap.c @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); #endif /* CONFIG_HAS_IOPORT */ #ifdef CONFIG_PCI -/** - * pci_iomap - create a virtual mapping cookie for a PCI BAR - * @dev: PCI device that owns the BAR - * @bar: BAR number - * @maxlen: length of the memory to map - * - * Using this function you will get a __iomem address to your device BAR. - * You can access it using ioread*() and iowrite*(). These functions hide - * the details if this is a MMIO or PIO address space and will just do what - * you expect from them in the correct way. - * - * @maxlen specifies the maximum length to map. If you want to get access to - * the complete BAR without checking for its length first, pass %0 here. - * */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - +/* Hide the details if this is a MMIO or PIO address space and just do what + * you expect in the correct way. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { IO_COND(addr, /* nothing */, iounmap(addr)); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c new file mode 100644 index 0000000..40b26cb --- /dev/null +++ b/lib/pci_iomap.c @@ -0,0 +1,48 @@ +/* + * Implement the default iomap interfaces + * + * (C) Copyright 2004 Linus Torvalds + */ +#include <linux/pci.h> +#include <linux/io.h> + +#include <linux/module.h> + +#ifdef CONFIG_PCI +/** + * pci_iomap - create a virtual mapping cookie for a PCI BAR + * @dev: PCI device that owns the BAR + * @bar: BAR number + * @maxlen: length of the memory to map + * + * Using this function you will get a __iomem address to your device BAR. + * You can access it using ioread*() and iowrite*(). These functions hide + * the details if this is a MMIO or PIO address space and will just do what + * you expect from them in the correct way. + * + * @maxlen specifies the maximum length to map. If you want to get access to + * the complete BAR without checking for its length first, pass %0 here. + * */ +void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) +{ + resource_size_t start = pci_resource_start(dev, bar); + resource_size_t len = pci_resource_len(dev, bar); + unsigned long flags = pci_resource_flags(dev, bar); + + if (!len || !start) + return NULL; + if (maxlen && len > maxlen) + len = maxlen; + if (flags & IORESOURCE_IO) + return ioport_map(start, len); + if (flags & IORESOURCE_MEM) { + if (flags & IORESOURCE_CACHEABLE) + return ioremap(start, len); + return ioremap_nocache(start, len); + } + /* What? */ + return NULL; +} + +EXPORT_SYMBOL(pci_iomap); +#endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu Many architectures want a generic pci_iomap but not the rest of iomap.c. Split that to a separate .c file and add a new config symbol. select automatically by GENERIC_IOMAP. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- include/asm-generic/io.h | 5 +-- include/asm-generic/iomap.h | 7 +---- include/asm-generic/pci_iomap.h | 26 +++++++++++++++++++++ lib/Kconfig | 4 +++ lib/Makefile | 1 + lib/iomap.c | 38 +----------------------------- lib/pci_iomap.c | 48 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 85 insertions(+), 44 deletions(-) create mode 100644 include/asm-generic/pci_iomap.h create mode 100644 lib/pci_iomap.c diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 9120887..c8a67345 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -19,6 +19,8 @@ #include <asm-generic/iomap.h> #endif +#include <asm-generic/pci_iomap.h> + #ifndef mmiowb #define mmiowb() do {} while (0) #endif @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) #define __io_virt(x) ((void __force *) (x)) #ifndef CONFIG_GENERIC_IOMAP -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) { } diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 98dcd76..fdcddcb 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); #ifdef CONFIG_PCI /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); #else struct pci_dev; -static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - return NULL; -} static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { } #endif +#include <asm-generic/pci_iomap.h> + #endif diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h new file mode 100644 index 0000000..e08b3bd --- /dev/null +++ b/include/asm-generic/pci_iomap.h @@ -0,0 +1,26 @@ +/* Generic I/O port emulation, based on MN10300 code + * + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public Licence + * as published by the Free Software Foundation; either version + * 2 of the Licence, or (at your option) any later version. + */ +#ifndef __ASM_GENERIC_PCI_IOMAP_H +#define __ASM_GENERIC_PCI_IOMAP_H + +#ifdef CONFIG_PCI +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ +struct pci_dev; +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); +#else +struct pci_dev; +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) +{ + return NULL; +} +#endif + +#endif /* __ASM_GENERIC_IO_H */ diff --git a/lib/Kconfig b/lib/Kconfig index 0058927..36884b4 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,8 +19,12 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_PCI_IOMAP + bool + config GENERIC_IOMAP bool + select GENERIC_PCI_IOMAP config CRC_CCITT tristate "CRC-CCITT functions" diff --git a/lib/Makefile b/lib/Makefile index a4da283..609b2adc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -33,6 +33,7 @@ endif lib-$(CONFIG_HOTPLUG) += kobject_uevent.o obj-$(CONFIG_GENERIC_IOMAP) += iomap.o +obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o diff --git a/lib/iomap.c b/lib/iomap.c index 5dbcb4b..ada922a 100644 --- a/lib/iomap.c +++ b/lib/iomap.c @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); #endif /* CONFIG_HAS_IOPORT */ #ifdef CONFIG_PCI -/** - * pci_iomap - create a virtual mapping cookie for a PCI BAR - * @dev: PCI device that owns the BAR - * @bar: BAR number - * @maxlen: length of the memory to map - * - * Using this function you will get a __iomem address to your device BAR. - * You can access it using ioread*() and iowrite*(). These functions hide - * the details if this is a MMIO or PIO address space and will just do what - * you expect from them in the correct way. - * - * @maxlen specifies the maximum length to map. If you want to get access to - * the complete BAR without checking for its length first, pass %0 here. - * */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - +/* Hide the details if this is a MMIO or PIO address space and just do what + * you expect in the correct way. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { IO_COND(addr, /* nothing */, iounmap(addr)); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c new file mode 100644 index 0000000..40b26cb --- /dev/null +++ b/lib/pci_iomap.c @@ -0,0 +1,48 @@ +/* + * Implement the default iomap interfaces + * + * (C) Copyright 2004 Linus Torvalds + */ +#include <linux/pci.h> +#include <linux/io.h> + +#include <linux/module.h> + +#ifdef CONFIG_PCI +/** + * pci_iomap - create a virtual mapping cookie for a PCI BAR + * @dev: PCI device that owns the BAR + * @bar: BAR number + * @maxlen: length of the memory to map + * + * Using this function you will get a __iomem address to your device BAR. + * You can access it using ioread*() and iowrite*(). These functions hide + * the details if this is a MMIO or PIO address space and will just do what + * you expect from them in the correct way. + * + * @maxlen specifies the maximum length to map. If you want to get access to + * the complete BAR without checking for its length first, pass %0 here. + * */ +void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) +{ + resource_size_t start = pci_resource_start(dev, bar); + resource_size_t len = pci_resource_len(dev, bar); + unsigned long flags = pci_resource_flags(dev, bar); + + if (!len || !start) + return NULL; + if (maxlen && len > maxlen) + len = maxlen; + if (flags & IORESOURCE_IO) + return ioport_map(start, len); + if (flags & IORESOURCE_MEM) { + if (flags & IORESOURCE_CACHEABLE) + return ioremap(start, len); + return ioremap_nocache(start, len); + } + /* What? */ + return NULL; +} + +EXPORT_SYMBOL(pci_iomap); +#endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP 2011-11-24 20:17 ` Michael S. Tsirkin (?) (?) @ 2011-11-24 22:07 ` Arnd Bergmann -1 siblings, 0 replies; 113+ messages in thread From: Arnd Bergmann @ 2011-11-24 22:07 UTC (permalink / raw) To: linuxppc-dev Cc: Michael S. Tsirkin, Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert On Thursday 24 November 2011 22:17:02 Michael S. Tsirkin wrote: > Many architectures want a generic pci_iomap but > not the rest of iomap.c. Split that to a separate .c > file and add a new config symbol. select automatically > by GENERIC_IOMAP. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Very nice! Acked-by: Arnd Bergmann <arnd@arndb.de> ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-24 22:07 ` Arnd Bergmann 0 siblings, 0 replies; 113+ messages in thread From: Arnd Bergmann @ 2011-11-24 22:07 UTC (permalink / raw) To: linuxppc-dev Cc: Nicolas Pitre, linux-mips, linux-m68k, x86, linux-ia64, Michael S. Tsirkin, linux-pci, linux, Jesse Barnes, Chen Liqin, Paul Mackerras, Ralf Baechle, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-hexagon, Helge Deller, linux-sh, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, Arend van Spriel, Matt Turner, linux-arch, Lasse Collin, Lucas De Marchi, microblaze-uclinux, Michal Simek, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Andrew Morton, linux-arm-kernel, Richard Henderson, Michael Ellerman, Paul Bolle, Tony Luck, linux-cris-kernel, linux-parisc, Paul Gortmaker, linux-kernel, Fenghua Yu, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Fabio Baltieri, David S. Miller On Thursday 24 November 2011 22:17:02 Michael S. Tsirkin wrote: > Many architectures want a generic pci_iomap but > not the rest of iomap.c. Split that to a separate .c > file and add a new config symbol. select automatically > by GENERIC_IOMAP. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Very nice! Acked-by: Arnd Bergmann <arnd@arndb.de> ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-24 22:07 ` Arnd Bergmann 0 siblings, 0 replies; 113+ messages in thread From: Arnd Bergmann @ 2011-11-24 22:07 UTC (permalink / raw) To: linuxppc-dev Cc: Michael S. Tsirkin, Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert On Thursday 24 November 2011 22:17:02 Michael S. Tsirkin wrote: > Many architectures want a generic pci_iomap but > not the rest of iomap.c. Split that to a separate .c > file and add a new config symbol. select automatically > by GENERIC_IOMAP. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Very nice! Acked-by: Arnd Bergmann <arnd@arndb.de> ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-24 22:07 ` Arnd Bergmann 0 siblings, 0 replies; 113+ messages in thread From: Arnd Bergmann @ 2011-11-24 22:07 UTC (permalink / raw) To: linuxppc-dev Cc: Michael S. Tsirkin, Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, David S. Miller On Thursday 24 November 2011 22:17:02 Michael S. Tsirkin wrote: > Many architectures want a generic pci_iomap but > not the rest of iomap.c. Split that to a separate .c > file and add a new config symbol. select automatically > by GENERIC_IOMAP. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Very nice! Acked-by: Arnd Bergmann <arnd@arndb.de> ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP 2011-11-24 20:17 ` Michael S. Tsirkin (?) @ 2011-11-25 0:54 ` Stephen Rothwell -1 siblings, 0 replies; 113+ messages in thread From: Stephen Rothwell @ 2011-11-25 0:54 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux-sh, linux-pci, linux, Jesse Barnes, Chen Liqin, Paul Mackerras, Ralf Baechle, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, Arend van Spriel, Matt Turner, linux-arch [-- Attachment #1.1: Type: text/plain, Size: 5328 bytes --] Hi Michael, On Thu, 24 Nov 2011 22:17:02 +0200 "Michael S. Tsirkin" <mst@redhat.com> wrote: > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > index 9120887..c8a67345 100644 > --- a/include/asm-generic/io.h > +++ b/include/asm-generic/io.h > @@ -19,6 +19,8 @@ > #include <asm-generic/iomap.h> > #endif > > +#include <asm-generic/pci_iomap.h> > + > #ifndef mmiowb > #define mmiowb() do {} while (0) > #endif > @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) > #define __io_virt(x) ((void __force *) (x)) > > #ifndef CONFIG_GENERIC_IOMAP > -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > -struct pci_dev; > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) > { > } Just wondering why you move pci_iomap but not pic_iounmap. And also if pci_iounmap is meant to stay here, then the "struct pci_dev" should probably stay as well. > diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h > index 98dcd76..fdcddcb 100644 > --- a/include/asm-generic/iomap.h > +++ b/include/asm-generic/iomap.h > @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); > #ifdef CONFIG_PCI > /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > struct pci_dev; > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > extern void pci_iounmap(struct pci_dev *dev, void __iomem *); Ditto with pci_iounmap. Also the comment above really belongs with pci_iomap. > diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h > new file mode 100644 > index 0000000..e08b3bd > --- /dev/null > +++ b/include/asm-generic/pci_iomap.h > @@ -0,0 +1,26 @@ > +/* Generic I/O port emulation, based on MN10300 code > + * > + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. > + * Written by David Howells (dhowells@redhat.com) > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public Licence > + * as published by the Free Software Foundation; either version > + * 2 of the Licence, or (at your option) any later version. > + */ > +#ifndef __ASM_GENERIC_PCI_IOMAP_H > +#define __ASM_GENERIC_PCI_IOMAP_H > + > +#ifdef CONFIG_PCI > +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > +struct pci_dev; You could move this struct declaration above the ifdef and remove the duplicate below. > +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > +#else > +struct pci_dev; > +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) > +{ > + return NULL; > +} > +#endif > + > +#endif /* __ASM_GENERIC_IO_H */ > diff --git a/lib/iomap.c b/lib/iomap.c > index 5dbcb4b..ada922a 100644 > --- a/lib/iomap.c > +++ b/lib/iomap.c > @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); > #endif /* CONFIG_HAS_IOPORT */ > > #ifdef CONFIG_PCI > -/** > - * pci_iomap - create a virtual mapping cookie for a PCI BAR > - * @dev: PCI device that owns the BAR > - * @bar: BAR number > - * @maxlen: length of the memory to map > - * > - * Using this function you will get a __iomem address to your device BAR. > - * You can access it using ioread*() and iowrite*(). These functions hide > - * the details if this is a MMIO or PIO address space and will just do what > - * you expect from them in the correct way. > - * > - * @maxlen specifies the maximum length to map. If you want to get access to > - * the complete BAR without checking for its length first, pass %0 here. > - * */ > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) > -{ > - resource_size_t start = pci_resource_start(dev, bar); > - resource_size_t len = pci_resource_len(dev, bar); > - unsigned long flags = pci_resource_flags(dev, bar); > - > - if (!len || !start) > - return NULL; > - if (maxlen && len > maxlen) > - len = maxlen; > - if (flags & IORESOURCE_IO) > - return ioport_map(start, len); > - if (flags & IORESOURCE_MEM) { > - if (flags & IORESOURCE_CACHEABLE) > - return ioremap(start, len); > - return ioremap_nocache(start, len); > - } > - /* What? */ > - return NULL; > -} > - > +/* Hide the details if this is a MMIO or PIO address space and just do what > + * you expect in the correct way. */ > void pci_iounmap(struct pci_dev *dev, void __iomem * addr) > { > IO_COND(addr, /* nothing */, iounmap(addr)); > } > -EXPORT_SYMBOL(pci_iomap); > EXPORT_SYMBOL(pci_iounmap); Ditto with pci_iounmap > diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c > new file mode 100644 > index 0000000..40b26cb > --- /dev/null > +++ b/lib/pci_iomap.c > @@ -0,0 +1,48 @@ > +/* > + * Implement the default iomap interfaces > + * > + * (C) Copyright 2004 Linus Torvalds > + */ > +#include <linux/pci.h> > +#include <linux/io.h> > + > +#include <linux/module.h> If this is relative to (at least) v3.2-rc1, then you should use export.h instead of module.h -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --] [-- Attachment #2: Type: text/plain, Size: 150 bytes --] _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-25 0:54 ` Stephen Rothwell 0 siblings, 0 replies; 113+ messages in thread From: Stephen Rothwell @ 2011-11-25 0:54 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux-sh, linux-pci, linux, Jesse Barnes, Chen Liqin, Paul Mackerras, Ralf Baechle, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, Arend van Spriel, Matt Turner, linux-arch, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Michal Simek, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Andrew Morton, linux-arm-kernel, Richard Henderson, Michael Ellerman, Paul Bolle, Tony Luck, linux-cris-kernel, linux-parisc, Paul Gortmaker, linux-kernel, Fenghua Yu, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Fabio Baltieri, linuxppc-dev, David S. Miller [-- Attachment #1: Type: text/plain, Size: 5328 bytes --] Hi Michael, On Thu, 24 Nov 2011 22:17:02 +0200 "Michael S. Tsirkin" <mst@redhat.com> wrote: > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > index 9120887..c8a67345 100644 > --- a/include/asm-generic/io.h > +++ b/include/asm-generic/io.h > @@ -19,6 +19,8 @@ > #include <asm-generic/iomap.h> > #endif > > +#include <asm-generic/pci_iomap.h> > + > #ifndef mmiowb > #define mmiowb() do {} while (0) > #endif > @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) > #define __io_virt(x) ((void __force *) (x)) > > #ifndef CONFIG_GENERIC_IOMAP > -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > -struct pci_dev; > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) > { > } Just wondering why you move pci_iomap but not pic_iounmap. And also if pci_iounmap is meant to stay here, then the "struct pci_dev" should probably stay as well. > diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h > index 98dcd76..fdcddcb 100644 > --- a/include/asm-generic/iomap.h > +++ b/include/asm-generic/iomap.h > @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); > #ifdef CONFIG_PCI > /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > struct pci_dev; > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > extern void pci_iounmap(struct pci_dev *dev, void __iomem *); Ditto with pci_iounmap. Also the comment above really belongs with pci_iomap. > diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h > new file mode 100644 > index 0000000..e08b3bd > --- /dev/null > +++ b/include/asm-generic/pci_iomap.h > @@ -0,0 +1,26 @@ > +/* Generic I/O port emulation, based on MN10300 code > + * > + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. > + * Written by David Howells (dhowells@redhat.com) > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public Licence > + * as published by the Free Software Foundation; either version > + * 2 of the Licence, or (at your option) any later version. > + */ > +#ifndef __ASM_GENERIC_PCI_IOMAP_H > +#define __ASM_GENERIC_PCI_IOMAP_H > + > +#ifdef CONFIG_PCI > +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > +struct pci_dev; You could move this struct declaration above the ifdef and remove the duplicate below. > +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > +#else > +struct pci_dev; > +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) > +{ > + return NULL; > +} > +#endif > + > +#endif /* __ASM_GENERIC_IO_H */ > diff --git a/lib/iomap.c b/lib/iomap.c > index 5dbcb4b..ada922a 100644 > --- a/lib/iomap.c > +++ b/lib/iomap.c > @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); > #endif /* CONFIG_HAS_IOPORT */ > > #ifdef CONFIG_PCI > -/** > - * pci_iomap - create a virtual mapping cookie for a PCI BAR > - * @dev: PCI device that owns the BAR > - * @bar: BAR number > - * @maxlen: length of the memory to map > - * > - * Using this function you will get a __iomem address to your device BAR. > - * You can access it using ioread*() and iowrite*(). These functions hide > - * the details if this is a MMIO or PIO address space and will just do what > - * you expect from them in the correct way. > - * > - * @maxlen specifies the maximum length to map. If you want to get access to > - * the complete BAR without checking for its length first, pass %0 here. > - * */ > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) > -{ > - resource_size_t start = pci_resource_start(dev, bar); > - resource_size_t len = pci_resource_len(dev, bar); > - unsigned long flags = pci_resource_flags(dev, bar); > - > - if (!len || !start) > - return NULL; > - if (maxlen && len > maxlen) > - len = maxlen; > - if (flags & IORESOURCE_IO) > - return ioport_map(start, len); > - if (flags & IORESOURCE_MEM) { > - if (flags & IORESOURCE_CACHEABLE) > - return ioremap(start, len); > - return ioremap_nocache(start, len); > - } > - /* What? */ > - return NULL; > -} > - > +/* Hide the details if this is a MMIO or PIO address space and just do what > + * you expect in the correct way. */ > void pci_iounmap(struct pci_dev *dev, void __iomem * addr) > { > IO_COND(addr, /* nothing */, iounmap(addr)); > } > -EXPORT_SYMBOL(pci_iomap); > EXPORT_SYMBOL(pci_iounmap); Ditto with pci_iounmap > diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c > new file mode 100644 > index 0000000..40b26cb > --- /dev/null > +++ b/lib/pci_iomap.c > @@ -0,0 +1,48 @@ > +/* > + * Implement the default iomap interfaces > + * > + * (C) Copyright 2004 Linus Torvalds > + */ > +#include <linux/pci.h> > +#include <linux/io.h> > + > +#include <linux/module.h> If this is relative to (at least) v3.2-rc1, then you should use export.h instead of module.h -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-25 0:54 ` Stephen Rothwell 0 siblings, 0 replies; 113+ messages in thread From: Stephen Rothwell @ 2011-11-25 0:54 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller [-- Attachment #1: Type: text/plain, Size: 5328 bytes --] Hi Michael, On Thu, 24 Nov 2011 22:17:02 +0200 "Michael S. Tsirkin" <mst@redhat.com> wrote: > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > index 9120887..c8a67345 100644 > --- a/include/asm-generic/io.h > +++ b/include/asm-generic/io.h > @@ -19,6 +19,8 @@ > #include <asm-generic/iomap.h> > #endif > > +#include <asm-generic/pci_iomap.h> > + > #ifndef mmiowb > #define mmiowb() do {} while (0) > #endif > @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) > #define __io_virt(x) ((void __force *) (x)) > > #ifndef CONFIG_GENERIC_IOMAP > -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > -struct pci_dev; > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) > { > } Just wondering why you move pci_iomap but not pic_iounmap. And also if pci_iounmap is meant to stay here, then the "struct pci_dev" should probably stay as well. > diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h > index 98dcd76..fdcddcb 100644 > --- a/include/asm-generic/iomap.h > +++ b/include/asm-generic/iomap.h > @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); > #ifdef CONFIG_PCI > /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > struct pci_dev; > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > extern void pci_iounmap(struct pci_dev *dev, void __iomem *); Ditto with pci_iounmap. Also the comment above really belongs with pci_iomap. > diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h > new file mode 100644 > index 0000000..e08b3bd > --- /dev/null > +++ b/include/asm-generic/pci_iomap.h > @@ -0,0 +1,26 @@ > +/* Generic I/O port emulation, based on MN10300 code > + * > + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. > + * Written by David Howells (dhowells@redhat.com) > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public Licence > + * as published by the Free Software Foundation; either version > + * 2 of the Licence, or (at your option) any later version. > + */ > +#ifndef __ASM_GENERIC_PCI_IOMAP_H > +#define __ASM_GENERIC_PCI_IOMAP_H > + > +#ifdef CONFIG_PCI > +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > +struct pci_dev; You could move this struct declaration above the ifdef and remove the duplicate below. > +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > +#else > +struct pci_dev; > +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) > +{ > + return NULL; > +} > +#endif > + > +#endif /* __ASM_GENERIC_IO_H */ > diff --git a/lib/iomap.c b/lib/iomap.c > index 5dbcb4b..ada922a 100644 > --- a/lib/iomap.c > +++ b/lib/iomap.c > @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); > #endif /* CONFIG_HAS_IOPORT */ > > #ifdef CONFIG_PCI > -/** > - * pci_iomap - create a virtual mapping cookie for a PCI BAR > - * @dev: PCI device that owns the BAR > - * @bar: BAR number > - * @maxlen: length of the memory to map > - * > - * Using this function you will get a __iomem address to your device BAR. > - * You can access it using ioread*() and iowrite*(). These functions hide > - * the details if this is a MMIO or PIO address space and will just do what > - * you expect from them in the correct way. > - * > - * @maxlen specifies the maximum length to map. If you want to get access to > - * the complete BAR without checking for its length first, pass %0 here. > - * */ > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) > -{ > - resource_size_t start = pci_resource_start(dev, bar); > - resource_size_t len = pci_resource_len(dev, bar); > - unsigned long flags = pci_resource_flags(dev, bar); > - > - if (!len || !start) > - return NULL; > - if (maxlen && len > maxlen) > - len = maxlen; > - if (flags & IORESOURCE_IO) > - return ioport_map(start, len); > - if (flags & IORESOURCE_MEM) { > - if (flags & IORESOURCE_CACHEABLE) > - return ioremap(start, len); > - return ioremap_nocache(start, len); > - } > - /* What? */ > - return NULL; > -} > - > +/* Hide the details if this is a MMIO or PIO address space and just do what > + * you expect in the correct way. */ > void pci_iounmap(struct pci_dev *dev, void __iomem * addr) > { > IO_COND(addr, /* nothing */, iounmap(addr)); > } > -EXPORT_SYMBOL(pci_iomap); > EXPORT_SYMBOL(pci_iounmap); Ditto with pci_iounmap > diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c > new file mode 100644 > index 0000000..40b26cb > --- /dev/null > +++ b/lib/pci_iomap.c > @@ -0,0 +1,48 @@ > +/* > + * Implement the default iomap interfaces > + * > + * (C) Copyright 2004 Linus Torvalds > + */ > +#include <linux/pci.h> > +#include <linux/io.h> > + > +#include <linux/module.h> If this is relative to (at least) v3.2-rc1, then you should use export.h instead of module.h -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP 2011-11-25 0:54 ` Stephen Rothwell (?) @ 2011-11-25 0:59 ` Stephen Rothwell -1 siblings, 0 replies; 113+ messages in thread From: Stephen Rothwell @ 2011-11-25 0:59 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux-sh, linux-pci, linux, Jesse Barnes, Chen Liqin, Paul Mackerras, Ralf Baechle, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, Arend van Spriel, Matt Turner, linux-arch [-- Attachment #1.1: Type: text/plain, Size: 319 bytes --] Hi Michael, On Fri, 25 Nov 2011 11:54:55 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > Just wondering why you move pci_iomap but not pic_iounmap. I figured this out. Arches have their own. -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --] [-- Attachment #2: Type: text/plain, Size: 150 bytes --] _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-25 0:59 ` Stephen Rothwell 0 siblings, 0 replies; 113+ messages in thread From: Stephen Rothwell @ 2011-11-25 0:59 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux-sh, linux-pci, linux, Jesse Barnes, Chen Liqin, Paul Mackerras, Ralf Baechle, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, Arend van Spriel, Matt Turner, linux-arch, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Michal Simek, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Andrew Morton, linux-arm-kernel, Richard Henderson, Michael Ellerman, Paul Bolle, Tony Luck, linux-cris-kernel, linux-parisc, Paul Gortmaker, linux-kernel, Fenghua Yu, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Fabio Baltieri, linuxppc-dev, David S. Miller [-- Attachment #1: Type: text/plain, Size: 319 bytes --] Hi Michael, On Fri, 25 Nov 2011 11:54:55 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > Just wondering why you move pci_iomap but not pic_iounmap. I figured this out. Arches have their own. -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-25 0:59 ` Stephen Rothwell 0 siblings, 0 replies; 113+ messages in thread From: Stephen Rothwell @ 2011-11-25 0:59 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller [-- Attachment #1: Type: text/plain, Size: 319 bytes --] Hi Michael, On Fri, 25 Nov 2011 11:54:55 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > Just wondering why you move pci_iomap but not pic_iounmap. I figured this out. Arches have their own. -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP 2011-11-25 0:54 ` Stephen Rothwell (?) (?) @ 2011-11-27 17:12 ` Michael S. Tsirkin -1 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-27 17:12 UTC (permalink / raw) To: Stephen Rothwell Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, lin On Fri, Nov 25, 2011 at 11:54:55AM +1100, Stephen Rothwell wrote: > Hi Michael, > > On Thu, 24 Nov 2011 22:17:02 +0200 "Michael S. Tsirkin" <mst@redhat.com> wrote: > > > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > > index 9120887..c8a67345 100644 > > --- a/include/asm-generic/io.h > > +++ b/include/asm-generic/io.h > > @@ -19,6 +19,8 @@ > > #include <asm-generic/iomap.h> > > #endif > > > > +#include <asm-generic/pci_iomap.h> > > + > > #ifndef mmiowb > > #define mmiowb() do {} while (0) > > #endif > > @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) > > #define __io_virt(x) ((void __force *) (x)) > > > > #ifndef CONFIG_GENERIC_IOMAP > > -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > -struct pci_dev; > > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) > > { > > } > > Just wondering why you move pci_iomap but not pic_iounmap. unmap is implemented significantly different between architectures. > And also if > pci_iounmap is meant to stay here, then the "struct pci_dev" should > probably stay as well. Right. I'll fix that. > > diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h > > index 98dcd76..fdcddcb 100644 > > --- a/include/asm-generic/iomap.h > > +++ b/include/asm-generic/iomap.h > > @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); > > #ifdef CONFIG_PCI > > /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > struct pci_dev; > > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > extern void pci_iounmap(struct pci_dev *dev, void __iomem *); > > Ditto with pci_iounmap. Answered above :) > Also the comment above really belongs with pci_iomap. Right, I'll correct the comment. > > diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h > > new file mode 100644 > > index 0000000..e08b3bd > > --- /dev/null > > +++ b/include/asm-generic/pci_iomap.h > > @@ -0,0 +1,26 @@ > > +/* Generic I/O port emulation, based on MN10300 code > > + * > > + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. > > + * Written by David Howells (dhowells@redhat.com) > > + * > > + * This program is free software; you can redistribute it and/or > > + * modify it under the terms of the GNU General Public Licence > > + * as published by the Free Software Foundation; either version > > + * 2 of the Licence, or (at your option) any later version. > > + */ > > +#ifndef __ASM_GENERIC_PCI_IOMAP_H > > +#define __ASM_GENERIC_PCI_IOMAP_H > > + > > +#ifdef CONFIG_PCI > > +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > +struct pci_dev; > > You could move this struct declaration above the ifdef and remove the > duplicate below. Good point. Will do. > > +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > +#else > > +struct pci_dev; > > +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) > > +{ > > + return NULL; > > +} > > +#endif > > + > > +#endif /* __ASM_GENERIC_IO_H */ > > diff --git a/lib/iomap.c b/lib/iomap.c > > index 5dbcb4b..ada922a 100644 > > --- a/lib/iomap.c > > +++ b/lib/iomap.c > > @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); > > #endif /* CONFIG_HAS_IOPORT */ > > > > #ifdef CONFIG_PCI > > -/** > > - * pci_iomap - create a virtual mapping cookie for a PCI BAR > > - * @dev: PCI device that owns the BAR > > - * @bar: BAR number > > - * @maxlen: length of the memory to map > > - * > > - * Using this function you will get a __iomem address to your device BAR. > > - * You can access it using ioread*() and iowrite*(). These functions hide > > - * the details if this is a MMIO or PIO address space and will just do what > > - * you expect from them in the correct way. > > - * > > - * @maxlen specifies the maximum length to map. If you want to get access to > > - * the complete BAR without checking for its length first, pass %0 here. > > - * */ > > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) > > -{ > > - resource_size_t start = pci_resource_start(dev, bar); > > - resource_size_t len = pci_resource_len(dev, bar); > > - unsigned long flags = pci_resource_flags(dev, bar); > > - > > - if (!len || !start) > > - return NULL; > > - if (maxlen && len > maxlen) > > - len = maxlen; > > - if (flags & IORESOURCE_IO) > > - return ioport_map(start, len); > > - if (flags & IORESOURCE_MEM) { > > - if (flags & IORESOURCE_CACHEABLE) > > - return ioremap(start, len); > > - return ioremap_nocache(start, len); > > - } > > - /* What? */ > > - return NULL; > > -} > > - > > +/* Hide the details if this is a MMIO or PIO address space and just do what > > + * you expect in the correct way. */ > > void pci_iounmap(struct pci_dev *dev, void __iomem * addr) > > { > > IO_COND(addr, /* nothing */, iounmap(addr)); > > } > > -EXPORT_SYMBOL(pci_iomap); > > EXPORT_SYMBOL(pci_iounmap); > > Ditto with pci_iounmap Answered above. > > diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c > > new file mode 100644 > > index 0000000..40b26cb > > --- /dev/null > > +++ b/lib/pci_iomap.c > > @@ -0,0 +1,48 @@ > > +/* > > + * Implement the default iomap interfaces > > + * > > + * (C) Copyright 2004 Linus Torvalds > > + */ > > +#include <linux/pci.h> > > +#include <linux/io.h> > > + > > +#include <linux/module.h> > > If this is relative to (at least) v3.2-rc1, then you should use export.h > instead of module.h I just copied lib/iomap.c Will fix, thanks for the comments. > -- > Cheers, > Stephen Rothwell sfr@canb.auug.org.au > http://www.canb.auug.org.au/~sfr/ ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-27 17:12 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-27 17:12 UTC (permalink / raw) To: Stephen Rothwell Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux-sh, linux-pci, linux, Jesse Barnes, Chen Liqin, Paul Mackerras, Ralf Baechle, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, Arend van Spriel, Matt Turner, linux-arch, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Michal Simek, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Andrew Morton, linux-arm-kernel, Richard Henderson, Michael Ellerman, Paul Bolle, Tony Luck, linux-cris-kernel, linux-parisc, Paul Gortmaker, linux-kernel, Fenghua Yu, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Fabio Baltieri, linuxppc-dev, David S. Miller On Fri, Nov 25, 2011 at 11:54:55AM +1100, Stephen Rothwell wrote: > Hi Michael, > > On Thu, 24 Nov 2011 22:17:02 +0200 "Michael S. Tsirkin" <mst@redhat.com> wrote: > > > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > > index 9120887..c8a67345 100644 > > --- a/include/asm-generic/io.h > > +++ b/include/asm-generic/io.h > > @@ -19,6 +19,8 @@ > > #include <asm-generic/iomap.h> > > #endif > > > > +#include <asm-generic/pci_iomap.h> > > + > > #ifndef mmiowb > > #define mmiowb() do {} while (0) > > #endif > > @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) > > #define __io_virt(x) ((void __force *) (x)) > > > > #ifndef CONFIG_GENERIC_IOMAP > > -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > -struct pci_dev; > > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) > > { > > } > > Just wondering why you move pci_iomap but not pic_iounmap. unmap is implemented significantly different between architectures. > And also if > pci_iounmap is meant to stay here, then the "struct pci_dev" should > probably stay as well. Right. I'll fix that. > > diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h > > index 98dcd76..fdcddcb 100644 > > --- a/include/asm-generic/iomap.h > > +++ b/include/asm-generic/iomap.h > > @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); > > #ifdef CONFIG_PCI > > /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > struct pci_dev; > > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > extern void pci_iounmap(struct pci_dev *dev, void __iomem *); > > Ditto with pci_iounmap. Answered above :) > Also the comment above really belongs with pci_iomap. Right, I'll correct the comment. > > diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h > > new file mode 100644 > > index 0000000..e08b3bd > > --- /dev/null > > +++ b/include/asm-generic/pci_iomap.h > > @@ -0,0 +1,26 @@ > > +/* Generic I/O port emulation, based on MN10300 code > > + * > > + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. > > + * Written by David Howells (dhowells@redhat.com) > > + * > > + * This program is free software; you can redistribute it and/or > > + * modify it under the terms of the GNU General Public Licence > > + * as published by the Free Software Foundation; either version > > + * 2 of the Licence, or (at your option) any later version. > > + */ > > +#ifndef __ASM_GENERIC_PCI_IOMAP_H > > +#define __ASM_GENERIC_PCI_IOMAP_H > > + > > +#ifdef CONFIG_PCI > > +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > +struct pci_dev; > > You could move this struct declaration above the ifdef and remove the > duplicate below. Good point. Will do. > > +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > +#else > > +struct pci_dev; > > +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) > > +{ > > + return NULL; > > +} > > +#endif > > + > > +#endif /* __ASM_GENERIC_IO_H */ > > diff --git a/lib/iomap.c b/lib/iomap.c > > index 5dbcb4b..ada922a 100644 > > --- a/lib/iomap.c > > +++ b/lib/iomap.c > > @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); > > #endif /* CONFIG_HAS_IOPORT */ > > > > #ifdef CONFIG_PCI > > -/** > > - * pci_iomap - create a virtual mapping cookie for a PCI BAR > > - * @dev: PCI device that owns the BAR > > - * @bar: BAR number > > - * @maxlen: length of the memory to map > > - * > > - * Using this function you will get a __iomem address to your device BAR. > > - * You can access it using ioread*() and iowrite*(). These functions hide > > - * the details if this is a MMIO or PIO address space and will just do what > > - * you expect from them in the correct way. > > - * > > - * @maxlen specifies the maximum length to map. If you want to get access to > > - * the complete BAR without checking for its length first, pass %0 here. > > - * */ > > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) > > -{ > > - resource_size_t start = pci_resource_start(dev, bar); > > - resource_size_t len = pci_resource_len(dev, bar); > > - unsigned long flags = pci_resource_flags(dev, bar); > > - > > - if (!len || !start) > > - return NULL; > > - if (maxlen && len > maxlen) > > - len = maxlen; > > - if (flags & IORESOURCE_IO) > > - return ioport_map(start, len); > > - if (flags & IORESOURCE_MEM) { > > - if (flags & IORESOURCE_CACHEABLE) > > - return ioremap(start, len); > > - return ioremap_nocache(start, len); > > - } > > - /* What? */ > > - return NULL; > > -} > > - > > +/* Hide the details if this is a MMIO or PIO address space and just do what > > + * you expect in the correct way. */ > > void pci_iounmap(struct pci_dev *dev, void __iomem * addr) > > { > > IO_COND(addr, /* nothing */, iounmap(addr)); > > } > > -EXPORT_SYMBOL(pci_iomap); > > EXPORT_SYMBOL(pci_iounmap); > > Ditto with pci_iounmap Answered above. > > diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c > > new file mode 100644 > > index 0000000..40b26cb > > --- /dev/null > > +++ b/lib/pci_iomap.c > > @@ -0,0 +1,48 @@ > > +/* > > + * Implement the default iomap interfaces > > + * > > + * (C) Copyright 2004 Linus Torvalds > > + */ > > +#include <linux/pci.h> > > +#include <linux/io.h> > > + > > +#include <linux/module.h> > > If this is relative to (at least) v3.2-rc1, then you should use export.h > instead of module.h I just copied lib/iomap.c Will fix, thanks for the comments. > -- > Cheers, > Stephen Rothwell sfr@canb.auug.org.au > http://www.canb.auug.org.au/~sfr/ ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-27 17:12 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-27 17:12 UTC (permalink / raw) To: Stephen Rothwell Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller On Fri, Nov 25, 2011 at 11:54:55AM +1100, Stephen Rothwell wrote: > Hi Michael, > > On Thu, 24 Nov 2011 22:17:02 +0200 "Michael S. Tsirkin" <mst@redhat.com> wrote: > > > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > > index 9120887..c8a67345 100644 > > --- a/include/asm-generic/io.h > > +++ b/include/asm-generic/io.h > > @@ -19,6 +19,8 @@ > > #include <asm-generic/iomap.h> > > #endif > > > > +#include <asm-generic/pci_iomap.h> > > + > > #ifndef mmiowb > > #define mmiowb() do {} while (0) > > #endif > > @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) > > #define __io_virt(x) ((void __force *) (x)) > > > > #ifndef CONFIG_GENERIC_IOMAP > > -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > -struct pci_dev; > > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) > > { > > } > > Just wondering why you move pci_iomap but not pic_iounmap. unmap is implemented significantly different between architectures. > And also if > pci_iounmap is meant to stay here, then the "struct pci_dev" should > probably stay as well. Right. I'll fix that. > > diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h > > index 98dcd76..fdcddcb 100644 > > --- a/include/asm-generic/iomap.h > > +++ b/include/asm-generic/iomap.h > > @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); > > #ifdef CONFIG_PCI > > /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > struct pci_dev; > > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > extern void pci_iounmap(struct pci_dev *dev, void __iomem *); > > Ditto with pci_iounmap. Answered above :) > Also the comment above really belongs with pci_iomap. Right, I'll correct the comment. > > diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h > > new file mode 100644 > > index 0000000..e08b3bd > > --- /dev/null > > +++ b/include/asm-generic/pci_iomap.h > > @@ -0,0 +1,26 @@ > > +/* Generic I/O port emulation, based on MN10300 code > > + * > > + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. > > + * Written by David Howells (dhowells@redhat.com) > > + * > > + * This program is free software; you can redistribute it and/or > > + * modify it under the terms of the GNU General Public Licence > > + * as published by the Free Software Foundation; either version > > + * 2 of the Licence, or (at your option) any later version. > > + */ > > +#ifndef __ASM_GENERIC_PCI_IOMAP_H > > +#define __ASM_GENERIC_PCI_IOMAP_H > > + > > +#ifdef CONFIG_PCI > > +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > +struct pci_dev; > > You could move this struct declaration above the ifdef and remove the > duplicate below. Good point. Will do. > > +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > +#else > > +struct pci_dev; > > +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) > > +{ > > + return NULL; > > +} > > +#endif > > + > > +#endif /* __ASM_GENERIC_IO_H */ > > diff --git a/lib/iomap.c b/lib/iomap.c > > index 5dbcb4b..ada922a 100644 > > --- a/lib/iomap.c > > +++ b/lib/iomap.c > > @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); > > #endif /* CONFIG_HAS_IOPORT */ > > > > #ifdef CONFIG_PCI > > -/** > > - * pci_iomap - create a virtual mapping cookie for a PCI BAR > > - * @dev: PCI device that owns the BAR > > - * @bar: BAR number > > - * @maxlen: length of the memory to map > > - * > > - * Using this function you will get a __iomem address to your device BAR. > > - * You can access it using ioread*() and iowrite*(). These functions hide > > - * the details if this is a MMIO or PIO address space and will just do what > > - * you expect from them in the correct way. > > - * > > - * @maxlen specifies the maximum length to map. If you want to get access to > > - * the complete BAR without checking for its length first, pass %0 here. > > - * */ > > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) > > -{ > > - resource_size_t start = pci_resource_start(dev, bar); > > - resource_size_t len = pci_resource_len(dev, bar); > > - unsigned long flags = pci_resource_flags(dev, bar); > > - > > - if (!len || !start) > > - return NULL; > > - if (maxlen && len > maxlen) > > - len = maxlen; > > - if (flags & IORESOURCE_IO) > > - return ioport_map(start, len); > > - if (flags & IORESOURCE_MEM) { > > - if (flags & IORESOURCE_CACHEABLE) > > - return ioremap(start, len); > > - return ioremap_nocache(start, len); > > - } > > - /* What? */ > > - return NULL; > > -} > > - > > +/* Hide the details if this is a MMIO or PIO address space and just do what > > + * you expect in the correct way. */ > > void pci_iounmap(struct pci_dev *dev, void __iomem * addr) > > { > > IO_COND(addr, /* nothing */, iounmap(addr)); > > } > > -EXPORT_SYMBOL(pci_iomap); > > EXPORT_SYMBOL(pci_iounmap); > > Ditto with pci_iounmap Answered above. > > diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c > > new file mode 100644 > > index 0000000..40b26cb > > --- /dev/null > > +++ b/lib/pci_iomap.c > > @@ -0,0 +1,48 @@ > > +/* > > + * Implement the default iomap interfaces > > + * > > + * (C) Copyright 2004 Linus Torvalds > > + */ > > +#include <linux/pci.h> > > +#include <linux/io.h> > > + > > +#include <linux/module.h> > > If this is relative to (at least) v3.2-rc1, then you should use export.h > instead of module.h I just copied lib/iomap.c Will fix, thanks for the comments. > -- > Cheers, > Stephen Rothwell sfr@canb.auug.org.au > http://www.canb.auug.org.au/~sfr/ ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP @ 2011-11-27 17:12 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-27 17:12 UTC (permalink / raw) To: Stephen Rothwell Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven On Fri, Nov 25, 2011 at 11:54:55AM +1100, Stephen Rothwell wrote: > Hi Michael, > > On Thu, 24 Nov 2011 22:17:02 +0200 "Michael S. Tsirkin" <mst@redhat.com> wrote: > > > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > > index 9120887..c8a67345 100644 > > --- a/include/asm-generic/io.h > > +++ b/include/asm-generic/io.h > > @@ -19,6 +19,8 @@ > > #include <asm-generic/iomap.h> > > #endif > > > > +#include <asm-generic/pci_iomap.h> > > + > > #ifndef mmiowb > > #define mmiowb() do {} while (0) > > #endif > > @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) > > #define __io_virt(x) ((void __force *) (x)) > > > > #ifndef CONFIG_GENERIC_IOMAP > > -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > -struct pci_dev; > > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) > > { > > } > > Just wondering why you move pci_iomap but not pic_iounmap. unmap is implemented significantly different between architectures. > And also if > pci_iounmap is meant to stay here, then the "struct pci_dev" should > probably stay as well. Right. I'll fix that. > > diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h > > index 98dcd76..fdcddcb 100644 > > --- a/include/asm-generic/iomap.h > > +++ b/include/asm-generic/iomap.h > > @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *); > > #ifdef CONFIG_PCI > > /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > struct pci_dev; > > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > extern void pci_iounmap(struct pci_dev *dev, void __iomem *); > > Ditto with pci_iounmap. Answered above :) > Also the comment above really belongs with pci_iomap. Right, I'll correct the comment. > > diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h > > new file mode 100644 > > index 0000000..e08b3bd > > --- /dev/null > > +++ b/include/asm-generic/pci_iomap.h > > @@ -0,0 +1,26 @@ > > +/* Generic I/O port emulation, based on MN10300 code > > + * > > + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. > > + * Written by David Howells (dhowells@redhat.com) > > + * > > + * This program is free software; you can redistribute it and/or > > + * modify it under the terms of the GNU General Public Licence > > + * as published by the Free Software Foundation; either version > > + * 2 of the Licence, or (at your option) any later version. > > + */ > > +#ifndef __ASM_GENERIC_PCI_IOMAP_H > > +#define __ASM_GENERIC_PCI_IOMAP_H > > + > > +#ifdef CONFIG_PCI > > +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > > +struct pci_dev; > > You could move this struct declaration above the ifdef and remove the > duplicate below. Good point. Will do. > > +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); > > +#else > > +struct pci_dev; > > +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) > > +{ > > + return NULL; > > +} > > +#endif > > + > > +#endif /* __ASM_GENERIC_IO_H */ > > diff --git a/lib/iomap.c b/lib/iomap.c > > index 5dbcb4b..ada922a 100644 > > --- a/lib/iomap.c > > +++ b/lib/iomap.c > > @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); > > #endif /* CONFIG_HAS_IOPORT */ > > > > #ifdef CONFIG_PCI > > -/** > > - * pci_iomap - create a virtual mapping cookie for a PCI BAR > > - * @dev: PCI device that owns the BAR > > - * @bar: BAR number > > - * @maxlen: length of the memory to map > > - * > > - * Using this function you will get a __iomem address to your device BAR. > > - * You can access it using ioread*() and iowrite*(). These functions hide > > - * the details if this is a MMIO or PIO address space and will just do what > > - * you expect from them in the correct way. > > - * > > - * @maxlen specifies the maximum length to map. If you want to get access to > > - * the complete BAR without checking for its length first, pass %0 here. > > - * */ > > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) > > -{ > > - resource_size_t start = pci_resource_start(dev, bar); > > - resource_size_t len = pci_resource_len(dev, bar); > > - unsigned long flags = pci_resource_flags(dev, bar); > > - > > - if (!len || !start) > > - return NULL; > > - if (maxlen && len > maxlen) > > - len = maxlen; > > - if (flags & IORESOURCE_IO) > > - return ioport_map(start, len); > > - if (flags & IORESOURCE_MEM) { > > - if (flags & IORESOURCE_CACHEABLE) > > - return ioremap(start, len); > > - return ioremap_nocache(start, len); > > - } > > - /* What? */ > > - return NULL; > > -} > > - > > +/* Hide the details if this is a MMIO or PIO address space and just do what > > + * you expect in the correct way. */ > > void pci_iounmap(struct pci_dev *dev, void __iomem * addr) > > { > > IO_COND(addr, /* nothing */, iounmap(addr)); > > } > > -EXPORT_SYMBOL(pci_iomap); > > EXPORT_SYMBOL(pci_iounmap); > > Ditto with pci_iounmap Answered above. > > diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c > > new file mode 100644 > > index 0000000..40b26cb > > --- /dev/null > > +++ b/lib/pci_iomap.c > > @@ -0,0 +1,48 @@ > > +/* > > + * Implement the default iomap interfaces > > + * > > + * (C) Copyright 2004 Linus Torvalds > > + */ > > +#include <linux/pci.h> > > +#include <linux/io.h> > > + > > +#include <linux/module.h> > > If this is relative to (at least) v3.2-rc1, then you should use export.h > instead of module.h I just copied lib/iomap.c Will fix, thanks for the comments. > -- > Cheers, > Stephen Rothwell sfr@canb.auug.org.au > http://www.canb.auug.org.au/~sfr/ ^ permalink raw reply [flat|nested] 113+ messages in thread
* [PATCH-RFC 02/10 v2] lib: add GENERIC_PCI_IOMAP 2011-11-24 20:17 ` Michael S. Tsirkin ` (6 preceding siblings ...) (?) @ 2011-11-28 19:21 ` Michael S. Tsirkin -1 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-28 19:21 UTC (permalink / raw) To: Stephen Rothwell Cc: Arnd Bergmann, Andrew Morton, John W. Linville, Lasse Collin, Michael S. Tsirkin, Arend van Spriel, Franky Lin, Jonas Bonn, linux-arch, linux-kernel, Jesse Barnes, linux-pci Many architectures want a generic pci_iomap but not the rest of iomap.c. Split that to a separate .c file and add a new config symbol. select automatically by GENERIC_IOMAP. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- Here's an updated version (just this one patch was changed). Changes from v1: minor tweaks to address comments by Stephen Rothwell include/asm-generic/io.h | 4 +- include/asm-generic/iomap.h | 9 ++----- include/asm-generic/pci_iomap.h | 25 ++++++++++++++++++++ lib/Kconfig | 4 +++ lib/Makefile | 1 + lib/iomap.c | 38 +----------------------------- lib/pci_iomap.c | 48 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 85 insertions(+), 44 deletions(-) create mode 100644 include/asm-generic/pci_iomap.h create mode 100644 lib/pci_iomap.c diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 9120887..dddc61d 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -19,6 +19,8 @@ #include <asm-generic/iomap.h> #endif +#include <asm-generic/pci_iomap.h> + #ifndef mmiowb #define mmiowb() do {} while (0) #endif @@ -283,9 +285,7 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) #define __io_virt(x) ((void __force *) (x)) #ifndef CONFIG_GENERIC_IOMAP -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) { } diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 98dcd76..8a3d4fd 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h @@ -67,18 +67,15 @@ extern void ioport_unmap(void __iomem *); #endif #ifdef CONFIG_PCI -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ +/* Destroy a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); #else struct pci_dev; -static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - return NULL; -} static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { } #endif +#include <asm-generic/pci_iomap.h> + #endif diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h new file mode 100644 index 0000000..8de4b73 --- /dev/null +++ b/include/asm-generic/pci_iomap.h @@ -0,0 +1,25 @@ +/* Generic I/O port emulation, based on MN10300 code + * + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public Licence + * as published by the Free Software Foundation; either version + * 2 of the Licence, or (at your option) any later version. + */ +#ifndef __ASM_GENERIC_PCI_IOMAP_H +#define __ASM_GENERIC_PCI_IOMAP_H + +struct pci_dev; +#ifdef CONFIG_PCI +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); +#else +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) +{ + return NULL; +} +#endif + +#endif /* __ASM_GENERIC_IO_H */ diff --git a/lib/Kconfig b/lib/Kconfig index 0058927..36884b4 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -19,8 +19,12 @@ config RATIONAL config GENERIC_FIND_FIRST_BIT bool +config GENERIC_PCI_IOMAP + bool + config GENERIC_IOMAP bool + select GENERIC_PCI_IOMAP config CRC_CCITT tristate "CRC-CCITT functions" diff --git a/lib/Makefile b/lib/Makefile index a4da283..609b2adc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -33,6 +33,7 @@ endif lib-$(CONFIG_HOTPLUG) += kobject_uevent.o obj-$(CONFIG_GENERIC_IOMAP) += iomap.o +obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o diff --git a/lib/iomap.c b/lib/iomap.c index 5dbcb4b..ada922a 100644 --- a/lib/iomap.c +++ b/lib/iomap.c @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap); #endif /* CONFIG_HAS_IOPORT */ #ifdef CONFIG_PCI -/** - * pci_iomap - create a virtual mapping cookie for a PCI BAR - * @dev: PCI device that owns the BAR - * @bar: BAR number - * @maxlen: length of the memory to map - * - * Using this function you will get a __iomem address to your device BAR. - * You can access it using ioread*() and iowrite*(). These functions hide - * the details if this is a MMIO or PIO address space and will just do what - * you expect from them in the correct way. - * - * @maxlen specifies the maximum length to map. If you want to get access to - * the complete BAR without checking for its length first, pass %0 here. - * */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - +/* Hide the details if this is a MMIO or PIO address space and just do what + * you expect in the correct way. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { IO_COND(addr, /* nothing */, iounmap(addr)); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c new file mode 100644 index 0000000..4b0fdc2 --- /dev/null +++ b/lib/pci_iomap.c @@ -0,0 +1,48 @@ +/* + * Implement the default iomap interfaces + * + * (C) Copyright 2004 Linus Torvalds + */ +#include <linux/pci.h> +#include <linux/io.h> + +#include <linux/export.h> + +#ifdef CONFIG_PCI +/** + * pci_iomap - create a virtual mapping cookie for a PCI BAR + * @dev: PCI device that owns the BAR + * @bar: BAR number + * @maxlen: length of the memory to map + * + * Using this function you will get a __iomem address to your device BAR. + * You can access it using ioread*() and iowrite*(). These functions hide + * the details if this is a MMIO or PIO address space and will just do what + * you expect from them in the correct way. + * + * @maxlen specifies the maximum length to map. If you want to get access to + * the complete BAR without checking for its length first, pass %0 here. + * */ +void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) +{ + resource_size_t start = pci_resource_start(dev, bar); + resource_size_t len = pci_resource_len(dev, bar); + unsigned long flags = pci_resource_flags(dev, bar); + + if (!len || !start) + return NULL; + if (maxlen && len > maxlen) + len = maxlen; + if (flags & IORESOURCE_IO) + return ioport_map(start, len); + if (flags & IORESOURCE_MEM) { + if (flags & IORESOURCE_CACHEABLE) + return ioremap(start, len); + return ioremap_nocache(start, len); + } + /* What? */ + return NULL; +} + +EXPORT_SYMBOL(pci_iomap); +#endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 03/10] alpha: switch to GENERIC_PCI_IOMAP [not found] <cover.1322163031.git.mst@redhat.com> ` (3 preceding siblings ...) 2011-11-24 20:17 ` Michael S. Tsirkin @ 2011-11-24 20:17 ` Michael S. Tsirkin 2011-11-24 20:18 ` Michael S. Tsirkin ` (4 subsequent siblings) 9 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu alpha copied pci_iomap from generic code to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/alpha/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 1 + arch/alpha/kernel/pci.c | 26 +------------------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3636b11..56a4df9 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -315,6 +315,7 @@ config ISA_DMA_API config PCI bool depends on !ALPHA_JENSEN + select GENERIC_PCI_IOMAP default y help Find out whether you have a PCI motherboard. PCI is the name of a diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index c9ab94e..f3cae27 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -508,30 +508,7 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) return -EOPNOTSUPP; } -/* Create an __iomem token from a PCI BAR. Copied from lib/iomap.c with - no changes, since we don't want the other things in that object file. */ - -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - /* Not checking IORESOURCE_CACHEABLE because alpha does - not distinguish between ioremap and ioremap_nocache. */ - return ioremap(start, len); - } - return NULL; -} - -/* Destroy that token. Not copied from lib/iomap.c. */ +/* Destroy an __iomem token. Not copied from lib/iomap.c. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { @@ -539,7 +516,6 @@ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); /* FIXME: Some boxes have multiple ISA bridges! */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 03/10] alpha: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, Michael S. Tsirkin, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller alpha copied pci_iomap from generic code to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/alpha/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 1 + arch/alpha/kernel/pci.c | 26 +------------------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3636b11..56a4df9 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -315,6 +315,7 @@ config ISA_DMA_API config PCI bool depends on !ALPHA_JENSEN + select GENERIC_PCI_IOMAP default y help Find out whether you have a PCI motherboard. PCI is the name of a diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index c9ab94e..f3cae27 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -508,30 +508,7 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) return -EOPNOTSUPP; } -/* Create an __iomem token from a PCI BAR. Copied from lib/iomap.c with - no changes, since we don't want the other things in that object file. */ - -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - /* Not checking IORESOURCE_CACHEABLE because alpha does - not distinguish between ioremap and ioremap_nocache. */ - return ioremap(start, len); - } - return NULL; -} - -/* Destroy that token. Not copied from lib/iomap.c. */ +/* Destroy an __iomem token. Not copied from lib/iomap.c. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { @@ -539,7 +516,6 @@ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); /* FIXME: Some boxes have multiple ISA bridges! */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 03/10] alpha: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu alpha copied pci_iomap from generic code to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/alpha/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 1 + arch/alpha/kernel/pci.c | 26 +------------------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3636b11..56a4df9 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -315,6 +315,7 @@ config ISA_DMA_API config PCI bool depends on !ALPHA_JENSEN + select GENERIC_PCI_IOMAP default y help Find out whether you have a PCI motherboard. PCI is the name of a diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index c9ab94e..f3cae27 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -508,30 +508,7 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) return -EOPNOTSUPP; } -/* Create an __iomem token from a PCI BAR. Copied from lib/iomap.c with - no changes, since we don't want the other things in that object file. */ - -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - /* Not checking IORESOURCE_CACHEABLE because alpha does - not distinguish between ioremap and ioremap_nocache. */ - return ioremap(start, len); - } - return NULL; -} - -/* Destroy that token. Not copied from lib/iomap.c. */ +/* Destroy an __iomem token. Not copied from lib/iomap.c. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { @@ -539,7 +516,6 @@ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); /* FIXME: Some boxes have multiple ISA bridges! */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 03/10] alpha: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci alpha copied pci_iomap from generic code to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/alpha/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 1 + arch/alpha/kernel/pci.c | 26 +------------------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3636b11..56a4df9 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -315,6 +315,7 @@ config ISA_DMA_API config PCI bool depends on !ALPHA_JENSEN + select GENERIC_PCI_IOMAP default y help Find out whether you have a PCI motherboard. PCI is the name of a diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index c9ab94e..f3cae27 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -508,30 +508,7 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) return -EOPNOTSUPP; } -/* Create an __iomem token from a PCI BAR. Copied from lib/iomap.c with - no changes, since we don't want the other things in that object file. */ - -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - /* Not checking IORESOURCE_CACHEABLE because alpha does - not distinguish between ioremap and ioremap_nocache. */ - return ioremap(start, len); - } - return NULL; -} - -/* Destroy that token. Not copied from lib/iomap.c. */ +/* Destroy an __iomem token. Not copied from lib/iomap.c. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { @@ -539,7 +516,6 @@ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); /* FIXME: Some boxes have multiple ISA bridges! */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 03/10] alpha: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci alpha copied pci_iomap from generic code to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/alpha/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 1 + arch/alpha/kernel/pci.c | 26 +------------------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3636b11..56a4df9 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -315,6 +315,7 @@ config ISA_DMA_API config PCI bool depends on !ALPHA_JENSEN + select GENERIC_PCI_IOMAP default y help Find out whether you have a PCI motherboard. PCI is the name of a diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index c9ab94e..f3cae27 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -508,30 +508,7 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) return -EOPNOTSUPP; } -/* Create an __iomem token from a PCI BAR. Copied from lib/iomap.c with - no changes, since we don't want the other things in that object file. */ - -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - /* Not checking IORESOURCE_CACHEABLE because alpha does - not distinguish between ioremap and ioremap_nocache. */ - return ioremap(start, len); - } - return NULL; -} - -/* Destroy that token. Not copied from lib/iomap.c. */ +/* Destroy an __iomem token. Not copied from lib/iomap.c. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { @@ -539,7 +516,6 @@ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); /* FIXME: Some boxes have multiple ISA bridges! */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 03/10] alpha: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu alpha copied pci_iomap from generic code to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/alpha/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/alpha/Kconfig | 1 + arch/alpha/kernel/pci.c | 26 +------------------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3636b11..56a4df9 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -315,6 +315,7 @@ config ISA_DMA_API config PCI bool depends on !ALPHA_JENSEN + select GENERIC_PCI_IOMAP default y help Find out whether you have a PCI motherboard. PCI is the name of a diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index c9ab94e..f3cae27 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -508,30 +508,7 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) return -EOPNOTSUPP; } -/* Create an __iomem token from a PCI BAR. Copied from lib/iomap.c with - no changes, since we don't want the other things in that object file. */ - -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - /* Not checking IORESOURCE_CACHEABLE because alpha does - not distinguish between ioremap and ioremap_nocache. */ - return ioremap(start, len); - } - return NULL; -} - -/* Destroy that token. Not copied from lib/iomap.c. */ +/* Destroy an __iomem token. Not copied from lib/iomap.c. */ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { @@ -539,7 +516,6 @@ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); /* FIXME: Some boxes have multiple ISA bridges! */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 03/10] alpha: switch to GENERIC_PCI_IOMAP 2011-11-24 20:17 ` Michael S. Tsirkin ` (4 preceding siblings ...) (?) @ 2011-12-04 10:50 ` Michael S. Tsirkin -1 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-04 10:50 UTC (permalink / raw) To: Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha On Thu, Nov 24, 2011 at 10:17:23PM +0200, Michael S. Tsirkin wrote: > alpha copied pci_iomap from generic code to avoid > pulling the rest of iomap.c in. Since that's in > a separate file now, we can reuse the common implementation. > > The only difference is handling of nocache flag, > that turns out to be done correctly by the > generic code since arch/alpha/include/asm/io.h > defines ioremap_nocache same as ioremap. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Sorry to nag - any ACKs/NACKs on the alpha changes (both this, and 'alpha: drop pci_iomap/pci_iounmap from pci-noop.c')? I intend to send this to Linus if there are no objections. Thanks! > --- > arch/alpha/Kconfig | 1 + > arch/alpha/kernel/pci.c | 26 +------------------------- > 2 files changed, 2 insertions(+), 25 deletions(-) > > diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig > index 3636b11..56a4df9 100644 > --- a/arch/alpha/Kconfig > +++ b/arch/alpha/Kconfig > @@ -315,6 +315,7 @@ config ISA_DMA_API > config PCI > bool > depends on !ALPHA_JENSEN > + select GENERIC_PCI_IOMAP > default y > help > Find out whether you have a PCI motherboard. PCI is the name of a > diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c > index c9ab94e..f3cae27 100644 > --- a/arch/alpha/kernel/pci.c > +++ b/arch/alpha/kernel/pci.c > @@ -508,30 +508,7 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) > return -EOPNOTSUPP; > } > > -/* Create an __iomem token from a PCI BAR. Copied from lib/iomap.c with > - no changes, since we don't want the other things in that object file. */ > - > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) > -{ > - resource_size_t start = pci_resource_start(dev, bar); > - resource_size_t len = pci_resource_len(dev, bar); > - unsigned long flags = pci_resource_flags(dev, bar); > - > - if (!len || !start) > - return NULL; > - if (maxlen && len > maxlen) > - len = maxlen; > - if (flags & IORESOURCE_IO) > - return ioport_map(start, len); > - if (flags & IORESOURCE_MEM) { > - /* Not checking IORESOURCE_CACHEABLE because alpha does > - not distinguish between ioremap and ioremap_nocache. */ > - return ioremap(start, len); > - } > - return NULL; > -} > - > -/* Destroy that token. Not copied from lib/iomap.c. */ > +/* Destroy an __iomem token. Not copied from lib/iomap.c. */ > > void pci_iounmap(struct pci_dev *dev, void __iomem * addr) > { > @@ -539,7 +516,6 @@ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) > iounmap(addr); > } > > -EXPORT_SYMBOL(pci_iomap); > EXPORT_SYMBOL(pci_iounmap); > > /* FIXME: Some boxes have multiple ISA bridges! */ > -- > 1.7.5.53.gc233e ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 03/10] alpha: switch to GENERIC_PCI_IOMAP 2011-11-24 20:17 ` Michael S. Tsirkin ` (5 preceding siblings ...) (?) @ 2011-12-06 16:45 ` Raúl Porcel -1 siblings, 0 replies; 113+ messages in thread From: Raúl Porcel @ 2011-12-06 16:45 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha On 11/24/2011 09:17 PM, Michael S. Tsirkin wrote: > alpha copied pci_iomap from generic code to avoid > pulling the rest of iomap.c in. Since that's in > a separate file now, we can reuse the common implementation. > > The only difference is handling of nocache flag, > that turns out to be done correctly by the > generic code since arch/alpha/include/asm/io.h > defines ioremap_nocache same as ioremap. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> [snip] WFM on my DS20E using 3.2.0-rc4-00231-g958c6c2 so, Tested-by: Raúl Porcel <armin76@gentoo.org> -- To unsubscribe from this list: send the line "unsubscribe linux-alpha" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 113+ messages in thread
* [PATCH-RFC 04/10] arm: switch to GENERIC_PCI_IOMAP [not found] <cover.1322163031.git.mst@redhat.com> ` (3 preceding siblings ...) 2011-11-24 20:17 ` Michael S. Tsirkin @ 2011-11-24 20:17 ` Michael S. Tsirkin 2011-11-24 20:18 ` Michael S. Tsirkin ` (4 subsequent siblings) 9 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu arm copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/arm/Kconfig | 1 + arch/arm/include/asm/io.h | 2 +- arch/arm/mm/iomap.c | 21 --------------------- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 44789ef..2ebf66b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -30,6 +30,7 @@ config ARM select HAVE_SPARSE_IRQ select GENERIC_IRQ_SHOW select CPU_PM if (SUSPEND || CPU_IDLE) + select GENERIC_PCI_IOMAP help The ARM series is a line of low-power-consumption RISC chip designs licensed by ARM Ltd and targeted at embedded applications and diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 065d100..9275828 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -27,6 +27,7 @@ #include <asm/byteorder.h> #include <asm/memory.h> #include <asm/system.h> +#include <asm-generic/pci_iomap.h> /* * ISA I/O bus memory addresses are 1:1 with the physical address. @@ -306,7 +307,6 @@ extern void ioport_unmap(void __iomem *addr); struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen); extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); /* diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c index 430df1a..e62956e 100644 --- a/arch/arm/mm/iomap.c +++ b/arch/arm/mm/iomap.c @@ -35,27 +35,6 @@ EXPORT_SYMBOL(pcibios_min_mem); unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC; EXPORT_SYMBOL(pci_flags); -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if ((unsigned long)addr >= VMALLOC_START && -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 04/10] arm: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, Michael S. Tsirkin, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller arm copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/arm/Kconfig | 1 + arch/arm/include/asm/io.h | 2 +- arch/arm/mm/iomap.c | 21 --------------------- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 44789ef..2ebf66b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -30,6 +30,7 @@ config ARM select HAVE_SPARSE_IRQ select GENERIC_IRQ_SHOW select CPU_PM if (SUSPEND || CPU_IDLE) + select GENERIC_PCI_IOMAP help The ARM series is a line of low-power-consumption RISC chip designs licensed by ARM Ltd and targeted at embedded applications and diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 065d100..9275828 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -27,6 +27,7 @@ #include <asm/byteorder.h> #include <asm/memory.h> #include <asm/system.h> +#include <asm-generic/pci_iomap.h> /* * ISA I/O bus memory addresses are 1:1 with the physical address. @@ -306,7 +307,6 @@ extern void ioport_unmap(void __iomem *addr); struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen); extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); /* diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c index 430df1a..e62956e 100644 --- a/arch/arm/mm/iomap.c +++ b/arch/arm/mm/iomap.c @@ -35,27 +35,6 @@ EXPORT_SYMBOL(pcibios_min_mem); unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC; EXPORT_SYMBOL(pci_flags); -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if ((unsigned long)addr >= VMALLOC_START && -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 04/10] arm: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu arm copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/arm/Kconfig | 1 + arch/arm/include/asm/io.h | 2 +- arch/arm/mm/iomap.c | 21 --------------------- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 44789ef..2ebf66b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -30,6 +30,7 @@ config ARM select HAVE_SPARSE_IRQ select GENERIC_IRQ_SHOW select CPU_PM if (SUSPEND || CPU_IDLE) + select GENERIC_PCI_IOMAP help The ARM series is a line of low-power-consumption RISC chip designs licensed by ARM Ltd and targeted at embedded applications and diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 065d100..9275828 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -27,6 +27,7 @@ #include <asm/byteorder.h> #include <asm/memory.h> #include <asm/system.h> +#include <asm-generic/pci_iomap.h> /* * ISA I/O bus memory addresses are 1:1 with the physical address. @@ -306,7 +307,6 @@ extern void ioport_unmap(void __iomem *addr); struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen); extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); /* diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c index 430df1a..e62956e 100644 --- a/arch/arm/mm/iomap.c +++ b/arch/arm/mm/iomap.c @@ -35,27 +35,6 @@ EXPORT_SYMBOL(pcibios_min_mem); unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC; EXPORT_SYMBOL(pci_flags); -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if ((unsigned long)addr >= VMALLOC_START && -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 04/10] arm: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci arm copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/arm/Kconfig | 1 + arch/arm/include/asm/io.h | 2 +- arch/arm/mm/iomap.c | 21 --------------------- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 44789ef..2ebf66b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -30,6 +30,7 @@ config ARM select HAVE_SPARSE_IRQ select GENERIC_IRQ_SHOW select CPU_PM if (SUSPEND || CPU_IDLE) + select GENERIC_PCI_IOMAP help The ARM series is a line of low-power-consumption RISC chip designs licensed by ARM Ltd and targeted at embedded applications and diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 065d100..9275828 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -27,6 +27,7 @@ #include <asm/byteorder.h> #include <asm/memory.h> #include <asm/system.h> +#include <asm-generic/pci_iomap.h> /* * ISA I/O bus memory addresses are 1:1 with the physical address. @@ -306,7 +307,6 @@ extern void ioport_unmap(void __iomem *addr); struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen); extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); /* diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c index 430df1a..e62956e 100644 --- a/arch/arm/mm/iomap.c +++ b/arch/arm/mm/iomap.c @@ -35,27 +35,6 @@ EXPORT_SYMBOL(pcibios_min_mem); unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC; EXPORT_SYMBOL(pci_flags); -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if ((unsigned long)addr >= VMALLOC_START && -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 04/10] arm: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci arm copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/arm/Kconfig | 1 + arch/arm/include/asm/io.h | 2 +- arch/arm/mm/iomap.c | 21 --------------------- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 44789ef..2ebf66b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -30,6 +30,7 @@ config ARM select HAVE_SPARSE_IRQ select GENERIC_IRQ_SHOW select CPU_PM if (SUSPEND || CPU_IDLE) + select GENERIC_PCI_IOMAP help The ARM series is a line of low-power-consumption RISC chip designs licensed by ARM Ltd and targeted at embedded applications and diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 065d100..9275828 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -27,6 +27,7 @@ #include <asm/byteorder.h> #include <asm/memory.h> #include <asm/system.h> +#include <asm-generic/pci_iomap.h> /* * ISA I/O bus memory addresses are 1:1 with the physical address. @@ -306,7 +307,6 @@ extern void ioport_unmap(void __iomem *addr); struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen); extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); /* diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c index 430df1a..e62956e 100644 --- a/arch/arm/mm/iomap.c +++ b/arch/arm/mm/iomap.c @@ -35,27 +35,6 @@ EXPORT_SYMBOL(pcibios_min_mem); unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC; EXPORT_SYMBOL(pci_flags); -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if ((unsigned long)addr >= VMALLOC_START && -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 04/10] arm: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:17 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:17 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu arm copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/arm/Kconfig | 1 + arch/arm/include/asm/io.h | 2 +- arch/arm/mm/iomap.c | 21 --------------------- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 44789ef..2ebf66b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -30,6 +30,7 @@ config ARM select HAVE_SPARSE_IRQ select GENERIC_IRQ_SHOW select CPU_PM if (SUSPEND || CPU_IDLE) + select GENERIC_PCI_IOMAP help The ARM series is a line of low-power-consumption RISC chip designs licensed by ARM Ltd and targeted at embedded applications and diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 065d100..9275828 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -27,6 +27,7 @@ #include <asm/byteorder.h> #include <asm/memory.h> #include <asm/system.h> +#include <asm-generic/pci_iomap.h> /* * ISA I/O bus memory addresses are 1:1 with the physical address. @@ -306,7 +307,6 @@ extern void ioport_unmap(void __iomem *addr); struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen); extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); /* diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c index 430df1a..e62956e 100644 --- a/arch/arm/mm/iomap.c +++ b/arch/arm/mm/iomap.c @@ -35,27 +35,6 @@ EXPORT_SYMBOL(pcibios_min_mem); unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC; EXPORT_SYMBOL(pci_flags); -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if ((unsigned long)addr >= VMALLOC_START && -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 04/10] arm: switch to GENERIC_PCI_IOMAP 2011-11-24 20:17 ` Michael S. Tsirkin ` (4 preceding siblings ...) (?) @ 2011-12-04 10:47 ` Michael S. Tsirkin 2011-12-04 21:25 ` Russell King - ARM Linux -1 siblings, 1 reply; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-04 10:47 UTC (permalink / raw) To: linux-arm-kernel On Thu, Nov 24, 2011 at 10:17:42PM +0200, Michael S. Tsirkin wrote: > arm copied pci_iomap from generic code, probably to avoid > pulling the rest of iomap.c in. Since that's in > a separate file now, we can reuse the common implementation. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > --- Sorry to nag, any ACKs/NACKs on the arm part? I intend to send this to Linus if there are no objections. Thanks! > arch/arm/Kconfig | 1 + > arch/arm/include/asm/io.h | 2 +- > arch/arm/mm/iomap.c | 21 --------------------- > 3 files changed, 2 insertions(+), 22 deletions(-) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index 44789ef..2ebf66b 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -30,6 +30,7 @@ config ARM > select HAVE_SPARSE_IRQ > select GENERIC_IRQ_SHOW > select CPU_PM if (SUSPEND || CPU_IDLE) > + select GENERIC_PCI_IOMAP > help > The ARM series is a line of low-power-consumption RISC chip designs > licensed by ARM Ltd and targeted at embedded applications and > diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h > index 065d100..9275828 100644 > --- a/arch/arm/include/asm/io.h > +++ b/arch/arm/include/asm/io.h > @@ -27,6 +27,7 @@ > #include <asm/byteorder.h> > #include <asm/memory.h> > #include <asm/system.h> > +#include <asm-generic/pci_iomap.h> > > /* > * ISA I/O bus memory addresses are 1:1 with the physical address. > @@ -306,7 +307,6 @@ extern void ioport_unmap(void __iomem *addr); > > struct pci_dev; > > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen); > extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); > > /* > diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c > index 430df1a..e62956e 100644 > --- a/arch/arm/mm/iomap.c > +++ b/arch/arm/mm/iomap.c > @@ -35,27 +35,6 @@ EXPORT_SYMBOL(pcibios_min_mem); > unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC; > EXPORT_SYMBOL(pci_flags); > > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) > -{ > - resource_size_t start = pci_resource_start(dev, bar); > - resource_size_t len = pci_resource_len(dev, bar); > - unsigned long flags = pci_resource_flags(dev, bar); > - > - if (!len || !start) > - return NULL; > - if (maxlen && len > maxlen) > - len = maxlen; > - if (flags & IORESOURCE_IO) > - return ioport_map(start, len); > - if (flags & IORESOURCE_MEM) { > - if (flags & IORESOURCE_CACHEABLE) > - return ioremap(start, len); > - return ioremap_nocache(start, len); > - } > - return NULL; > -} > -EXPORT_SYMBOL(pci_iomap); > - > void pci_iounmap(struct pci_dev *dev, void __iomem *addr) > { > if ((unsigned long)addr >= VMALLOC_START && > -- > 1.7.5.53.gc233e ^ permalink raw reply [flat|nested] 113+ messages in thread
* [PATCH-RFC 04/10] arm: switch to GENERIC_PCI_IOMAP 2011-12-04 10:47 ` Michael S. Tsirkin @ 2011-12-04 21:25 ` Russell King - ARM Linux 0 siblings, 0 replies; 113+ messages in thread From: Russell King - ARM Linux @ 2011-12-04 21:25 UTC (permalink / raw) To: linux-arm-kernel On Sun, Dec 04, 2011 at 12:47:09PM +0200, Michael S. Tsirkin wrote: > On Thu, Nov 24, 2011 at 10:17:42PM +0200, Michael S. Tsirkin wrote: > > arm copied pci_iomap from generic code, probably to avoid > > pulling the rest of iomap.c in. Since that's in > > a separate file now, we can reuse the common implementation. > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > > --- > > Sorry to nag, any ACKs/NACKs on the arm part? > I intend to send this to Linus if there are no > objections. Thanks! As there's no difference between the generic version and this version you're removing... Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> ^ permalink raw reply [flat|nested] 113+ messages in thread
* [PATCH-RFC 05/10] microblaze: switch to GENERIC_PCI_IOMAP [not found] <cover.1322163031.git.mst@redhat.com> ` (3 preceding siblings ...) 2011-11-24 20:17 ` Michael S. Tsirkin @ 2011-11-24 20:18 ` Michael S. Tsirkin 2011-11-24 20:18 ` Michael S. Tsirkin ` (4 subsequent siblings) 9 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu microblaze copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/microblaze/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/microblaze/Kconfig | 1 + arch/microblaze/pci/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index e446bab..f0eead7 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -17,6 +17,7 @@ config MICROBLAZE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW + select GENERIC_PCI_IOMAP config SWAP def_bool n diff --git a/arch/microblaze/pci/iomap.c b/arch/microblaze/pci/iomap.c index 57acda8..b07abba 100644 --- a/arch/microblaze/pci/iomap.c +++ b/arch/microblaze/pci/iomap.c @@ -10,25 +10,6 @@ #include <asm/io.h> #include <asm/pci-bridge.h> -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 05/10] microblaze: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:18 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, Michael S. Tsirkin, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller microblaze copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/microblaze/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/microblaze/Kconfig | 1 + arch/microblaze/pci/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index e446bab..f0eead7 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -17,6 +17,7 @@ config MICROBLAZE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW + select GENERIC_PCI_IOMAP config SWAP def_bool n diff --git a/arch/microblaze/pci/iomap.c b/arch/microblaze/pci/iomap.c index 57acda8..b07abba 100644 --- a/arch/microblaze/pci/iomap.c +++ b/arch/microblaze/pci/iomap.c @@ -10,25 +10,6 @@ #include <asm/io.h> #include <asm/pci-bridge.h> -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 05/10] microblaze: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:18 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu microblaze copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/microblaze/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/microblaze/Kconfig | 1 + arch/microblaze/pci/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index e446bab..f0eead7 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -17,6 +17,7 @@ config MICROBLAZE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW + select GENERIC_PCI_IOMAP config SWAP def_bool n diff --git a/arch/microblaze/pci/iomap.c b/arch/microblaze/pci/iomap.c index 57acda8..b07abba 100644 --- a/arch/microblaze/pci/iomap.c +++ b/arch/microblaze/pci/iomap.c @@ -10,25 +10,6 @@ #include <asm/io.h> #include <asm/pci-bridge.h> -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 05/10] microblaze: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:18 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci microblaze copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/microblaze/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/microblaze/Kconfig | 1 + arch/microblaze/pci/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index e446bab..f0eead7 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -17,6 +17,7 @@ config MICROBLAZE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW + select GENERIC_PCI_IOMAP config SWAP def_bool n diff --git a/arch/microblaze/pci/iomap.c b/arch/microblaze/pci/iomap.c index 57acda8..b07abba 100644 --- a/arch/microblaze/pci/iomap.c +++ b/arch/microblaze/pci/iomap.c @@ -10,25 +10,6 @@ #include <asm/io.h> #include <asm/pci-bridge.h> -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 05/10] microblaze: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:18 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci microblaze copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/microblaze/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/microblaze/Kconfig | 1 + arch/microblaze/pci/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index e446bab..f0eead7 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -17,6 +17,7 @@ config MICROBLAZE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW + select GENERIC_PCI_IOMAP config SWAP def_bool n diff --git a/arch/microblaze/pci/iomap.c b/arch/microblaze/pci/iomap.c index 57acda8..b07abba 100644 --- a/arch/microblaze/pci/iomap.c +++ b/arch/microblaze/pci/iomap.c @@ -10,25 +10,6 @@ #include <asm/io.h> #include <asm/pci-bridge.h> -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 05/10] microblaze: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:18 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu microblaze copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/microblaze/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/microblaze/Kconfig | 1 + arch/microblaze/pci/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index e446bab..f0eead7 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -17,6 +17,7 @@ config MICROBLAZE select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW + select GENERIC_PCI_IOMAP config SWAP def_bool n diff --git a/arch/microblaze/pci/iomap.c b/arch/microblaze/pci/iomap.c index 57acda8..b07abba 100644 --- a/arch/microblaze/pci/iomap.c +++ b/arch/microblaze/pci/iomap.c @@ -10,25 +10,6 @@ #include <asm/io.h> #include <asm/pci-bridge.h> -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP [not found] <cover.1322163031.git.mst@redhat.com> ` (3 preceding siblings ...) 2011-11-24 20:17 ` Michael S. Tsirkin @ 2011-11-24 20:18 ` Michael S. Tsirkin 2011-11-24 20:18 ` Michael S. Tsirkin ` (4 subsequent siblings) 9 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu mips copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/mips/Kconfig | 1 + arch/mips/lib/iomap-pci.c | 26 -------------------------- 2 files changed, 1 insertions(+), 26 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d46f1da..b70c96f 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2317,6 +2317,7 @@ config PCI bool "Support for PCI controller" depends on HW_HAS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/mips/lib/iomap-pci.c b/arch/mips/lib/iomap-pci.c index 2ab899c..2635b1a 100644 --- a/arch/mips/lib/iomap-pci.c +++ b/arch/mips/lib/iomap-pci.c @@ -40,32 +40,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *) (ctrl->io_map_base + port); } -/* - * Create a virtual mapping cookie for a PCI BAR (memory or IO) - */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:18 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, Michael S. Tsirkin, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller mips copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/mips/Kconfig | 1 + arch/mips/lib/iomap-pci.c | 26 -------------------------- 2 files changed, 1 insertions(+), 26 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d46f1da..b70c96f 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2317,6 +2317,7 @@ config PCI bool "Support for PCI controller" depends on HW_HAS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/mips/lib/iomap-pci.c b/arch/mips/lib/iomap-pci.c index 2ab899c..2635b1a 100644 --- a/arch/mips/lib/iomap-pci.c +++ b/arch/mips/lib/iomap-pci.c @@ -40,32 +40,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *) (ctrl->io_map_base + port); } -/* - * Create a virtual mapping cookie for a PCI BAR (memory or IO) - */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:18 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu mips copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/mips/Kconfig | 1 + arch/mips/lib/iomap-pci.c | 26 -------------------------- 2 files changed, 1 insertions(+), 26 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d46f1da..b70c96f 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2317,6 +2317,7 @@ config PCI bool "Support for PCI controller" depends on HW_HAS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/mips/lib/iomap-pci.c b/arch/mips/lib/iomap-pci.c index 2ab899c..2635b1a 100644 --- a/arch/mips/lib/iomap-pci.c +++ b/arch/mips/lib/iomap-pci.c @@ -40,32 +40,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *) (ctrl->io_map_base + port); } -/* - * Create a virtual mapping cookie for a PCI BAR (memory or IO) - */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:18 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci mips copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/mips/Kconfig | 1 + arch/mips/lib/iomap-pci.c | 26 -------------------------- 2 files changed, 1 insertions(+), 26 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d46f1da..b70c96f 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2317,6 +2317,7 @@ config PCI bool "Support for PCI controller" depends on HW_HAS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/mips/lib/iomap-pci.c b/arch/mips/lib/iomap-pci.c index 2ab899c..2635b1a 100644 --- a/arch/mips/lib/iomap-pci.c +++ b/arch/mips/lib/iomap-pci.c @@ -40,32 +40,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *) (ctrl->io_map_base + port); } -/* - * Create a virtual mapping cookie for a PCI BAR (memory or IO) - */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:18 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci mips copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/mips/Kconfig | 1 + arch/mips/lib/iomap-pci.c | 26 -------------------------- 2 files changed, 1 insertions(+), 26 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d46f1da..b70c96f 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2317,6 +2317,7 @@ config PCI bool "Support for PCI controller" depends on HW_HAS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/mips/lib/iomap-pci.c b/arch/mips/lib/iomap-pci.c index 2ab899c..2635b1a 100644 --- a/arch/mips/lib/iomap-pci.c +++ b/arch/mips/lib/iomap-pci.c @@ -40,32 +40,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *) (ctrl->io_map_base + port); } -/* - * Create a virtual mapping cookie for a PCI BAR (memory or IO) - */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:18 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:18 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu mips copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/mips/Kconfig | 1 + arch/mips/lib/iomap-pci.c | 26 -------------------------- 2 files changed, 1 insertions(+), 26 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d46f1da..b70c96f 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2317,6 +2317,7 @@ config PCI bool "Support for PCI controller" depends on HW_HAS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/mips/lib/iomap-pci.c b/arch/mips/lib/iomap-pci.c index 2ab899c..2635b1a 100644 --- a/arch/mips/lib/iomap-pci.c +++ b/arch/mips/lib/iomap-pci.c @@ -40,32 +40,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *) (ctrl->io_map_base + port); } -/* - * Create a virtual mapping cookie for a PCI BAR (memory or IO) - */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP 2011-11-24 20:18 ` Michael S. Tsirkin ` (4 preceding siblings ...) (?) @ 2011-12-04 10:47 ` Michael S. Tsirkin -1 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-04 10:47 UTC (permalink / raw) To: Ralf Baechle, linux-mips On Thu, Nov 24, 2011 at 10:18:37PM +0200, Michael S. Tsirkin wrote: > mips copied pci_iomap from generic code, probably to avoid > pulling the rest of iomap.c in. Since that's in > a separate file now, we can reuse the common implementation. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > --- Sorry to nag, any ACKs/NACKs on the mips part? I intend to send this to Linus if there are no objections. Thanks! > arch/mips/Kconfig | 1 + > arch/mips/lib/iomap-pci.c | 26 -------------------------- > 2 files changed, 1 insertions(+), 26 deletions(-) > > diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig > index d46f1da..b70c96f 100644 > --- a/arch/mips/Kconfig > +++ b/arch/mips/Kconfig > @@ -2317,6 +2317,7 @@ config PCI > bool "Support for PCI controller" > depends on HW_HAS_PCI > select PCI_DOMAINS > + select GENERIC_PCI_IOMAP > help > Find out whether you have a PCI motherboard. PCI is the name of a > bus system, i.e. the way the CPU talks to the other stuff inside > diff --git a/arch/mips/lib/iomap-pci.c b/arch/mips/lib/iomap-pci.c > index 2ab899c..2635b1a 100644 > --- a/arch/mips/lib/iomap-pci.c > +++ b/arch/mips/lib/iomap-pci.c > @@ -40,32 +40,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, > return (void __iomem *) (ctrl->io_map_base + port); > } > > -/* > - * Create a virtual mapping cookie for a PCI BAR (memory or IO) > - */ > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) > -{ > - resource_size_t start = pci_resource_start(dev, bar); > - resource_size_t len = pci_resource_len(dev, bar); > - unsigned long flags = pci_resource_flags(dev, bar); > - > - if (!len || !start) > - return NULL; > - if (maxlen && len > maxlen) > - len = maxlen; > - if (flags & IORESOURCE_IO) > - return ioport_map_pci(dev, start, len); > - if (flags & IORESOURCE_MEM) { > - if (flags & IORESOURCE_CACHEABLE) > - return ioremap(start, len); > - return ioremap_nocache(start, len); > - } > - /* What? */ > - return NULL; > -} > - > -EXPORT_SYMBOL(pci_iomap); > - > void pci_iounmap(struct pci_dev *dev, void __iomem * addr) > { > iounmap(addr); > -- > 1.7.5.53.gc233e ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP 2011-11-24 20:18 ` Michael S. Tsirkin (?) (?) @ 2012-01-28 22:38 ` Kevin Cernekee -1 siblings, 0 replies; 113+ messages in thread From: Kevin Cernekee @ 2012-01-28 22:38 UTC (permalink / raw) To: Ralf Baechle, Michael S. Tsirkin Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt On Thu, Nov 24, 2011 at 12:18 PM, Michael S. Tsirkin <mst@redhat.com> wrote: > mips copied pci_iomap from generic code, probably to avoid > pulling the rest of iomap.c in. Since that's in > a separate file now, we can reuse the common implementation. [snip] > - if (flags & IORESOURCE_IO) > - return ioport_map_pci(dev, start, len); While investigating a new warning on the 3.3-rc1 MIPS build (unused static function ioport_map_pci()), I noticed that this patch has shown up in Linus' tree as commit eab90291d35438bcebf7c3dc85be66d0f24e3002. I am not completely clear on the implications it has on mapping PCI I/O regions: Prior to this change, the MIPS version of pci_iomap() called a MIPS-specific function, ioport_map_pci(), which tried to use the PCI controller's io_map_base field to determine the base address of the PCI I/O space. It also had a fallback mechanism to deal with the case where io_map_base is unset. Now, in 3.3-rc1, the generic version of pci_iomap() is used instead. This code just calls arch/mips/lib/iomap.c:ioport_map() on these regions. ioport_map() falls through to ioport_map_legacy(), which always uses mips_io_port_base (not the PCI controller's io_map_base) as the base address. But on MIPS, it is still permissible to use different I/O port bases for PCI devices and for legacy (ISA?) devices. Is this new behavior desirable, or are there any supported platforms on which adverse effects might be seen? As for my part, I don't use PCI I/O regions at all - just memory regions. I'm more worried about making sure my tree builds with 0 warnings. If we do want to move ahead with the switch to GENERIC_PCI_IOMAP now, I have patches to scrap iomap-pci.c entirely and squash the unused function warning. If we still want to support the case where io_map_base != mips_io_port_base, maybe it would be better to revert commit eab90291 for 3.3. Might also want to take a look at SH since it also appears to have an orphaned ioport_map_pci() function. What are your thoughts? ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP @ 2012-01-28 22:38 ` Kevin Cernekee 0 siblings, 0 replies; 113+ messages in thread From: Kevin Cernekee @ 2012-01-28 22:38 UTC (permalink / raw) To: Ralf Baechle, Michael S. Tsirkin Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux-sh, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller On Thu, Nov 24, 2011 at 12:18 PM, Michael S. Tsirkin <mst@redhat.com> wrote= : > mips copied pci_iomap from generic code, probably to avoid > pulling the rest of iomap.c in. =C2=A0Since that's in > a separate file now, we can reuse the common implementation. [snip] > - =C2=A0 =C2=A0 =C2=A0 if (flags & IORESOURCE_IO) > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ioport_map_pci(= dev, start, len); While investigating a new warning on the 3.3-rc1 MIPS build (unused static function ioport_map_pci()), I noticed that this patch has shown up in Linus' tree as commit eab90291d35438bcebf7c3dc85be66d0f24e3002. I am not completely clear on the implications it has on mapping PCI I/O reg= ions: Prior to this change, the MIPS version of pci_iomap() called a MIPS-specific function, ioport_map_pci(), which tried to use the PCI controller's io_map_base field to determine the base address of the PCI I/O space. It also had a fallback mechanism to deal with the case where io_map_base is unset. Now, in 3.3-rc1, the generic version of pci_iomap() is used instead. This code just calls arch/mips/lib/iomap.c:ioport_map() on these regions. ioport_map() falls through to ioport_map_legacy(), which always uses mips_io_port_base (not the PCI controller's io_map_base) as the base address. But on MIPS, it is still permissible to use different I/O port bases for PCI devices and for legacy (ISA?) devices. Is this new behavior desirable, or are there any supported platforms on which adverse effects might be seen? As for my part, I don't use PCI I/O regions at all - just memory regions. I'm more worried about making sure my tree builds with 0 warnings. If we do want to move ahead with the switch to GENERIC_PCI_IOMAP now, I have patches to scrap iomap-pci.c entirely and squash the unused function warning. If we still want to support the case where io_map_base !=3D mips_io_port_base, maybe it would be better to revert commit eab90291 for 3.3. Might also want to take a look at SH since it also appears to have an orphaned ioport_map_pci() function. What are your thoughts? ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP @ 2012-01-28 22:38 ` Kevin Cernekee 0 siblings, 0 replies; 113+ messages in thread From: Kevin Cernekee @ 2012-01-28 22:38 UTC (permalink / raw) To: Ralf Baechle, Michael S. Tsirkin Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt On Thu, Nov 24, 2011 at 12:18 PM, Michael S. Tsirkin <mst@redhat.com> w= rote: > mips copied pci_iomap from generic code, probably to avoid > pulling the rest of iomap.c in. =C2=A0Since that's in > a separate file now, we can reuse the common implementation. [snip] > - =C2=A0 =C2=A0 =C2=A0 if (flags & IORESOURCE_IO) > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ioport_map_= pci(dev, start, len); While investigating a new warning on the 3.3-rc1 MIPS build (unused static function ioport_map_pci()), I noticed that this patch has shown up in Linus' tree as commit eab90291d35438bcebf7c3dc85be66d0f24e3002. I am not completely clear on the implications it has on mapping PCI I/O= regions: Prior to this change, the MIPS version of pci_iomap() called a MIPS-specific function, ioport_map_pci(), which tried to use the PCI controller's io_map_base field to determine the base address of the PCI I/O space. It also had a fallback mechanism to deal with the case where io_map_base is unset. Now, in 3.3-rc1, the generic version of pci_iomap() is used instead. This code just calls arch/mips/lib/iomap.c:ioport_map() on these regions. ioport_map() falls through to ioport_map_legacy(), which always uses mips_io_port_base (not the PCI controller's io_map_base) as the base address. But on MIPS, it is still permissible to use different I/O port bases for PCI devices and for legacy (ISA?) devices. Is this new behavior desirable, or are there any supported platforms on which adverse effects might be seen? As for my part, I don't use PCI I/O regions at all - just memory regions. I'm more worried about making sure my tree builds with 0 warnings. If we do want to move ahead with the switch to GENERIC_PCI_IOMAP now, I have patches to scrap iomap-pci.c entirely and squash the unused function warning. If we still want to support the case where io_map_base !=3D mips_io_port_base, maybe it would be better to revert commit eab90291 for 3.3. Might also want to take a look at SH since it also appears to have an orphaned ioport_map_pci() function. What are your thoughts? ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP @ 2012-01-28 22:38 ` Kevin Cernekee 0 siblings, 0 replies; 113+ messages in thread From: Kevin Cernekee @ 2012-01-28 22:38 UTC (permalink / raw) To: Ralf Baechle, Michael S. Tsirkin Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci On Thu, Nov 24, 2011 at 12:18 PM, Michael S. Tsirkin <mst@redhat.com> wrote: > mips copied pci_iomap from generic code, probably to avoid > pulling the rest of iomap.c in. Since that's in > a separate file now, we can reuse the common implementation. [snip] > - if (flags & IORESOURCE_IO) > - return ioport_map_pci(dev, start, len); While investigating a new warning on the 3.3-rc1 MIPS build (unused static function ioport_map_pci()), I noticed that this patch has shown up in Linus' tree as commit eab90291d35438bcebf7c3dc85be66d0f24e3002. I am not completely clear on the implications it has on mapping PCI I/O regions: Prior to this change, the MIPS version of pci_iomap() called a MIPS-specific function, ioport_map_pci(), which tried to use the PCI controller's io_map_base field to determine the base address of the PCI I/O space. It also had a fallback mechanism to deal with the case where io_map_base is unset. Now, in 3.3-rc1, the generic version of pci_iomap() is used instead. This code just calls arch/mips/lib/iomap.c:ioport_map() on these regions. ioport_map() falls through to ioport_map_legacy(), which always uses mips_io_port_base (not the PCI controller's io_map_base) as the base address. But on MIPS, it is still permissible to use different I/O port bases for PCI devices and for legacy (ISA?) devices. Is this new behavior desirable, or are there any supported platforms on which adverse effects might be seen? As for my part, I don't use PCI I/O regions at all - just memory regions. I'm more worried about making sure my tree builds with 0 warnings. If we do want to move ahead with the switch to GENERIC_PCI_IOMAP now, I have patches to scrap iomap-pci.c entirely and squash the unused function warning. If we still want to support the case where io_map_base != mips_io_port_base, maybe it would be better to revert commit eab90291 for 3.3. Might also want to take a look at SH since it also appears to have an orphaned ioport_map_pci() function. What are your thoughts? ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP 2012-01-28 22:38 ` Kevin Cernekee (?) (?) @ 2012-01-29 22:45 ` Michael S. Tsirkin -1 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2012-01-29 22:45 UTC (permalink / raw) To: Kevin Cernekee Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux-sh, Benjamin Herrenschmidt, linux, linux-pci, Jesse Barnes, Kumar Gala, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jesper Nilsson, Russell King, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel On Sat, Jan 28, 2012 at 02:38:10PM -0800, Kevin Cernekee wrote: > On Thu, Nov 24, 2011 at 12:18 PM, Michael S. Tsirkin <mst@redhat.com> wrote: > > mips copied pci_iomap from generic code, probably to avoid > > pulling the rest of iomap.c in. Since that's in > > a separate file now, we can reuse the common implementation. > > [snip] > > > - if (flags & IORESOURCE_IO) > > - return ioport_map_pci(dev, start, len); > > While investigating a new warning on the 3.3-rc1 MIPS build (unused > static function ioport_map_pci()), I noticed that this patch has shown > up in Linus' tree as commit eab90291d35438bcebf7c3dc85be66d0f24e3002. > > I am not completely clear on the implications it has on mapping PCI I/O regions: Yes, my bad, I missed the difference between ioport_map_pci and ioport_map for both MIPS and SH. I'll post a patch to fix this, which is probably preferable to reintroducing the code duplication where it might trip us up again. -- MST ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP @ 2012-01-29 22:45 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2012-01-29 22:45 UTC (permalink / raw) To: Kevin Cernekee Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux-sh, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller On Sat, Jan 28, 2012 at 02:38:10PM -0800, Kevin Cernekee wrote: > On Thu, Nov 24, 2011 at 12:18 PM, Michael S. Tsirkin <mst@redhat.com> wrote: > > mips copied pci_iomap from generic code, probably to avoid > > pulling the rest of iomap.c in. Since that's in > > a separate file now, we can reuse the common implementation. > > [snip] > > > - if (flags & IORESOURCE_IO) > > - return ioport_map_pci(dev, start, len); > > While investigating a new warning on the 3.3-rc1 MIPS build (unused > static function ioport_map_pci()), I noticed that this patch has shown > up in Linus' tree as commit eab90291d35438bcebf7c3dc85be66d0f24e3002. > > I am not completely clear on the implications it has on mapping PCI I/O regions: Yes, my bad, I missed the difference between ioport_map_pci and ioport_map for both MIPS and SH. I'll post a patch to fix this, which is probably preferable to reintroducing the code duplication where it might trip us up again. -- MST ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP @ 2012-01-29 22:45 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2012-01-29 22:45 UTC (permalink / raw) To: Kevin Cernekee Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux-sh, Benjamin Herrenschmidt, linux, linux-pci, Jesse Barnes, Kumar Gala, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jesper Nilsson, Russell King, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel On Sat, Jan 28, 2012 at 02:38:10PM -0800, Kevin Cernekee wrote: > On Thu, Nov 24, 2011 at 12:18 PM, Michael S. Tsirkin <mst@redhat.com> wro= te: > > mips copied pci_iomap from generic code, probably to avoid > > pulling the rest of iomap.c in. =A0Since that's in > > a separate file now, we can reuse the common implementation. > = > [snip] > = > > - =A0 =A0 =A0 if (flags & IORESOURCE_IO) > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return ioport_map_pci(dev, start, len); > = > While investigating a new warning on the 3.3-rc1 MIPS build (unused > static function ioport_map_pci()), I noticed that this patch has shown > up in Linus' tree as commit eab90291d35438bcebf7c3dc85be66d0f24e3002. > = > I am not completely clear on the implications it has on mapping PCI I/O r= egions: Yes, my bad, I missed the difference between ioport_map_pci and ioport_map for both MIPS and SH. I'll post a patch to fix this, which is probably preferable to reintroducing the code duplication where it might trip us up again. -- = MST ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 06/10] mips: switch to GENERIC_PCI_IOMAP @ 2012-01-29 22:45 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2012-01-29 22:45 UTC (permalink / raw) To: Kevin Cernekee Cc: Ralf Baechle, Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci On Sat, Jan 28, 2012 at 02:38:10PM -0800, Kevin Cernekee wrote: > On Thu, Nov 24, 2011 at 12:18 PM, Michael S. Tsirkin <mst@redhat.com> wrote: > > mips copied pci_iomap from generic code, probably to avoid > > pulling the rest of iomap.c in. Since that's in > > a separate file now, we can reuse the common implementation. > > [snip] > > > - if (flags & IORESOURCE_IO) > > - return ioport_map_pci(dev, start, len); > > While investigating a new warning on the 3.3-rc1 MIPS build (unused > static function ioport_map_pci()), I noticed that this patch has shown > up in Linus' tree as commit eab90291d35438bcebf7c3dc85be66d0f24e3002. > > I am not completely clear on the implications it has on mapping PCI I/O regions: Yes, my bad, I missed the difference between ioport_map_pci and ioport_map for both MIPS and SH. I'll post a patch to fix this, which is probably preferable to reintroducing the code duplication where it might trip us up again. -- MST ^ permalink raw reply [flat|nested] 113+ messages in thread
* [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP [not found] <cover.1322163031.git.mst@redhat.com> ` (3 preceding siblings ...) 2011-11-24 20:17 ` Michael S. Tsirkin @ 2011-11-24 20:19 ` Michael S. Tsirkin 2011-11-24 20:18 ` Michael S. Tsirkin ` (4 subsequent siblings) 9 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu parisc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/parisc/Kconfig | 1 + arch/parisc/lib/iomap.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index fdfd8be..242a1b7 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -14,6 +14,7 @@ config PARISC select GENERIC_ATOMIC64 if !64BIT select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE + select GENERIC_PCI_IOMAP select IRQ_PER_CPU select ARCH_HAVE_NMI_SAFE_CMPXCHG diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c index 8f470c9..fb8e10a 100644 --- a/arch/parisc/lib/iomap.c +++ b/arch/parisc/lib/iomap.c @@ -436,28 +436,6 @@ void ioport_unmap(void __iomem *addr) } } -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { if (!INDIRECT_ADDR(addr)) { @@ -483,5 +461,4 @@ EXPORT_SYMBOL(iowrite16_rep); EXPORT_SYMBOL(iowrite32_rep); EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:19 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, Michael S. Tsirkin, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller parisc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/parisc/Kconfig | 1 + arch/parisc/lib/iomap.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index fdfd8be..242a1b7 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -14,6 +14,7 @@ config PARISC select GENERIC_ATOMIC64 if !64BIT select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE + select GENERIC_PCI_IOMAP select IRQ_PER_CPU select ARCH_HAVE_NMI_SAFE_CMPXCHG diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c index 8f470c9..fb8e10a 100644 --- a/arch/parisc/lib/iomap.c +++ b/arch/parisc/lib/iomap.c @@ -436,28 +436,6 @@ void ioport_unmap(void __iomem *addr) } } -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { if (!INDIRECT_ADDR(addr)) { @@ -483,5 +461,4 @@ EXPORT_SYMBOL(iowrite16_rep); EXPORT_SYMBOL(iowrite32_rep); EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:19 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu parisc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/parisc/Kconfig | 1 + arch/parisc/lib/iomap.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index fdfd8be..242a1b7 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -14,6 +14,7 @@ config PARISC select GENERIC_ATOMIC64 if !64BIT select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE + select GENERIC_PCI_IOMAP select IRQ_PER_CPU select ARCH_HAVE_NMI_SAFE_CMPXCHG diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c index 8f470c9..fb8e10a 100644 --- a/arch/parisc/lib/iomap.c +++ b/arch/parisc/lib/iomap.c @@ -436,28 +436,6 @@ void ioport_unmap(void __iomem *addr) } } -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { if (!INDIRECT_ADDR(addr)) { @@ -483,5 +461,4 @@ EXPORT_SYMBOL(iowrite16_rep); EXPORT_SYMBOL(iowrite32_rep); EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:19 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci parisc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/parisc/Kconfig | 1 + arch/parisc/lib/iomap.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index fdfd8be..242a1b7 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -14,6 +14,7 @@ config PARISC select GENERIC_ATOMIC64 if !64BIT select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE + select GENERIC_PCI_IOMAP select IRQ_PER_CPU select ARCH_HAVE_NMI_SAFE_CMPXCHG diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c index 8f470c9..fb8e10a 100644 --- a/arch/parisc/lib/iomap.c +++ b/arch/parisc/lib/iomap.c @@ -436,28 +436,6 @@ void ioport_unmap(void __iomem *addr) } } -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { if (!INDIRECT_ADDR(addr)) { @@ -483,5 +461,4 @@ EXPORT_SYMBOL(iowrite16_rep); EXPORT_SYMBOL(iowrite32_rep); EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:19 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci parisc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/parisc/Kconfig | 1 + arch/parisc/lib/iomap.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index fdfd8be..242a1b7 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -14,6 +14,7 @@ config PARISC select GENERIC_ATOMIC64 if !64BIT select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE + select GENERIC_PCI_IOMAP select IRQ_PER_CPU select ARCH_HAVE_NMI_SAFE_CMPXCHG diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c index 8f470c9..fb8e10a 100644 --- a/arch/parisc/lib/iomap.c +++ b/arch/parisc/lib/iomap.c @@ -436,28 +436,6 @@ void ioport_unmap(void __iomem *addr) } } -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { if (!INDIRECT_ADDR(addr)) { @@ -483,5 +461,4 @@ EXPORT_SYMBOL(iowrite16_rep); EXPORT_SYMBOL(iowrite32_rep); EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:19 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu parisc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/parisc/Kconfig | 1 + arch/parisc/lib/iomap.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index fdfd8be..242a1b7 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -14,6 +14,7 @@ config PARISC select GENERIC_ATOMIC64 if !64BIT select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_PROBE + select GENERIC_PCI_IOMAP select IRQ_PER_CPU select ARCH_HAVE_NMI_SAFE_CMPXCHG diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c index 8f470c9..fb8e10a 100644 --- a/arch/parisc/lib/iomap.c +++ b/arch/parisc/lib/iomap.c @@ -436,28 +436,6 @@ void ioport_unmap(void __iomem *addr) } } -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { if (!INDIRECT_ADDR(addr)) { @@ -483,5 +461,4 @@ EXPORT_SYMBOL(iowrite16_rep); EXPORT_SYMBOL(iowrite32_rep); EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-11-24 20:19 ` Michael S. Tsirkin ` (4 preceding siblings ...) (?) @ 2011-12-04 10:48 ` Michael S. Tsirkin 2011-12-04 14:22 ` James Bottomley -1 siblings, 1 reply; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-04 10:48 UTC (permalink / raw) To: Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote: > parisc copied pci_iomap from generic code, probably to avoid > pulling the rest of iomap.c in. Since that's in > a separate file now, we can reuse the common implementation. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Sorry to nag, any ACKs/NACKs on the parisc part? I intend to send this to Linus if there are no objections. Thanks! > --- > arch/parisc/Kconfig | 1 + > arch/parisc/lib/iomap.c | 23 ----------------------- > 2 files changed, 1 insertions(+), 23 deletions(-) > > diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig > index fdfd8be..242a1b7 100644 > --- a/arch/parisc/Kconfig > +++ b/arch/parisc/Kconfig > @@ -14,6 +14,7 @@ config PARISC > select GENERIC_ATOMIC64 if !64BIT > select HAVE_GENERIC_HARDIRQS > select GENERIC_IRQ_PROBE > + select GENERIC_PCI_IOMAP > select IRQ_PER_CPU > select ARCH_HAVE_NMI_SAFE_CMPXCHG > > diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c > index 8f470c9..fb8e10a 100644 > --- a/arch/parisc/lib/iomap.c > +++ b/arch/parisc/lib/iomap.c > @@ -436,28 +436,6 @@ void ioport_unmap(void __iomem *addr) > } > } > > -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) > -{ > - resource_size_t start = pci_resource_start(dev, bar); > - resource_size_t len = pci_resource_len(dev, bar); > - unsigned long flags = pci_resource_flags(dev, bar); > - > - if (!len || !start) > - return NULL; > - if (maxlen && len > maxlen) > - len = maxlen; > - if (flags & IORESOURCE_IO) > - return ioport_map(start, len); > - if (flags & IORESOURCE_MEM) { > - if (flags & IORESOURCE_CACHEABLE) > - return ioremap(start, len); > - return ioremap_nocache(start, len); > - } > - /* What? */ > - return NULL; > -} > - > void pci_iounmap(struct pci_dev *dev, void __iomem * addr) > { > if (!INDIRECT_ADDR(addr)) { > @@ -483,5 +461,4 @@ EXPORT_SYMBOL(iowrite16_rep); > EXPORT_SYMBOL(iowrite32_rep); > EXPORT_SYMBOL(ioport_map); > EXPORT_SYMBOL(ioport_unmap); > -EXPORT_SYMBOL(pci_iomap); > EXPORT_SYMBOL(pci_iounmap); > -- > 1.7.5.53.gc233e ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-04 10:48 ` Michael S. Tsirkin @ 2011-12-04 14:22 ` James Bottomley 2011-12-04 14:30 ` Michael S. Tsirkin 0 siblings, 1 reply; 113+ messages in thread From: James Bottomley @ 2011-12-04 14:22 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote: > On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote: > > parisc copied pci_iomap from generic code, probably to avoid > > pulling the rest of iomap.c in. Since that's in > > a separate file now, we can reuse the common implementation. > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > > Sorry to nag, any ACKs/NACKs on the parisc part? > I intend to send this to Linus if there are no > objections. Thanks! Next time, send the patch to linux-arch or linux-parisc ... it helps to get people to review it. Although this one looks completely trivial, unless I'm missing something? Obviously there was a bit of a brain fart when this was done: the parisc piece shouldn't be a copy of the generic code: we don't have native i/o ports and emulation is pretty expensive, so we should prefer IORESOURCE_MEM over IORESOURCE_IO when both are available ... but even on x86, memory mapping is faster (although not by the order of magnitude it is on parisc), so it looks like you could fix this in the generic code. James ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-04 14:22 ` James Bottomley @ 2011-12-04 14:30 ` Michael S. Tsirkin 2011-12-04 14:32 ` James Bottomley 2011-12-05 18:23 ` Grant Grundler 0 siblings, 2 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-04 14:30 UTC (permalink / raw) To: James Bottomley Cc: Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Sun, Dec 04, 2011 at 08:22:34AM -0600, James Bottomley wrote: > On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote: > > On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote: > > > parisc copied pci_iomap from generic code, probably to avoid > > > pulling the rest of iomap.c in. Since that's in > > > a separate file now, we can reuse the common implementation. > > > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > > > > Sorry to nag, any ACKs/NACKs on the parisc part? > > I intend to send this to Linus if there are no > > objections. Thanks! > > Next time, send the patch to linux-arch or linux-parisc ... it helps to > get people to review it. Although this one looks completely trivial, > unless I'm missing something? I think it's trivial but I don't have the setup to even compile it so depend on someone to ack. > Obviously there was a bit of a brain fart when this was done: the parisc > piece shouldn't be a copy of the generic code: we don't have native i/o > ports and emulation is pretty expensive, so we should prefer > IORESOURCE_MEM over IORESOURCE_IO when both are available ... but even > on x86, memory mapping is faster (although not by the order of magnitude > it is on parisc), so it looks like you could fix this in the generic > code. > > James AFAIK, on PCI a resource is either IO or MEM, but never both. What am I missing? -- MST ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-04 14:30 ` Michael S. Tsirkin @ 2011-12-04 14:32 ` James Bottomley 2011-12-04 14:42 ` Michael S. Tsirkin 2011-12-05 18:23 ` Grant Grundler 1 sibling, 1 reply; 113+ messages in thread From: James Bottomley @ 2011-12-04 14:32 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Sun, 2011-12-04 at 16:30 +0200, Michael S. Tsirkin wrote: > On Sun, Dec 04, 2011 at 08:22:34AM -0600, James Bottomley wrote: > > On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote: > > > On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote: > > > > parisc copied pci_iomap from generic code, probably to avoid > > > > pulling the rest of iomap.c in. Since that's in > > > > a separate file now, we can reuse the common implementation. > > > > > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > > > > > > Sorry to nag, any ACKs/NACKs on the parisc part? > > > I intend to send this to Linus if there are no > > > objections. Thanks! > > > > Next time, send the patch to linux-arch or linux-parisc ... it helps to > > get people to review it. Although this one looks completely trivial, > > unless I'm missing something? > > I think it's trivial but I don't have the setup to even compile it so > depend on someone to ack. > > > Obviously there was a bit of a brain fart when this was done: the parisc > > piece shouldn't be a copy of the generic code: we don't have native i/o > > ports and emulation is pretty expensive, so we should prefer > > IORESOURCE_MEM over IORESOURCE_IO when both are available ... but even > > on x86, memory mapping is faster (although not by the order of magnitude > > it is on parisc), so it looks like you could fix this in the generic > > code. > > > > James > > AFAIK, on PCI a resource is either IO or MEM, but never both. > What am I missing? Could be ... I know we've had issues in the past with standard drivers like the sym53c8xx which map via both and operate far less efficiently over I/O ... but that could have been different bars I suppose (it's so long ago that I can't remember). James ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-04 14:32 ` James Bottomley @ 2011-12-04 14:42 ` Michael S. Tsirkin 2011-12-05 15:33 ` James Bottomley 0 siblings, 1 reply; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-04 14:42 UTC (permalink / raw) To: James Bottomley Cc: Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Sun, Dec 04, 2011 at 08:32:24AM -0600, James Bottomley wrote: > On Sun, 2011-12-04 at 16:30 +0200, Michael S. Tsirkin wrote: > > On Sun, Dec 04, 2011 at 08:22:34AM -0600, James Bottomley wrote: > > > On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote: > > > > On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote: > > > > > parisc copied pci_iomap from generic code, probably to avoid > > > > > pulling the rest of iomap.c in. Since that's in > > > > > a separate file now, we can reuse the common implementation. > > > > > > > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > > > > > > > > Sorry to nag, any ACKs/NACKs on the parisc part? > > > > I intend to send this to Linus if there are no > > > > objections. Thanks! > > > > > > Next time, send the patch to linux-arch or linux-parisc ... it helps to > > > get people to review it. Although this one looks completely trivial, > > > unless I'm missing something? > > > > I think it's trivial but I don't have the setup to even compile it so > > depend on someone to ack. > > > > > Obviously there was a bit of a brain fart when this was done: the parisc > > > piece shouldn't be a copy of the generic code: we don't have native i/o > > > ports and emulation is pretty expensive, so we should prefer > > > IORESOURCE_MEM over IORESOURCE_IO when both are available ... but even > > > on x86, memory mapping is faster (although not by the order of magnitude > > > it is on parisc), so it looks like you could fix this in the generic > > > code. > > > > > > James > > > > AFAIK, on PCI a resource is either IO or MEM, but never both. > > What am I missing? > > Could be ... I know we've had issues in the past with standard drivers > like the sym53c8xx which map via both and operate far less efficiently > over I/O ... but that could have been different bars I suppose (it's so > long ago that I can't remember). Probably, it looks like it has both mmio and io: drivers/scsi/sym53c8xx_2/sym_glue.c #ifdef CONFIG_SCSI_SYM53C8XX_MMIO if (device->mmio_base) device->s.ioaddr = pci_iomap(pdev, 1, pci_resource_len(pdev, 1)); #endif if (!device->s.ioaddr) device->s.ioaddr = pci_iomap(pdev, 0, pci_resource_len(pdev, 0)); so ... ACK? > > James > -- MSt ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-04 14:42 ` Michael S. Tsirkin @ 2011-12-05 15:33 ` James Bottomley 2011-12-05 16:24 ` Michael S. Tsirkin 0 siblings, 1 reply; 113+ messages in thread From: James Bottomley @ 2011-12-05 15:33 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Sun, 2011-12-04 at 16:42 +0200, Michael S. Tsirkin wrote: > On Sun, Dec 04, 2011 at 08:32:24AM -0600, James Bottomley wrote: > > On Sun, 2011-12-04 at 16:30 +0200, Michael S. Tsirkin wrote: > > > On Sun, Dec 04, 2011 at 08:22:34AM -0600, James Bottomley wrote: > > > > On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote: > > > > > On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote: > > > > > > parisc copied pci_iomap from generic code, probably to avoid > > > > > > pulling the rest of iomap.c in. Since that's in > > > > > > a separate file now, we can reuse the common implementation. > > > > > > > > > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > > > > > > > > > > Sorry to nag, any ACKs/NACKs on the parisc part? > > > > > I intend to send this to Linus if there are no > > > > > objections. Thanks! > > > > > > > > Next time, send the patch to linux-arch or linux-parisc ... it helps to > > > > get people to review it. Although this one looks completely trivial, > > > > unless I'm missing something? > > > > > > I think it's trivial but I don't have the setup to even compile it so > > > depend on someone to ack. > > > > > > > Obviously there was a bit of a brain fart when this was done: the parisc > > > > piece shouldn't be a copy of the generic code: we don't have native i/o > > > > ports and emulation is pretty expensive, so we should prefer > > > > IORESOURCE_MEM over IORESOURCE_IO when both are available ... but even > > > > on x86, memory mapping is faster (although not by the order of magnitude > > > > it is on parisc), so it looks like you could fix this in the generic > > > > code. > > > > > > > > James > > > > > > AFAIK, on PCI a resource is either IO or MEM, but never both. > > > What am I missing? > > > > Could be ... I know we've had issues in the past with standard drivers > > like the sym53c8xx which map via both and operate far less efficiently > > over I/O ... but that could have been different bars I suppose (it's so > > long ago that I can't remember). > > Probably, it looks like it has both mmio and io: > > drivers/scsi/sym53c8xx_2/sym_glue.c > > #ifdef CONFIG_SCSI_SYM53C8XX_MMIO > if (device->mmio_base) > device->s.ioaddr = pci_iomap(pdev, 1, > pci_resource_len(pdev, 1)); > #endif > if (!device->s.ioaddr) > device->s.ioaddr = pci_iomap(pdev, 0, > pci_resource_len(pdev, 0)); > > > so ... ACK? Um, well, it looks like a trivial code shift, so it doesn't really need one (it can just go through the trivial tree). Unless there's some reason actually to test it out on parisc because something will break (in which case, I'll need the actual patch, not just a quoted one). James ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-05 15:33 ` James Bottomley @ 2011-12-05 16:24 ` Michael S. Tsirkin 2011-12-05 16:46 ` James Bottomley 0 siblings, 1 reply; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-05 16:24 UTC (permalink / raw) To: James Bottomley Cc: Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Mon, Dec 05, 2011 at 09:33:29AM -0600, James Bottomley wrote: > On Sun, 2011-12-04 at 16:42 +0200, Michael S. Tsirkin wrote: > > On Sun, Dec 04, 2011 at 08:32:24AM -0600, James Bottomley wrote: > > > On Sun, 2011-12-04 at 16:30 +0200, Michael S. Tsirkin wrote: > > > > On Sun, Dec 04, 2011 at 08:22:34AM -0600, James Bottomley wrote: > > > > > On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote: > > > > > > On Thu, Nov 24, 2011 at 10:19:34PM +0200, Michael S. Tsirkin wrote: > > > > > > > parisc copied pci_iomap from generic code, probably to avoid > > > > > > > pulling the rest of iomap.c in. Since that's in > > > > > > > a separate file now, we can reuse the common implementation. > > > > > > > > > > > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > > > > > > > > > > > > Sorry to nag, any ACKs/NACKs on the parisc part? > > > > > > I intend to send this to Linus if there are no > > > > > > objections. Thanks! > > > > > > > > > > Next time, send the patch to linux-arch or linux-parisc ... it helps to > > > > > get people to review it. Although this one looks completely trivial, > > > > > unless I'm missing something? > > > > > > > > I think it's trivial but I don't have the setup to even compile it so > > > > depend on someone to ack. > > > > > > > > > Obviously there was a bit of a brain fart when this was done: the parisc > > > > > piece shouldn't be a copy of the generic code: we don't have native i/o > > > > > ports and emulation is pretty expensive, so we should prefer > > > > > IORESOURCE_MEM over IORESOURCE_IO when both are available ... but even > > > > > on x86, memory mapping is faster (although not by the order of magnitude > > > > > it is on parisc), so it looks like you could fix this in the generic > > > > > code. > > > > > > > > > > James > > > > > > > > AFAIK, on PCI a resource is either IO or MEM, but never both. > > > > What am I missing? > > > > > > Could be ... I know we've had issues in the past with standard drivers > > > like the sym53c8xx which map via both and operate far less efficiently > > > over I/O ... but that could have been different bars I suppose (it's so > > > long ago that I can't remember). > > > > Probably, it looks like it has both mmio and io: > > > > drivers/scsi/sym53c8xx_2/sym_glue.c > > > > #ifdef CONFIG_SCSI_SYM53C8XX_MMIO > > if (device->mmio_base) > > device->s.ioaddr = pci_iomap(pdev, 1, > > pci_resource_len(pdev, 1)); > > #endif > > if (!device->s.ioaddr) > > device->s.ioaddr = pci_iomap(pdev, 0, > > pci_resource_len(pdev, 0)); > > > > > > so ... ACK? > > Um, well, it looks like a trivial code shift, so it doesn't really need > one (it can just go through the trivial tree). It's part of a larger set not all of which is trivial. > Unless there's some > reason actually to test it out on parisc because something will break > (in which case, I'll need the actual patch, not just a quoted one). > > James A build test would be nice. Just forwarded you a patch. It's also on linux-next. -- MST ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-05 16:24 ` Michael S. Tsirkin @ 2011-12-05 16:46 ` James Bottomley 0 siblings, 0 replies; 113+ messages in thread From: James Bottomley @ 2011-12-05 16:46 UTC (permalink / raw) To: Michael S. Tsirkin Cc: Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Mon, 2011-12-05 at 18:24 +0200, Michael S. Tsirkin wrote: > > > so ... ACK? > > > > Um, well, it looks like a trivial code shift, so it doesn't really need > > one (it can just go through the trivial tree). > > It's part of a larger set not all of which is trivial. OK, so it looks fine to me. > > Unless there's some > > reason actually to test it out on parisc because something will break > > (in which case, I'll need the actual patch, not just a quoted one). > > > > James > > A build test would be nice. Just forwarded you a patch. > It's also on linux-next. Actually, sending it to me doesn't help. Being busy and lazy, I want to see if someone else will test it ... that's why we send patches to the list. James ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-04 14:30 ` Michael S. Tsirkin 2011-12-04 14:32 ` James Bottomley @ 2011-12-05 18:23 ` Grant Grundler 2011-12-06 11:06 ` Michael S. Tsirkin 1 sibling, 1 reply; 113+ messages in thread From: Grant Grundler @ 2011-12-05 18:23 UTC (permalink / raw) To: Michael S. Tsirkin Cc: James Bottomley, Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Sun, Dec 4, 2011 at 6:30 AM, Michael S. Tsirkin <mst@redhat.com> wrote: ... > AFAIK, on PCI a resource is either IO or MEM, but never both. > What am I missing? Yes, a particular PCI BAR (Base Address Register) is either IO or MEM (not both) address space resource. James is observing many older devices have the same set of registers mapped in both address spaces using two BARs. As you already know, MMIO is "lighter weight" (CPU cost to generate transactions on PCI bus). I think this is orthogonal to the issue you are addressing. Regarding handling of IO Port space cookies: > - if (flags & IORESOURCE_IO) > - return ioport_map(start, len); I don't know who all the consumers of pci_iomap() are. If user space can somehow call this, it should fail for IO port space "mappings" since unlike x86, parisc has no INB/OUTB instructions. Generating IO Port space requires frobbing PCI Bus controller registers that I don't think we want to expose to user space. I'm going to assume this is NOT a problem since any code that generates anything that tries to look like an INB/OUTB just won't compile on parisc. I think removing the parisc specific definition and using the generic one instead looks fine to me. But I'm not confident enough to offer a formal ACKed-by line. Sorry. :( cheers, grant ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-05 18:23 ` Grant Grundler @ 2011-12-06 11:06 ` Michael S. Tsirkin 2011-12-06 16:18 ` Grant Grundler 0 siblings, 1 reply; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-06 11:06 UTC (permalink / raw) To: Grant Grundler Cc: James Bottomley, Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Mon, Dec 05, 2011 at 10:23:17AM -0800, Grant Grundler wrote: > On Sun, Dec 4, 2011 at 6:30 AM, Michael S. Tsirkin <mst@redhat.com> wrote: > ... > > AFAIK, on PCI a resource is either IO or MEM, but never both. > > What am I missing? > > Yes, a particular PCI BAR (Base Address Register) is either IO or MEM > (not both) address space resource. > > James is observing many older devices have the same set of registers > mapped in both address spaces using two BARs. As you already know, > MMIO is "lighter weight" (CPU cost to generate transactions on PCI > bus). I think this is orthogonal to the issue you are addressing. > > Regarding handling of IO Port space cookies: > > - if (flags & IORESOURCE_IO) > > - return ioport_map(start, len); > > I don't know who all the consumers of pci_iomap() are. If user space > can somehow call this, it should fail for IO port space "mappings" > since unlike x86, parisc has no INB/OUTB instructions. Generating IO > Port space requires frobbing PCI Bus controller registers that I don't > think we want to expose to user space. > > I'm going to assume this is NOT a problem since any code that > generates anything that tries to look like an INB/OUTB just won't > compile on parisc. I think removing the parisc specific definition > and using the generic one instead looks fine to me. But I'm not > confident enough to offer a formal ACKed-by line. Sorry. :( > > cheers, > grant How about a Tested-by line? I presume you have the hardware to try this out? You can also get the patches from my tree: git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next or from linux-next. -- MST ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-06 11:06 ` Michael S. Tsirkin @ 2011-12-06 16:18 ` Grant Grundler 2011-12-06 16:24 ` Michael S. Tsirkin 0 siblings, 1 reply; 113+ messages in thread From: Grant Grundler @ 2011-12-06 16:18 UTC (permalink / raw) To: Michael S. Tsirkin Cc: James Bottomley, Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Tue, Dec 6, 2011 at 3:06 AM, Michael S. Tsirkin <mst@redhat.com> wro= te: > On Mon, Dec 05, 2011 at 10:23:17AM -0800, Grant Grundler wrote: =2E.. >> I'm going to assume this is NOT a problem since any code that >> generates anything that tries to look like an INB/OUTB just won't >> compile on parisc. =C2=A0I think removing the parisc specific defini= tion >> and using the generic one instead looks fine to me. =C2=A0But I'm no= t >> confident enough to offer a formal ACKed-by line. Sorry. :( >> >> cheers, >> grant > > How about a Tested-by line? I presume you have the hardware to > try this out? I do have the HW at home to test this...but it's not been powered up in 6+ months. I have to point dpkg at a new repository and update all the SW on the machine. If you don't mind waiting another week, I'll make time to do that later this week (or weekend). > You can also get the patches from my tree: > git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-nex= t > or from linux-next. That's easy enough - thanks! grant > > -- > MST -- To unsubscribe from this list: send the line "unsubscribe linux-parisc"= in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-06 16:18 ` Grant Grundler @ 2011-12-06 16:24 ` Michael S. Tsirkin 2011-12-16 2:11 ` Grant Grundler 0 siblings, 1 reply; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-06 16:24 UTC (permalink / raw) To: Grant Grundler Cc: James Bottomley, Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Tue, Dec 06, 2011 at 08:18:43AM -0800, Grant Grundler wrote: > On Tue, Dec 6, 2011 at 3:06 AM, Michael S. Tsirkin <mst@redhat.com> w= rote: > > On Mon, Dec 05, 2011 at 10:23:17AM -0800, Grant Grundler wrote: > ... > >> I'm going to assume this is NOT a problem since any code that > >> generates anything that tries to look like an INB/OUTB just won't > >> compile on parisc. =A0I think removing the parisc specific definit= ion > >> and using the generic one instead looks fine to me. =A0But I'm not > >> confident enough to offer a formal ACKed-by line. Sorry. :( > >> > >> cheers, > >> grant > > > > How about a Tested-by line? I presume you have the hardware to > > try this out? >=20 > I do have the HW at home to test this...but it's not been powered up > in 6+ months. I have to point dpkg at a new repository and update all > the SW on the machine. If you don't mind waiting another week, I'll > make time to do that later this week (or weekend). > > > You can also get the patches from my tree: > > git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-n= ext > > or from linux-next. >=20 > That's easy enough - thanks! > grant Waiting for 3.4 window to open anyway, so yes that will be nice. Thanks! --=20 MST -- To unsubscribe from this list: send the line "unsubscribe linux-parisc"= in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 07/10] parisc: switch to GENERIC_PCI_IOMAP 2011-12-06 16:24 ` Michael S. Tsirkin @ 2011-12-16 2:11 ` Grant Grundler 0 siblings, 0 replies; 113+ messages in thread From: Grant Grundler @ 2011-12-16 2:11 UTC (permalink / raw) To: Michael S. Tsirkin Cc: James Bottomley, Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc On Tue, Dec 6, 2011 at 8:24 AM, Michael S. Tsirkin <mst@redhat.com> wrote: ... >> I do have the HW at home to test this...but it's not been powered up >> in 6+ months. I have to point dpkg at a new repository and update all >> the SW on the machine. If you don't mind waiting another week, I'll >> make time to do that later this week (or weekend). >> >> > You can also get the patches from my tree: >> > git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next >> > or from linux-next. >> >> That's easy enough - thanks! >> grant > > Waiting for 3.4 window to open anyway, so yes that will be nice. Michael, Just an update that I haven't forgotten your request. I tried to update the machine on Monday and the current state of hppa for debian-ports is dselect can't resolve dependencies on versions of packages because those versions don't exist for hppa. I've just asked for help with this on debian-hppa mailing list and will see if we can get this machine updated. cheers, grant ^ permalink raw reply [flat|nested] 113+ messages in thread
* [PATCH-RFC 08/10] powerpc: switch to GENERIC_PCI_IOMAP [not found] <cover.1322163031.git.mst@redhat.com> ` (3 preceding siblings ...) 2011-11-24 20:17 ` Michael S. Tsirkin @ 2011-11-24 20:19 ` Michael S. Tsirkin 2011-11-24 20:18 ` Michael S. Tsirkin ` (4 subsequent siblings) 9 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu powerpc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/powerpc/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 951e18f..6ffe3df 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -710,6 +710,7 @@ config PCI default PCI_PERMEDIA if !4xx && !CPM2 && !8xx default PCI_QSPAN if !4xx && !CPM2 && 8xx select ARCH_SUPPORTS_MSI + select GENERIC_PCI_IOMAP help Find out whether your system includes a PCI bus. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c index 2627918..97a3715 100644 --- a/arch/powerpc/kernel/iomap.c +++ b/arch/powerpc/kernel/iomap.c @@ -119,24 +119,6 @@ EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); #ifdef CONFIG_PCI -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) @@ -146,6 +128,5 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 08/10] powerpc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:19 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, Michael S. Tsirkin, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller powerpc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/powerpc/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 951e18f..6ffe3df 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -710,6 +710,7 @@ config PCI default PCI_PERMEDIA if !4xx && !CPM2 && !8xx default PCI_QSPAN if !4xx && !CPM2 && 8xx select ARCH_SUPPORTS_MSI + select GENERIC_PCI_IOMAP help Find out whether your system includes a PCI bus. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c index 2627918..97a3715 100644 --- a/arch/powerpc/kernel/iomap.c +++ b/arch/powerpc/kernel/iomap.c @@ -119,24 +119,6 @@ EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); #ifdef CONFIG_PCI -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) @@ -146,6 +128,5 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 08/10] powerpc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:19 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu powerpc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/powerpc/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 951e18f..6ffe3df 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -710,6 +710,7 @@ config PCI default PCI_PERMEDIA if !4xx && !CPM2 && !8xx default PCI_QSPAN if !4xx && !CPM2 && 8xx select ARCH_SUPPORTS_MSI + select GENERIC_PCI_IOMAP help Find out whether your system includes a PCI bus. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c index 2627918..97a3715 100644 --- a/arch/powerpc/kernel/iomap.c +++ b/arch/powerpc/kernel/iomap.c @@ -119,24 +119,6 @@ EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); #ifdef CONFIG_PCI -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) @@ -146,6 +128,5 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 08/10] powerpc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:19 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci powerpc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/powerpc/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 951e18f..6ffe3df 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -710,6 +710,7 @@ config PCI default PCI_PERMEDIA if !4xx && !CPM2 && !8xx default PCI_QSPAN if !4xx && !CPM2 && 8xx select ARCH_SUPPORTS_MSI + select GENERIC_PCI_IOMAP help Find out whether your system includes a PCI bus. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c index 2627918..97a3715 100644 --- a/arch/powerpc/kernel/iomap.c +++ b/arch/powerpc/kernel/iomap.c @@ -119,24 +119,6 @@ EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); #ifdef CONFIG_PCI -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) @@ -146,6 +128,5 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 08/10] powerpc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:19 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci powerpc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/powerpc/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 951e18f..6ffe3df 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -710,6 +710,7 @@ config PCI default PCI_PERMEDIA if !4xx && !CPM2 && !8xx default PCI_QSPAN if !4xx && !CPM2 && 8xx select ARCH_SUPPORTS_MSI + select GENERIC_PCI_IOMAP help Find out whether your system includes a PCI bus. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c index 2627918..97a3715 100644 --- a/arch/powerpc/kernel/iomap.c +++ b/arch/powerpc/kernel/iomap.c @@ -119,24 +119,6 @@ EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); #ifdef CONFIG_PCI -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) @@ -146,6 +128,5 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 08/10] powerpc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:19 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:19 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu powerpc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/powerpc/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/iomap.c | 19 ------------------- 2 files changed, 1 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 951e18f..6ffe3df 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -710,6 +710,7 @@ config PCI default PCI_PERMEDIA if !4xx && !CPM2 && !8xx default PCI_QSPAN if !4xx && !CPM2 && 8xx select ARCH_SUPPORTS_MSI + select GENERIC_PCI_IOMAP help Find out whether your system includes a PCI bus. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c index 2627918..97a3715 100644 --- a/arch/powerpc/kernel/iomap.c +++ b/arch/powerpc/kernel/iomap.c @@ -119,24 +119,6 @@ EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); #ifdef CONFIG_PCI -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len) - return NULL; - if (max && len > max) - len = max; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) @@ -146,6 +128,5 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr) iounmap(addr); } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); #endif /* CONFIG_PCI */ -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 08/10] powerpc: switch to GENERIC_PCI_IOMAP 2011-11-24 20:19 ` Michael S. Tsirkin ` (4 preceding siblings ...) (?) @ 2011-12-04 10:48 ` Michael S. Tsirkin 2011-12-04 20:52 ` Benjamin Herrenschmidt -1 siblings, 1 reply; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-04 10:48 UTC (permalink / raw) To: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev On Thu, Nov 24, 2011 at 10:19:54PM +0200, Michael S. Tsirkin wrote: > powerpc copied pci_iomap from generic code, probably to avoid > pulling the rest of iomap.c in. Since that's in > a separate file now, we can reuse the common implementation. > > The only difference is handling of nocache flag, > that turns out to be done correctly by the > generic code since arch/powerpc/include/asm/io.h > defines ioremap_nocache same as ioremap. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Sorry to nag, any ACKs/NACKs on the powerpc changes? I intend to send this to Linus if there are no objections. Thanks! > --- > arch/powerpc/Kconfig | 1 + > arch/powerpc/kernel/iomap.c | 19 ------------------- > 2 files changed, 1 insertions(+), 19 deletions(-) > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index 951e18f..6ffe3df 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -710,6 +710,7 @@ config PCI > default PCI_PERMEDIA if !4xx && !CPM2 && !8xx > default PCI_QSPAN if !4xx && !CPM2 && 8xx > select ARCH_SUPPORTS_MSI > + select GENERIC_PCI_IOMAP > help > Find out whether your system includes a PCI bus. PCI is the name of > a bus system, i.e. the way the CPU talks to the other stuff inside > diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c > index 2627918..97a3715 100644 > --- a/arch/powerpc/kernel/iomap.c > +++ b/arch/powerpc/kernel/iomap.c > @@ -119,24 +119,6 @@ EXPORT_SYMBOL(ioport_map); > EXPORT_SYMBOL(ioport_unmap); > > #ifdef CONFIG_PCI > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) > -{ > - resource_size_t start = pci_resource_start(dev, bar); > - resource_size_t len = pci_resource_len(dev, bar); > - unsigned long flags = pci_resource_flags(dev, bar); > - > - if (!len) > - return NULL; > - if (max && len > max) > - len = max; > - if (flags & IORESOURCE_IO) > - return ioport_map(start, len); > - if (flags & IORESOURCE_MEM) > - return ioremap(start, len); > - /* What? */ > - return NULL; > -} > - > void pci_iounmap(struct pci_dev *dev, void __iomem *addr) > { > if (isa_vaddr_is_ioport(addr)) > @@ -146,6 +128,5 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr) > iounmap(addr); > } > > -EXPORT_SYMBOL(pci_iomap); > EXPORT_SYMBOL(pci_iounmap); > #endif /* CONFIG_PCI */ > -- > 1.7.5.53.gc233e ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 08/10] powerpc: switch to GENERIC_PCI_IOMAP 2011-12-04 10:48 ` Michael S. Tsirkin @ 2011-12-04 20:52 ` Benjamin Herrenschmidt 2011-12-05 6:03 ` Michael S. Tsirkin 0 siblings, 1 reply; 113+ messages in thread From: Benjamin Herrenschmidt @ 2011-12-04 20:52 UTC (permalink / raw) To: Michael S. Tsirkin; +Cc: linuxppc-dev, Paul Mackerras On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote: > On Thu, Nov 24, 2011 at 10:19:54PM +0200, Michael S. Tsirkin wrote: > > powerpc copied pci_iomap from generic code, probably to avoid > > pulling the rest of iomap.c in. Since that's in > > a separate file now, we can reuse the common implementation. > > > > The only difference is handling of nocache flag, > > that turns out to be done correctly by the > > generic code since arch/powerpc/include/asm/io.h > > defines ioremap_nocache same as ioremap. > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > > > Sorry to nag, any ACKs/NACKs on the powerpc changes? > I intend to send this to Linus if there are no > objections. Thanks! Ah sorry, forgot about that. Do you have a git tree I can pull to do quick test ? No objection in principle. Cheers, Ben. > > --- > > arch/powerpc/Kconfig | 1 + > > arch/powerpc/kernel/iomap.c | 19 ------------------- > > 2 files changed, 1 insertions(+), 19 deletions(-) > > > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > > index 951e18f..6ffe3df 100644 > > --- a/arch/powerpc/Kconfig > > +++ b/arch/powerpc/Kconfig > > @@ -710,6 +710,7 @@ config PCI > > default PCI_PERMEDIA if !4xx && !CPM2 && !8xx > > default PCI_QSPAN if !4xx && !CPM2 && 8xx > > select ARCH_SUPPORTS_MSI > > + select GENERIC_PCI_IOMAP > > help > > Find out whether your system includes a PCI bus. PCI is the name of > > a bus system, i.e. the way the CPU talks to the other stuff inside > > diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c > > index 2627918..97a3715 100644 > > --- a/arch/powerpc/kernel/iomap.c > > +++ b/arch/powerpc/kernel/iomap.c > > @@ -119,24 +119,6 @@ EXPORT_SYMBOL(ioport_map); > > EXPORT_SYMBOL(ioport_unmap); > > > > #ifdef CONFIG_PCI > > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) > > -{ > > - resource_size_t start = pci_resource_start(dev, bar); > > - resource_size_t len = pci_resource_len(dev, bar); > > - unsigned long flags = pci_resource_flags(dev, bar); > > - > > - if (!len) > > - return NULL; > > - if (max && len > max) > > - len = max; > > - if (flags & IORESOURCE_IO) > > - return ioport_map(start, len); > > - if (flags & IORESOURCE_MEM) > > - return ioremap(start, len); > > - /* What? */ > > - return NULL; > > -} > > - > > void pci_iounmap(struct pci_dev *dev, void __iomem *addr) > > { > > if (isa_vaddr_is_ioport(addr)) > > @@ -146,6 +128,5 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr) > > iounmap(addr); > > } > > > > -EXPORT_SYMBOL(pci_iomap); > > EXPORT_SYMBOL(pci_iounmap); > > #endif /* CONFIG_PCI */ > > -- > > 1.7.5.53.gc233e ^ permalink raw reply [flat|nested] 113+ messages in thread
* Re: [PATCH-RFC 08/10] powerpc: switch to GENERIC_PCI_IOMAP 2011-12-04 20:52 ` Benjamin Herrenschmidt @ 2011-12-05 6:03 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-05 6:03 UTC (permalink / raw) To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras On Mon, Dec 05, 2011 at 07:52:01AM +1100, Benjamin Herrenschmidt wrote: > On Sun, 2011-12-04 at 12:48 +0200, Michael S. Tsirkin wrote: > > On Thu, Nov 24, 2011 at 10:19:54PM +0200, Michael S. Tsirkin wrote: > > > powerpc copied pci_iomap from generic code, probably to avoid > > > pulling the rest of iomap.c in. Since that's in > > > a separate file now, we can reuse the common implementation. > > > > > > The only difference is handling of nocache flag, > > > that turns out to be done correctly by the > > > generic code since arch/powerpc/include/asm/io.h > > > defines ioremap_nocache same as ioremap. > > > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > > > > > > Sorry to nag, any ACKs/NACKs on the powerpc changes? > > I intend to send this to Linus if there are no > > objections. Thanks! > > Ah sorry, forgot about that. Do you have a git tree I can pull to do > quick test ? Yes. git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next Thanks! > No objection in principle. > > Cheers, > Ben. ^ permalink raw reply [flat|nested] 113+ messages in thread
* [PATCH-RFC 09/10] sh: switch to GENERIC_PCI_IOMAP [not found] <cover.1322163031.git.mst@redhat.com> ` (3 preceding siblings ...) 2011-11-24 20:17 ` Michael S. Tsirkin @ 2011-11-24 20:20 ` Michael S. Tsirkin 2011-11-24 20:18 ` Michael S. Tsirkin ` (4 subsequent siblings) 9 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:20 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu sh copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sh/Kconfig | 1 + arch/sh/drivers/pci/pci.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5aeab58..ead1640 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -857,6 +857,7 @@ config PCI bool "PCI support" depends on SYS_SUPPORTS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index c2691af..11aaf2f 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -393,29 +393,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *)(chan->io_map_base + port); } -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (unlikely(!len || !start)) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 09/10] sh: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:20 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:20 UTC (permalink / raw) Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, Michael S. Tsirkin, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller sh copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sh/Kconfig | 1 + arch/sh/drivers/pci/pci.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5aeab58..ead1640 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -857,6 +857,7 @@ config PCI bool "PCI support" depends on SYS_SUPPORTS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index c2691af..11aaf2f 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -393,29 +393,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *)(chan->io_map_base + port); } -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (unlikely(!len || !start)) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 09/10] sh: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:20 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:20 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu sh copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sh/Kconfig | 1 + arch/sh/drivers/pci/pci.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5aeab58..ead1640 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -857,6 +857,7 @@ config PCI bool "PCI support" depends on SYS_SUPPORTS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index c2691af..11aaf2f 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -393,29 +393,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *)(chan->io_map_base + port); } -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (unlikely(!len || !start)) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 09/10] sh: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:20 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:20 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci sh copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sh/Kconfig | 1 + arch/sh/drivers/pci/pci.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5aeab58..ead1640 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -857,6 +857,7 @@ config PCI bool "PCI support" depends on SYS_SUPPORTS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index c2691af..11aaf2f 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -393,29 +393,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *)(chan->io_map_base + port); } -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (unlikely(!len || !start)) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 09/10] sh: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:20 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:20 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci sh copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sh/Kconfig | 1 + arch/sh/drivers/pci/pci.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5aeab58..ead1640 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -857,6 +857,7 @@ config PCI bool "PCI support" depends on SYS_SUPPORTS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index c2691af..11aaf2f 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -393,29 +393,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *)(chan->io_map_base + port); } -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (unlikely(!len || !start)) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 09/10] sh: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:20 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:20 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu sh copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sh/Kconfig | 1 + arch/sh/drivers/pci/pci.c | 23 ----------------------- 2 files changed, 1 insertions(+), 23 deletions(-) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5aeab58..ead1640 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -857,6 +857,7 @@ config PCI bool "PCI support" depends on SYS_SUPPORTS_PCI select PCI_DOMAINS + select GENERIC_PCI_IOMAP help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index c2691af..11aaf2f 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -393,29 +393,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, return (void __iomem *)(chan->io_map_base + port); } -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (unlikely(!len || !start)) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - - if (flags & IORESOURCE_IO) - return ioport_map_pci(dev, start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - - return NULL; -} -EXPORT_SYMBOL(pci_iomap); - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { iounmap(addr); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 10/10] sparc: switch to GENERIC_PCI_IOMAP [not found] <cover.1322163031.git.mst@redhat.com> ` (3 preceding siblings ...) 2011-11-24 20:17 ` Michael S. Tsirkin @ 2011-11-24 20:21 ` Michael S. Tsirkin 2011-11-24 20:18 ` Michael S. Tsirkin ` (4 subsequent siblings) 9 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:21 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu sparc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sparc/Kconfig | 1 + arch/sparc/include/asm/io_32.h | 5 ++++- arch/sparc/include/asm/io_64.h | 5 ++++- arch/sparc/lib/iomap.c | 23 ----------------------- 4 files changed, 9 insertions(+), 25 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index f92602e..a4644f5 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -28,6 +28,7 @@ config SPARC select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW select USE_GENERIC_SMP_HELPERS if SMP + select GENERIC_PCI_IOMAP config SPARC32 def_bool !64BIT diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h index c2ced21..9be8778 100644 --- a/arch/sparc/include/asm/io_32.h +++ b/arch/sparc/include/asm/io_32.h @@ -8,6 +8,10 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) static inline u32 flip_dword (u32 l) @@ -324,7 +328,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); /* diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 9c89654..19cd51d 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -9,6 +9,10 @@ #include <asm/system.h> #include <asm/asi.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + /* PC crapola... */ #define __SLOW_DOWN_IO do { } while (0) #define SLOW_DOWN_IO do { } while (0) @@ -514,7 +518,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); static inline int sbus_can_dma_64bit(void) diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c index 9ef37e1..c4d42a5 100644 --- a/arch/sparc/lib/iomap.c +++ b/arch/sparc/lib/iomap.c @@ -18,31 +18,8 @@ void ioport_unmap(void __iomem *addr) EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { /* nothing to do */ } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 10/10] sparc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:21 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:21 UTC (permalink / raw) Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, Michael S. Tsirkin, linux, linux-pci, Jesse Barnes, Chen Liqin, Paul Mackerras, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu, Jonas Bonn, Jesper Nilsson, Russell King, linux-sh, linux-hexagon, Helge Deller, x86, James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven, linux-arch, Arend van Spriel, Matt Turner, Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux, Paul Bolle, Rob Herring, Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner, Fabio Baltieri, linux-arm-kernel, Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck, linux-parisc, linux-cris-kernel, Paul Gortmaker, linux-kernel, Ralf Baechle, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha, Olof Johansson, Andrew Morton, linuxppc-dev, David S. Miller sparc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sparc/Kconfig | 1 + arch/sparc/include/asm/io_32.h | 5 ++++- arch/sparc/include/asm/io_64.h | 5 ++++- arch/sparc/lib/iomap.c | 23 ----------------------- 4 files changed, 9 insertions(+), 25 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index f92602e..a4644f5 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -28,6 +28,7 @@ config SPARC select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW select USE_GENERIC_SMP_HELPERS if SMP + select GENERIC_PCI_IOMAP config SPARC32 def_bool !64BIT diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h index c2ced21..9be8778 100644 --- a/arch/sparc/include/asm/io_32.h +++ b/arch/sparc/include/asm/io_32.h @@ -8,6 +8,10 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) static inline u32 flip_dword (u32 l) @@ -324,7 +328,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); /* diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 9c89654..19cd51d 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -9,6 +9,10 @@ #include <asm/system.h> #include <asm/asi.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + /* PC crapola... */ #define __SLOW_DOWN_IO do { } while (0) #define SLOW_DOWN_IO do { } while (0) @@ -514,7 +518,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); static inline int sbus_can_dma_64bit(void) diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c index 9ef37e1..c4d42a5 100644 --- a/arch/sparc/lib/iomap.c +++ b/arch/sparc/lib/iomap.c @@ -18,31 +18,8 @@ void ioport_unmap(void __iomem *addr) EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { /* nothing to do */ } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 10/10] sparc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:21 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:21 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu sparc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sparc/Kconfig | 1 + arch/sparc/include/asm/io_32.h | 5 ++++- arch/sparc/include/asm/io_64.h | 5 ++++- arch/sparc/lib/iomap.c | 23 ----------------------- 4 files changed, 9 insertions(+), 25 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index f92602e..a4644f5 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -28,6 +28,7 @@ config SPARC select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW select USE_GENERIC_SMP_HELPERS if SMP + select GENERIC_PCI_IOMAP config SPARC32 def_bool !64BIT diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h index c2ced21..9be8778 100644 --- a/arch/sparc/include/asm/io_32.h +++ b/arch/sparc/include/asm/io_32.h @@ -8,6 +8,10 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) static inline u32 flip_dword (u32 l) @@ -324,7 +328,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); /* diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 9c89654..19cd51d 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -9,6 +9,10 @@ #include <asm/system.h> #include <asm/asi.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + /* PC crapola... */ #define __SLOW_DOWN_IO do { } while (0) #define SLOW_DOWN_IO do { } while (0) @@ -514,7 +518,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); static inline int sbus_can_dma_64bit(void) diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c index 9ef37e1..c4d42a5 100644 --- a/arch/sparc/lib/iomap.c +++ b/arch/sparc/lib/iomap.c @@ -18,31 +18,8 @@ void ioport_unmap(void __iomem *addr) EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { /* nothing to do */ } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 10/10] sparc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:21 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:21 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci sparc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sparc/Kconfig | 1 + arch/sparc/include/asm/io_32.h | 5 ++++- arch/sparc/include/asm/io_64.h | 5 ++++- arch/sparc/lib/iomap.c | 23 ----------------------- 4 files changed, 9 insertions(+), 25 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index f92602e..a4644f5 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -28,6 +28,7 @@ config SPARC select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW select USE_GENERIC_SMP_HELPERS if SMP + select GENERIC_PCI_IOMAP config SPARC32 def_bool !64BIT diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h index c2ced21..9be8778 100644 --- a/arch/sparc/include/asm/io_32.h +++ b/arch/sparc/include/asm/io_32.h @@ -8,6 +8,10 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) static inline u32 flip_dword (u32 l) @@ -324,7 +328,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); /* diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 9c89654..19cd51d 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -9,6 +9,10 @@ #include <asm/system.h> #include <asm/asi.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + /* PC crapola... */ #define __SLOW_DOWN_IO do { } while (0) #define SLOW_DOWN_IO do { } while (0) @@ -514,7 +518,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); static inline int sbus_can_dma_64bit(void) diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c index 9ef37e1..c4d42a5 100644 --- a/arch/sparc/lib/iomap.c +++ b/arch/sparc/lib/iomap.c @@ -18,31 +18,8 @@ void ioport_unmap(void __iomem *addr) EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { /* nothing to do */ } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 10/10] sparc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:21 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:21 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu, Paul Mundt, David S. Miller, Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann, Andrew Morton, Michael S. Tsirkin, Nicolas Pitre, Paul Bolle, Olof Johansson, Rob Herring, Paul Gortmaker, Kumar Gala, Michael Ellerman, Fabio Baltieri, Lucas De Marchi, John W. Linville, Lasse Collin, Arend van Spriel, Franky Lin, linux-alpha, linux-kernel, linux-arm-kernel, linux-cris-kernel, linux-hexagon, linux-ia64, linux-m68k, microblaze-uclinux, linux-mips, linux, linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch, Jesse Barnes, linux-pci sparc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sparc/Kconfig | 1 + arch/sparc/include/asm/io_32.h | 5 ++++- arch/sparc/include/asm/io_64.h | 5 ++++- arch/sparc/lib/iomap.c | 23 ----------------------- 4 files changed, 9 insertions(+), 25 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index f92602e..a4644f5 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -28,6 +28,7 @@ config SPARC select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW select USE_GENERIC_SMP_HELPERS if SMP + select GENERIC_PCI_IOMAP config SPARC32 def_bool !64BIT diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h index c2ced21..9be8778 100644 --- a/arch/sparc/include/asm/io_32.h +++ b/arch/sparc/include/asm/io_32.h @@ -8,6 +8,10 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) static inline u32 flip_dword (u32 l) @@ -324,7 +328,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); /* diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 9c89654..19cd51d 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -9,6 +9,10 @@ #include <asm/system.h> #include <asm/asi.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + /* PC crapola... */ #define __SLOW_DOWN_IO do { } while (0) #define SLOW_DOWN_IO do { } while (0) @@ -514,7 +518,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); static inline int sbus_can_dma_64bit(void) diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c index 9ef37e1..c4d42a5 100644 --- a/arch/sparc/lib/iomap.c +++ b/arch/sparc/lib/iomap.c @@ -18,31 +18,8 @@ void ioport_unmap(void __iomem *addr) EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { /* nothing to do */ } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC 10/10] sparc: switch to GENERIC_PCI_IOMAP @ 2011-11-24 20:21 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-11-24 20:21 UTC (permalink / raw) Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King, Mikael Starvik, Jesper Nilsson, Richard Kuo, Tony Luck, Fenghua Yu, Geert Uytterhoeven, Michal Simek, Ralf Baechle, Jonas Bonn, Kyle McMartin, Helge Deller, James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras, Chen Liqin, Lennox Wu sparc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- arch/sparc/Kconfig | 1 + arch/sparc/include/asm/io_32.h | 5 ++++- arch/sparc/include/asm/io_64.h | 5 ++++- arch/sparc/lib/iomap.c | 23 ----------------------- 4 files changed, 9 insertions(+), 25 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index f92602e..a4644f5 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -28,6 +28,7 @@ config SPARC select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW select USE_GENERIC_SMP_HELPERS if SMP + select GENERIC_PCI_IOMAP config SPARC32 def_bool !64BIT diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h index c2ced21..9be8778 100644 --- a/arch/sparc/include/asm/io_32.h +++ b/arch/sparc/include/asm/io_32.h @@ -8,6 +8,10 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) static inline u32 flip_dword (u32 l) @@ -324,7 +328,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); /* diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 9c89654..19cd51d 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -9,6 +9,10 @@ #include <asm/system.h> #include <asm/asi.h> +#ifdef __KERNEL__ +#include <asm-generic/pci_iomap.h> +#endif + /* PC crapola... */ #define __SLOW_DOWN_IO do { } while (0) #define SLOW_DOWN_IO do { } while (0) @@ -514,7 +518,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); static inline int sbus_can_dma_64bit(void) diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c index 9ef37e1..c4d42a5 100644 --- a/arch/sparc/lib/iomap.c +++ b/arch/sparc/lib/iomap.c @@ -18,31 +18,8 @@ void ioport_unmap(void __iomem *addr) EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { /* nothing to do */ } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC v2 10/10] sparc: switch to GENERIC_PCI_IOMAP 2011-11-24 20:21 ` Michael S. Tsirkin @ 2011-12-04 14:34 ` Michael S. Tsirkin -1 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-04 14:34 UTC (permalink / raw) To: Sam Ravnborg Cc: David S. Miller, Michael S. Tsirkin, sparclinux, linux-kernel sparc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- Changes from v1: remove ifdef __KERNEL__ from files not exported to userspace. arch/sparc/Kconfig | 1 + arch/sparc/include/asm/io_32.h | 2 +- arch/sparc/include/asm/io_64.h | 2 +- arch/sparc/lib/iomap.c | 23 ----------------------- 4 files changed, 3 insertions(+), 25 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index f92602e..a4644f5 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -28,6 +28,7 @@ config SPARC select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW select USE_GENERIC_SMP_HELPERS if SMP + select GENERIC_PCI_IOMAP config SPARC32 def_bool !64BIT diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h index c2ced21..2006e5d 100644 --- a/arch/sparc/include/asm/io_32.h +++ b/arch/sparc/include/asm/io_32.h @@ -7,6 +7,7 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> +#include <asm-generic/pci_iomap.h> #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) @@ -324,7 +325,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); /* diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 9c89654..9481e5a 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -8,6 +8,7 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> #include <asm/asi.h> +#include <asm-generic/pci_iomap.h> /* PC crapola... */ #define __SLOW_DOWN_IO do { } while (0) @@ -514,7 +515,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); static inline int sbus_can_dma_64bit(void) diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c index 9ef37e1..c4d42a5 100644 --- a/arch/sparc/lib/iomap.c +++ b/arch/sparc/lib/iomap.c @@ -18,31 +18,8 @@ void ioport_unmap(void __iomem *addr) EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { /* nothing to do */ } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
* [PATCH-RFC v2 10/10] sparc: switch to GENERIC_PCI_IOMAP @ 2011-12-04 14:34 ` Michael S. Tsirkin 0 siblings, 0 replies; 113+ messages in thread From: Michael S. Tsirkin @ 2011-12-04 14:34 UTC (permalink / raw) To: Sam Ravnborg Cc: David S. Miller, Michael S. Tsirkin, sparclinux, linux-kernel sparc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- Changes from v1: remove ifdef __KERNEL__ from files not exported to userspace. arch/sparc/Kconfig | 1 + arch/sparc/include/asm/io_32.h | 2 +- arch/sparc/include/asm/io_64.h | 2 +- arch/sparc/lib/iomap.c | 23 ----------------------- 4 files changed, 3 insertions(+), 25 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index f92602e..a4644f5 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -28,6 +28,7 @@ config SPARC select HAVE_GENERIC_HARDIRQS select GENERIC_IRQ_SHOW select USE_GENERIC_SMP_HELPERS if SMP + select GENERIC_PCI_IOMAP config SPARC32 def_bool !64BIT diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h index c2ced21..2006e5d 100644 --- a/arch/sparc/include/asm/io_32.h +++ b/arch/sparc/include/asm/io_32.h @@ -7,6 +7,7 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> +#include <asm-generic/pci_iomap.h> #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) @@ -324,7 +325,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); /* diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 9c89654..9481e5a 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -8,6 +8,7 @@ #include <asm/page.h> /* IO address mapping routines need this */ #include <asm/system.h> #include <asm/asi.h> +#include <asm-generic/pci_iomap.h> /* PC crapola... */ #define __SLOW_DOWN_IO do { } while (0) @@ -514,7 +515,6 @@ extern void ioport_unmap(void __iomem *); /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); extern void pci_iounmap(struct pci_dev *dev, void __iomem *); static inline int sbus_can_dma_64bit(void) diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c index 9ef37e1..c4d42a5 100644 --- a/arch/sparc/lib/iomap.c +++ b/arch/sparc/lib/iomap.c @@ -18,31 +18,8 @@ void ioport_unmap(void __iomem *addr) EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_unmap); -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - if (maxlen && len > maxlen) - len = maxlen; - if (flags & IORESOURCE_IO) - return ioport_map(start, len); - if (flags & IORESOURCE_MEM) { - if (flags & IORESOURCE_CACHEABLE) - return ioremap(start, len); - return ioremap_nocache(start, len); - } - /* What? */ - return NULL; -} - void pci_iounmap(struct pci_dev *dev, void __iomem * addr) { /* nothing to do */ } -EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); -- 1.7.5.53.gc233e ^ permalink raw reply related [flat|nested] 113+ messages in thread
end of thread, other threads:[~2012-01-29 22:45 UTC | newest]
Thread overview: 113+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1322163031.git.mst@redhat.com>
2011-11-24 20:15 ` [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig Michael S. Tsirkin
2011-11-24 20:15 ` Michael S. Tsirkin
2011-11-24 20:15 ` Michael S. Tsirkin
2011-11-24 20:15 ` Michael S. Tsirkin
2011-11-24 20:15 ` Michael S. Tsirkin
2011-11-24 20:15 ` Michael S. Tsirkin
2011-11-25 8:41 ` Jesper Nilsson
2011-11-25 8:41 ` Jesper Nilsson
2011-11-25 8:41 ` Jesper Nilsson
2011-11-28 20:12 ` Richard Kuo
2011-11-28 20:12 ` Richard Kuo
2011-11-28 20:12 ` Richard Kuo
2011-11-28 20:12 ` Richard Kuo
2011-11-24 20:17 ` [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 22:07 ` Arnd Bergmann
2011-11-24 22:07 ` Arnd Bergmann
2011-11-24 22:07 ` Arnd Bergmann
2011-11-24 22:07 ` Arnd Bergmann
2011-11-25 0:54 ` Stephen Rothwell
2011-11-25 0:54 ` Stephen Rothwell
2011-11-25 0:54 ` Stephen Rothwell
2011-11-25 0:59 ` Stephen Rothwell
2011-11-25 0:59 ` Stephen Rothwell
2011-11-25 0:59 ` Stephen Rothwell
2011-11-27 17:12 ` Michael S. Tsirkin
2011-11-27 17:12 ` Michael S. Tsirkin
2011-11-27 17:12 ` Michael S. Tsirkin
2011-11-27 17:12 ` Michael S. Tsirkin
2011-11-28 19:21 ` [PATCH-RFC 02/10 v2] " Michael S. Tsirkin
2011-11-24 20:17 ` [PATCH-RFC 03/10] alpha: switch to GENERIC_PCI_IOMAP Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-12-04 10:50 ` Michael S. Tsirkin
2011-12-06 16:45 ` Raúl Porcel
2011-11-24 20:17 ` [PATCH-RFC 04/10] arm: " Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-11-24 20:17 ` Michael S. Tsirkin
2011-12-04 10:47 ` Michael S. Tsirkin
2011-12-04 21:25 ` Russell King - ARM Linux
2011-11-24 20:18 ` [PATCH-RFC 05/10] microblaze: " Michael S. Tsirkin
2011-11-24 20:18 ` Michael S. Tsirkin
2011-11-24 20:18 ` Michael S. Tsirkin
2011-11-24 20:18 ` Michael S. Tsirkin
2011-11-24 20:18 ` Michael S. Tsirkin
2011-11-24 20:18 ` Michael S. Tsirkin
2011-11-24 20:18 ` [PATCH-RFC 06/10] mips: " Michael S. Tsirkin
2011-11-24 20:18 ` Michael S. Tsirkin
2011-11-24 20:18 ` Michael S. Tsirkin
2011-11-24 20:18 ` Michael S. Tsirkin
2011-11-24 20:18 ` Michael S. Tsirkin
2011-11-24 20:18 ` Michael S. Tsirkin
2011-12-04 10:47 ` Michael S. Tsirkin
2012-01-28 22:38 ` Kevin Cernekee
2012-01-28 22:38 ` Kevin Cernekee
2012-01-28 22:38 ` Kevin Cernekee
2012-01-28 22:38 ` Kevin Cernekee
2012-01-29 22:45 ` Michael S. Tsirkin
2012-01-29 22:45 ` Michael S. Tsirkin
2012-01-29 22:45 ` Michael S. Tsirkin
2012-01-29 22:45 ` Michael S. Tsirkin
2011-11-24 20:19 ` [PATCH-RFC 07/10] parisc: " Michael S. Tsirkin
2011-11-24 20:19 ` Michael S. Tsirkin
2011-11-24 20:19 ` Michael S. Tsirkin
2011-11-24 20:19 ` Michael S. Tsirkin
2011-11-24 20:19 ` Michael S. Tsirkin
2011-11-24 20:19 ` Michael S. Tsirkin
2011-12-04 10:48 ` Michael S. Tsirkin
2011-12-04 14:22 ` James Bottomley
2011-12-04 14:30 ` Michael S. Tsirkin
2011-12-04 14:32 ` James Bottomley
2011-12-04 14:42 ` Michael S. Tsirkin
2011-12-05 15:33 ` James Bottomley
2011-12-05 16:24 ` Michael S. Tsirkin
2011-12-05 16:46 ` James Bottomley
2011-12-05 18:23 ` Grant Grundler
2011-12-06 11:06 ` Michael S. Tsirkin
2011-12-06 16:18 ` Grant Grundler
2011-12-06 16:24 ` Michael S. Tsirkin
2011-12-16 2:11 ` Grant Grundler
2011-11-24 20:19 ` [PATCH-RFC 08/10] powerpc: " Michael S. Tsirkin
2011-11-24 20:19 ` Michael S. Tsirkin
2011-11-24 20:19 ` Michael S. Tsirkin
2011-11-24 20:19 ` Michael S. Tsirkin
2011-11-24 20:19 ` Michael S. Tsirkin
2011-11-24 20:19 ` Michael S. Tsirkin
2011-12-04 10:48 ` Michael S. Tsirkin
2011-12-04 20:52 ` Benjamin Herrenschmidt
2011-12-05 6:03 ` Michael S. Tsirkin
2011-11-24 20:20 ` [PATCH-RFC 09/10] sh: " Michael S. Tsirkin
2011-11-24 20:20 ` Michael S. Tsirkin
2011-11-24 20:20 ` Michael S. Tsirkin
2011-11-24 20:20 ` Michael S. Tsirkin
2011-11-24 20:20 ` Michael S. Tsirkin
2011-11-24 20:20 ` Michael S. Tsirkin
2011-11-24 20:21 ` [PATCH-RFC 10/10] sparc: " Michael S. Tsirkin
2011-11-24 20:21 ` Michael S. Tsirkin
2011-11-24 20:21 ` Michael S. Tsirkin
2011-11-24 20:21 ` Michael S. Tsirkin
2011-11-24 20:21 ` Michael S. Tsirkin
2011-11-24 20:21 ` Michael S. Tsirkin
2011-12-04 14:34 ` [PATCH-RFC v2 " Michael S. Tsirkin
2011-12-04 14:34 ` Michael S. Tsirkin
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.