arch: switch the default on ARCH_HAS_SG_CHAIN
authorChristoph Hellwig <hch@lst.de>
Fri, 9 Nov 2018 08:51:00 +0000 (09:51 +0100)
committerChristoph Hellwig <hch@lst.de>
Thu, 6 Dec 2018 15:04:56 +0000 (07:04 -0800)
These days architectures are mostly out of the business of dealing with
struct scatterlist at all, unless they have architecture specific iommu
drivers.  Replace the ARCH_HAS_SG_CHAIN symbol with a ARCH_NO_SG_CHAIN
one only enabled for architectures with horrible legacy iommu drivers
like alpha and parisc, and conditionally for arm which wants to keep it
disable for legacy platforms.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
15 files changed:
Documentation/features/io/sg-chain/arch-support.txt [deleted file]
arch/alpha/Kconfig
arch/arc/Kconfig
arch/arm/Kconfig
arch/arm64/Kconfig
arch/ia64/Kconfig
arch/parisc/Kconfig
arch/powerpc/Kconfig
arch/s390/Kconfig
arch/sparc/Kconfig
arch/x86/Kconfig
arch/xtensa/Kconfig
include/linux/scatterlist.h
lib/Kconfig
lib/scatterlist.c

diff --git a/Documentation/features/io/sg-chain/arch-support.txt b/Documentation/features/io/sg-chain/arch-support.txt
deleted file mode 100644 (file)
index 6554f03..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Feature name:          sg-chain
-#         Kconfig:       ARCH_HAS_SG_CHAIN
-#         description:   arch supports chained scatter-gather lists
-#
-    -----------------------
-    |         arch |status|
-    -----------------------
-    |       alpha: | TODO |
-    |         arc: |  ok  |
-    |         arm: |  ok  |
-    |       arm64: |  ok  |
-    |         c6x: | TODO |
-    |       h8300: | TODO |
-    |     hexagon: | TODO |
-    |        ia64: |  ok  |
-    |        m68k: | TODO |
-    |  microblaze: | TODO |
-    |        mips: | TODO |
-    |       nds32: | TODO |
-    |       nios2: | TODO |
-    |    openrisc: | TODO |
-    |      parisc: | TODO |
-    |     powerpc: |  ok  |
-    |       riscv: | TODO |
-    |        s390: |  ok  |
-    |          sh: | TODO |
-    |       sparc: |  ok  |
-    |          um: | TODO |
-    |   unicore32: | TODO |
-    |         x86: |  ok  |
-    |      xtensa: | TODO |
-    -----------------------
index 5b4f8836345381017ff54770f44180115a81c7e4..a7e748a46c1853092060a5eaedf7288dc238570e 100644 (file)
@@ -5,6 +5,7 @@ config ALPHA
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select ARCH_MIGHT_HAVE_PC_SERIO
        select ARCH_NO_PREEMPT
+       select ARCH_NO_SG_CHAIN
        select ARCH_USE_CMPXCHG_LOCKREF
        select HAVE_AOUT
        select HAVE_IDE
index c9e2a1323536313c8ee0e10906db67902c846674..fd48d698da2906e999e36dbb432b3385b53efe13 100644 (file)
@@ -13,7 +13,6 @@ config ARC
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_HAS_SYNC_DMA_FOR_CPU
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
-       select ARCH_HAS_SG_CHAIN
        select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC
        select BUILDTIME_EXTABLE_SORT
        select CLONE_BACKWARDS
index 3b2852df6eb32b52bb2c2bf2cb9a7ffd68320454..a858ee791ef04b33e68cf200d4019ce3ecb00a2b 100644 (file)
@@ -19,6 +19,7 @@ config ARM
        select ARCH_HAVE_CUSTOM_GPIO_H
        select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_MIGHT_HAVE_PC_PARPORT
+       select ARCH_NO_SG_CHAIN if !ARM_HAS_SG_CHAIN
        select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
        select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7
        select ARCH_SUPPORTS_ATOMIC_RMW
@@ -119,7 +120,6 @@ config ARM
          <http://www.arm.linux.org.uk/>.
 
 config ARM_HAS_SG_CHAIN
-       select ARCH_HAS_SG_CHAIN
        bool
 
 config ARM_DMA_USE_IOMMU
index 2e645ea693ea56e68ffe2cc57c8b86cdc212a3a3..06cf0ef243679016251fca889058bae1ea305fd1 100644 (file)
@@ -23,7 +23,6 @@ config ARM64
        select ARCH_HAS_MEMBARRIER_SYNC_CORE
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_HAS_SET_MEMORY
-       select ARCH_HAS_SG_CHAIN
        select ARCH_HAS_STRICT_KERNEL_RWX
        select ARCH_HAS_STRICT_MODULE_RWX
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
index 36773def6920b4104a0c190b306e2aaf8019bd36..d6f203658994bb8411835d1ef237cea995ae349c 100644 (file)
@@ -29,7 +29,6 @@ config IA64
        select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_VIRT_CPU_ACCOUNTING
        select ARCH_HAS_DMA_MARK_CLEAN
-       select ARCH_HAS_SG_CHAIN
        select VIRT_TO_BUS
        select ARCH_DISCARD_MEMBLOCK
        select GENERIC_IRQ_PROBE
