linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [SCSI] bfa: allocate memory with GFP_ATOMIC in spinlock context
@ 2014-04-18  7:25 Alexey Khoroshilov
  2014-04-18  7:50 ` Alexey Khoroshilov
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Khoroshilov @ 2014-04-18  7:25 UTC (permalink / raw)
  To: Anil Gurumurthy, Sudarsana Kalluru
  Cc: Alexey Khoroshilov, James E.J. Bottomley, linux-scsi,
	linux-kernel, ldv-project

bfa_fcb_pbc_vport_create() is called only from bfa_fcs_pbc_vport_init(),
that is called only from bfad_drv_start() with bfad_lock spinlock held.
So the patch replaces GFP_KERNEL with GFP_ATOMIC to avoid
sleeping in atomic spinlock context.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
 drivers/scsi/bfa/bfad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index cc0fbcdc5192..8f46d1b72fb8 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -652,7 +652,7 @@ bfad_vport_create(struct bfad_s *bfad, u16 vf_id,
 	unsigned long	flags;
 	struct completion fcomp;
 
-	vport = kzalloc(sizeof(struct bfad_vport_s), GFP_KERNEL);
+	vport = kzalloc(sizeof(struct bfad_vport_s), GFP_ATOMIC);
 	if (!vport) {
 		rc = BFA_STATUS_ENOMEM;
 		goto ext;
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [SCSI] bfa: allocate memory with GFP_ATOMIC in spinlock context
  2014-04-18  7:25 [PATCH] [SCSI] bfa: allocate memory with GFP_ATOMIC in spinlock context Alexey Khoroshilov
@ 2014-04-18  7:50 ` Alexey Khoroshilov
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Khoroshilov @ 2014-04-18  7:50 UTC (permalink / raw)
  To: Anil Gurumurthy, Sudarsana Kalluru
  Cc: James E.J. Bottomley, linux-scsi, linux-kernel, ldv-project

Please ignore this patch, it will resend a correct version of it.

On 18.04.2014 00:25, Alexey Khoroshilov wrote:
> bfa_fcb_pbc_vport_create() is called only from bfa_fcs_pbc_vport_init(),
> that is called only from bfad_drv_start() with bfad_lock spinlock held.
> So the patch replaces GFP_KERNEL with GFP_ATOMIC to avoid
> sleeping in atomic spinlock context.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> ---
>  drivers/scsi/bfa/bfad.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
> index cc0fbcdc5192..8f46d1b72fb8 100644
> --- a/drivers/scsi/bfa/bfad.c
> +++ b/drivers/scsi/bfa/bfad.c
> @@ -652,7 +652,7 @@ bfad_vport_create(struct bfad_s *bfad, u16 vf_id,
>  	unsigned long	flags;
>  	struct completion fcomp;
>  
> -	vport = kzalloc(sizeof(struct bfad_vport_s), GFP_KERNEL);
> +	vport = kzalloc(sizeof(struct bfad_vport_s), GFP_ATOMIC);
>  	if (!vport) {
>  		rc = BFA_STATUS_ENOMEM;
>  		goto ext;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-18  7:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-18  7:25 [PATCH] [SCSI] bfa: allocate memory with GFP_ATOMIC in spinlock context Alexey Khoroshilov
2014-04-18  7:50 ` Alexey Khoroshilov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).