1. 08 9月, 2012 1 次提交
    • V
      ARM: OMAP: omap_device: Do not overwrite resources allocated by OF layer · b82b04e8
      Vaibhav Hiremath 提交于
      With the new devices (like, AM33XX and OMAP5) we now only support
      DT boot mode of operation and now it is the time to start killing
      slowly the dependency on hwmod, so with this patch, we are starting
      with device resources.
      The idea here is implemented considering to both boot modes -
        - DT boot mode
          OF framework will construct the resource structure (currently
          does for MEM & IRQ resource) and we should respect/use these
          resources, killing hwmod dependency.
          If pdev->num_resources > 0, we assume that MEM & IRQ resources
          have been allocated by OF layer already (through DTB).
      
          Once DMA resource is available from OF layer, we should
          kill filling any resources from hwmod.
      
        - Non-DT boot mode
          Here, pdev->num_resources = 0, and we should get all the
          resources from hwmod (following existing steps)
      Signed-off-by: NVaibhav Hiremath <hvaibhav@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Kevin Hilman <khilman@ti.com>
      [b-cousson@ti.com: Fix some checkpatch CHECK issues]
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      b82b04e8
  2. 06 9月, 2012 1 次提交
    • P
      ARM: OMAP: omap_device: Fix up resource names when booted with devicetree · 3956a1a0
      Peter Ujfalusi 提交于
      When booted with some resource will have their name set to NULL. This can
      cause later kernel crash since this is not expected by the platform code.
      
      When we boot without DT the devices are created with platform_device_add()
      which itself fixes up the missing resource names:
      if (r->name == NULL)
      	r->name = dev_name(&pdev->dev);
      
      The of core also fixes up the resource names when taking the information
      from DT data - in __of_address_to_resource():
      r->name = name ? name : dev->full_name;
      
      When we boot OMAP with devicetree: of will create the devices based on the
      DT data so the resource names are guarantied to be not NULL. Since we have
      the 'ti,hwmod' tag, we remove the of created resources from the device and
      re-create them based on hwmod data. If the hwmod data does not specify a
      name for a resource it will be NULL.
      This can cause kernel crash if the driver uses
      platform_get_resource_byname() to get any resource.
      Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
      [b-cousson@ti.com: Change omap_hwmod to omap_device in subject]
      Signed-off-by: NBenoit Cousson <b-cousson@ti.com>
      3956a1a0
  3. 31 8月, 2012 5 次提交
  4. 25 8月, 2012 3 次提交
  5. 22 8月, 2012 1 次提交
    • M
      mm: hugetlbfs: correctly populate shared pmd · eb48c071
      Michal Hocko 提交于
      Each page mapped in a process's address space must be correctly
      accounted for in _mapcount.  Normally the rules for this are
      straightforward but hugetlbfs page table sharing is different.  The page
      table pages at the PMD level are reference counted while the mapcount
      remains the same.
      
      If this accounting is wrong, it causes bugs like this one reported by
      Larry Woodman:
      
        kernel BUG at mm/filemap.c:135!
        invalid opcode: 0000 [#1] SMP
        CPU 22
        Modules linked in: bridge stp llc sunrpc binfmt_misc dcdbas microcode pcspkr acpi_pad acpi]
        Pid: 18001, comm: mpitest Tainted: G        W    3.3.0+ #4 Dell Inc. PowerEdge R620/07NDJ2
        RIP: 0010:[<ffffffff8112cfed>]  [<ffffffff8112cfed>] __delete_from_page_cache+0x15d/0x170
        Process mpitest (pid: 18001, threadinfo ffff880428972000, task ffff880428b5cc20)
        Call Trace:
          delete_from_page_cache+0x40/0x80
          truncate_hugepages+0x115/0x1f0
          hugetlbfs_evict_inode+0x18/0x30
          evict+0x9f/0x1b0
          iput_final+0xe3/0x1e0
          iput+0x3e/0x50
          d_kill+0xf8/0x110
          dput+0xe2/0x1b0
          __fput+0x162/0x240
      
      During fork(), copy_hugetlb_page_range() detects if huge_pte_alloc()
      shared page tables with the check dst_pte == src_pte.  The logic is if
      the PMD page is the same, they must be shared.  This assumes that the
      sharing is between the parent and child.  However, if the sharing is
      with a different process entirely then this check fails as in this
      diagram:
      
        parent
          |
          ------------>pmd
                       src_pte----------> data page
                                              ^
        other--------->pmd--------------------|
                        ^
        child-----------|
                       dst_pte
      
      For this situation to occur, it must be possible for Parent and Other to
      have faulted and failed to share page tables with each other.  This is
      possible due to the following style of race.
      
        PROC A                                          PROC B
        copy_hugetlb_page_range                         copy_hugetlb_page_range
          src_pte == huge_pte_offset                      src_pte == huge_pte_offset
          !src_pte so no sharing                          !src_pte so no sharing
      
        (time passes)
      
        hugetlb_fault                                   hugetlb_fault
          huge_pte_alloc                                  huge_pte_alloc
            huge_pmd_share                                 huge_pmd_share
              LOCK(i_mmap_mutex)
              find nothing, no sharing
              UNLOCK(i_mmap_mutex)
                                                            LOCK(i_mmap_mutex)
                                                            find nothing, no sharing
                                                            UNLOCK(i_mmap_mutex)
            pmd_alloc                                       pmd_alloc
            LOCK(instantiation_mutex)
            fault
            UNLOCK(instantiation_mutex)
                                                        LOCK(instantiation_mutex)
                                                        fault
                                                        UNLOCK(instantiation_mutex)
      
      These two processes are not poing to the same data page but are not
      sharing page tables because the opportunity was missed.  When either
      process later forks, the src_pte == dst pte is potentially insufficient.
      As the check falls through, the wrong PTE information is copied in
      (harmless but wrong) and the mapcount is bumped for a page mapped by a
      shared page table leading to the BUG_ON.
      
      This patch addresses the issue by moving pmd_alloc into huge_pmd_share
      which guarantees that the shared pud is populated in the same critical
      section as pmd.  This also means that huge_pte_offset test in
      huge_pmd_share is serialized correctly now which in turn means that the
      success of the sharing will be higher as the racing tasks see the pud
      and pmd populated together.
      
      Race identified and changelog written mostly by Mel Gorman.
      
      {akpm@linux-foundation.org: attempt to make the huge_pmd_share() comment comprehensible, clean up coding style]
      Reported-by: NLarry Woodman <lwoodman@redhat.com>
      Tested-by: NLarry Woodman <lwoodman@redhat.com>
      Reviewed-by: NMel Gorman <mgorman@suse.de>
      Signed-off-by: NMichal Hocko <mhocko@suse.cz>
      Reviewed-by: NRik van Riel <riel@redhat.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Ken Chen <kenchen@google.com>
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Hillf Danton <dhillf@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      eb48c071
  6. 21 8月, 2012 1 次提交
  7. 19 8月, 2012 10 次提交
  8. 17 8月, 2012 2 次提交
  9. 16 8月, 2012 2 次提交
    • M
      C6X: select GENERIC_ATOMIC64 · 01ddd9a8
      Mark Salter 提交于
      The generic atomic64 support came in 2009 to support the perf subsystem
      with the expectation that all architectures would implement atomic64
      support. Since then, other optional parts of the generic kernel have
      also come to expect atomic64 support. This patch enables generic atomic64
      support for C6X architecture.
      Signed-off-by: NMark Salter <msalter@redhat.com>
      01ddd9a8
    • M
      C6X: add Lx_CACHE_SHIFT defines · 6330c790
      Mark Salter 提交于
      C6X currently lacks Lx_CACHE_SHIFT defines which are needed in a
      few places in the generic kernel. This patch adds _SHIFT defines
      for the various caches and bases the Lx_CACHE_BYTES defines on
      them.
      Signed-off-by: NMark Salter <msalter@redhat.com>
      6330c790
  10. 15 8月, 2012 4 次提交
  11. 14 8月, 2012 4 次提交
  12. 13 8月, 2012 1 次提交
  13. 11 8月, 2012 5 次提交