1. 24 Apr, 2013 6 commits
    • Dave Martin's avatar
      ARM: mcpm_head.S: vlock-based first man election · 1ae98561
      Dave Martin authored
      Instead of requiring the first man to be elected in advance (which
      can be suboptimal in some situations), this patch uses a per-
      cluster mutex to co-ordinate selection of the first man.
      
      This should also make it more feasible to reuse this code path for
      asynchronous cluster resume (as in CPUidle scenarios).
      
      We must ensure that the vlock data doesn't share a cacheline with
      anything else, or dirty cache eviction could corrupt it.
      Signed-off-by: default avatarDave Martin <dave.martin@linaro.org>
      Signed-off-by: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
      Reviewed-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Reviewed-by: default avatarWill Deacon <will.deacon@arm.com>
      1ae98561
    • Dave Martin's avatar
      ARM: mcpm: Add baremetal voting mutexes · 9762f12d
      Dave Martin authored
      This patch adds a simple low-level voting mutex implementation
      to be used to arbitrate during first man selection when no load/store
      exclusive instructions are usable.
      
      For want of a better name, these are called "vlocks".  (I was
      tempted to call them ballot locks, but "block" is way too confusing
      an abbreviation...)
      
      There is no function to wait for the lock to be released, and no
      vlock_lock() function since we don't need these at the moment.
      These could straightforwardly be added if vlocks get used for other
      purposes.
      
      For architectural correctness even Strongly-Ordered memory accesses
      require barriers in order to guarantee that multiple CPUs have a
      coherent view of the ordering of memory accesses.  Whether or not
      this matters depends on hardware implementation details of the
      memory system.  Since the purpose of this code is to provide a clean,
      generic locking mechanism with no platform-specific dependencies the
      barriers should be present to avoid unpleasant surprises on future
      platforms.
      
      Note:
      
        * When taking the lock, we don't care about implicit background
          memory operations and other signalling which may be pending,
          because those are not part of the critical section anyway.
      
          A DMB is sufficient to ensure correctly observed ordering if
          the explicit memory accesses in vlock_trylock.
      
        * No barrier is required after checking the election result,
          because the result is determined by the store to
          VLOCK_OWNER_OFFSET and is already globally observed due to the
          barriers in voting_end.  This means that global agreement on
          the winner is guaranteed, even before the winner is known
          locally.
      Signed-off-by: default avatarDave Martin <dave.martin@linaro.org>
      Signed-off-by: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
      Reviewed-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Reviewed-by: default avatarWill Deacon <will.deacon@arm.com>
      9762f12d
    • Dave Martin's avatar
      ARM: mcpm: introduce helpers for platform coherency exit/setup · 7fe31d28
      Dave Martin authored
      This provides helper methods to coordinate between CPUs coming down
      and CPUs going up, as well as documentation on the used algorithms,
      so that cluster teardown and setup
      operations are not done for a cluster simultaneously.
      
      For use in the power_down() implementation:
        * __mcpm_cpu_going_down(unsigned int cluster, unsigned int cpu)
        * __mcpm_outbound_enter_critical(unsigned int cluster)
        * __mcpm_outbound_leave_critical(unsigned int cluster)
        * __mcpm_cpu_down(unsigned int cluster, unsigned int cpu)
      
      The power_up_setup() helper should do platform-specific setup in
      preparation for turning the CPU on, such as invalidating local caches
      or entering coherency.  It must be assembler for now, since it must
      run before the MMU can be switched on.  It is passed the affinity level
      for which initialization should be performed.
      
      Because the mcpm_sync_struct content is looked-up and modified
      with the cache enabled or disabled depending on the code path, it is
      crucial to always ensure proper cache maintenance to update main memory
      right away.  The sync_cache_*() helpers are used to that end.
      
      Also, in order to prevent a cached writer from interfering with an
      adjacent non-cached writer, we ensure each state variable is located to
      a separate cache line.
      
      Thanks to Nicolas Pitre and Achin Gupta for the help with this
      patch.
      Signed-off-by: default avatarDave Martin <dave.martin@linaro.org>
      Signed-off-by: default avatarNicolas Pitre <nico@linaro.org>
      Reviewed-by: default avatarWill Deacon <will.deacon@arm.com>
      7fe31d28
    • Nicolas Pitre's avatar
      ARM: mcpm: introduce the CPU/cluster power API · 7c2b8605
      Nicolas Pitre authored
      This is the basic API used to handle the powering up/down of individual
      CPUs in a (multi-)cluster system.  The platform specific backend
      implementation has the responsibility to also handle the cluster level
      power as well when the first/last CPU in a cluster is brought up/down.
      Signed-off-by: default avatarNicolas Pitre <nico@linaro.org>
      Reviewed-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Reviewed-by: default avatarWill Deacon <will.deacon@arm.com>
      7c2b8605
    • Nicolas Pitre's avatar
      ARM: multi-cluster PM: secondary kernel entry code · e8db288e
      Nicolas Pitre authored
      CPUs in cluster based systems, such as big.LITTLE, have special needs
      when entering the kernel due to a hotplug event, or when resuming from
      a deep sleep mode.
      
      This is vectorized so multiple CPUs can enter the kernel in parallel
      without serialization.
      
      The mcpm prefix stands for "multi cluster power management", however
      this is usable on single cluster systems as well.  Only the basic
      structure is introduced here.  This will be extended with later patches.
      
      In order not to complexify things more than they currently have to,
      the planned work to make runtime adjusted MPIDR based indexing and
      dynamic memory allocation for cluster states is postponed to a later
      cycle. The MAX_NR_CLUSTERS and MAX_CPUS_PER_CLUSTER static definitions
      should be sufficient for those systems expected to be available in the
      near future.
      Signed-off-by: default avatarNicolas Pitre <nico@linaro.org>
      Reviewed-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Reviewed-by: default avatarWill Deacon <will.deacon@arm.com>
      e8db288e
    • Nicolas Pitre's avatar
      ARM: cacheflush: add synchronization helpers for mixed cache state accesses · 0c91e7e0
      Nicolas Pitre authored
      Algorithms used by the MCPM layer rely on state variables which are
      accessed while the cache is either active or inactive, depending
      on the code path and the active state.
      
      This patch introduces generic cache maintenance helpers to provide the
      necessary cache synchronization for such state variables to always hit
      main memory in an ordered way.
      Signed-off-by: default avatarNicolas Pitre <nico@linaro.org>
      Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: default avatarDave Martin <dave.martin@linaro.org>
      0c91e7e0
  2. 18 Mar, 2013 1 commit
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm · 6210d421
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "Just three fixes this time - a fix for a fix for our memset function,
        fixing the dummy clockevent so that it doesn't interfere with real
        hardware clockevents, and fixing a build error for Tegra."
      
      * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
        ARM: 7675/1: amba: tegra-ahb: Fix build error w/ PM_SLEEP w/o PM_RUNTIME
        ARM: 7674/1: smp: Avoid dummy clockevent being preferred over real hardware clock-event
        ARM: 7670/1: fix the memset fix
      6210d421
  3. 17 Mar, 2013 4 commits
    • Linus Torvalds's avatar
      Linux 3.9-rc3 · a937536b
      Linus Torvalds authored
      a937536b
    • David Rientjes's avatar
      perf,x86: fix link failure for non-Intel configs · 6c4d3bc9
      David Rientjes authored
      Commit 1d9d8639 ("perf,x86: fix kernel crash with PEBS/BTS after
      suspend/resume") introduces a link failure since
      perf_restore_debug_store() is only defined for CONFIG_CPU_SUP_INTEL:
      
      	arch/x86/power/built-in.o: In function `restore_processor_state':
      	(.text+0x45c): undefined reference to `perf_restore_debug_store'
      
      Fix it by defining the dummy function appropriately.
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6c4d3bc9
    • Linus Torvalds's avatar
      perf,x86: fix wrmsr_on_cpu() warning on suspend/resume · 2a6e06b2
      Linus Torvalds authored
      Commit 1d9d8639 ("perf,x86: fix kernel crash with PEBS/BTS after
      suspend/resume") fixed a crash when doing PEBS performance profiling
      after resuming, but in using init_debug_store_on_cpu() to restore the
      DS_AREA mtrr it also resulted in a new WARN_ON() triggering.
      
      init_debug_store_on_cpu() uses "wrmsr_on_cpu()", which in turn uses CPU
      cross-calls to do the MSR update.  Which is not really valid at the
      early resume stage, and the warning is quite reasonable.  Now, it all
      happens to _work_, for the simple reason that smp_call_function_single()
      ends up just doing the call directly on the CPU when the CPU number
      matches, but we really should just do the wrmsr() directly instead.
      
      This duplicates the wrmsr() logic, but hopefully we can just remove the
      wrmsr_on_cpu() version eventually.
      Reported-and-tested-by: default avatarParag Warudkar <parag.lkml@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2a6e06b2
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 08637024
      Linus Torvalds authored
      Pull btrfs fixes from Chris Mason:
       "Eric's rcu barrier patch fixes a long standing problem with our
        unmount code hanging on to devices in workqueue helpers.  Liu Bo
        nailed down a difficult assertion for in-memory extent mappings."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        Btrfs: fix warning of free_extent_map
        Btrfs: fix warning when creating snapshots
        Btrfs: return as soon as possible when edquot happens
        Btrfs: return EIO if we have extent tree corruption
        btrfs: use rcu_barrier() to wait for bdev puts at unmount
        Btrfs: remove btrfs_try_spin_lock
        Btrfs: get better concurrency for snapshot-aware defrag work
      08637024
  4. 16 Mar, 2013 8 commits
    • Liu Bo's avatar
      Btrfs: fix warning of free_extent_map · 3b277594
      Liu Bo authored
      Users report that an extent map's list is still linked when it's actually
      going to be freed from cache.
      
      The story is that
      
      a) when we're going to drop an extent map and may split this large one into
      smaller ems, and if this large one is flagged as EXTENT_FLAG_LOGGING which means
      that it's on the list to be logged, then the smaller ems split from it will also
      be flagged as EXTENT_FLAG_LOGGING, and this is _not_ expected.
      
      b) we'll keep ems from unlinking the list and freeing when they are flagged with
      EXTENT_FLAG_LOGGING, because the log code holds one reference.
      
      The end result is the warning, but the truth is that we set the flag
      EXTENT_FLAG_LOGGING only during fsync.
      
      So clear flag EXTENT_FLAG_LOGGING for extent maps split from a large one.
      Reported-by: default avatarJohannes Hirte <johannes.hirte@fem.tu-ilmenau.de>
      Reported-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      3b277594
    • Linus Torvalds's avatar
      Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild · e2043785
      Linus Torvalds authored
      Pull kbuild fix from Michal Marek:
       "One fix for for make headers_install/headers_check to not require make
        3.81.  The requirement has been accidentally introduced in 3.7."
      
      * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
        kbuild: fix make headers_check with make 3.80
      e2043785
    • Linus Torvalds's avatar
      Merge tag 'for-3.9-rc3' of git://openrisc.net/jonas/linux · 23659587
      Linus Torvalds authored
      Pull OpenRISC bug fixes from Jonas Bonn:
      
       - The GPIO descriptor work has exposed how broken the non-GPIOLIB bits
         for OpenRISC were.  We now require GPIOLIB as this is the preferred
         way forward.
      
       - The system.h split introduced a bug in llist.h for arches using
         asm-generic/cmpxchg.h directly, which is currently only OpenRISC.
         The patch here moves two defines from asm-generic/atomic.h to
         asm-generic/cmpxchg.h to make things work as they should.
      
       - The VIRT_TO_BUS selector was added for OpenRISC, but OpenRISC does
         not have the virt_to_bus methods, so there's a patch to remove it
         again.
      
      * tag 'for-3.9-rc3' of git://openrisc.net/jonas/linux:
        openrisc: remove HAVE_VIRT_TO_BUS
        asm-generic: move cmpxchg*_local defs to cmpxchg.h
        openrisc: require gpiolib
      23659587
    • Linus Torvalds's avatar
      Merge tag 'char-misc-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 9e1a0aab
      Linus Torvalds authored
      Pull char/misc fixes from Greg Kroah-Hartman:
       "Here are some tiny fixes for the w1 drivers and the final removal
        patch for getting rid of CONFIG_EXPERIMENTAL (all users of it are now
        gone from your tree, this just drops the Kconfig item itself.)
      
        All have been in the linux-next tree for a while"
      
      * tag 'char-misc-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        final removal of CONFIG_EXPERIMENTAL
        w1: fix oops when w1_search is called from netlink connector
        w1-gpio: fix unused variable warning
        w1-gpio: remove erroneous __exit and __exit_p()
        ARM: w1-gpio: fix erroneous gpio requests
      9e1a0aab
    • Linus Torvalds's avatar
      Merge tag 'sound-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 5cd8846c
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of small fixes, as expected for the middle rc:
         - A couple of fixes for potential NULL dereferences and out-of-range
           array accesses revealed by static code parsers
         - A fix for the wrong error handling detected by trinity
         - A regression fix for missing audio on some MacBooks
         - CA0132 DSP loader fixes
         - Fix for EAPD control of IDT codecs on machines w/o speaker
         - Fix a regression in the HD-audio widget list parser code
         - Workaround for the NuForce UDH-100 USB audio"
      
      * tag 'sound-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - Fix missing EAPD/GPIO setup for Cirrus codecs
        sound: sequencer: cap array index in seq_chn_common_event()
        ALSA: hda/ca0132 - Remove extra setting of dsp_state.
        ALSA: hda/ca0132 - Check download state of DSP.
        ALSA: hda/ca0132 - Check if dspload_image succeeded.
        ALSA: hda - Disable IDT eapd_switch if there are no internal speakers
        ALSA: hda - Fix snd_hda_get_num_raw_conns() to return a correct value
        ALSA: usb-audio: add a workaround for the NuForce UDH-100
        ALSA: asihpi - fix potential NULL pointer dereference
        ALSA: seq: Fix missing error handling in snd_seq_timer_open()
      5cd8846c
    • Linus Torvalds's avatar
      Merge branch 'fixes-for-3.9' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping · c7f17deb
      Linus Torvalds authored
      Pull DMA-mapping fix from Marek Szyprowski:
       "An important fix for all ARM architectures which use ZONE_DMA.
        Without it dma_alloc_* calls with GFP_ATOMIC flag might have allocated
        buffers outsize DMA zone."
      
      * 'fixes-for-3.9' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping:
        ARM: DMA-mapping: add missing GFP_DMA flag for atomic buffer allocation
      c7f17deb
    • Linus Torvalds's avatar
      Merge tag 'mfd-fixes-3.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-fixes · de1893f6
      Linus Torvalds authored
      Pull MFD fixes from Samuel Ortiz:
       "This is the first batch of MFD fixes for 3.9.
      
        With this one we have:
      
         - An ab8500 build failure fix.
         - An ab8500 device tree parsing fix.
         - A fix for twl4030_madc remove routine to work properly (when
           built-in).
         - A fix for properly registering palmas interrupt handler.
         - A fix for omap-usb init routine to actually write into the
           hostconfig register.
         - A couple of warning fixes for ab8500-gpadc and tps65912"
      
      * tag 'mfd-fixes-3.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-fixes:
        mfd: twl4030-madc: Remove __exit_p annotation
        mfd: ab8500: Kill "reg" property from binding
        mfd: ab8500-gpadc: Complain if we fail to enable vtvout LDO
        mfd: wm831x: Don't forward declare enum wm831x_auxadc
        mfd: twl4030-audio: Fix argument type for twl4030_audio_disable_resource()
        mfd: tps65912: Declare and use tps65912_irq_exit()
        mfd: palmas: Provide irq flags through DT/platform data
        mfd: Make AB8500_CORE select POWER_SUPPLY to fix build error
        mfd: omap-usb-host: Actually update hostconfig
      de1893f6
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging · 92fbb1c9
      Linus Torvalds authored
      Pull hwmon fixes from Guenter Roeck:
       "Bug fixes for pmbus, ltc2978, and lineage-pem drivers
      
        Added specific maintainer for some hwmon drivers"
      
      * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (pmbus/ltc2978) Fix temperature reporting
        hwmon: (pmbus) Fix krealloc() misuse in pmbus_add_attribute()
        hwmon: (lineage-pem) Add missing terminating entry for pem_[input|fan]_attributes
        MAINTAINERS: Add maintainer for MAX6697, INA209, and INA2XX drivers
      92fbb1c9
  5. 15 Mar, 2013 10 commits
  6. 14 Mar, 2013 11 commits