]> git.baikalelectronics.ru Git - kernel.git/commit
xen/swiotlb: Use page alignment for early buffer allocation.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 15 Dec 2011 16:28:46 +0000 (11:28 -0500)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 15 Dec 2011 16:28:46 +0000 (11:28 -0500)
commit223cbece2a7f921b959042bb6ba14de8b5d1d9ac
tree93b0527829417bbe187dd5e3d7cb1765346a8603
parent117bf61017982c9c701103cb0d089a60c6fa11d9
xen/swiotlb: Use page alignment for early buffer allocation.

This fixes an odd bug found on a Dell PowerEdge 1850/0RC130
(BIOS A05 01/09/2006) where all of the modules doing pci_set_dma_mask
would fail with:

ata_piix 0000:00:1f.1: enabling device (0005 -> 0007)
ata_piix 0000:00:1f.1: can't derive routing for PCI INT A
ata_piix 0000:00:1f.1: BMDMA: failed to set dma mask, falling back to PIO

The issue was the Xen-SWIOTLB was allocated such as that the end of
buffer was stradling a page (and also above 4GB). The fix was
spotted by Kalev Leonid  which was to piggyback on git commit
9c5e7e2feb3c6d952e7b5dc72ca333dfd2f70dd9 "swiotlb: Use page alignment
for early buffer allocation" which:

We could call free_bootmem_late() if swiotlb is not used, and
it will shrink to page alignment.

So alloc them with page alignment at first, to avoid lose two pages

And doing that fixes the outstanding issue.

CC: stable@kernel.org
Suggested-by: "Kalev, Leonid" <Leonid.Kalev@ca.com>
Reported-and-Tested-by: "Taylor, Neal E" <Neal.Taylor@ca.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/swiotlb-xen.c