Commit:     11282b32a4ed7bb5fc390c83a1d6b9bc8017882c
Parent:     fc89afce349a70f73d9c0b6d91a15c4913f071a0
Author:     Roland Dreier <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 16 13:57:33 2007 -0800
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Fri Feb 16 13:57:33 2007 -0800

    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 <[EMAIL PROTECTED]>
 drivers/infiniband/hw/mthca/mthca_memfree.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_memfree.c 
index 0b9d053..48f7c65 100644
--- a/drivers/infiniband/hw/mthca/mthca_memfree.c
+++ b/drivers/infiniband/hw/mthca/mthca_memfree.c
@@ -175,7 +175,9 @@ struct mthca_icm *mthca_alloc_icm(struct mthca_dev *dev, 
int npages,
                if (!ret) {
-                       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,
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to