• Tetsuo Handa's avatar
    scsi: message: fusion: Avoid flush_scheduled_work() usage · a4c2673c
    Tetsuo Handa authored
    Like commit c4f135d6 ("workqueue: Wrap flush_workqueue() using a
    macro") says, flush_scheduled_work() is dangerous and will be forbidden.
    
    Commit 4d4109d0 ("[SCSI] mpt fusion: Power Management fixes for MPT SAS
    PCI-E controllers") added flush_scheduled_work() call into
    mptscsih_suspend().  As of commit 4d4109d0, there were several
    schedule{,_delayed}_work() calls where flush_scheduled_work() from
    mptscsih_suspend() meant to wait for completion. However, which work items
    this flush_scheduled_work() call was for was not explained.
    
    Then, schedule_work("struct mptsas_hotplug_event"->work) and
    schedule_work(MPT_ADAPTER->sas_persist_task) have been removed by commit
    3eb0822c ("[SCSI] mpt fusion: Firmware event implementation using
    seperate WorkQueue"), and schedule_work("struct
    mptsas_send_discovery_event"->work) has been removed by commit f9c34022
    ("[SCSI] mpt fusion: SAS topology scan changes, expander events").
    
    There still remains schedule_work("struct work_queue_wrapper"->work) call
    in mptspi.c and schedule_delayed_work("struct mpt_lan_priv"->work) call in
    mptlan.c , but I guess that these are not work items which commit
    4d4109d0 meant to wait for completion because these are not per
    MPT_ADAPTER work items. If my guess is correct, we no longer need to call
    flush_scheduled_work() from mptscsih_suspend().
    
    Link: https://lore.kernel.org/r/0b9ebcfb-b647-1381-0653-b54528a64a86@I-love.SAKURA.ne.jpSigned-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    a4c2673c
mptscsih.c 90.7 KB