]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/infiniband/hw/mthca/mthca_memfree.c
Detach sched.h from mm.h
[mirror_ubuntu-jammy-kernel.git] / drivers / infiniband / hw / mthca / mthca_memfree.c
index 0b9d053a599d2c3a328913aceccafb5721ed5698..e61f3e626980e582959b3cfa0f1bd31a141a3db1 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <linux/mm.h>
 #include <linux/scatterlist.h>
+#include <linux/sched.h>
 
 #include <asm/page.h>
 
@@ -175,7 +176,9 @@ struct mthca_icm *mthca_alloc_icm(struct mthca_dev *dev, int npages,
                if (!ret) {
                        ++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->npages,
                                                        PCI_DMA_BIDIRECTIONAL);