mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-18 19:05:39 +00:00
IB/mthca: Fix allocation of ICM chunks in coherent memory
The change to allow allocating ICM chunks from coherent memory did not increment the count of sg entries properly, so a chunk that required more than allocation would not be mapped properly by the HCA. Fix this by adding the missing increment of chunk->nsg. Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
parent
fc89afce34
commit
11282b32a4
@ -175,7 +175,9 @@ struct mthca_icm *mthca_alloc_icm(struct mthca_dev *dev, int npages,
|
|||||||
if (!ret) {
|
if (!ret) {
|
||||||
++chunk->npages;
|
++chunk->npages;
|
||||||
|
|
||||||
if (!coherent && chunk->npages == MTHCA_ICM_CHUNK_LEN) {
|
if (coherent)
|
||||||
|
++chunk->nsg;
|
||||||
|
else if (chunk->npages == MTHCA_ICM_CHUNK_LEN) {
|
||||||
chunk->nsg = pci_map_sg(dev->pdev, chunk->mem,
|
chunk->nsg = pci_map_sg(dev->pdev, chunk->mem,
|
||||||
chunk->npages,
|
chunk->npages,
|
||||||
PCI_DMA_BIDIRECTIONAL);
|
PCI_DMA_BIDIRECTIONAL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user