Commit e3af2e3b authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Martin K. Petersen

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

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

Link: https://lore.kernel.org/r/eccb2179ce800529851ed4fabc9d3f95fbbf7d7f.1644906731.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c5b483d5
...@@ -3680,7 +3680,7 @@ mptsas_expander_add(MPT_ADAPTER *ioc, u16 handle) ...@@ -3680,7 +3680,7 @@ mptsas_expander_add(MPT_ADAPTER *ioc, u16 handle)
MPI_SAS_EXPAND_PGAD_FORM_SHIFT), handle))) MPI_SAS_EXPAND_PGAD_FORM_SHIFT), handle)))
return NULL; return NULL;
port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_ATOMIC); port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL);
if (!port_info) { if (!port_info) {
dfailprintk(ioc, printk(MYIOC_s_ERR_FMT dfailprintk(ioc, printk(MYIOC_s_ERR_FMT
"%s: exit at line=%d\n", ioc->name, "%s: exit at line=%d\n", ioc->name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment