Skip to contentSkip to conversation

bfa: Use GFP_ATOMIC under spin_lock

PATCH In review Dan Carpenter 2 participants 2 messages Mar 8, 2013 – Mar 11, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bfa: Use GFP_ATOMIC under spin_lock

This is always called with spinlocks held so it should use GFP_ATOMIC. The call tree is:

-> bfad_drv_start()
Takes spin_lock_irqsave(&bfad->bfad_lock, flags); -> bfa_fcs_pbc_vport_init()

      -> bfa_fcb_pbc_vport_create()
drivers/scsi/bfa/bfad.c +1 -1
index a5f7690..d144a06 100644
@@ -491,7 +491,7 @@ bfa_fcb_pbc_vport_create(struct bfad_s *bfad, struct bfi_pbc_vport_s pbc_vport)
 	struct bfad_vport_s   *vport;
 	int rc;
 
-	vport = kzalloc(sizeof(struct bfad_vport_s), GFP_KERNEL);
+	vport = kzalloc(sizeof(struct bfad_vport_s), GFP_ATOMIC);
 	if (!vport) {
 		bfa_trc(bfad, 0);
 		return;
Acked-by on v1 1/1
#1 lore raw
Quoted 31 lines

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Friday, March 08, 2013 4:01 AM
To: Anil Gurumurthy
Cc: Vijay Mohan Guvva; James E.J. Bottomley; [email protected]; [email protected]; [email protected]
Subject: [patch] [SCSI] bfa: Use GFP_ATOMIC under spin_lock

This is always called with spinlocks held so it should use GFP_ATOMIC. The call tree is:

-> bfad_drv_start()

   Takes spin_lock_irqsave(&bfad->bfad_lock, flags);
   -> bfa_fcs_pbc_vport_init()
      -> bfa_fcb_pbc_vport_create()
drivers/scsi/bfa/bfad.c index renamed from drivers/scsi/bfa/bfad.c +0 -0

a5f7690..d144a06 100644

drivers/scsi/bfa/bfad.c +1 -1
@@ -491,7 +491,7 @@ bfa_fcb_pbc_vport_create(struct bfad_s *bfad,
 struct bfi_pbc_vport_s pbc_vport)
 	struct bfad_vport_s   *vport;
 	int rc;
 
-	vport = kzalloc(sizeof(struct bfad_vport_s), GFP_KERNEL);
+	vport = kzalloc(sizeof(struct bfad_vport_s), GFP_ATOMIC);
 	if (!vport) {
 		bfa_trc(bfad, 0);
Quoted 1 line

return;

Changes looks good. Thanks for the patch.