linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wd719x: pass GFP_ATOMIC instead of GFP_KERNEL
@ 2019-05-29  1:35 Hariprasad Kelam
  2019-05-29  6:23 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Hariprasad Kelam @ 2019-05-29  1:35 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen, linux-scsi, linux-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

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 drivers/scsi/wd719x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c
index c2f4006..f300fd7 100644
--- a/drivers/scsi/wd719x.c
+++ b/drivers/scsi/wd719x.c
@@ -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;
-- 
2.7.4


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

* Re: [PATCH] wd719x: pass GFP_ATOMIC instead of GFP_KERNEL
  2019-05-29  1:35 [PATCH] wd719x: pass GFP_ATOMIC instead of GFP_KERNEL Hariprasad Kelam
@ 2019-05-29  6:23 ` Christoph Hellwig
  2019-05-29 21:11   ` David Rientjes
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2019-05-29  6:23 UTC (permalink / raw)
  To: Hariprasad Kelam
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi, linux-kernel

On Wed, May 29, 2019 at 07:05:40AM +0530, Hariprasad Kelam wrote:
> 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.

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

* Re: [PATCH] wd719x: pass GFP_ATOMIC instead of GFP_KERNEL
  2019-05-29  6:23 ` Christoph Hellwig
@ 2019-05-29 21:11   ` David Rientjes
  0 siblings, 0 replies; 3+ messages in thread
From: David Rientjes @ 2019-05-29 21:11 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Hariprasad Kelam, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, linux-kernel

On Tue, 28 May 2019, Christoph Hellwig wrote:

> > 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.

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

end of thread, other threads:[~2019-05-29 21:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29  1:35 [PATCH] wd719x: pass GFP_ATOMIC instead of GFP_KERNEL Hariprasad Kelam
2019-05-29  6:23 ` Christoph Hellwig
2019-05-29 21:11   ` David Rientjes

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).