]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/pseries: Correct VIO bus accounting problem in CMO env.
authorRobert Jennings <rcj@linux.vnet.ibm.com>
Thu, 22 Jan 2009 09:40:00 +0000 (09:40 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 28 Jan 2009 06:15:52 +0000 (17:15 +1100)
commit763dbb0627215ca0ff665be6ca9fb29a91ed69cf
treee2d013ded81fb9d8ad31a14b6ba4d8761727bd8b
parentf44569de66c03ea9624ef5fbad0bcc79a687ec50
powerpc/pseries: Correct VIO bus accounting problem in CMO env.

In the VIO bus code the wrappers for dma alloc_coherent and free_coherent
calls are rounding to IOMMU_PAGE_SIZE.  Taking a look at the underlying
calls, the actual mapping is promoted to PAGE_SIZE.  Changing the
rounding in these two functions fixes under-reporting the entitlement
used by the system.  Without this change, the system could run out of
entitlement before it believes it has and incur mapping failures at the
firmware level.

Also in the VIO bus code, the wrapper for dma map_sg is not exiting in
an error path where it should.  Rather than fall through to code for the
success case, this patch adds the return that is needed in the error path.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/vio.c