diff options
| -rw-r--r-- | arch/parisc/include/asm/dma-mapping.h | 2 | ||||
| -rw-r--r-- | drivers/parisc/ccio-dma.c | 10 | ||||
| -rw-r--r-- | drivers/parisc/sba_iommu.c | 10 |
3 files changed, 18 insertions, 4 deletions
diff --git a/arch/parisc/include/asm/dma-mapping.h b/arch/parisc/include/asm/dma-mapping.h index 9a2a8956a695..2b16282add69 100644 --- a/arch/parisc/include/asm/dma-mapping.h +++ b/arch/parisc/include/asm/dma-mapping.h | |||
| @@ -20,8 +20,6 @@ | |||
| 20 | ** flush/purge and allocate "regular" cacheable pages for everything. | 20 | ** flush/purge and allocate "regular" cacheable pages for everything. |
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #define DMA_ERROR_CODE (~(dma_addr_t)0) | ||
| 24 | |||
| 25 | #ifdef CONFIG_PA11 | 23 | #ifdef CONFIG_PA11 |
| 26 | extern const struct dma_map_ops pcxl_dma_ops; | 24 | extern const struct dma_map_ops pcxl_dma_ops; |
| 27 | extern const struct dma_map_ops pcx_dma_ops; | 25 | extern const struct dma_map_ops pcx_dma_ops; |
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 56c93f096de9..6aa1e7f6672f 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c | |||
| @@ -110,6 +110,8 @@ | |||
| 110 | #define CMD_TLB_DIRECT_WRITE 35 /* IO_COMMAND for I/O TLB Writes */ | 110 | #define CMD_TLB_DIRECT_WRITE 35 /* IO_COMMAND for I/O TLB Writes */ |
| 111 | #define CMD_TLB_PURGE 33 /* IO_COMMAND to Purge I/O TLB entry */ | 111 | #define CMD_TLB_PURGE 33 /* IO_COMMAND to Purge I/O TLB entry */ |
| 112 | 112 | ||
| 113 | #define CCIO_MAPPING_ERROR (~(dma_addr_t)0) | ||
| 114 | |||
| 113 | struct ioa_registers { | 115 | struct ioa_registers { |
| 114 | /* Runway Supervisory Set */ | 116 | /* Runway Supervisory Set */ |
| 115 | int32_t unused1[12]; | 117 | int32_t unused1[12]; |
| @@ -742,7 +744,7 @@ ccio_map_single(struct device *dev, void *addr, size_t size, | |||
| 742 | BUG_ON(!dev); | 744 | BUG_ON(!dev); |
| 743 | ioc = GET_IOC(dev); | 745 | ioc = GET_IOC(dev); |
| 744 | if (!ioc) | 746 | if (!ioc) |
| 745 | return DMA_ERROR_CODE; | 747 | return CCIO_MAPPING_ERROR; |
| 746 | 748 | ||
| 747 | BUG_ON(size <= 0); | 749 | BUG_ON(size <= 0); |
| 748 | 750 | ||
| @@ -1023,6 +1025,11 @@ ccio_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents, | |||
| 1023 | DBG_RUN_SG("%s() DONE (nents %d)\n", __func__, nents); | 1025 | DBG_RUN_SG("%s() DONE (nents %d)\n", __func__, nents); |
| 1024 | } | 1026 | } |
| 1025 | 1027 | ||
| 1028 | static int ccio_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
| 1029 | { | ||
| 1030 | return dma_addr == CCIO_MAPPING_ERROR; | ||
| 1031 | } | ||
| 1032 | |||
| 1026 | static const struct dma_map_ops ccio_ops = { | 1033 | static const struct dma_map_ops ccio_ops = { |
| 1027 | .dma_supported = ccio_dma_supported, | 1034 | .dma_supported = ccio_dma_supported, |
| 1028 | .alloc = ccio_alloc, | 1035 | .alloc = ccio_alloc, |
| @@ -1031,6 +1038,7 @@ static const struct dma_map_ops ccio_ops = { | |||
| 1031 | .unmap_page = ccio_unmap_page, | 1038 | .unmap_page = ccio_unmap_page, |
| 1032 | .map_sg = ccio_map_sg, | 1039 | .map_sg = ccio_map_sg, |
| 1033 | .unmap_sg = ccio_unmap_sg, | 1040 | .unmap_sg = ccio_unmap_sg, |
| 1041 | .mapping_error = ccio_mapping_error, | ||
| 1034 | }; | 1042 | }; |
| 1035 | 1043 | ||
| 1036 | #ifdef CONFIG_PROC_FS | 1044 | #ifdef CONFIG_PROC_FS |
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 87ad5fd6a7a2..4086f79d58d5 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
| @@ -93,6 +93,8 @@ | |||
| 93 | 93 | ||
| 94 | #define DEFAULT_DMA_HINT_REG 0 | 94 | #define DEFAULT_DMA_HINT_REG 0 |
| 95 | 95 | ||
| 96 | #define SBA_MAPPING_ERROR (~(dma_addr_t)0) | ||
| 97 | |||
| 96 | struct sba_device *sba_list; | 98 | struct sba_device *sba_list; |
| 97 | EXPORT_SYMBOL_GPL(sba_list); | 99 | EXPORT_SYMBOL_GPL(sba_list); |
| 98 | 100 | ||
| @@ -725,7 +727,7 @@ sba_map_single(struct device *dev, void *addr, size_t size, | |||
| 725 | 727 | ||
| 726 | ioc = GET_IOC(dev); | 728 | ioc = GET_IOC(dev); |
| 727 | if (!ioc) | 729 | if (!ioc) |
| 728 | return DMA_ERROR_CODE; | 730 | return SBA_MAPPING_ERROR; |
| 729 | 731 | ||
| 730 | /* save offset bits */ | 732 | /* save offset bits */ |
| 731 | offset = ((dma_addr_t) (long) addr) & ~IOVP_MASK; | 733 | offset = ((dma_addr_t) (long) addr) & ~IOVP_MASK; |
| @@ -1083,6 +1085,11 @@ sba_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents, | |||
| 1083 | 1085 | ||
| 1084 | } | 1086 | } |
| 1085 | 1087 | ||
| 1088 | static int sba_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
| 1089 | { | ||
| 1090 | return dma_addr == SBA_MAPPING_ERROR; | ||
| 1091 | } | ||
| 1092 | |||
| 1086 | static const struct dma_map_ops sba_ops = { | 1093 | static const struct dma_map_ops sba_ops = { |
| 1087 | .dma_supported = sba_dma_supported, | 1094 | .dma_supported = sba_dma_supported, |
| 1088 | .alloc = sba_alloc, | 1095 | .alloc = sba_alloc, |
| @@ -1091,6 +1098,7 @@ static const struct dma_map_ops sba_ops = { | |||
| 1091 | .unmap_page = sba_unmap_page, | 1098 | .unmap_page = sba_unmap_page, |
| 1092 | .map_sg = sba_map_sg, | 1099 | .map_sg = sba_map_sg, |
| 1093 | .unmap_sg = sba_unmap_sg, | 1100 | .unmap_sg = sba_unmap_sg, |
| 1101 | .mapping_error = sba_mapping_error, | ||
| 1094 | }; | 1102 | }; |
| 1095 | 1103 | ||
| 1096 | 1104 | ||
