[lkml]   [2022]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] scsi: message: fusion: Use GFP_KERNEL instead of GFP_ATOMIC in non-atomic context
Just a few lines below this kzalloc() we have a mutex_lock() which can

More over, the only way to call this function is when a delayed work is
schedule. And delayed work can sleep.
INIT_DELAYED_WORK(&fw_event->work, mptsas_firmware_event_work);
--> mptsas_firmware_event_work()
--> mptsas_send_link_status_event()
--> mptsas_expander_add()

So there is really no good reason to use GFP_ATOMIC here. Change it to
GFP_KERNEL to give more opportunities to the kernel.

Signed-off-by: Christophe JAILLET <>
drivers/message/fusion/mptsas.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 4acd8f9a48e1..34901bcd1ce8 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -3680,7 +3680,7 @@ mptsas_expander_add(MPT_ADAPTER *ioc, u16 handle)
return NULL;

- port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_ATOMIC);
+ port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL);
if (!port_info) {
dfailprintk(ioc, printk(MYIOC_s_ERR_FMT
"%s: exit at line=%d\n", ioc->name,
 \ /
  Last update: 2022-02-15 07:33    [W:0.059 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site