Merge branch 'upstream/android-3.10' into 'linaro-fixes/android-3.10'
authorAmit Pundir <amit.pundir@linaro.org>
Mon, 10 Nov 2014 05:46:05 +0000 (11:16 +0530)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 10 Nov 2014 05:46:05 +0000 (11:16 +0530)
23 files changed:
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/boot/.gitignore
arch/arm/boot/Makefile
arch/arm/boot/dts/Makefile
drivers/char/dcc_tty.c
drivers/cpufreq/Kconfig
drivers/staging/android/Kconfig
drivers/staging/android/ion/Kconfig
drivers/staging/android/ion/Makefile
drivers/staging/android/ion/ion_dummy_driver.c [new file with mode: 0644]
drivers/staging/android/ion/ion_priv.h
fs/eventpoll.c
include/net/ping.h
include/uapi/linux/eventpoll.h
kernel/power/wakelock.c
kernel/printk.c
mm/vmscan.c
net/Kconfig
net/ipv4/tcp.c
net/ipv6/ping.c
scripts/Makefile.lib
security/Kconfig

index 99887aaa04bb06c6d8d5774c3ae8d884f57661a0..351e48e45cbb54830711caea8f51fd6ad4223fac 100644 (file)
@@ -1861,16 +1861,16 @@ config BUILD_ARM_APPENDED_DTB_IMAGE
        bool "Build a concatenated zImage/dtb by default"
        depends on OF
        help
-         Enabling this option will cause a concatenated zImage and list of
-         DTBs to be built by default (instead of a standalone zImage.)
-         The image will built in arch/arm/boot/zImage-dtb
+         Enabling this option will cause a concatenated zImage and DTB to
+         be built by default (instead of a standalone zImage.)  The image
+         will built in arch/arm/boot/zImage-dtb.<dtb name>
 
-config BUILD_ARM_APPENDED_DTB_IMAGE_NAMES
-       string "Default dtb names"
+config BUILD_ARM_APPENDED_DTB_IMAGE_NAME
+       string "Default dtb name"
        depends on BUILD_ARM_APPENDED_DTB_IMAGE
        help
-         Space separated list of names of dtbs to append when
-         building a concatenated zImage-dtb.
+         name of the dtb to append when building a concatenated
+         zImage/dtb.
 
 # Compressed boot loader in ROM.  Yes, we really want to ask about
 # TEXT and BSS so we preserve their values in the config files.
index 314c7be492a9b919025c359085ea6ac16c6621a7..883e4bec807fe3614a767de19b21783e93b11cfd 100644 (file)
@@ -265,7 +265,7 @@ libs-y                              := arch/arm/lib/ $(libs-y)
 ifeq ($(CONFIG_XIP_KERNEL),y)
 KBUILD_IMAGE := xipImage
 else ifeq ($(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE),y)
-KBUILD_IMAGE := zImage-dtb
+KBUILD_IMAGE := zImage-dtb.$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAME)
 else
 KBUILD_IMAGE := zImage
 endif
@@ -297,9 +297,6 @@ zinstall uinstall install: vmlinux
 dtbs: scripts
        $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) dtbs
 
-zImage-dtb: vmlinux scripts dtbs
-       $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
-
 # We use MRPROPER_FILES and CLEAN_FILES now
 archclean:
        $(Q)$(MAKE) $(clean)=$(boot)
index ad7a0253ea961a405fb13bb284bd1c5942e28675..3c79f85975aaa26c7c2e353fefc54d71d89bc5bf 100644 (file)
@@ -4,4 +4,3 @@ xipImage
 bootpImage
 uImage
 *.dtb
-zImage-dtb
\ No newline at end of file
index 65285bbbf899354364da68043a6f4f7d49130965..085bb96493a373d7c2e2a17b20bf49f17b173f08 100644 (file)
@@ -28,14 +28,6 @@ export ZRELADDR INITRD_PHYS PARAMS_PHYS
 
 targets := Image zImage xipImage bootpImage uImage
 
-DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES))
-ifneq ($(DTB_NAMES),)
-DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES))
-else
-DTB_LIST := $(dtb-y)
-endif
-DTB_OBJS := $(addprefix $(obj)/dts/,$(DTB_LIST))
-
 ifeq ($(CONFIG_XIP_KERNEL),y)
 
 $(obj)/xipImage: vmlinux FORCE
