Skip to contentSkip to conversation

wd719x: pass GFP_ATOMIC instead of GFP_KERNEL

PATCH Superseded Hariprasad Kelam 3 participants 3 messages May 29, 2019 SCSI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wd719x: pass GFP_ATOMIC instead of GFP_KERNEL

wd719x_chip_init is getting called in interrupt disabled mode(spin_lock_irqsave) , so we need to GFP_ATOMIC instead of GFP_KERNEL.

Issue identified by coccicheck

---
 drivers/scsi/wd719x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/wd719x.c +1 -1
index c2f4006..f300fd7 100644
@@ -319,7 +319,7 @@ static int wd719x_chip_init(struct wd719x *wd)
 
 	if (!wd->fw_virt)
 		wd->fw_virt = dma_alloc_coherent(&wd->pdev->dev, wd->fw_size,
-						 &wd->fw_phys, GFP_KERNEL);
+						 &wd->fw_phys, GFP_ATOMIC);
 	if (!wd->fw_virt) {
 		ret = -ENOMEM;
 		goto wd719x_init_end;
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · Hariprasad Kelam

wd719x_chip_init is getting called in interrupt disabled mode(spin_lock_irqsave) , so we need to GFP_ATOMIC instead of GFP_KERNEL.

Issue identified by coccicheck

I don't think request_firmware is any more happy being called under a spinlock. The right fix is to not hold a spinlock over the board initialization.

#2 lore raw
Quoted 10 lines · Christoph Hellwig
Quoted 5 lines

wd719x_chip_init is getting called in interrupt disabled mode(spin_lock_irqsave) , so we need to GFP_ATOMIC instead of GFP_KERNEL.

Issue identified by coccicheck

I don't think request_firmware is any more happy being called under a spinlock. The right fix is to not hold a spinlock over the board initialization.

Right, and not even wd719x_chip_init() is always called in this context otherwise wd719x_board_found() would also need the same change.