1. 04 Apr, 2013 10 commits
  2. 03 Apr, 2013 7 commits
  3. 02 Apr, 2013 2 commits
    • Mike Turquette's avatar
      clk: allow reentrant calls into the clk framework · 533ddeb1
      Mike Turquette authored
      Reentrancy into the clock framework is necessary for clock operations
      that result in nested calls to the clk api.  A common example is a clock
      that is prepared via an i2c transaction, such as a clock inside of a
      discrete audio chip or a power management IC.  The i2c subsystem itself
      will use the clk api resulting in a deadlock:
      
      clk_prepare(audio_clk)
      	i2c_transfer(..)
      		clk_prepare(i2c_controller_clk)
      
      The ability to reenter the clock framework prevents this deadlock.
      
      Other use cases exist such as allowing .set_rate callbacks to call
      clk_set_parent to achieve the best rate, or to save power in certain
      configurations.  Yet another example is performing pinctrl operations
      from a clk_ops callback.  Calls into the pinctrl subsystem may call
      clk_{un}prepare on an unrelated clock.  Allowing for nested calls to
      reenter the clock framework enables both of these use cases.
      
      Reentrancy is implemented by two global pointers that track the owner
      currently holding a global lock.  One pointer tracks the owner during
      sleepable, mutex-protected operations and the other one tracks the owner
      during non-interruptible, spinlock-protected operations.
      
      When the clk framework is entered we try to hold the global lock.  If it
      is held we compare the current task against the current owner; a match
      implies a nested call and we reenter.  If the values do not match then
      we block on the lock until it is released.
      Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
      Cc: Rajagopal Venkat <rajagopal.venkat@linaro.org>
      Cc: David Brown <davidb@codeaurora.org>
      Tested-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      533ddeb1
    • Mike Turquette's avatar
      clk: abstract locking out into helper functions · eab89f69
      Mike Turquette authored
      Create locking helpers for the global mutex and global spinlock.  The
      definitions of these helpers will be expanded upon in the next patch
      which introduces reentrancy into the locking scheme.
      Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
      Cc: Rajagopal Venkat <rajagopal.venkat@linaro.org>
      Cc: David Brown <davidb@codeaurora.org>
      Tested-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      eab89f69
  4. 27 Mar, 2013 6 commits
  5. 26 Mar, 2013 1 commit
    • Prashant Gaikwad's avatar
      clk: Add composite clock type · ece70094
      Prashant Gaikwad authored
      Not all clocks are required to be decomposed into basic clock
      types but at the same time want to use the functionality
      provided by these basic clock types instead of duplicating.
      
      For example, Tegra SoC has ~100 clocks which can be decomposed
      into Mux -> Div -> Gate clock types making the clock count to
      ~300. Also, parent change operation can not be performed on gate
      clock which forces to use mux clock in driver if want to change
      the parent.
      
      Instead aggregate the basic clock types functionality into one
      clock and just use this clock for all operations. This clock
      type re-uses the functionality of basic clock types and not
      limited to basic clock types but any hardware-specific
      implementation.
      Signed-off-by: default avatarPrashant Gaikwad <pgaikwad@nvidia.com>
      Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
      ece70094
  6. 23 Mar, 2013 8 commits
  7. 22 Mar, 2013 6 commits
    • Linus Torvalds's avatar
      Merge git://git.infradead.org/users/willy/linux-nvme · 5da273fe
      Linus Torvalds authored
      Pull NVMe driver update from Matthew Wilcox:
       "These patches have mostly been baking for a few months; sorry I didn't
        get them in during the merge window.  They're all bug fixes, except
        for the addition of the SMART log and the addition to MAINTAINERS."
      
      * git://git.infradead.org/users/willy/linux-nvme:
        NVMe: Add namespaces with no LBA range feature
        MAINTAINERS: Add entry for the NVMe driver
        NVMe: Initialize iod nents to 0
        NVMe: Define SMART log
        NVMe: Add result to nvme_get_features
        NVMe: Set result from user admin command
        NVMe: End queued bio requests when freeing queue
        NVMe: Free cmdid on nvme_submit_bio error
      5da273fe
    • Linus Torvalds's avatar
      Merge branch 'akpm' (fixes from Andrew) · 14629ed3
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton.
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mqueue: sys_mq_open: do not call mnt_drop_write() if read-only
        mm/hotplug: only free wait_table if it's allocated by vmalloc
        dma-debug: update DMA debug API to better handle multiple mappings of a buffer
        dma-debug: fix locking bug in check_unmap()
        drivers/rtc/rtc-at91rm9200.c: use a variable for storing IMR
        drivers/video/ep93xx-fb.c: include <linux/io.h> for devm_ioremap()
        drivers/rtc/rtc-da9052.c: fix for rtc device registration
        mm: zone_end_pfn is too small
        poweroff: change orderly_poweroff() to use schedule_work()
        mm/hugetlb: fix total hugetlbfs pages count when using memory overcommit accouting
        printk: Provide a wake_up_klogd() off-case
        irq_work.h: fix warning when CONFIG_IRQ_WORK=n
      14629ed3
    • Vladimir Davydov's avatar
      mqueue: sys_mq_open: do not call mnt_drop_write() if read-only · 38d78e58
      Vladimir Davydov authored
      mnt_drop_write() must be called only if mnt_want_write() succeeded,
      otherwise the mnt_writers counter will diverge.
      
      mnt_writers counters are used to check if remounting FS as read-only is
      OK, so after an extra mnt_drop_write() call, it would be impossible to
      remount mqueue FS as read-only.  Besides, on umount a warning would be
      printed like this one:
      
        =====================================
        [ BUG: bad unlock balance detected! ]
        3.9.0-rc3 #5 Not tainted
        -------------------------------------
        a.out/12486 is trying to release lock (sb_writers) at:
        mnt_drop_write+0x1f/0x30
        but there are no more locks to release!
      Signed-off-by: default avatarVladimir Davydov <vdavydov@parallels.com>
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      38d78e58
    • Jianguo Wu's avatar
      mm/hotplug: only free wait_table if it's allocated by vmalloc · ca4b3f30
      Jianguo Wu authored
      zone->wait_table may be allocated from bootmem, it can not be freed.
      Signed-off-by: default avatarJianguo Wu <wujianguo@huawei.com>
      Reviewed-by: default avatarTang Chen <tangchen@cn.fujitsu.com>
      Cc: Tang Chen <tangchen@cn.fujitsu.com>
      Cc: Jiang Liu <jiang.liu@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ca4b3f30
    • Alexander Duyck's avatar
      dma-debug: update DMA debug API to better handle multiple mappings of a buffer · 96e7d7a1
      Alexander Duyck authored
      There were reports of the igb driver unmapping buffers without calling
      dma_mapping_error.  On closer inspection issues were found in the DMA
      debug API and how it handled multiple mappings of the same buffer.
      
      The issue I found is the fact that the debug_dma_mapping_error would
      only set the map_err_type to MAP_ERR_CHECKED in the case that the was
      only one match for device and device address.  However in the case of
      non-IOMMU, multiple addresses existed and as a result it was not setting
      this field once a second mapping was instantiated.  I have resolved this
      by changing the search so that it instead will now set MAP_ERR_CHECKED
      on the first buffer that matches the device and DMA address that is
      currently in the state MAP_ERR_NOT_CHECKED.
      
      A secondary side effect of this patch is that in the case of multiple
      buffers using the same address only the last mapping will have a valid
      map_err_type.  The previous mappings will all end up with map_err_type
      set to MAP_ERR_CHECKED because of the dma_mapping_error call in
      debug_dma_map_page.  However this behavior may be preferable as it means
      you will likely only see one real error per multi-mapped buffer, versus
      the current behavior of multiple false errors mer multi-mapped buffer.
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Reviewed-by: default avatarShuah Khan <shuah.khan@hp.com>
      Tested-by: default avatarShuah Khan <shuah.khan@hp.com>
      Cc: Jakub Kicinski <kubakici@wp.pl>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      96e7d7a1
    • Alexander Duyck's avatar
      dma-debug: fix locking bug in check_unmap() · 8d640a51
      Alexander Duyck authored
      In check_unmap() it is possible to get into a dead-locked state if
      dma_mapping_error is called.  The problem is that the bucket is locked in
      check_unmap, and locked again by debug_dma_mapping_error which is called
      by dma_mapping_error.  To resolve that we must release the lock on the
      bucket before making the call to dma_mapping_error.
      
      [akpm@linux-foundation.org: restore 80-col trickery to be consistent with the rest of the file]
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Reviewed-by: default avatarShuah Khan <shuah.khan@hp.com>
      Tested-by: default avatarShuah Khan <shuah.khan@hp.com>
      Cc: Jakub Kicinski <kubakici@wp.pl>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8d640a51