@@ -64,10 +56,6 @@ $(obj)/zImage:       $(obj)/compressed/vmlinux FORCE
        $(call if_changed,objcopy)
        @$(kecho) '  Kernel: $@ is ready'
 
-$(obj)/zImage-dtb:     $(obj)/zImage $(DTB_OBJS) FORCE
-       $(call if_changed,cat)
-       @echo '  Kernel: $@ is ready'
-
 endif
 
 ifneq ($(LOADADDR),)
index b83cc5083a2c618b4aaf6c3c6d35e982450e2586..f0895c581a89be8668a99db10e6873ae94be0cef 100644 (file)
@@ -210,20 +210,13 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
        wm8850-w70v2.dtb
 dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
 
-DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES))
-ifneq ($(DTB_NAMES),)
-DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES))
-else
-DTB_LIST := $(dtb-y)
-endif
-
 targets += dtbs
-targets += $(DTB_LIST)
+targets += $(dtb-y)
 endif
 
 # *.dtb used to be generated in the directory above. Clean out the
 # old build results so people don't accidentally use them.
-dtbs: $(addprefix $(obj)/, $(DTB_LIST))
+dtbs: $(addprefix $(obj)/, $(dtb-y))
        $(Q)rm -f $(obj)/../*.dtb
 
 clean-files := *.dtb
index a787accdcb14b2556bcb59ea5693c1d04e198307..0a62d410286faf7d800719e8b8d3d7debc9e0eb6 100644 (file)
@@ -26,7 +26,7 @@ MODULE_DESCRIPTION("DCC TTY Driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION("1.0");
 
-static spinlock_t g_dcc_tty_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(g_dcc_tty_lock);
 static struct hrtimer g_dcc_timer;
 static char g_dcc_buffer[16];
 static int g_dcc_buffer_head;
@@ -80,8 +80,8 @@ static void dcc_poll_locked(void)
                );
                if (rch >= 0) {
                        ch = rch;
-                       tty_insert_flip_string(g_dcc_tty, &ch, 1);
-                       tty_flip_buffer_push(g_dcc_tty);
+                       tty_insert_flip_string(g_dcc_tty->port, &ch, 1);
+                       tty_flip_buffer_push(g_dcc_tty->port);
                }
        }
 
index 62236d63339162373877098b2641bfff1b49f684..e86900b03c8e922c9ad661cee4502c2944c896ed 100644 (file)
@@ -172,6 +172,7 @@ config CPU_FREQ_GOV_ONDEMAND
 
 config CPU_FREQ_GOV_INTERACTIVE
        tristate "'interactive' cpufreq policy governor"
+       default n
        help
          'interactive' - This driver adds a dynamic cpufreq policy governor
          designed for latency-sensitive workloads.
index c5539001f4442769bbafcd926b79c3612f51cccd..f07d9f2a06f955759614bfa29cff41cca9f6142b 100644 (file)
@@ -20,9 +20,9 @@ config ANDROID_BINDER_IPC
          between said processes.
 
 config ANDROID_BINDER_IPC_32BIT
-       bool "Use old 32-bit binder api"
+       bool
         default y
-       depends on !64BIT
+       depends on !64BIT && ANDROID_BINDER_IPC
        ---help---
          Enable to support an old 32-bit Android user-space. Breaks the new
          Android user-space.
index a9a64ea2343fd38953c9fdfe744e0c1ffb3ebc02..0f8fec1f84e5571c055841b7f96d78432bedca39 100644 (file)
@@ -17,6 +17,16 @@ config ION_TEST
          Choose this option to create a device that can be used to test the
          kernel and device side ION functions.
 
+config ION_DUMMY
+       bool "Dummy Ion driver"
+       depends on ION
+       help
+         Provides a dummy ION driver that registers the
+         /dev/ion device and some basic heaps. This can
+         be used for testing the ION infrastructure if
+         one doesn't have access to hardware drivers that
+         use ION.
+
 config ION_TEGRA
        tristate "Ion for Tegra"
        depends on ARCH_TEGRA && ION
index 75039b98eebb91132c508d4ab1604270d01f7e81..b56fd2bf2b4f4853a56aac29958afdf4bf77b5b5 100644 (file)
@@ -4,4 +4,7 @@ obj-$(CONFIG_ION_TEST) += ion_test.o
 ifdef CONFIG_COMPAT
 obj-$(CONFIG_ION) += compat_ion.o
 endif
+
+obj-$(CONFIG_ION_DUMMY) += ion_dummy_driver.o
 obj-$(CONFIG_ION_TEGRA) += tegra/
+
diff --git a/drivers/staging/android/ion/ion_dummy_driver.c b/drivers/staging/android/ion/ion_dummy_driver.c
new file mode 100644 (file)
index 0000000..55b2002
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * drivers/gpu/ion/ion_dummy_driver.c
+ *
+ * Copyright (C) 2013 Linaro, Inc
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/bootmem.h>
+#include <linux/memblock.h>
+#include <linux/sizes.h>
+#include "ion.h"
+#include "ion_priv.h"
+
+struct ion_device *idev;
+struct ion_heap **heaps;
+
+void *carveout_ptr;
+void *chunk_ptr;
+
+struct ion_platform_heap dummy_heaps[] = {
+               {
+                       .id     = ION_HEAP_TYPE_SYSTEM,
+                       .type   = ION_HEAP_TYPE_SYSTEM,
+                       .name   = "system",
+               },
+               {
+                       .id     = ION_HEAP_TYPE_SYSTEM_CONTIG,
+                       .type   = ION_HEAP_TYPE_SYSTEM_CONTIG,
+                       .name   = "system contig",
+               },
+               {
+                       .id     = ION_HEAP_TYPE_CARVEOUT,
+                       .type   = ION_HEAP_TYPE_CARVEOUT,
+                       .name   = "carveout",
+                       .size   = SZ_4M,
+               },
+               {
+                       .id     = ION_HEAP_TYPE_CHUNK,
+                       .type   = ION_HEAP_TYPE_CHUNK,
+                       .name   = "chunk",
+                       .size   = SZ_4M,
+                       .align  = SZ_16K,
+                       .priv   = (void *)(SZ_16K),
+               },
+};
+
+struct ion_platform_data dummy_ion_pdata = {
+       .nr = 4,
+       .heaps = dummy_heaps,
+};
+
+static int __init ion_dummy_init(void)
+{
+       int i, err;
+
+       idev = ion_device_create(NULL);
+       heaps = kzalloc(sizeof(struct ion_heap *) * dummy_ion_pdata.nr,
+                       GFP_KERNEL);
+       if (!heaps)
+               return PTR_ERR(heaps);
+
+
+       /* Allocate a dummy carveout heap */
+       carveout_ptr = alloc_pages_exact(
+                               dummy_heaps[ION_HEAP_TYPE_CARVEOUT].size,
+                               GFP_KERNEL);
+       if (carveout_ptr)
+               dummy_heaps[ION_HEAP_TYPE_CARVEOUT].base =
+                                               virt_to_phys(carveout_ptr);
+       else
+               pr_err("ion_dummy: Could not allocate carveout\n");
+
+       /* Allocate a dummy chunk heap */
+       chunk_ptr = alloc_pages_exact(
+                               dummy_heaps[ION_HEAP_TYPE_CHUNK].size,
+                               GFP_KERNEL);
+       if (chunk_ptr)
+               dummy_heaps[ION_HEAP_TYPE_CHUNK].base = virt_to_phys(chunk_ptr);
+       else
+               pr_err("ion_dummy: Could not allocate chunk\n");
+
+       for (i = 0; i < dummy_ion_pdata.nr; i++) {
+               struct ion_platform_heap *heap_data = &dummy_ion_pdata.heaps[i];
+
+               if (heap_data->type == ION_HEAP_TYPE_CARVEOUT &&
+                                                       !heap_data->base)
+                       continue;
+
+               if (heap_data->type == ION_HEAP_TYPE_CHUNK && !heap_data->base)
+                       continue;
+
+               heaps[i] = ion_heap_create(heap_data);
+               if (IS_ERR_OR_NULL(heaps[i])) {
+                       err = PTR_ERR(heaps[i]);
+                       goto err;
+               }
+               ion_device_add_heap(idev, heaps[i]);
+       }
+       return 0;
+err:
+       for (i = 0; i < dummy_ion_pdata.nr; i++) {
+               if (heaps[i])
+                       ion_heap_destroy(heaps[i]);
+       }
+       kfree(heaps);
+
+       if (carveout_ptr) {
+               free_pages_exact(carveout_ptr,
+                               dummy_heaps[ION_HEAP_TYPE_CARVEOUT].size);
+               carveout_ptr = NULL;
+       }
+       if (chunk_ptr) {
+               free_pages_exact(chunk_ptr,
+                               dummy_heaps[ION_HEAP_TYPE_CHUNK].size);
+               chunk_ptr = NULL;
+       }
+       return err;
+}
+
+static void __exit ion_dummy_exit(void)
+{
+       int i;
+
+       ion_device_destroy(idev);
+
+       for (i = 0; i < dummy_ion_pdata.nr; i++)
+               ion_heap_destroy(heaps[i]);
+       kfree(heaps);
+
+       if (carveout_ptr) {
+               free_pages_exact(carveout_ptr,
+                               dummy_heaps[ION_HEAP_TYPE_CARVEOUT].size);
+               carveout_ptr = NULL;
+       }
+       if (chunk_ptr) {
+               free_pages_exact(chunk_ptr,
+                               dummy_heaps[ION_HEAP_TYPE_CHUNK].size);
+               chunk_ptr = NULL;
+       }
+
+       return;
+}
+
+module_init(ion_dummy_init);
+module_exit(ion_dummy_exit);
+
index 18ef365e7552ec1b641906f74993c910471bc653..9bcd077f251cb6eec56f6b3ce7c1a9247dcc5b49 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/sched.h>
 #include <linux/shrinker.h>
 #include <linux/types.h>
