Merge branches 'audit', 'delay', 'fixes', 'misc' and 'sta2x11' into for-linus
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 27 Jul 2012 22:06:32 +0000 (23:06 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 27 Jul 2012 22:06:32 +0000 (23:06 +0100)
1  2  3  4  5  6 
arch/arm/Kconfig
arch/arm/kernel/arch_timer.c
arch/arm/kernel/armksyms.c
arch/arm/kernel/perf_event.c
arch/arm/kernel/traps.c
arch/arm/lib/Makefile
arch/arm/mm/dma-mapping.c
arch/arm/mm/init.c
arch/arm/mm/mmu.c
drivers/tty/serial/amba-pl011.c

diff --combined arch/arm/Kconfig
index a91009c6187062253579d0324292ade00ea2241c,a91009c6187062253579d0324292ade00ea2241c,b649c5904a4ff3c993732067411e7723fc4d4d19,a91009c6187062253579d0324292ade00ea2241c,acd12efe6f3e133ff9f8f5bc37cddff7d546e634,b649c5904a4ff3c993732067411e7723fc4d4d19..8928b21a2dba2bce9061ad02e4546f03eea42041
@@@@@@@ -7,6 -7,6 -7,7 -7,6 -7,7 -7,7 +7,6 @@@@@@@ config AR
        select HAVE_IDE if PCI || ISA || PCMCIA
        select HAVE_DMA_ATTRS
        select HAVE_DMA_CONTIGUOUS if (CPU_V6 || CPU_V6K || CPU_V7)
  - --  select CMA if (CPU_V6 || CPU_V6K || CPU_V7)
        select HAVE_MEMBLOCK
        select RTC_LIB
        select SYS_SUPPORTS_APM_EMULATION
        select GENERIC_SMP_IDLE_THREAD
        select KTIME_SCALAR
        select GENERIC_CLOCKEVENTS_BROADCAST if SMP
++++ +  select GENERIC_STRNCPY_FROM_USER
++++ +  select GENERIC_STRNLEN_USER
++++ +  select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
@@@@@@@ -293,7 -293,7 -294,6 -293,7 -297,6 -294,6 +296,7 @@@@@@@ config ARCH_VERSATIL
        select ICST
        select GENERIC_CLOCKEVENTS
        select ARCH_WANT_OPTIONAL_GPIOLIB
  + ++  select NEED_MACH_IO_H if PCI
        select PLAT_VERSATILE
        select PLAT_VERSATILE_CLCD
        select PLAT_VERSATILE_FPGA_IRQ
@@@@@@@ -589,7 -589,7 -589,6 -589,7 -592,6 -589,6 +592,7 @@@@@@@ config ARCH_ORION5
        select PCI
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
  + ++  select NEED_MACH_IO_H
        select PLAT_ORION
        help
          Support for the following Marvell Orion 5x series SoCs:
@@@@@@@ -1961,6 -1961,6 -1960,6 -1961,6 -1963,25 -1960,6 +1964,25 @@@@@@@ config ARM_ATAG_DTB_COMPA
          bootloaders, this option allows zImage to extract the information
          from the ATAG list and store it at run time into the appended DTB.
      
++++ +choice
++++ +  prompt "Kernel command line type" if ARM_ATAG_DTB_COMPAT
++++ +  default ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER
++++ +
++++ +config ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER
++++ +  bool "Use bootloader kernel arguments if available"
++++ +  help
++++ +    Uses the command-line options passed by the boot loader instead of
++++ +    the device tree bootargs property. If the boot loader doesn't provide
++++ +    any, the device tree bootargs property will be used.
++++ +
++++ +config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND
++++ +  bool "Extend with bootloader kernel arguments"
++++ +  help
++++ +    The command-line arguments provided by the boot loader will be
++++ +    appended to the the device tree bootargs property.
++++ +
++++ +endchoice
++++ +
      config CMDLINE
        string "Default kernel command string"
        default ""
index dd58035621f79aceb061321015af9736226ad086,dd58035621f79aceb061321015af9736226ad086,675cee09c014be0aca0b2ee8bc2c8941ee5903d5,dd58035621f79aceb061321015af9736226ad086,df44c8cf9e2e8e6657668558a3598ca137e5fb26,dd58035621f79aceb061321015af9736226ad086..cf258807160d6506cbfdb21df74758f75de04dfe
@@@@@@@ -32,6 -32,6 -32,8 -32,6 -32,6 -32,6 +32,8 @@@@@@@ static int arch_timer_ppi2
      
      static struct clock_event_device __percpu **arch_timer_evt;
      
++ +++extern void init_current_timer_delay(unsigned long freq);
++ +++
      /*
       * Architected system timer support.
       */
@@@@@@@ -137,7 -137,7 -139,7 -137,7 -137,7 -137,7 +139,7 @@@@@@@ static int __cpuinit arch_timer_setup(s
        /* Be safe... */
        arch_timer_disable();
      
---- -  clk->features = CLOCK_EVT_FEAT_ONESHOT;
++++ +  clk->features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP;
        clk->name = "arch_sys_timer";
        clk->rating = 450;
        clk->set_mode = arch_timer_set_mode;
@@@@@@@ -223,6 -223,6 -225,14 -223,6 -223,6 -223,6 +225,14 @@@@@@@ static cycle_t arch_counter_read(struc
        return arch_counter_get_cntpct();
      }
      
++ +++int read_current_timer(unsigned long *timer_val)
++ +++{
++ +++  if (!arch_timer_rate)
++ +++          return -ENXIO;
++ +++  *timer_val = arch_counter_get_cntpct();
++ +++  return 0;
++ +++}
++ +++
      static struct clocksource clocksource_counter = {
        .name   = "arch_sys_counter",
        .rating = 400,
@@@@@@@ -296,6 -296,6 -306,7 -296,6 -296,6 -296,6 +306,7 @@@@@@@ static int __init arch_timer_register(v
        if (err)
                goto out_free_irq;
      
++ +++  init_current_timer_delay(arch_timer_rate);
        return 0;
      
      out_free_irq:
index b57c75e0b01f975defe734de3cce7c6ecfb34dda,b57c75e0b01f975defe734de3cce7c6ecfb34dda,71962284d288719176023c0da5ed22fe36f6ba37,b57c75e0b01f975defe734de3cce7c6ecfb34dda,c3dff6abc89dd046b607428ddadf4e582e9e8c00,b57c75e0b01f975defe734de3cce7c6ecfb34dda..60d3b738d4200987e76c75b2e9da513920087a89
@@@@@@@ -49,8 -49,8 -49,7 -49,8 -49,8 -49,8 +49,7 @@@@@@@ extern void __aeabi_ulcmp(void)
      extern void fpundefinstr(void);
      
        /* platform dependent support */
-- ---EXPORT_SYMBOL(__udelay);
-- ---EXPORT_SYMBOL(__const_udelay);
++ +++EXPORT_SYMBOL(arm_delay_ops);
      
        /* networking */
      EXPORT_SYMBOL(csum_partial);
@@@@@@@ -87,10 -87,10 -86,10 -87,10 -87,6 -87,10 +86,6 @@@@@@@ EXPORT_SYMBOL(memmove)
      EXPORT_SYMBOL(memchr);
      EXPORT_SYMBOL(__memzero);
      
---- -  /* user mem (segment) */
---- -EXPORT_SYMBOL(__strnlen_user);
---- -EXPORT_SYMBOL(__strncpy_from_user);
---- -
      #ifdef CONFIG_MMU
      EXPORT_SYMBOL(copy_page);
      
index a02eada3aa5d06036027ac1241e652d5032781bd,a02eada3aa5d06036027ac1241e652d5032781bd,186c8cb982c543a2cc1631796b34376151b33702,a02eada3aa5d06036027ac1241e652d5032781bd,df85eda3add31666dd673d530c6837dc4662195a,186c8cb982c543a2cc1631796b34376151b33702..ab243b87118da54628c25b0069ecc52cc0d2f717
@@@@@@@ -47,17 -47,17 -47,17 -47,17 -47,14 -47,17 +47,14 @@@@@@@ static DEFINE_PER_CPU(struct pmu_hw_eve
      /* Set at runtime when we know what CPU type we are. */
      static struct arm_pmu *cpu_pmu;
      
---- -enum arm_perf_pmu_ids
---- -armpmu_get_pmu_id(void)
++++ +const char *perf_pmu_name(void)
      {
---- -  int id = -ENODEV;
---- -
---- -  if (cpu_pmu != NULL)
---- -          id = cpu_pmu->id;
++++ +  if (!cpu_pmu)
++++ +          return NULL;
      
---- -  return id;
++++ +  return cpu_pmu->pmu.name;
      }
---- -EXPORT_SYMBOL_GPL(armpmu_get_pmu_id);
++++ +EXPORT_SYMBOL_GPL(perf_pmu_name);
      
      int perf_num_counters(void)
      {
@@@@@@@ -503,7 -503,7 -503,7 -503,7 -500,7 -503,7 +500,7 @@@@@@@ __hw_perf_event_init(struct perf_event 
             event_requires_mode_exclusion(&event->attr)) {
                pr_debug("ARM performance counters do not support "
                         "mode exclusion\n");
  - --          return -EPERM;
  + ++          return -EOPNOTSUPP;
        }
      
        /*
@@@@@@@ -760,7 -760,7 -760,7 -760,7 -757,7 -760,7 +757,7 @@@@@@@ init_hw_perf_events(void
                        cpu_pmu->name, cpu_pmu->num_events);
                cpu_pmu_init(cpu_pmu);
                register_cpu_notifier(&pmu_cpu_notifier);
---- -          armpmu_register(cpu_pmu, "cpu", PERF_TYPE_RAW);
++++ +          armpmu_register(cpu_pmu, cpu_pmu->name, PERF_TYPE_RAW);
        } else {
                pr_info("no hardware support available\n");
        }
diff --combined arch/arm/kernel/traps.c
index 3647170e9a16ba3aa8838218ed99e74dbc5b7c59,3647170e9a16ba3aa8838218ed99e74dbc5b7c59,4928d89758f4ce0dea767acdf9fcf2299dff7833,3647170e9a16ba3aa8838218ed99e74dbc5b7c59,2df8715c36c0eeaa76ff489ad65ee1c76740d365,4928d89758f4ce0dea767acdf9fcf2299dff7833..8b97d739b17b1040f4f3e4bb7fe069d84808fa72
@@@@@@@ -233,9 -233,9 -233,9 -233,9 -233,9 -233,9 +233,9 @@@@@@@ void show_stack(struct task_struct *tsk
      #define S_ISA " ARM"
      #endif
      
---- -static int __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs)
++++ +static int __die(const char *str, int err, struct pt_regs *regs)
      {
---- -  struct task_struct *tsk = thread->task;
++++ +  struct task_struct *tsk = current;
        static int die_counter;
        int ret;
      
        /* trap and error numbers are mostly meaningless on ARM */
        ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV);
        if (ret == NOTIFY_STOP)
---- -          return ret;
++++ +          return 1;
      
        print_modules();
        __show_regs(regs);
        printk(KERN_EMERG "Process %.*s (pid: %d, stack limit = 0x%p)\n",
---- -          TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), thread + 1);
++++ +          TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), end_of_stack(tsk));
      
        if (!user_mode(regs) || in_interrupt()) {
                dump_mem(KERN_EMERG, "Stack: ", regs->ARM_sp,
                dump_instr(KERN_EMERG, regs);
        }
      
---- -  return ret;
++++ +  return 0;
      }
      
---- -static DEFINE_RAW_SPINLOCK(die_lock);
++++ +static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED;
++++ +static int die_owner = -1;
++++ +static unsigned int die_nest_count;
      
---- -/*
---- - * This function is protected against re-entrancy.
---- - */
---- -void die(const char *str, struct pt_regs *regs, int err)
++++ +static unsigned long oops_begin(void)
      {
---- -  struct thread_info *thread = current_thread_info();
---- -  int ret;
---- -  enum bug_trap_type bug_type = BUG_TRAP_TYPE_NONE;
++++ +  int cpu;
++++ +  unsigned long flags;
      
        oops_enter();
      
---- -  raw_spin_lock_irq(&die_lock);
++++ +  /* racy, but better than risking deadlock. */
++++ +  raw_local_irq_save(flags);
++++ +  cpu = smp_processor_id();
++++ +  if (!arch_spin_trylock(&die_lock)) {
++++ +          if (cpu == die_owner)
++++ +                  /* nested oops. should stop eventually */;
++++ +          else
++++ +                  arch_spin_lock(&die_lock);
++++ +  }
++++ +  die_nest_count++;
++++ +  die_owner = cpu;
        console_verbose();
        bust_spinlocks(1);
---- -  if (!user_mode(regs))
---- -          bug_type = report_bug(regs->ARM_pc, regs);
---- -  if (bug_type != BUG_TRAP_TYPE_NONE)
---- -          str = "Oops - BUG";
---- -  ret = __die(str, err, thread, regs);
++++ +  return flags;
++++ +}
      
---- -  if (regs && kexec_should_crash(thread->task))
++++ +static void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
++++ +{
++++ +  if (regs && kexec_should_crash(current))
                crash_kexec(regs);
      
        bust_spinlocks(0);
++++ +  die_owner = -1;
        add_taint(TAINT_DIE);
---- -  raw_spin_unlock_irq(&die_lock);
++++ +  die_nest_count--;
++++ +  if (!die_nest_count)
++++ +          /* Nest count reaches zero, release the lock. */
++++ +          arch_spin_unlock(&die_lock);
++++ +  raw_local_irq_restore(flags);
        oops_exit();
      
        if (in_interrupt())
                panic("Fatal exception in interrupt");
        if (panic_on_oops)
                panic("Fatal exception");
---- -  if (ret != NOTIFY_STOP)
---- -          do_exit(SIGSEGV);
++++ +  if (signr)
++++ +          do_exit(signr);
++++ +}
++++ +
++++ +/*
++++ + * This function is protected against re-entrancy.
++++ + */
++++ +void die(const char *str, struct pt_regs *regs, int err)
++++ +{
++++ +  enum bug_trap_type bug_type = BUG_TRAP_TYPE_NONE;
++++ +  unsigned long flags = oops_begin();
++++ +  int sig = SIGSEGV;
++++ +
++++ +  if (!user_mode(regs))
++++ +          bug_type = report_bug(regs->ARM_pc, regs);
++++ +  if (bug_type != BUG_TRAP_TYPE_NONE)
++++ +          str = "Oops - BUG";
++++ +
++++ +  if (__die(str, err, regs))
++++ +          sig = 0;
++++ +
++++ +  oops_end(flags, regs, sig);
      }
      
      void arm_notify_die(const char *str, struct pt_regs *regs,
@@@@@@@ -820,8 -820,8 -820,6 -820,8 -852,6 -820,6 +852,8 @@@@@@@ void __init early_trap_init(void *vecto
         */
        memcpy((void *)(vectors + KERN_SIGRETURN_CODE - CONFIG_VECTORS_BASE),
               sigreturn_codes, sizeof(sigreturn_codes));
  + ++  memcpy((void *)(vectors + KERN_RESTART_CODE - CONFIG_VECTORS_BASE),
  + ++         syscall_restart_code, sizeof(syscall_restart_code));
      
        flush_icache_range(vectors, vectors + PAGE_SIZE);
        modify_domain(DOMAIN_USER, DOMAIN_CLIENT);
diff --combined arch/arm/lib/Makefile
index 992769ae2599f1f5c050847311fabd789d308c52,992769ae2599f1f5c050847311fabd789d308c52,b621114644fdeeb06e87f6bad1a08dfb0c26fdd1,992769ae2599f1f5c050847311fabd789d308c52,d5060dab6e52af6651f57ef80fbab88dbfba0c7f,992769ae2599f1f5c050847311fabd789d308c52..2473fd1fd51cfa50ef02985e6e8d83c5f97119c8
@@@@@@@ -6,9 -6,9 -6,9 -6,9 -6,8 -6,9 +6,8 @@@@@@@
      
      lib-y             := backtrace.o changebit.o csumipv6.o csumpartial.o   \
                   csumpartialcopy.o csumpartialcopyuser.o clearbit.o \
-- ---             delay.o findbit.o memchr.o memcpy.o                \
++ +++             delay.o delay-loop.o findbit.o memchr.o memcpy.o   \
                   memmove.o memset.o memzero.o setbit.o              \
---- -             strncpy_from_user.o strnlen_user.o                 \
                   strchr.o strrchr.o                                 \
                   testchangebit.o testclearbit.o testsetbit.o        \
                   ashldi3.o ashrdi3.o lshrdi3.o muldi3.o             \
index 655878bcc96d265a2ec81f87112ba48d5b5a037e,4044abcf6f9d8d90f3bac55df229267dc09b23ed,ea6b43154090a2af00cbb168c7ef2d3a0589b2b2,4044abcf6f9d8d90f3bac55df229267dc09b23ed,ea6b43154090a2af00cbb168c7ef2d3a0589b2b2,30a031c0fcf501ef2ab022fa1fe28603591764aa..5cfc989940761f0a8aa317b3bc37270d40835178
      #include <linux/slab.h>
      #include <linux/iommu.h>
      #include <linux/vmalloc.h>
+++++ #include <linux/sizes.h>
      
      #include <asm/memory.h>
      #include <asm/highmem.h>
      #include <asm/cacheflush.h>
      #include <asm/tlbflush.h>
----- #include <asm/sizes.h>
      #include <asm/mach/arch.h>
      #include <asm/dma-iommu.h>
      #include <asm/mach/map.h>
@@@@@@@ -228,7 -228,7 -228,7 -228,7 -228,7 -228,7 +228,7 @@@@@@@ static pte_t **consistent_pte
      
      #define DEFAULT_CONSISTENT_DMA_SIZE SZ_2M
      
  - --unsigned long consistent_base = CONSISTENT_END - DEFAULT_CONSISTENT_DMA_SIZE;
  + ++static unsigned long consistent_base = CONSISTENT_END - DEFAULT_CONSISTENT_DMA_SIZE;
      
      void __init init_consistent_dma_size(unsigned long size)
      {
@@@@@@@ -268,8 -268,8 -268,10 -268,8 -268,10 -268,10 +268,8 @@@@@@@ static int __init consistent_init(void
        unsigned long base = consistent_base;
        unsigned long num_ptes = (CONSISTENT_END - base) >> PMD_SHIFT;
      
  - --#ifndef CONFIG_ARM_DMA_USE_IOMMU
  - --  if (cpu_architecture() >= CPU_ARCH_ARMv6)
  + ++  if (IS_ENABLED(CONFIG_CMA) && !IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU))
                return 0;
  - --#endif
      
        consistent_pte = kmalloc(num_ptes * sizeof(pte_t), GFP_KERNEL);
        if (!consistent_pte) {
@@@@@@@ -321,7 -321,7 -323,7 -321,7 -323,7 -323,7 +321,7 @@@@@@@ static struct arm_vmregion_head coheren
        .vm_list        = LIST_HEAD_INIT(coherent_head.vm_list),
      };
      
  - --size_t coherent_pool_size = DEFAULT_CONSISTENT_DMA_SIZE / 8;
  + ++static size_t coherent_pool_size = DEFAULT_CONSISTENT_DMA_SIZE / 8;
      
      static int __init early_coherent_pool(char *p)
      {
@@@@@@@ -340,7 -340,7 -342,7 -340,7 -342,7 -342,7 +340,7 @@@@@@@ static int __init coherent_init(void
        struct page *page;
        void *ptr;
      
  - --  if (cpu_architecture() < CPU_ARCH_ARMv6)
  + ++  if (!IS_ENABLED(CONFIG_CMA))
                return 0;
      
        ptr = __alloc_from_contiguous(NULL, size, prot, &page);
@@@@@@@ -702,7 -702,7 -704,7 -702,7 -704,7 -704,7 +702,7 @@@@@@@ static void *__dma_alloc(struct device 
      
        if (arch_is_coherent() || nommu())
                addr = __alloc_simple_buffer(dev, size, gfp, &page);
  - --  else if (cpu_architecture() < CPU_ARCH_ARMv6)
  + ++  else if (!IS_ENABLED(CONFIG_CMA))
                addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller);
        else if (gfp & GFP_ATOMIC)
                addr = __alloc_from_pool(dev, size, &page, caller);
@@@@@@@ -771,7 -771,7 -773,7 -771,7 -773,7 -773,7 +771,7 @@@@@@@ void arm_dma_free(struct device *dev, s
      
        if (arch_is_coherent() || nommu()) {
                __dma_free_buffer(page, size);
  - --  } else if (cpu_architecture() < CPU_ARCH_ARMv6) {
  + ++  } else if (!IS_ENABLED(CONFIG_CMA)) {
                __dma_free_remap(cpu_addr, size);
                __dma_free_buffer(page, size);
        } else {
@@@@@@@ -1067,7 -1067,7 -1069,7 -1067,7 -1069,7 -1069,7 +1067,7 @@@@@@@ static struct page **__iommu_alloc_buff
                return NULL;
      
        while (count) {
  - --          int j, order = __ffs(count);
  + ++          int j, order = __fls(count);
      
                pages[i] = alloc_pages(gfp | __GFP_NOWARN, order);
                while (!pages[i] && order)
        while (--i)
                if (pages[i])
                        __free_pages(pages[i], 0);
 -----  if (array_size < PAGE_SIZE)
 +++++  if (array_size <= PAGE_SIZE)
                kfree(pages);
        else
                vfree(pages);
@@@@@@@ -1106,7 -1106,7 -1108,7 -1106,7 -1108,7 -1108,7 +1106,7 @@@@@@@ static int __iommu_free_buffer(struct d
        for (i = 0; i < count; i++)
                if (pages[i])
                        __free_pages(pages[i], 0);
 -----  if (array_size < PAGE_SIZE)
 +++++  if (array_size <= PAGE_SIZE)
                kfree(pages);
        else
                vfree(pages);
diff --combined arch/arm/mm/init.c
index f54d59219764bc314b1cd10c587ea76f87fd70a9,f54d59219764bc314b1cd10c587ea76f87fd70a9,c21d06c7dd7ec0ae4bdf036b22b74983aa2e5c6f,f54d59219764bc314b1cd10c587ea76f87fd70a9,c21d06c7dd7ec0ae4bdf036b22b74983aa2e5c6f,ad7fd8ae8258a85c7c58471596fe44d9c428bbbc..9aec41fa80ae31a23429db805bc1800fd7b19cbd
      #include <linux/gfp.h>
      #include <linux/memblock.h>
      #include <linux/dma-contiguous.h>
+++++ #include <linux/sizes.h>
      
      #include <asm/mach-types.h>
      #include <asm/memblock.h>
      #include <asm/prom.h>
      #include <asm/sections.h>
      #include <asm/setup.h>
----- #include <asm/sizes.h>
      #include <asm/tlb.h>
      #include <asm/fixmap.h>
      
@@@@@@@ -212,7 -212,7 -212,7 -212,7 -212,7 -212,7 +212,7 @@@@@@@ EXPORT_SYMBOL(arm_dma_zone_size)
       * allocations.  This must be the smallest DMA mask in the system,
       * so a successful GFP_DMA allocation will always satisfy this.
       */
  - --u32 arm_dma_limit;
  + ++phys_addr_t arm_dma_limit;
      
      static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole,
        unsigned long dma_size)
diff --combined arch/arm/mm/mmu.c
index cf4528d5177448fb79cb5dc6689c873c2dbddb4a,cf4528d5177448fb79cb5dc6689c873c2dbddb4a,e5dad60b558b468315294b2c8b95c70193b6f74d,cf4528d5177448fb79cb5dc6689c873c2dbddb4a,f37dc1856a692804a4e65d9c0ff981069170e07e,2196116c882f9b09c4e447fc382f84645a1df370..4c2d0451e84af1c2a0347a6fe462dd2e3306db3e
      #include <linux/memblock.h>
      #include <linux/fs.h>
      #include <linux/vmalloc.h>
+++++ #include <linux/sizes.h>
      
      #include <asm/cp15.h>
      #include <asm/cputype.h>
      #include <asm/sections.h>
      #include <asm/cachetype.h>
      #include <asm/setup.h>
----- #include <asm/sizes.h>
      #include <asm/smp_plat.h>
      #include <asm/tlb.h>
      #include <asm/highmem.h>
@@@@@@@ -421,12 -421,12 -421,12 -421,12 -421,6 -421,12 +421,6 @@@@@@@ static void __init build_mem_type_table
        cp = &cache_policies[cachepolicy];
        vecs_pgprot = kern_pgprot = user_pgprot = cp->pte;
      
---- -  /*
---- -   * Only use write-through for non-SMP systems
---- -   */
---- -  if (!is_smp() && cpu_arch >= CPU_ARCH_ARMv5 && cachepolicy > CPOLICY_WRITETHROUGH)
---- -          vecs_pgprot = cache_policies[CPOLICY_WRITETHROUGH].pte;
---- -
        /*
         * Enable CPU-specific coherency if supported.
         * (Only available on XSC3 at the moment.)
@@@@@@@ -791,79 -791,79 -791,6 -791,79 -785,6 -791,6 +785,79 @@@@@@@ void __init iotable_init(struct map_des
        }
      }
      
  + ++#ifndef CONFIG_ARM_LPAE
  + ++
  + ++/*
  + ++ * The Linux PMD is made of two consecutive section entries covering 2MB
  + ++ * (see definition in include/asm/pgtable-2level.h).  However a call to
  + ++ * create_mapping() may optimize static mappings by using individual
  + ++ * 1MB section mappings.  This leaves the actual PMD potentially half
  + ++ * initialized if the top or bottom section entry isn't used, leaving it
  + ++ * open to problems if a subsequent ioremap() or vmalloc() tries to use
  + ++ * the virtual space left free by that unused section entry.
  + ++ *
  + ++ * Let's avoid the issue by inserting dummy vm entries covering the unused
  + ++ * PMD halves once the static mappings are in place.
  + ++ */
  + ++
  + ++static void __init pmd_empty_section_gap(unsigned long addr)
  + ++{
  + ++  struct vm_struct *vm;
  + ++
  + ++  vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));
  + ++  vm->addr = (void *)addr;
  + ++  vm->size = SECTION_SIZE;
  + ++  vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
  + ++  vm->caller = pmd_empty_section_gap;
  + ++  vm_area_add_early(vm);
  + ++}
  + ++
  + ++static void __init fill_pmd_gaps(void)
  + ++{
  + ++  struct vm_struct *vm;
  + ++  unsigned long addr, next = 0;
  + ++  pmd_t *pmd;
  + ++
  + ++  /* we're still single threaded hence no lock needed here */
  + ++  for (vm = vmlist; vm; vm = vm->next) {
  + ++          if (!(vm->flags & VM_ARM_STATIC_MAPPING))
  + ++                  continue;
  + ++          addr = (unsigned long)vm->addr;
  + ++          if (addr < next)
  + ++                  continue;
  + ++
  + ++          /*
  + ++           * Check if this vm starts on an odd section boundary.
  + ++           * If so and the first section entry for this PMD is free
  + ++           * then we block the corresponding virtual address.
  + ++           */
  + ++          if ((addr & ~PMD_MASK) == SECTION_SIZE) {
  + ++                  pmd = pmd_off_k(addr);
  + ++                  if (pmd_none(*pmd))
  + ++                          pmd_empty_section_gap(addr & PMD_MASK);
  + ++          }
  + ++
  + ++          /*
  + ++           * Then check if this vm ends on an odd section boundary.
  + ++           * If so and the second section entry for this PMD is empty
  + ++           * then we block the corresponding virtual address.
  + ++           */
  + ++          addr += vm->size;
  + ++          if ((addr & ~PMD_MASK) == SECTION_SIZE) {
  + ++                  pmd = pmd_off_k(addr) + 1;
  + ++                  if (pmd_none(*pmd))
  + ++                          pmd_empty_section_gap(addr);
  + ++          }
  + ++
  + ++          /* no need to look at any vm entry until we hit the next PMD */
  + ++          next = (addr + PMD_SIZE - 1) & PMD_MASK;
  + ++  }
  + ++}
  + ++
  + ++#else
  + ++#define fill_pmd_gaps() do { } while (0)
  + ++#endif
  + ++
      static void * __initdata vmalloc_min =
        (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET);
      
@@@@@@@ -1145,7 -1145,7 -1072,6 -1145,7 -1066,6 -1072,6 +1139,7 @@@@@@@ static void __init devicemaps_init(stru
         */
        if (mdesc->map_io)
                mdesc->map_io();
  + ++  fill_pmd_gaps();
      
        /*
         * Finally flush the caches and tlb to ensure that we're in a
index c17923ec6e9505cee3f15c80670f63d9e0644916,c17923ec6e9505cee3f15c80670f63d9e0644916,4ad721fb84052a61c3452d12532bcc9d21c9a84a,c17923ec6e9505cee3f15c80670f63d9e0644916,4ad721fb84052a61c3452d12532bcc9d21c9a84a,d394b9330b0ceae67b028d0600301111b7083f64..d3553b5d3fcabd851d6cce4b6eab6eb6bca80cbc
      #include <linux/delay.h>
      #include <linux/types.h>
      #include <linux/pinctrl/consumer.h>
+++++ #include <linux/sizes.h>
      
      #include <asm/io.h>
----- #include <asm/sizes.h>
      
      #define UART_NR                   14
      
@@@@@@@ -133,10 -133,10 -133,6 -133,10 -133,6 -133,6 +133,10 @@@@@@@ struct pl011_dmatx_data 
      struct uart_amba_port {
        struct uart_port        port;
        struct clk              *clk;
  + ++  /* Two optional pin states - default & sleep */
  + ++  struct pinctrl          *pinctrl;
  + ++  struct pinctrl_state    *pins_default;
  + ++  struct pinctrl_state    *pins_sleep;
        const struct vendor_data *vendor;
        unsigned int            dmacr;          /* dma control reg */
        unsigned int            im;             /* interrupt mask */
@@@@@@@ -1316,14 -1316,14 -1312,6 -1316,14 -1312,6 -1312,6 +1316,14 @@@@@@@ static int pl011_startup(struct uart_po
        unsigned int cr;
        int retval;
      
  + ++  /* Optionaly enable pins to be muxed in and configured */
  + ++  if (!IS_ERR(uap->pins_default)) {
  + ++          retval = pinctrl_select_state(uap->pinctrl, uap->pins_default);
  + ++          if (retval)
  + ++                  dev_err(port->dev,
  + ++                          "could not set default pins\n");
  + ++  }
  + ++
        retval = clk_prepare(uap->clk);
        if (retval)
                goto out;
@@@@@@@ -1432,7 -1432,7 -1420,6 -1432,7 -1420,6 -1420,6 +1432,7 @@@@@@@ static void pl011_shutdown(struct uart_
      {
        struct uart_amba_port *uap = (struct uart_amba_port *)port;
        unsigned int cr;
  + ++  int retval;
      
        /*
         * disable all interrupts
         */
        clk_disable(uap->clk);
        clk_unprepare(uap->clk);
  + ++  /* Optionally let pins go into sleep states */
  + ++  if (!IS_ERR(uap->pins_sleep)) {
  + ++          retval = pinctrl_select_state(uap->pinctrl, uap->pins_sleep);
  + ++          if (retval)
  + ++                  dev_err(port->dev,
  + ++                          "could not set pins to sleep state\n");
  + ++  }
  + ++
      
        if (uap->port.dev->platform_data) {
                struct amba_pl011_data *plat;
@@@@@@@ -1813,14 -1813,14 -1792,6 -1813,14 -1792,6 -1792,6 +1813,14 @@@@@@@ static int __init pl011_console_setup(s
        if (!uap)
                return -ENODEV;
      
  + ++  /* Allow pins to be muxed in and configured */
  + ++  if (!IS_ERR(uap->pins_default)) {
  + ++          ret = pinctrl_select_state(uap->pinctrl, uap->pins_default);
  + ++          if (ret)
  + ++                  dev_err(uap->port.dev,
  + ++                          "could not set default pins\n");
  + ++  }
  + ++
        ret = clk_prepare(uap->clk);
        if (ret)
                return ret;
@@@@@@@ -1873,6 -1873,6 -1844,7 -1873,6 -1844,7 -1844,7 +1873,6 @@@@@@@ static int pl011_probe(struct amba_devi
      {
        struct uart_amba_port *uap;
        struct vendor_data *vendor = id->data;
  - --  struct pinctrl *pinctrl;
        void __iomem *base;
        int i, ret;
      
                goto free;
        }
      
  - --  pinctrl = devm_pinctrl_get_select_default(&dev->dev);
  - --  if (IS_ERR(pinctrl)) {
  - --          ret = PTR_ERR(pinctrl);
  + ++  uap->pinctrl = devm_pinctrl_get(&dev->dev);
  + ++  if (IS_ERR(uap->pinctrl)) {
  + ++          ret = PTR_ERR(uap->pinctrl);
                goto unmap;
        }
  + ++  uap->pins_default = pinctrl_lookup_state(uap->pinctrl,
  + ++                                           PINCTRL_STATE_DEFAULT);
  + ++  if (IS_ERR(uap->pins_default))
  + ++          dev_err(&dev->dev, "could not get default pinstate\n");
  + ++
  + ++  uap->pins_sleep = pinctrl_lookup_state(uap->pinctrl,
  + ++                                         PINCTRL_STATE_SLEEP);
  + ++  if (IS_ERR(uap->pins_sleep))
  + ++          dev_dbg(&dev->dev, "could not get sleep pinstate\n");
      
        uap->clk = clk_get(&dev->dev, NULL);
        if (IS_ERR(uap->clk)) {