diff mbox series

[for-next,09/12] RDMA/bnxt_re: Use GFP_KERNEL in non atomic context

Message ID 1631470526-22228-10-git-send-email-selvin.xavier@broadcom.com (mailing list archive)
State Superseded
Delegated to: Leon Romanovsky
Headers show
Series RDMA/bnxt_re: Driver update | expand

Commit Message

Selvin Xavier Sept. 12, 2021, 6:15 p.m. UTC
Use GFP_KERNEL instead of GFP_ATOMIC while allocating
control path structures which will be only called from
non atomic context

Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
---
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Leon Romanovsky Sept. 13, 2021, 11:10 a.m. UTC | #1
On Sun, Sep 12, 2021 at 11:15:23AM -0700, Selvin Xavier wrote:
> Use GFP_KERNEL instead of GFP_ATOMIC while allocating
> control path structures which will be only called from
> non atomic context
> 
> Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
> ---
>  drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
> index 947e8c5..3de8547 100644
> --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
> +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
> @@ -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;

I think that you can do same change in bnxt_re_netdev_event() too.

>  
>  	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;
>  
> -- 
> 2.5.5
>
Selvin Xavier Sept. 13, 2021, 11:15 a.m. UTC | #2
On Mon, Sep 13, 2021 at 4:41 PM Leon Romanovsky <leon@kernel.org> wrote:
>
> On Sun, Sep 12, 2021 at 11:15:23AM -0700, Selvin Xavier wrote:
> > Use GFP_KERNEL instead of GFP_ATOMIC while allocating
> > control path structures which will be only called from
> > non atomic context
> >
> > Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
> > ---
> >  drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
> > index 947e8c5..3de8547 100644
> > --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
> > +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
> > @@ -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;
>
> I think that you can do same change in bnxt_re_netdev_event() too.

Sure.. thanks for pointing it out.
>
> >
> >       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;
> >
> > --
> > 2.5.5
> >
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
index 947e8c5..3de8547 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
@@ -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;