+#include <linux/device.h>
 
 #include "ion.h"
 
index 0cff4434880d1fff3b799e6c1e2df6328b7b5282..db10e00c971a71add3be6b140a40b4f9d68580f1 100644 (file)
@@ -1819,8 +1819,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
                goto error_tgt_fput;
 
        /* Check if EPOLLWAKEUP is allowed */
-       if ((epds.events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND))
-               epds.events &= ~EPOLLWAKEUP;
+       ep_take_care_of_epollwakeup(&epds);
 
        /*
         * We have to check that the file structure underneath the file descriptor
index 9242fa090d3dea62b402e49b68da1c10fd635c9d..2db4860e5848def0360395bfb1b2fd0c80b98a47 100644 (file)
@@ -38,7 +38,7 @@ struct pingv6_ops {
        void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err,
                                __be16 port, u32 info, u8 *payload);
        int (*ipv6_chk_addr)(struct net *net, const struct in6_addr *addr,
-                            struct net_device *dev, int strict);
+                            const struct net_device *dev, int strict);
 };
 
 struct ping_table {
index 2c267bcbb85c1c4e31b676127db7686d8d027e09..bc81fb2e1f0e19d363d3c8095c85b971c521d12a 100644 (file)
@@ -61,5 +61,16 @@ struct epoll_event {
        __u64 data;
 } EPOLL_PACKED;
 
-
+#ifdef CONFIG_PM_SLEEP
+static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev)
+{
+       if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND))
+               epev->events &= ~EPOLLWAKEUP;
+}
+#else
+static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev)
+{
+       epev->events &= ~EPOLLWAKEUP;
+}
+#endif
 #endif /* _UAPI_LINUX_EVENTPOLL_H */
