Merge branch 'android-3.10' into android-merge
Sumit Singh [Tue, 3 Mar 2015 09:57:51 +0000 (14:57 +0530)]
Conflicts:
arch/arm64/Makefile
drivers/Kconfig
drivers/Makefile
drivers/cpufreq/cpufreq_interactive.c
drivers/staging/android/ion/ion.c
fs/pstore/inode.c
fs/pstore/internal.h
fs/pstore/platform.c
fs/pstore/ram.c
include/linux/pstore.h
include/linux/pstore_ram.h
include/linux/wlan_plat.h

bug 200082354

Change-Id: I343eaeb85c02f3c1161e357621a80be0b2566de8
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>

38 files changed:
1  2 
arch/arm/Kconfig
arch/arm/crypto/aes_glue.c
arch/arm/crypto/sha1_glue.c
arch/arm/include/asm/Kbuild
arch/arm/vfp/vfpmodule.c
arch/arm64/Makefile
drivers/Kconfig
drivers/Makefile
drivers/cpufreq/cpufreq_interactive.c
drivers/staging/android/Kconfig
drivers/staging/android/alarm-dev.c
drivers/staging/android/ion/ion.c
drivers/staging/android/ion/ion_heap.c
drivers/staging/android/ion/ion_priv.h
drivers/staging/android/ion/ion_system_heap.c
drivers/staging/android/logger.c
drivers/staging/android/sync.c
drivers/usb/gadget/android.c
drivers/usb/gadget/f_accessory.c
fs/pstore/Kconfig
fs/pstore/Makefile
fs/pstore/inode.c
fs/pstore/internal.h
fs/pstore/platform.c
fs/pstore/ram.c
include/linux/pstore.h
include/linux/pstore_ram.h
include/linux/wlan_plat.h
include/net/addrconf.h
include/uapi/linux/Kbuild
kernel/irq/pm.c
kernel/power/process.c
kernel/sys.c
net/ipv4/ping.c
net/ipv6/addrconf.c
net/ipv6/route.c
security/selinux/hooks.c
security/selinux/ss/policydb.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -20,11 -20,7 +20,12 @@@ LIBGCC              := $(shell $(CC) $(KBUILD_CFLA
  KBUILD_DEFCONFIG := defconfig
  
  KBUILD_CFLAGS += -mgeneral-regs-only
+ KBUILD_CFLAGS += -fno-pic
 +ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
 +KBUILD_CPPFLAGS       += -mbig-endian
 +AS            += -EB
 +LD            += -EB
 +else
  KBUILD_CPPFLAGS       += -mlittle-endian
  AS            += -EL
  LD            += -EL
diff --cc drivers/Kconfig
@@@ -172,10 -168,6 +172,12 @@@ source "drivers/ipack/Kconfig
  
  source "drivers/reset/Kconfig"
  
 +source "drivers/edp/Kconfig"
 +
 +source "drivers/gpu/nvgpu/Kconfig"
 +
 +source "drivers/phy/Kconfig"
 +
+ source "drivers/android/Kconfig"
  endmenu
@@@ -161,9 -153,4 +161,10 @@@ obj-$(CONFIG_IIO)         += iio
  obj-$(CONFIG_VME_BUS)         += vme/
  obj-$(CONFIG_IPACK_BUS)               += ipack/
  obj-$(CONFIG_NTB)             += ntb/
 +obj-$(CONFIG_MIPI_BIF)                += mipi_bif/
 +
 +# The wildcard hack is necessary for kernel's make clean.
 +ifneq ($(wildcard $(srctree)/../kernel-t18x/drivers/Makefile),)
 +obj-$(CONFIG_ARCH_TEGRA_18x_SOC) += ../../kernel-t18x/drivers/
 +endif
+ obj-$(CONFIG_ANDROID)         += android/
@@@ -413,15 -404,22 +412,15 @@@ static void cpufreq_interactive_timer(u
        do_div(cputime_speedadj, delta_time);
        loadadjfreq = (unsigned int)cputime_speedadj * 100;
        cpu_load = loadadjfreq / pcpu->target_freq;
-       boosted = tunables->boost_val || now < tunables->boostpulse_endtime;
+       tunables->boosted = tunables->boost_val || now < tunables->boostpulse_endtime;
  
 +      new_freq = choose_freq(pcpu, loadadjfreq);
-       if (cpu_load >= tunables->go_hispeed_load || boosted) {
+       if (cpu_load >= tunables->go_hispeed_load || tunables->boosted) {
 -              if (pcpu->target_freq < tunables->hispeed_freq) {
 -                      new_freq = tunables->hispeed_freq;
 -              } else {
 -                      new_freq = choose_freq(pcpu, loadadjfreq);
 -
 -                      if (new_freq < tunables->hispeed_freq)
 -                              new_freq = tunables->hispeed_freq;
 -              }
 -      } else {
 -              new_freq = choose_freq(pcpu, loadadjfreq);
 -              if (new_freq > tunables->hispeed_freq &&
 -                              pcpu->target_freq < tunables->hispeed_freq)
 -                      new_freq = tunables->hispeed_freq;
 +              new_freq = max(new_freq, tunables->hispeed_freq);
 +              if (pcpu->target_freq < tunables->hispeed_freq &&
 +                              tunables->boost_factor)
 +                      new_freq = min((pcpu->target_freq
 +                                      * tunables->boost_factor), tunables->hispeed_freq);
        }
  
        if (pcpu->target_freq >= tunables->hispeed_freq &&
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1038,8 -1008,9 +1045,9 @@@ void sync_dump(void
        for (i = 0; i < s.count; i += DUMP_CHUNK) {
                if ((s.count - i) > DUMP_CHUNK) {
                        char c = s.buf[i + DUMP_CHUNK];
                        s.buf[i + DUMP_CHUNK] = 0;
 -                      pr_cont("%s", s.buf + i);
 +                      pr_debug("%s", s.buf + i);
                        s.buf[i + DUMP_CHUNK] = c;
                } else {
                        s.buf[s.count] = 0;
Simple merge
Simple merge
Simple merge
@@@ -6,7 -6,8 +6,9 @@@ obj-y += pstore.
  
  pstore-objs += inode.o platform.o
  obj-$(CONFIG_PSTORE_FTRACE)   += ftrace.o
 +obj-$(CONFIG_PSTORE_RTRACE)   += rtrace.o
  
+ obj-$(CONFIG_PSTORE_PMSG)     += pmsg.o
  ramoops-objs += ram.o ram_core.o
  obj-$(CONFIG_PSTORE_RAM)      += ramoops.o
@@@ -389,25 -313,27 +389,30 @@@ int pstore_mkfile(enum pstore_type_id t
  
        switch (type) {
        case PSTORE_TYPE_DMESG:
-               sprintf(name, "dmesg-%s-%lld", psname, id);
+               scnprintf(name, sizeof(name), "dmesg-%s-%lld",
+                         psname, id);
                break;
        case PSTORE_TYPE_CONSOLE:
-               sprintf(name, "console-%s-%lld", psname, id);
 -              scnprintf(name, sizeof(name), "console-%s", psname);
++              scnprintf(name, sizeof(name),  "console-%s-%lld", psname, id);
                break;
        case PSTORE_TYPE_FTRACE:
-               sprintf(name, "ftrace-%s-%lld", psname, id);
 -              scnprintf(name, sizeof(name), "ftrace-%s", psname);
++              scnprintf(name, sizeof(name), "ftrace-%s-%lld", psname, id);
 +              break;
 +      case PSTORE_TYPE_RTRACE:
-               sprintf(name, "rtrace-%s", psname);
++              scnprintf(name, sizeof(name), "rtrace-%s", psname);
                break;
        case PSTORE_TYPE_MCE:
-               sprintf(name, "mce-%s-%lld", psname, id);
+               scnprintf(name, sizeof(name), "mce-%s-%lld", psname, id);
+               break;
+       case PSTORE_TYPE_PMSG:
+               scnprintf(name, sizeof(name), "pmsg-%s-%lld", psname, id);
                break;
        case PSTORE_TYPE_UNKNOWN:
-               sprintf(name, "unknown-%s-%lld", psname, id);
+               scnprintf(name, sizeof(name), "unknown-%s-%lld", psname, id);
                break;
        default:
-               sprintf(name, "type%d-%s-%lld", type, psname, id);
+               scnprintf(name, sizeof(name), "type%d-%s-%lld",
+                         type, psname, id);
                break;
        }
  
@@@ -73,12 -45,12 +73,18 @@@ extern void pstore_register_ftrace(void
  static inline void pstore_register_ftrace(void) {}
  #endif
  
 +#ifdef CONFIG_PSTORE_RTRACE
 +extern void pstore_register_rtrace(void);
 +#else
 +static inline void pstore_register_rtrace(void) {}
 +#endif
 +
+ #ifdef CONFIG_PSTORE_PMSG
+ extern void pstore_register_pmsg(void);
+ #else
+ static inline void pstore_register_pmsg(void) {}
+ #endif
  extern struct pstore_info *psinfo;
  
  extern void   pstore_set_kmsg_bytes(int);
@@@ -282,7 -267,7 +282,8 @@@ int pstore_register(struct pstore_info 
        kmsg_dump_register(&pstore_dumper);
        pstore_register_console();
        pstore_register_ftrace();
 +      pstore_register_rtrace();
+       pstore_register_pmsg();
  
        if (pstore_update_ms >= 0) {
                pstore_timer.expires = jiffies +
diff --cc fs/pstore/ram.c
@@@ -52,10 -51,10 +52,14 @@@ static ulong ramoops_ftrace_size = MIN_
  module_param_named(ftrace_size, ramoops_ftrace_size, ulong, 0400);
  MODULE_PARM_DESC(ftrace_size, "size of ftrace log");
  
 +static ulong ramoops_rtrace_size = MIN_MEM_SIZE;
 +module_param_named(rtrace_size, ramoops_rtrace_size, ulong, 0400);
 +MODULE_PARM_DESC(rtrace_size, "size of rtrace log");
 +
+ static ulong ramoops_pmsg_size = MIN_MEM_SIZE;
+ module_param_named(pmsg_size, ramoops_pmsg_size, ulong, 0400);
+ MODULE_PARM_DESC(pmsg_size, "size of user space message log");
  static ulong mem_address;
  module_param(mem_address, ulong, 0400);
  MODULE_PARM_DESC(mem_address,
@@@ -87,14 -81,13 +91,16 @@@ struct ramoops_context 
        struct persistent_ram_zone **przs;
        struct persistent_ram_zone *cprz;
        struct persistent_ram_zone *fprz;
 +      struct persistent_ram_zone *rprz;
+       struct persistent_ram_zone *mprz;
        phys_addr_t phys_addr;
        unsigned long size;
 +      unsigned int memtype;
        size_t record_size;
        size_t console_size;
        size_t ftrace_size;
 +      size_t rtrace_size;
+       size_t pmsg_size;
        int dump_oops;
        struct persistent_ram_ecc_info ecc_info;
        unsigned int max_dump_cnt;
        unsigned int dump_read_cnt;
        unsigned int console_read_cnt;
        unsigned int ftrace_read_cnt;
 +      unsigned int rtrace_read_cnt;
+       unsigned int pmsg_read_cnt;
        struct pstore_info pstore;
  };
  
@@@ -117,7 -110,7 +124,8 @@@ static int ramoops_pstore_open(struct p
        cxt->dump_read_cnt = 0;
        cxt->console_read_cnt = 0;
        cxt->ftrace_read_cnt = 0;
 +      cxt->rtrace_read_cnt = 0;
+       cxt->pmsg_read_cnt = 0;
        return 0;
  }
  
@@@ -162,18 -159,22 +176,21 @@@ static ssize_t ramoops_pstore_read(u64 
        prz = ramoops_get_next_prz(cxt->przs, &cxt->dump_read_cnt,
                                   cxt->max_dump_cnt, id, type,
                                   PSTORE_TYPE_DMESG, 1);
-       if (!prz)
+       if (!prz_ok(prz))
                prz = ramoops_get_next_prz(&cxt->cprz, &cxt->console_read_cnt,
                                           1, id, type, PSTORE_TYPE_CONSOLE, 0);
-       if (!prz)
+       if (!prz_ok(prz))
                prz = ramoops_get_next_prz(&cxt->fprz, &cxt->ftrace_read_cnt,
                                           1, id, type, PSTORE_TYPE_FTRACE, 0);
-       if (!prz)
+       if (!prz_ok(prz))
 +              prz = ramoops_get_next_prz(&cxt->rprz, &cxt->rtrace_read_cnt,
 +                                         1, id, type, PSTORE_TYPE_RTRACE, 0);
-       if (!prz)
++      if (!prz_ok(prz))
+               prz = ramoops_get_next_prz(&cxt->mprz, &cxt->pmsg_read_cnt,
+                                          1, id, type, PSTORE_TYPE_PMSG, 0);
+       if (!prz_ok(prz))
                return 0;
  
 -      /* TODO(kees): Bogus time for the moment. */
 -      time->tv_sec = 0;
 -      time->tv_nsec = 0;
 -
        size = persistent_ram_old_size(prz);
  
        /* ECC correction notice */
@@@ -238,11 -231,11 +255,16 @@@ static int notrace ramoops_pstore_write
                        return -ENOMEM;
                persistent_ram_write(cxt->fprz, buf, size);
                return 0;
 +      } else if (type == PSTORE_TYPE_RTRACE) {
 +              if (!cxt->rprz)
 +                      return -ENOMEM;
 +              persistent_ram_write(cxt->rprz, buf, size);
 +              return 0;
+       } else if (type == PSTORE_TYPE_PMSG) {
+               if (!cxt->mprz)
+                       return -ENOMEM;
+               persistent_ram_write(cxt->mprz, buf, size);
+               return 0;
        }
  
        if (type != PSTORE_TYPE_DMESG)
@@@ -303,9 -293,9 +325,12 @@@ static int ramoops_pstore_erase(enum ps
        case PSTORE_TYPE_FTRACE:
                prz = cxt->fprz;
                break;
 +      case PSTORE_TYPE_RTRACE:
 +              prz = cxt->rprz;
 +              break;
+       case PSTORE_TYPE_PMSG:
+               prz = cxt->mprz;
+               break;
        default:
                return -EINVAL;
        }
@@@ -456,38 -424,24 +481,46 @@@ static int ramoops_probe(struct platfor
         */
        if (cxt->max_dump_cnt)
                goto fail_out;
 -
 -      if (!pdata->mem_size || (!pdata->record_size && !pdata->console_size &&
 -                      !pdata->ftrace_size && !pdata->pmsg_size)) {
 -              pr_err("The memory size and the record/console size must be "
 -                      "non-zero\n");
 +      if ((pdata->mem_size && pdata->record_size) == 0) {
 +              pr_err("The memory size and the record size must be non-zero\n");
                goto fail_out;
        }
 -
 -      if (!is_power_of_2(pdata->mem_size))
 +#ifdef CONFIG_PSTORE_CONSOLE
 +      if (pdata->console_size == 0) {
 +              pr_err("PSTORE_CONSOLE is enabled, console size must be non-zero\n");
 +              goto fail_out;
 +      }
 +#endif
 +#ifdef CONFIG_PSTORE_FTRACE
 +      if (pdata->ftrace_size == 0) {
 +              pr_err("PSTORE_FTRACE is enabled, ftrace size must be non-zero\n");
 +              goto fail_out;
 +      }
 +#endif
 +#ifdef CONFIG_PSTORE_RTRACE
 +      if (pdata->rtrace_size == 0) {
 +              pr_err("PSTORE_RTRACE is enabled, rtrace size must be non-zero\n");
 +              goto fail_out;
 +      }
 +#endif
++#ifdef CONFIG_PSTORE_PMSG
++      if (pdata->pmsg_size == 0) {
++              pr_err("PSTORE_PMSG is enabled, pmsg size must be non-zero\n");
++              goto fail_out;
++      }
++#endif
 +      if (pdata->mem_size && !is_power_of_2(pdata->mem_size))
                pdata->mem_size = rounddown_pow_of_two(pdata->mem_size);
 -      if (!is_power_of_2(pdata->record_size))
 +      if (pdata->record_size && !is_power_of_2(pdata->record_size))
                pdata->record_size = rounddown_pow_of_two(pdata->record_size);
 -      if (!is_power_of_2(pdata->console_size))
 +      if (pdata->console_size && !is_power_of_2(pdata->console_size))
                pdata->console_size = rounddown_pow_of_two(pdata->console_size);
 -      if (!is_power_of_2(pdata->ftrace_size))
 +      if (pdata->ftrace_size && !is_power_of_2(pdata->ftrace_size))
                pdata->ftrace_size = rounddown_pow_of_two(pdata->ftrace_size);
 +      if (pdata->rtrace_size && !is_power_of_2(pdata->rtrace_size))
 +              pdata->rtrace_size = rounddown_pow_of_two(pdata->rtrace_size);
+       if (pdata->pmsg_size && !is_power_of_2(pdata->pmsg_size))
+               pdata->pmsg_size = rounddown_pow_of_two(pdata->pmsg_size);
  
        cxt->size = pdata->mem_size;
        cxt->phys_addr = pdata->mem_address;
        cxt->record_size = pdata->record_size;
        cxt->console_size = pdata->console_size;
        cxt->ftrace_size = pdata->ftrace_size;
 +      cxt->rtrace_size = pdata->rtrace_size;
+       cxt->pmsg_size = pdata->pmsg_size;
        cxt->dump_oops = pdata->dump_oops;
        cxt->ecc_info = pdata->ecc_info;
  
        paddr = cxt->phys_addr;
  
 -      dump_mem_sz = cxt->size - cxt->console_size - cxt->ftrace_size
 -                      - cxt->pmsg_size;
 +      dump_mem_sz = cxt->size - cxt->console_size - cxt->ftrace_size -
-                       cxt->rtrace_size;
++                      cxt->rtrace_size - cxt->pmsg_size;
        err = ramoops_init_przs(dev, cxt, &paddr, dump_mem_sz);
        if (err)
                goto fail_out;
                               LINUX_VERSION_CODE);
        if (err)
                goto fail_init_fprz;
 -
 -      err = ramoops_init_prz(dev, cxt, &cxt->mprz, &paddr, cxt->pmsg_size, 0);
 +#endif
 +#ifdef CONFIG_PSTORE_RTRACE
 +      err = ramoops_init_prz(dev, cxt, &cxt->rprz, &paddr,
 +                             cxt->rtrace_size, 0);
 +      if (err)
 +              goto fail_init_rprz;
 +#endif
-       if (!cxt->przs && !cxt->cprz && !cxt->fprz && !cxt->rprz) {
++#ifdef CONFIG_PSTORE_PMSG
++      err = ramoops_init_prz(dev, cxt, &cxt->mprz, &paddr,
++                             cxt->pmsg_size, 0);
+       if (err)
+               goto fail_init_mprz;
++#endif
++      if (!cxt->przs && !cxt->cprz && !cxt->fprz && !cxt->rprz &&
++                                                    !cxt->mprz) {
 +              pr_err("memory size too small, minimum is %zu\n",
 +                      cxt->console_size + cxt->record_size +
-                       cxt->ftrace_size + cxt->rtrace_size);
++                      cxt->ftrace_size + cxt->rtrace_size + cxt->pmsg_size);
 +              err = -EINVAL;
 +              goto fail_cnt;
 +      }
  
        cxt->pstore.data = cxt;
        /*
@@@ -577,9 -518,8 +618,11 @@@ fail_buf
  fail_clear:
        cxt->pstore.bufsize = 0;
        cxt->max_dump_cnt = 0;
 +fail_cnt:
+       kfree(cxt->mprz);
+ fail_init_mprz:
 +      kfree(cxt->rprz);
 +fail_init_rprz:
        kfree(cxt->fprz);
  fail_init_fprz:
        kfree(cxt->cprz);
@@@ -638,7 -577,7 +681,8 @@@ static void ramoops_register_dummy(void
        dummy_data->record_size = record_size;
        dummy_data->console_size = ramoops_console_size;
        dummy_data->ftrace_size = ramoops_ftrace_size;
 +      dummy_data->rtrace_size = ramoops_rtrace_size;
+       dummy_data->pmsg_size = ramoops_pmsg_size;
        dummy_data->dump_oops = dump_oops;
        /*
         * For backwards compatibility ramoops.ecc=1 means 16 bytes ECC
@@@ -36,7 -35,7 +36,8 @@@ enum pstore_type_id 
        PSTORE_TYPE_MCE         = 1,
        PSTORE_TYPE_CONSOLE     = 2,
        PSTORE_TYPE_FTRACE      = 3,
 -      PSTORE_TYPE_PMSG        = 4, /* Backport: 7 in upstream 3.19.0-rc3 */
 +      PSTORE_TYPE_RTRACE      = 4,
++      PSTORE_TYPE_PMSG        = 5, /* Backport: 7 in upstream 3.19.0-rc3 */
        PSTORE_TYPE_UNKNOWN     = 255
  };
  
@@@ -84,7 -81,7 +84,8 @@@ struct ramoops_platform_data 
        unsigned long   record_size;
        unsigned long   console_size;
        unsigned long   ftrace_size;
 +      unsigned long   rtrace_size;
+       unsigned long   pmsg_size;
        int             dump_oops;
        struct persistent_ram_ecc_info ecc_info;
  };
@@@ -25,8 -23,8 +25,9 @@@ struct wifi_platform_data 
        int (*set_carddetect)(int val);
        void *(*mem_prealloc)(int section, unsigned long size);
        int (*get_mac_addr)(unsigned char *buf);
 +      void *(*get_country_code)(char *ccode);
 +      struct sysedp_consumer *sysedpc;
+       int (*get_wake_irq)(void);
 -      void *(*get_country_code)(char *ccode, u32 flags);
  };
  
  #endif
Simple merge
Simple merge
diff --cc kernel/irq/pm.c
Simple merge
Simple merge
diff --cc kernel/sys.c
Simple merge
diff --cc net/ipv4/ping.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge