Merge branch 'akpm' (Andrew's patch-bomb)
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 31 Jul 2012 00:25:34 +0000 (17:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 31 Jul 2012 00:25:34 +0000 (17:25 -0700)
Merge Andrew's first set of patches:
 "Non-MM patches:

   - lots of misc bits

   - tree-wide have_clk() cleanups

   - quite a lot of printk tweaks.  I draw your attention to "printk:
     convert the format for KERN_<LEVEL> to a 2 byte pattern" which
     looks a bit scary.  But afaict it's solid.

   - backlight updates

   - lib/ feature work (notably the addition and use of memweight())

   - checkpatch updates

   - rtc updates

   - nilfs updates

   - fatfs updates (partial, still waiting for acks)

   - kdump, proc, fork, IPC, sysctl, taskstats, pps, etc

   - new fault-injection feature work"

* Merge emailed patches from Andrew Morton <akpm@linux-foundation.org>: (128 commits)
  drivers/misc/lkdtm.c: fix missing allocation failure check
  lib/scatterlist: do not re-write gfp_flags in __sg_alloc_table()
  fault-injection: add tool to run command with failslab or fail_page_alloc
  fault-injection: add selftests for cpu and memory hotplug
  powerpc: pSeries reconfig notifier error injection module
  memory: memory notifier error injection module
  PM: PM notifier error injection module
  cpu: rewrite cpu-notifier-error-inject module
  fault-injection: notifier error injection
  c/r: fcntl: add F_GETOWNER_UIDS option
  resource: make sure requested range is included in the root range
  include/linux/aio.h: cpp->C conversions
  fs: cachefiles: add support for large files in filesystem caching
  pps: return PTR_ERR on error in device_create
  taskstats: check nla_reserve() return
  sysctl: suppress kmemleak messages
  ipc: use Kconfig options for __ARCH_WANT_[COMPAT_]IPC_PARSE_VERSION
  ipc: compat: use signed size_t types for msgsnd and msgrcv
  ipc: allow compat IPC version field parsing if !ARCH_WANT_OLD_COMPAT_IPC
  ipc: add COMPAT_SHMLBA support
  ...

1  2 
MAINTAINERS
arch/arm/Kconfig
arch/blackfin/Kconfig
arch/mips/Kconfig
drivers/rtc/Kconfig
lib/Kconfig
lib/Makefile
lib/scatterlist.c
security/selinux/hooks.c

diff --combined MAINTAINERS
index 19f705073942cd169be2e7e63f223b100a4ec363,c8804c048ac8e1f2f8409d39f24e314b5acfa609..b2e3d88ff4cd94f5fcfb6112c7a9793dec1d7c58
@@@ -2750,6 -2750,7 +2750,7 @@@ M:      Jingoo Han <jg1.han@samsung.com
  L:    linux-fbdev@vger.kernel.org
  S:    Maintained
  F:    drivers/video/exynos/exynos_dp*
+ F:    include/video/exynos_dp*
  
  EXYNOS MIPI DISPLAY DRIVERS
  M:    Inki Dae <inki.dae@samsung.com>
@@@ -5526,18 -5527,6 +5527,18 @@@ S:    Maintaine
  F:    Documentation/video4linux/README.pvrusb2
  F:    drivers/media/video/pvrusb2/
  
 +PWM SUBSYSTEM
 +M:    Thierry Reding <thierry.reding@avionic-design.de>
 +L:    linux-kernel@vger.kernel.org
 +S:    Maintained
 +W:    http://gitorious.org/linux-pwm
 +T:    git git://gitorious.org/linux-pwm/linux-pwm.git
 +F:    Documentation/pwm.txt
 +F:    Documentation/devicetree/bindings/pwm/
 +F:    include/linux/pwm.h
 +F:    include/linux/of_pwm.h
 +F:    drivers/pwm/
 +
  PXA2xx/PXA3xx SUPPORT
  M:    Eric Miao <eric.y.miao@gmail.com>
  M:    Russell King <linux@arm.linux.org.uk>
@@@ -5912,16 -5901,6 +5913,16 @@@ L:    linux-fbdev@vger.kernel.or
  S:    Maintained
  F:    drivers/video/s3c-fb.c
  
 +SAMSUNG MULTIFUNCTION DEVICE DRIVERS
 +M:    Sangbeom Kim <sbkim73@samsung.com>
 +L:    linux-kernel@vger.kernel.org
 +S:    Supported
 +F:    drivers/mfd/sec*.c
 +F:    drivers/regulator/s2m*.c
 +F:    drivers/regulator/s5m*.c
 +F:    drivers/rtc/rtc-sec.c
 +F:    include/linux/mfd/samsung/
 +
  SERIAL DRIVERS
  M:    Alan Cox <alan@linux.intel.com>
  L:    linux-serial@vger.kernel.org
diff --combined arch/arm/Kconfig
index 6b86bb963a28a021f2d7e05c58f2677ed4a08c7b,5df11147be84c7ed081215e3709c173d09dc97bd..7980873525b264c5b8fe327387483d241662f3a1
@@@ -11,6 -11,7 +11,7 @@@ config AR
        select RTC_LIB
        select SYS_SUPPORTS_APM_EMULATION
        select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
+       select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
        select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
        select HAVE_ARCH_KGDB
@@@ -38,6 -39,7 +39,7 @@@
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
        select GENERIC_IRQ_PROBE
+       select ARCH_WANT_IPC_PARSE_VERSION
        select HARDIRQS_SW_RESEND
        select CPU_PM if (SUSPEND || CPU_IDLE)
        select GENERIC_PCI_IOMAP
@@@ -1009,6 -1011,7 +1011,6 @@@ config ARCH_VT850
        select ARCH_HAS_CPUFREQ
        select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
 -      select HAVE_PWM
        help
          Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
  
diff --combined arch/blackfin/Kconfig
index ec44fc6c34ca3dafaba2d1e3f3ad1575becaf410,fb9fe00e51a69a7e5a321a3741d948f000ee96ed..f34861920634d15c9de2b1149aa8562a767e64f1
@@@ -33,6 -33,7 +33,7 @@@ config BLACKFI
        select HAVE_PERF_EVENTS
        select ARCH_HAVE_CUSTOM_GPIO_H
        select ARCH_WANT_OPTIONAL_GPIOLIB
+       select ARCH_WANT_IPC_PARSE_VERSION
        select HAVE_GENERIC_HARDIRQS
        select GENERIC_ATOMIC64
        select GENERIC_IRQ_PROBE
@@@ -1002,6 -1003,16 +1003,6 @@@ config BFIN_GPTIMER
          To compile this driver as a module, choose M here: the module
          will be called gptimers.
  
 -config HAVE_PWM
 -      tristate "Enable PWM API support"
 -      depends on BFIN_GPTIMERS
 -      help
 -        Enable support for the Pulse Width Modulation framework (as
 -        found in linux/pwm.h).
 -
 -        To compile this driver as a module, choose M here: the module
 -        will be called pwm.
 -
  choice
        prompt "Uncached DMA region"
        default DMA_UNCACHED_1M
diff --combined arch/mips/Kconfig
index 750429018534b3f266af1a852300f7d0be4a4c55,2d56cd5af3361bf8b8b47602ce3d0a49bba87d2f..e3efc06e6409bd425bbd9686b0dc6698b65536a5
@@@ -20,12 -20,14 +20,14 @@@ config MIP
        select ARCH_BINFMT_ELF_RANDOMIZE_PIE
        select RTC_LIB if !MACH_LOONGSON
        select GENERIC_ATOMIC64 if !64BIT
+       select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select HAVE_DMA_ATTRS
        select HAVE_DMA_API_DEBUG
        select HAVE_GENERIC_HARDIRQS
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
        select HAVE_ARCH_JUMP_LABEL
+       select ARCH_WANT_IPC_PARSE_VERSION
        select IRQ_FORCED_THREADING
        select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
@@@ -209,7 -211,6 +211,7 @@@ config MACH_JZ474
        select SYS_HAS_CPU_MIPS32_R1
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_LITTLE_ENDIAN
 +      select SYS_SUPPORTS_ZBOOT_UART16550
        select DMA_NONCOHERENT
        select IRQ_CPU
        select GENERIC_GPIO
@@@ -265,16 -266,6 +267,16 @@@ config MACH_LOONGSO
          Chinese Academy of Sciences (CAS) in the People's Republic
          of China. The chief architect is Professor Weiwu Hu.
  
 +config MACH_LOONGSON1
 +      bool "Loongson 1 family of machines"
 +      select SYS_SUPPORTS_ZBOOT
 +      help
 +        This enables support for the Loongson 1 based machines.
 +
 +        Loongson 1 is a family of 32-bit MIPS-compatible SoCs developed by
 +        the ICT (Institute of Computing Technology) and the Chinese Academy
 +        of Sciences.
 +
  config MIPS_MALTA
        bool "MIPS Malta board"
        select ARCH_MAY_HAVE_PC_FDC
@@@ -798,8 -789,6 +800,8 @@@ config NLM_XLR_BOAR
        select ZONE_DMA if 64BIT
        select SYNC_R4K
        select SYS_HAS_EARLY_PRINTK
 +      select USB_ARCH_HAS_OHCI if USB_SUPPORT
 +      select USB_ARCH_HAS_EHCI if USB_SUPPORT
        help
          Support for systems based on Netlogic XLR and XLS processors.
          Say Y here if you have a XLR or XLS based board.
@@@ -812,6 -801,7 +814,6 @@@ config NLM_XLP_BOAR
        select SYS_HAS_CPU_XLP
        select SYS_SUPPORTS_SMP
        select HW_HAS_PCI
 -      select SWAP_IO_SPACE
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_64BIT_KERNEL
        select 64BIT_PHYS_ADDR
@@@ -848,7 -838,6 +850,7 @@@ source "arch/mips/txx9/Kconfig
  source "arch/mips/vr41xx/Kconfig"
  source "arch/mips/cavium-octeon/Kconfig"
  source "arch/mips/loongson/Kconfig"
 +source "arch/mips/loongson1/Kconfig"
  source "arch/mips/netlogic/Kconfig"
  
  endmenu
@@@ -1230,14 -1219,6 +1232,14 @@@ config CPU_LOONGSON2
          have a similar programming interface with FPGA northbridge used in
          Loongson2E.
  
 +config CPU_LOONGSON1B
 +      bool "Loongson 1B"
 +      depends on SYS_HAS_CPU_LOONGSON1B
 +      select CPU_LOONGSON1
 +      help
 +        The Loongson 1B is a 32-bit SoC, which implements the MIPS32
 +        release 2 instruction set.
 +
  config CPU_MIPS32_R1
        bool "MIPS32 Release 1"
        depends on SYS_HAS_CPU_MIPS32_R1
@@@ -1453,8 -1434,6 +1455,8 @@@ config CPU_CAVIUM_OCTEO
        select WEAK_ORDERING
        select CPU_SUPPORTS_HIGHMEM
        select CPU_SUPPORTS_HUGEPAGES
 +      select LIBFDT
 +      select USE_OF
        help
          The Cavium Octeon processor is a highly integrated chip containing
          many ethernet hardware widgets for networking tasks. The processor
@@@ -1567,14 -1546,6 +1569,14 @@@ config CPU_LOONGSON
        select CPU_SUPPORTS_64BIT_KERNEL
        select CPU_SUPPORTS_HIGHMEM
  
 +config CPU_LOONGSON1
 +      bool
 +      select CPU_MIPS32
 +      select CPU_MIPSR2
 +      select CPU_HAS_PREFETCH
 +      select CPU_SUPPORTS_32BIT_KERNEL
 +      select CPU_SUPPORTS_HIGHMEM
 +
  config CPU_BMIPS
        bool
        select CPU_MIPS32
@@@ -1593,9 -1564,6 +1595,9 @@@ config SYS_HAS_CPU_LOONGSON2
        select CPU_SUPPORTS_ADDRWINCFG if 64BIT
        select CPU_SUPPORTS_UNCACHED_ACCELERATED
  
 +config SYS_HAS_CPU_LOONGSON1B
 +      bool
 +
  config SYS_HAS_CPU_MIPS32_R1
        bool
  
@@@ -2400,8 -2368,6 +2402,8 @@@ config PCI_DOMAIN
  
  source "drivers/pci/Kconfig"
  
 +source "drivers/pci/pcie/Kconfig"
 +
  #
  # ISA support is now enabled via select.  Too many systems still have the one
  # or other ISA chip on the board that users don't know about so don't expect
diff --combined drivers/rtc/Kconfig
index f049c02413ce28b99e5a0cfa781f8ac0df06e97b,668da5922d9e3638a3e26ea8c02e312ca193d006..fabc99a75c6596d2b797e55a59fa7ecd2db49fc8
@@@ -135,16 -135,6 +135,16 @@@ config RTC_DRV_88PM860
          This driver can also be built as a module. If so, the module
          will be called rtc-88pm860x.
  
 +config RTC_DRV_88PM80X
 +      tristate "Marvell 88PM80x"
 +      depends on RTC_CLASS && I2C && MFD_88PM800
 +      help
 +        If you say yes here you get support for RTC function in Marvell
 +        88PM80x chips.
 +
 +        This driver can also be built as a module. If so, the module
 +        will be called rtc-88pm80x.
 +
  config RTC_DRV_DS1307
        tristate "Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025"
        help
@@@ -704,6 -694,7 +704,7 @@@ config RTC_DRV_AB310
  config RTC_DRV_AB8500
        tristate "ST-Ericsson AB8500 RTC"
        depends on AB8500_CORE
+       select RTC_INTF_DEV_UIE_EMUL
        help
          Select this to enable the ST-Ericsson AB8500 power management IC RTC
          support. This chip contains a battery- and capacitor-backed RTC.
diff --combined lib/Kconfig
index bfdbb1ff0aa39db058be3933b725d0737cd1f7b6,72c1d46930682faecaee1ff3607409b276e93103..bb94c1ba616a4213bc11521adef4310387032353
@@@ -340,6 -340,9 +340,9 @@@ config NLATT
  config GENERIC_ATOMIC64
         bool
  
+ config ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
+       def_bool y if GENERIC_ATOMIC64
  config LRU_CACHE
        tristate
  
@@@ -387,10 -390,4 +390,10 @@@ config SIGNATUR
          Digital signature verification. Currently only RSA is supported.
          Implementation is done using GnuPG MPI library
  
 +#
 +# libfdt files, only selected if needed.
 +#
 +config LIBFDT
 +      bool
 +
  endmenu
diff --combined lib/Makefile
index 2f2be5a8734c4ebf7ad21dbf79c3072df2e99f53,1054de86ae82e78e4dd9f37ea4dbf4b888950c96..9cb4104f47d91e97560c3aadbf03bcbfaa6a0d77
@@@ -22,7 -22,7 +22,7 @@@ lib-y += kobject.o klist.
  obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
         bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
         string_helpers.o gcd.o lcm.o list_sort.o uuid.o flex_array.o \
-        bsearch.o find_last_bit.o find_next_bit.o llist.o
+        bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o
  obj-y += kstrtox.o
  obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o
  
@@@ -90,7 -90,12 +90,12 @@@ obj-$(CONFIG_AUDIT_GENERIC) += audit.
  obj-$(CONFIG_SWIOTLB) += swiotlb.o
  obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o
  obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o
+ obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o
  obj-$(CONFIG_CPU_NOTIFIER_ERROR_INJECT) += cpu-notifier-error-inject.o
+ obj-$(CONFIG_PM_NOTIFIER_ERROR_INJECT) += pm-notifier-error-inject.o
+ obj-$(CONFIG_MEMORY_NOTIFIER_ERROR_INJECT) += memory-notifier-error-inject.o
+ obj-$(CONFIG_PSERIES_RECONFIG_NOTIFIER_ERROR_INJECT) += \
+       pSeries-reconfig-notifier-error-inject.o
  
  lib-$(CONFIG_GENERIC_BUG) += bug.o
  
@@@ -130,11 -135,6 +135,11 @@@ obj-$(CONFIG_GENERIC_STRNLEN_USER) += s
  
  obj-$(CONFIG_STMP_DEVICE) += stmp_device.o
  
 +libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o
 +$(foreach file, $(libfdt_files), \
 +      $(eval CFLAGS_$(file) = -I$(src)/../scripts/dtc/libfdt))
 +lib-$(CONFIG_LIBFDT) += $(libfdt_files)
 +
  hostprogs-y   := gen_crc32table
  clean-files   := crc32table.h
  
diff --combined lib/scatterlist.c
index e719adf695bfe49392f76f04dbc18de5e330939a,d09bdd8b40ce2eb829c448ef672bf1a65b658066..fadae774a20cc6abb0226ee4c3bfbc6cb4cd4eeb
@@@ -279,14 -279,6 +279,6 @@@ int __sg_alloc_table(struct sg_table *t
                if (!left)
                        sg_mark_end(&sg[sg_size - 1]);
  
-               /*
-                * only really needed for mempool backed sg allocations (like
-                * SCSI), a possible improvement here would be to pass the
-                * table pointer into the allocator and let that clear these
-                * flags
-                */
-               gfp_mask &= ~__GFP_WAIT;
-               gfp_mask |= __GFP_HIGH;
                prv = sg;
        } while (left);
  
@@@ -318,70 -310,6 +310,70 @@@ int sg_alloc_table(struct sg_table *tab
  }
  EXPORT_SYMBOL(sg_alloc_table);
  
 +/**
 + * sg_alloc_table_from_pages - Allocate and initialize an sg table from
 + *                           an array of pages
 + * @sgt:      The sg table header to use
 + * @pages:    Pointer to an array of page pointers
 + * @n_pages:  Number of pages in the pages array
 + * @offset:     Offset from start of the first page to the start of a buffer
 + * @size:       Number of valid bytes in the buffer (after offset)
 + * @gfp_mask: GFP allocation mask
 + *
 + *  Description:
 + *    Allocate and initialize an sg table from a list of pages. Contiguous
 + *    ranges of the pages are squashed into a single scatterlist node. A user
 + *    may provide an offset at a start and a size of valid data in a buffer
 + *    specified by the page array. The returned sg table is released by
 + *    sg_free_table.
 + *
 + * Returns:
 + *   0 on success, negative error on failure
 + */
 +int sg_alloc_table_from_pages(struct sg_table *sgt,
 +      struct page **pages, unsigned int n_pages,
 +      unsigned long offset, unsigned long size,
 +      gfp_t gfp_mask)
 +{
 +      unsigned int chunks;
 +      unsigned int i;
 +      unsigned int cur_page;
 +      int ret;
 +      struct scatterlist *s;
 +
 +      /* compute number of contiguous chunks */
 +      chunks = 1;
 +      for (i = 1; i < n_pages; ++i)
 +              if (page_to_pfn(pages[i]) != page_to_pfn(pages[i - 1]) + 1)
 +                      ++chunks;
 +
 +      ret = sg_alloc_table(sgt, chunks, gfp_mask);
 +      if (unlikely(ret))
 +              return ret;
 +
 +      /* merging chunks and putting them into the scatterlist */
 +      cur_page = 0;
 +      for_each_sg(sgt->sgl, s, sgt->orig_nents, i) {
 +              unsigned long chunk_size;
 +              unsigned int j;
 +
 +              /* look for the end of the current chunk */
 +              for (j = cur_page + 1; j < n_pages; ++j)
 +                      if (page_to_pfn(pages[j]) !=
 +                          page_to_pfn(pages[j - 1]) + 1)
 +                              break;
 +
 +              chunk_size = ((j - cur_page) << PAGE_SHIFT) - offset;
 +              sg_set_page(s, pages[cur_page], min(size, chunk_size), offset);
 +              size -= chunk_size;
 +              offset = 0;
 +              cur_page = j;
 +      }
 +
 +      return 0;
 +}
 +EXPORT_SYMBOL(sg_alloc_table_from_pages);
 +
  /**
   * sg_miter_start - start mapping iteration over a sg list
   * @miter: sg mapping iter to be started
diff --combined security/selinux/hooks.c
index 79690f401a5898c5d58004612d08131811059d2c,ec43760a8a03e691997697480063812b7f5bbf6e..6c77f63c759198ead061712fb3bad1166c4ace2a
@@@ -2791,16 -2791,11 +2791,16 @@@ static int selinux_inode_setxattr(struc
  
                        /* We strip a nul only if it is at the end, otherwise the
                         * context contains a nul and we should audit that */
 -                      str = value;
 -                      if (str[size - 1] == '\0')
 -                              audit_size = size - 1;
 -                      else
 -                              audit_size = size;
 +                      if (value) {
 +                              str = value;
 +                              if (str[size - 1] == '\0')
 +                                      audit_size = size - 1;
 +                              else
 +                                      audit_size = size;
 +                      } else {
 +                              str = "";
 +                              audit_size = 0;
 +                      }
                        ab = audit_log_start(current->audit_context, GFP_ATOMIC, AUDIT_SELINUX_ERR);
                        audit_log_format(ab, "op=setxattr invalid_context=");
                        audit_log_n_untrustedstring(ab, value, audit_size);
@@@ -3185,6 -3180,7 +3185,7 @@@ static int selinux_file_fcntl(struct fi
        case F_GETFL:
        case F_GETOWN:
        case F_GETSIG:
+       case F_GETOWNER_UIDS:
                /* Just check FD__USE permission */
                err = file_has_perm(cred, file, 0);
                break;