index 8f50de394d22b30090d1cf62cd3fd3069d451d57..c8fba3380076afd8db340855340e5886b8497dc6 100644 (file)
@@ -9,7 +9,6 @@
  * manipulate wakelocks on Android.
  */
 
-#include <linux/capability.h>
 #include <linux/ctype.h>
 #include <linux/device.h>
 #include <linux/err.h>
@@ -189,9 +188,6 @@ int pm_wake_lock(const char *buf)
        size_t len;
        int ret = 0;
 
-       if (!capable(CAP_BLOCK_SUSPEND))
-               return -EPERM;
-
        while (*str && !isspace(*str))
                str++;
 
@@ -235,9 +231,6 @@ int pm_wake_unlock(const char *buf)
        size_t len;
        int ret = 0;
 
-       if (!capable(CAP_BLOCK_SUSPEND))
-               return -EPERM;
-
        len = strlen(buf);
        if (!len)
                return -EINVAL;
index c2f720eb428304b297ae849322fd644215d9f405..cd0ee46eb894f3ade1c2f6fdf3752e6bd8e0c551 100644 (file)
 #define CREATE_TRACE_POINTS
 #include <trace/events/printk.h>
 
-#ifdef CONFIG_EARLY_PRINTK_DIRECT
-extern void printascii(char *);
-#endif
-
 /* printk's without a loglevel use this.. */
 #define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL
 