index 92a339ee28b385e918613a794aa21566d6dabe90..428ee50fc3dbce5cc0626384e5d51162ebab07a3 100644 (file)
@@ -11,6 +11,7 @@ config PARISC
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_STRICT_KERNEL_RWX
        select ARCH_HAS_UBSAN_SANITIZE_ALL
+       select ARCH_NO_SG_CHAIN
        select ARCH_SUPPORTS_MEMORY_FAILURE
        select RTC_CLASS
        select RTC_DRV_GENERIC
index 8be31261aec83190a65927854d214d613244c164..4bc8edd83cee2e46f86deadf27358f3c83b6d6fe 100644 (file)
@@ -138,7 +138,6 @@ config PPC
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_HAS_MEMBARRIER_CALLBACKS
        select ARCH_HAS_SCALED_CPUTIME          if VIRT_CPU_ACCOUNTING_NATIVE && PPC64
-       select ARCH_HAS_SG_CHAIN
        select ARCH_HAS_STRICT_KERNEL_RWX       if ((PPC_BOOK3S_64 || PPC32) && !RELOCATABLE && !HIBERNATION)
        select ARCH_HAS_TICK_BROADCAST          if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAS_UACCESS_FLUSHCACHE      if PPC64
index 5173366af8f359b98d9683afd6a9e105c7a7a910..5624e86070544f2a12348be88a13f90dd8c236fa 100644 (file)
@@ -73,7 +73,6 @@ config S390
        select ARCH_HAS_KCOV
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_HAS_SET_MEMORY
-       select ARCH_HAS_SG_CHAIN
        select ARCH_HAS_STRICT_KERNEL_RWX
        select ARCH_HAS_STRICT_MODULE_RWX
        select ARCH_HAS_UBSAN_SANITIZE_ALL
index 490b2c95c212cf794671ec2e72b4458d33fbdde8..8853b6ceae17572903e7cf8f0c8b98df3cd6a0bc 100644 (file)
@@ -40,7 +40,6 @@ config SPARC
        select MODULES_USE_ELF_RELA
        select ODD_RT_SIGACTION
        select OLD_SIGSUSPEND
-       select ARCH_HAS_SG_CHAIN
        select CPU_NO_EFFICIENT_FFS
        select LOCKDEP_SMALL if LOCKDEP
        select NEED_DMA_MAP_STATE
index 9d734f3c8234d4bbdd44bb06518a768a6b9b7d02..adc845b66f015767091961caf0aa9e02899ddf43 100644 (file)
@@ -66,7 +66,6 @@ config X86
        select ARCH_HAS_UACCESS_FLUSHCACHE      if X86_64
        select ARCH_HAS_UACCESS_MCSAFE          if X86_64 && X86_MCE
        select ARCH_HAS_SET_MEMORY
-       select ARCH_HAS_SG_CHAIN
        select ARCH_HAS_STRICT_KERNEL_RWX
        select ARCH_HAS_STRICT_MODULE_RWX
        select ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
index 239bfb16c58b67c41e6a2b949665d0f347e210ae..75488b606edca0d6fbb57f18f5cf026631cb7f5b 100644 (file)
@@ -1,7 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 config XTENSA
        def_bool y
-       select ARCH_HAS_SG_CHAIN
        select ARCH_HAS_SYNC_DMA_FOR_CPU
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
        select ARCH_NO_COHERENT_DMA_MMAP if !MMU
index 093aa57120b0cf1f40c2a75f28612331c6e6f6e0..b96f0d0b5b8f304be188e5d8662674739a2df0a6 100644 (file)
@@ -324,10 +324,10 @@ size_t sg_zero_buffer(struct scatterlist *sgl, unsigned int nents,
  * Like SG_CHUNK_SIZE, but for archs that have sg chaining. This limit
  * is totally arbitrary, a setting of 2048 will get you at least 8mb ios.
  */
-#ifdef CONFIG_ARCH_HAS_SG_CHAIN
-#define SG_MAX_SEGMENTS        2048
-#else
+#ifdef CONFIG_ARCH_NO_SG_CHAIN
 #define SG_MAX_SEGMENTS        SG_CHUNK_SIZE
+#else
+#define SG_MAX_SEGMENTS        2048
 #endif
 
 #ifdef CONFIG_SG_POOL
index a9965f4af4dd391cce6fb3875bd48332560e3598..d5a5e2ebf286ec3b2a0bd11776c43ffd02639419 100644 (file)
@@ -577,7 +577,7 @@ config SG_POOL
 # sg chaining option
 #
 
-config ARCH_HAS_SG_CHAIN
+config ARCH_NO_SG_CHAIN
        def_bool n
 
 config ARCH_HAS_PMEM_API
index 7c6096a7170486449736d82a37fbd50326ac169e..9ba349e775ef0839b11eb18d1bc671357ab68ae3 100644 (file)
@@ -271,7 +271,7 @@ int __sg_alloc_table(struct sg_table *table, unsigned int nents,
 
        if (nents == 0)
                return -EINVAL;
-#ifndef CONFIG_ARCH_HAS_SG_CHAIN
+#ifdef CONFIG_ARCH_NO_SG_CHAIN
        if (WARN_ON_ONCE(nents > max_ents))
                return -EINVAL;
 #endif