]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: message: fusion: Use GFP_KERNEL instead of GFP_ATOMIC in non-atomic context
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 15 Feb 2022 06:32:34 +0000 (07:32 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 28 Feb 2022 02:21:21 +0000 (21:21 -0500)
commit6015f063e7b911e0670e7e2b3cc22475b22c1eff
treefdedca855bae79bd71aef36b1f5241d73bce7abf
parentd65f93a535d9944fd0f536e0ea4a809ba264117a
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.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/message/fusion/mptsas.c