Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 454417 - Inconsistent documentation regarding pci_alloc_consistent
Inconsistent documentation regarding pci_alloc_consistent
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.8
All Linux
low Severity low
: rc
: ---
Assigned To: Prarit Bhargava
Martin Jenner
:
Depends On:
Blocks: 461304
  Show dependency treegraph
 
Reported: 2008-07-08 08:01 EDT by Prarit Bhargava
Modified: 2009-05-18 15:37 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-18 15:37:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
RHEL4 fix for this issue (833 bytes, patch)
2008-07-08 08:01 EDT, Prarit Bhargava
no flags Details | Diff
RHEL4 fix for this issue [v2] (1.14 KB, patch)
2008-07-08 08:06 EDT, Prarit Bhargava
no flags Details | Diff
RHEL4 fix for this issue [v3] (1.06 KB, patch)
2008-07-08 08:10 EDT, Prarit Bhargava
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1024 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 4.8 kernel security and bug fix update 2009-05-18 10:57:26 EDT

  None (edit)
Description Prarit Bhargava 2008-07-08 08:01:41 EDT
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).
Comment 1 Prarit Bhargava 2008-07-08 08:01:42 EDT
Created attachment 311255 [details]
RHEL4 fix for this issue
Comment 2 Prarit Bhargava 2008-07-08 08:06:03 EDT
Created attachment 311256 [details]
RHEL4 fix for this issue [v2]

Updated patch.
Comment 3 Prarit Bhargava 2008-07-08 08:10:29 EDT
Created attachment 311259 [details]
RHEL4 fix for this issue [v3]

Updated patch.
Comment 4 Prarit Bhargava 2008-07-08 08:17:59 EDT
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.
Comment 5 RHEL Product and Program Management 2008-07-08 08:54:33 EDT
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.
Comment 6 William Reich 2008-07-11 15:47:25 EDT

This was stimulated by work on report #298811
Comment 7 RHEL Product and Program Management 2008-09-03 09:16:42 EDT
Updating PM score.
Comment 8 Vivek Goyal 2008-09-09 17:43:36 EDT
Committed in 78.8.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/
Comment 11 errata-xmlrpc 2009-05-18 15:37:12 EDT
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

Note You need to log in before you can comment on or make changes to this bug.