Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • Documentation
  • DMA-API-HOWTO.txt
Find file BlameHistoryPermalink
  • Yinghai Lu's avatar
    PCI: Add pci_bus_addr_t · 40ba4e22
    Yinghai Lu authored May 27, 2015
    commit 3a9ad0b4 upstream.
    
    David Ahern reported that d63e2e1f ("sparc/PCI: Clip bridge windows
    to fit in upstream windows") fails to boot on sparc/T5-8:
    
      pci 0000:06:00.0: reg 0x184: can't handle BAR above 4GB (bus address 0x110204000)
    
    The problem is that sparc64 assumed that dma_addr_t only needed to hold DMA
    addresses, i.e., bus addresses returned via the DMA API (dma_map_single(),
    etc.), while the PCI core assumed dma_addr_t could hold *any* bus address,
    including raw BAR values.  On sparc64, all DMA addresses fit in 32 bits, so
    dma_addr_t is a 32-bit type.  However, BAR values can be 64 bits wide, so
    they don't fit in a dma_addr_t.  d63e2e1f added new checking that
    tripped over this mismatch.
    
    Add pci_bus_addr_t, which is wide enough to hold any PCI bus address,
    including both raw BAR values and DMA addresses.  This will be 64 bits
    on 64-bit platforms and on platforms with a 64-bit dma_addr_t.  Then
    dma_addr_t only needs to be wide enough to hold addresses from the DMA API.
    
    [bhelgaas: changelog, bugzilla, Kconfig to ensure pci_bus_addr_t is at
    least as wide as dma_addr_t, documentation]
    Fixes: d63e2e1f ("sparc/PCI: Clip bridge windows to fit in upstream windows")
    Fixes: 23b13bc7 ("PCI: Fail safely if we can't handle BARs larger than 4GB")
    Link: http://lkml.kernel.org/r/CAE9FiQU1gJY1LYrxs+ma5LCTEEe4xmtjRG0aXJ9K_Tsu+m9Wuw@mail.gmail.com
    Link: http://lkml.kernel.org/r/1427857069-6789-1-git-send-email-yinghai@kernel.org
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=96231
    
    
    Reported-by: default avatarDavid Ahern <david.ahern@oracle.com>
    Tested-by: default avatarDavid Ahern <david.ahern@oracle.com>
    Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
    
    Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
    40ba4e22
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7