RDMA/bnxt_re: Use GFP_KERNEL in non atomic context
authorSelvin Xavier <selvin.xavier@broadcom.com>
Wed, 15 Sep 2021 12:32:40 +0000 (05:32 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 20 Sep 2021 16:37:02 +0000 (13:37 -0300)
Use GFP_KERNEL instead of GFP_ATOMIC while allocating control path
structures which will be only called from non atomic context

Link: https://lore.kernel.org/r/1631709163-2287-10-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/bnxt_re/main.c
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c

index 2c2eeb05268fa368ef5861fc3110cb388dc7b7c1..4fa3b14b26138765be93b57d80567e8a2934c389 100644 (file)
@@ -1730,7 +1730,7 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier,
        }
        if (sch_work) {
                /* Allocate for the deferred task */
-               re_work = kzalloc(sizeof(*re_work), GFP_ATOMIC);
+               re_work = kzalloc(sizeof(*re_work), GFP_KERNEL);
                if (re_work) {
                        get_device(&rdev->ibdev.dev);
                        re_work->rdev = rdev;
index 947e8c55c303588c83066b138e0045996b9acc30..3de854727460e45e4a9ea5dd3181c5440f145435 100644 (file)
@@ -848,13 +848,13 @@ struct bnxt_qplib_rcfw_sbuf *bnxt_qplib_rcfw_alloc_sbuf(
 {
        struct bnxt_qplib_rcfw_sbuf *sbuf;
 
-       sbuf = kzalloc(sizeof(*sbuf), GFP_ATOMIC);
+       sbuf = kzalloc(sizeof(*sbuf), GFP_KERNEL);
        if (!sbuf)
                return NULL;
 
        sbuf->size = size;
        sbuf->sb = dma_alloc_coherent(&rcfw->pdev->dev, sbuf->size,
-                                     &sbuf->dma_addr, GFP_ATOMIC);
+                                     &sbuf->dma_addr, GFP_KERNEL);
        if (!sbuf->sb)
                goto bail;