index 80c0b17373f79944234613aa56468080361f2ff5..5d41059e1e924b4bcb31c73083c59d0a114e09b0 100644 (file)
@@ -167,7 +167,6 @@ static int debug_shrinker_show(struct seq_file *s, void *unused)
 
        down_read(&shrinker_rwsem);
        list_for_each_entry(shrinker, &shrinker_list, list) {
-               char name[64];
                int num_objs;
 
                num_objs = shrinker->shrink(shrinker, &sc);
index c5e34cf623c4e382ee8f7f9d35d3875c2d3da841..2a680dadfd6cc7effd3bcc23c34c6ed51764a3b5 100644 (file)
@@ -83,13 +83,13 @@ endif # if INET
 
 config ANDROID_PARANOID_NETWORK
        bool "Only allow certain groups to create sockets"
-       default y
+       default ANDROID
        help
                none
 
 config NET_ACTIVITY_STATS
        bool "Network activity statistics tracking"
-       default y
+       default ANDROID
        help
         Network activity statistics are useful for tracking wireless
         modem activity on 2G, 3G, 4G wireless networks. Counts number of
index 880d2a644ca296624104e392c4fd87aaf8f13339..7921d1abc449f0924eac2f8c58972fa31a44dd42 100644 (file)
@@ -3471,7 +3471,7 @@ static int tcp_is_local(struct net *net, __be32 addr) {
        return rt->dst.dev && (rt->dst.dev->flags & IFF_LOOPBACK);
 }
 
-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+#if defined(CONFIG_IPV6)
 static int tcp_is_local6(struct net *net, struct in6_addr *addr) {
        struct rt6_info *rt6 = rt6_lookup(net, addr, addr, 0, 0);
        return rt6 && rt6->dst.dev && (rt6->dst.dev->flags & IFF_LOOPBACK);
@@ -3528,7 +3528,7 @@ restart:
                                        continue;
                        }
 
-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+#if defined(CONFIG_IPV6)
                        if (family == AF_INET6) {
                                struct in6_addr *s6;
                                if (!inet->pinet6)
index 38ceca8a6358ba2eaec0d59434f5e6306670f2f8..5f0d294b36cd206549792ac8c8f88d2735fb8a14 100644 (file)
@@ -73,7 +73,7 @@ int dummy_icmpv6_err_convert(u8 type, u8 code, int *err)
 void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
                            __be16 port, u32 info, u8 *payload) {}
 int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
-                       struct net_device *dev, int strict)
+                       const struct net_device *dev, int strict)
 {
        return 0;
 }
index ef2142a6159319f2bdf5f153bf7f551a937a2168..bd161eff6921ff4b0ddfa92645d57a72ee3fd59b 100644 (file)
@@ -273,11 +273,17 @@ $(obj)/%.dtb: $(src)/%.dts FORCE
 
 dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
 
-# cat
-# ---------------------------------------------------------------------------
-# Concatentate multiple files together
-quiet_cmd_cat = CAT     $@
-cmd_cat = (cat $(filter-out FORCE,$^) > $@) || (rm -f $@; false)
+$(obj)/%.dtb: $(src)/%.dts FORCE
+       $(call if_changed_dep,dtc)
+
+dtc-tmp = $(subst $(comma),_,$(dot-target).dts)
+
+quiet_cmd_dtc_cpp = DTC+CPP $@
+cmd_dtc_cpp = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
+       $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $(dtc-tmp)
+
+$(obj)/%.dtb: $(src)/%.dtsp FORCE
+       $(call if_changed_dep,dtc_cpp)
 
 # Bzip2
 # ---------------------------------------------------------------------------
index e9c6ac724fef153efb0c8ae3ceea6da99407ae7c..beb86b500adffd406e65b26d0cf9abeab3891703 100644 (file)
@@ -103,7 +103,7 @@ config INTEL_TXT
 config LSM_MMAP_MIN_ADDR
        int "Low address space for LSM to protect from user allocation"
        depends on SECURITY && SECURITY_SELINUX
-       default 32768 if ARM
+       default 32768 if ARM || (ARM64 && COMPAT)
        default 65536
        help
          This is the portion of low virtual memory which should be protected