Bug 454417
| Summary: | Inconsistent documentation regarding pci_alloc_consistent | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 4 | Reporter: | Prarit Bhargava <prarit> | ||||||||
| Component: | kernel | Assignee: | Prarit Bhargava <prarit> | ||||||||
| Status: | CLOSED ERRATA | QA Contact: | Martin Jenner <mjenner> | ||||||||
| Severity: | low | Docs Contact: | |||||||||
| Priority: | low | ||||||||||
| Version: | 4.8 | CC: | agospoda, nhorman, reich, vgoyal | ||||||||
| Target Milestone: | rc | ||||||||||
| Target Release: | --- | ||||||||||
| Hardware: | All | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | Environment: | ||||||||||
| Last Closed: | 2009-05-18 19:37:12 UTC | Type: | --- | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Bug Depends On: | |||||||||||
| Bug Blocks: | 461304 | ||||||||||
| Attachments: |
|
||||||||||
Created attachment 311255 [details]
RHEL4 fix for this issue
Created attachment 311256 [details]
RHEL4 fix for this issue [v2]
Updated patch.
Created attachment 311259 [details]
RHEL4 fix for this issue [v3]
Updated patch.
William (Reich) -- I submitted this patch internally to our kernel list. That means that this patch will be reviewed and eventually included in RHEL4. P. This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release. This was stimulated by work on report #298811 Updating PM score. Committed in 78.8.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/ An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2009-1024.html |
Description of problem: William Reich noticed the following inconsistency between the DMA-API.txt file and the DMA-mapping.txt file. The DMA-mapping.txt file was backported into RHEL4. Version-Release number of selected component (if applicable): 77.EL Additional info: pci_alloc_consistent() calls dma_alloc_coherent() dma_alloc_coherent() executes the following code: memory = dma_alloc_pages(dev, gfp, get_order(size)); . . . int high, mmu; bus = virt_to_bus(memory); high = (bus + size) >= dma_mask; <<< by bumping the dma_mask, you are simply increasing this value. Therefore, high = 0 (always). mmu = high; if (force_iommu && !(gfp & GFP_DMA)) mmu = 1; if (no_iommu || dma_mask < 0xffffffffUL) { if (high) { if (!(gfp & GFP_DMA)) { gfp |= GFP_DMA; free_pages((unsigned long)memory, get_order(size)); goto again; } goto free; } mmu = 0; } memset(memory, 0, size); if (!mmu) { *dma_handle = virt_to_bus(memory); return memory; <<< we always return here because mmu=0 } In the case that that high evaluates to 1, we end up at another method of getting a dma area, *dma_handle = dma_map_area(dev, bus, size, PCI_DMA_BIDIRECTIONAL, 0); The call to dma_map_area *does not guarantee* any alignment. It simply queries the iommu for an empty area and returns pointers to the area (virtual and a dma handle).