Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187291
b: refs/heads/master
c: 6a1961f
h: refs/heads/master
i:
  187289: 53541ac
  187287: 0079f94
v: v3
  • Loading branch information
FUJITA Tomonori authored and Linus Torvalds committed Mar 12, 2010
1 parent 8062df6 commit 09d67b5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e3c4bccabaf3e5c13f4b307c7737cbe8d0cecd02
refs/heads/master: 6a1961f49ee8d7339ea2454443dfc0460e0b2748
10 changes: 10 additions & 0 deletions trunk/Documentation/DMA-API.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ parameters if it is.

Returns: 0 if successful and a negative error if not.

int
dma_set_coherent_mask(struct device *dev, u64 mask)
int
pci_set_consistent_dma_mask(struct pci_device *dev, u64 mask)

Checks to see if the mask is possible and updates the device
parameters if it is.

Returns: 0 if successful and a negative error if not.

u64
dma_get_required_mask(struct device *dev)

Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2315,12 +2315,11 @@ pci_set_dma_mask(struct pci_dev *dev, u64 mask)
int
pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
{
if (!pci_dma_supported(dev, mask))
return -EIO;
int ret = dma_set_coherent_mask(&dev->dev, mask);
if (ret)
return ret;

dev->dev.coherent_dma_mask = mask;
dev_dbg(&dev->dev, "using %dbit consistent DMA mask\n", fls64(mask));

return 0;
}
#endif
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/linux/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ static inline u64 dma_get_mask(struct device *dev)
return DMA_BIT_MASK(32);
}

static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
{
if (!dma_supported(dev, mask))
return -EIO;
dev->coherent_dma_mask = mask;
return 0;
}

extern u64 dma_get_required_mask(struct device *dev);

static inline unsigned int dma_get_max_seg_size(struct device *dev)
Expand Down

0 comments on commit 09d67b5

Please sign in to comment.