sh/sh64: fixup dma-mapping for new sg layout
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
Родитель
ebc3bbcfcf
Коммит
71df50a4e4
|
@ -2,7 +2,7 @@
|
||||||
#define __ASM_SH_DMA_MAPPING_H
|
#define __ASM_SH_DMA_MAPPING_H
|
||||||
|
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <asm/scatterlist.h>
|
#include <linux/scatterlist.h>
|
||||||
#include <asm/cacheflush.h>
|
#include <asm/cacheflush.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
|
@ -85,10 +85,9 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
|
||||||
|
|
||||||
for (i = 0; i < nents; i++) {
|
for (i = 0; i < nents; i++) {
|
||||||
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
|
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
|
||||||
dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
|
dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
|
||||||
sg[i].length, dir);
|
|
||||||
#endif
|
#endif
|
||||||
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
|
sg[i].dma_address = sg_phys(&sg[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return nents;
|
return nents;
|
||||||
|
@ -138,10 +137,9 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
|
||||||
|
|
||||||
for (i = 0; i < nelems; i++) {
|
for (i = 0; i < nelems; i++) {
|
||||||
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
|
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
|
||||||
dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
|
dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
|
||||||
sg[i].length, dir);
|
|
||||||
#endif
|
#endif
|
||||||
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
|
sg[i].dma_address = sg_phys(&sg[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define __ASM_SH_DMA_MAPPING_H
|
#define __ASM_SH_DMA_MAPPING_H
|
||||||
|
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <asm/scatterlist.h>
|
#include <linux/scatterlist.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
struct pci_dev;
|
struct pci_dev;
|
||||||
|
@ -71,10 +71,9 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
|
||||||
|
|
||||||
for (i = 0; i < nents; i++) {
|
for (i = 0; i < nents; i++) {
|
||||||
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
|
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
|
||||||
dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
|
dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
|
||||||
sg[i].length, dir);
|
|
||||||
#endif
|
#endif
|
||||||
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
|
sg[i].dma_address = sg_phys(&sg[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return nents;
|
return nents;
|
||||||
|
@ -124,10 +123,9 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
|
||||||
|
|
||||||
for (i = 0; i < nelems; i++) {
|
for (i = 0; i < nelems; i++) {
|
||||||
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
|
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
|
||||||
dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
|
dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
|
||||||
sg[i].length, dir);
|
|
||||||
#endif
|
#endif
|
||||||
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
|
sg[i].dma_address = sg_phys(&sg[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче