mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-17 09:43:59 +08:00
iommu/amd: Remove align-parameter from __map_single()
This parameter is not required anymore because the iova-allocations are always aligned to its size. Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
2d4c515bf0
commit
bda350dbdb
@ -2162,22 +2162,17 @@ static dma_addr_t __map_single(struct device *dev,
|
|||||||
phys_addr_t paddr,
|
phys_addr_t paddr,
|
||||||
size_t size,
|
size_t size,
|
||||||
int direction,
|
int direction,
|
||||||
bool align,
|
|
||||||
u64 dma_mask)
|
u64 dma_mask)
|
||||||
{
|
{
|
||||||
dma_addr_t offset = paddr & ~PAGE_MASK;
|
dma_addr_t offset = paddr & ~PAGE_MASK;
|
||||||
dma_addr_t address, start, ret;
|
dma_addr_t address, start, ret;
|
||||||
unsigned int pages;
|
unsigned int pages;
|
||||||
unsigned long align_mask = 0;
|
|
||||||
int prot = 0;
|
int prot = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
pages = iommu_num_pages(paddr, size, PAGE_SIZE);
|
pages = iommu_num_pages(paddr, size, PAGE_SIZE);
|
||||||
paddr &= PAGE_MASK;
|
paddr &= PAGE_MASK;
|
||||||
|
|
||||||
if (align)
|
|
||||||
align_mask = (1UL << get_order(size)) - 1;
|
|
||||||
|
|
||||||
address = dma_ops_alloc_iova(dev, dma_dom, pages, dma_mask);
|
address = dma_ops_alloc_iova(dev, dma_dom, pages, dma_mask);
|
||||||
if (address == DMA_ERROR_CODE)
|
if (address == DMA_ERROR_CODE)
|
||||||
goto out;
|
goto out;
|
||||||
@ -2273,8 +2268,7 @@ static dma_addr_t map_page(struct device *dev, struct page *page,
|
|||||||
|
|
||||||
dma_mask = *dev->dma_mask;
|
dma_mask = *dev->dma_mask;
|
||||||
|
|
||||||
return __map_single(dev, domain->priv, paddr, size, dir, false,
|
return __map_single(dev, domain->priv, paddr, size, dir, dma_mask);
|
||||||
dma_mask);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2317,8 +2311,7 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
|
|||||||
paddr = sg_phys(s);
|
paddr = sg_phys(s);
|
||||||
|
|
||||||
s->dma_address = __map_single(dev, domain->priv,
|
s->dma_address = __map_single(dev, domain->priv,
|
||||||
paddr, s->length, dir, false,
|
paddr, s->length, dir, dma_mask);
|
||||||
dma_mask);
|
|
||||||
|
|
||||||
if (s->dma_address) {
|
if (s->dma_address) {
|
||||||
s->dma_length = s->length;
|
s->dma_length = s->length;
|
||||||
@ -2402,7 +2395,7 @@ static void *alloc_coherent(struct device *dev, size_t size,
|
|||||||
dma_mask = *dev->dma_mask;
|
dma_mask = *dev->dma_mask;
|
||||||
|
|
||||||
*dma_addr = __map_single(dev, domain->priv, page_to_phys(page),
|
*dma_addr = __map_single(dev, domain->priv, page_to_phys(page),
|
||||||
size, DMA_BIDIRECTIONAL, true, dma_mask);
|
size, DMA_BIDIRECTIONAL, dma_mask);
|
||||||
|
|
||||||
if (*dma_addr == DMA_ERROR_CODE)
|
if (*dma_addr == DMA_ERROR_CODE)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
Loading…
Reference in New Issue
Block a user