linux/drivers/scsi/qla2xxx
Ahmed S. Darwish 4f6a57c23b scsi: qla2xxx: Remove in_interrupt() from qla83xx-specific code
qla83xx_wait_logic() is used to control the frequency of device IDC lock
retries. If in_interrupt() is true, it does 20 loops of cpu_relax().
Otherwise, it sleeps for 100ms and yields the CPU.

While in_interrupt() is ill-defined and does not provide what the name
suggests, it is not needed here: that qla83xx_wait_logic() is exclusively
called by qla83xx_idc_lock() / unlock(), and they always run from process
context. Below is an analysis of all the idc lock/unlock callers, in order
of appearance:

  - qla_os.c:
      qla83xx_nic_core_unrecoverable_work(),
      qla83xx_idc_state_handler_work(),
      qla83xx_nic_core_reset_work(),
      qla83xx_service_idc_aen(), all workqueue context

  - qla_os.c: qla83xx_check_nic_core_fw_alive(), has msleep()

  - qla_os.c: qla83xx_set_drv_presence(), called once from
    qla2x00_abort_isp(), which is bound to process-context ->abort_isp()
    hook. It also invokes wait_for_completion_timeout() through the chain
    qla2x00_configure_hba() => qla24xx_link_initialize() =>
    qla2x00_mailbox_command().

  - qla_os.c: qla83xx_clear_drv_presence(), which is called from
    qla2x00_abort_isp() discussed above, and from qla2x00_remove_one()
    which is PCI process-context ->remove() hook.

  - qla_os.c: qla83xx_need_reset_handler(), has a one second msleep() in
    a loop.

  - qla_os.c: qla83xx_device_bootstrap(), called only by
    qla83xx_idc_state_handler(), which has multiple msleep()
    invocations.

  - qla_os.c: qla83xx_idc_state_handler(), multiple msleep()
    invocations.

  - qla_attr.c: qla2x00_sysfs_write_reset(), sysfs bin_attribute
    ->write() hook, process context

  - qla_init.c: qla83xx_nic_core_fw_load()
      => qla_init.c: qla2x00_initialize_adapter()
        => bound to isp_operations ->initialize_adapter() hook
        ** => qla_os.c: qla2x00_probe_one(), PCI ->probe() process ctx

  - qla_init.c: qla83xx_initiating_reset(), msleep() in a loop.

  - qla_init.c: qla83xx_nic_core_reset(), called by
    qla83xx_nic_core_reset_work(), workqueue context.

Remove the in_interrupt() check, and thus replace the entirety of
qla83xx_wait_logic() with an msleep(QLA83XX_WAIT_LOGIC_MS).

Mark qla83xx_idc_lock() / unlock() with "Context: task, can sleep".

Link: https://lore.kernel.org/r/20201126132952.2287996-7-bigeasy@linutronix.de
Cc: Nilesh Javali <njavali@marvell.com>
Cc: GR-QLogic-Storage-Upstream@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-12-01 00:03:53 -05:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile
qla_attr.c SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_bsg.c scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_bsg.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_dbg.c SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_dbg.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_def.h scsi: qla2xxx: Remove in_interrupt() from qla82xx-specific code 2020-12-01 00:03:52 -05:00
qla_devtbl.h
qla_dfs.c SCSI misc on 20201023 2020-10-23 16:19:02 -07:00
qla_dsd.h scsi: qla2xxx: Include the <asm/unaligned.h> header file from qla_dsd.h 2019-08-12 21:34:04 -04:00
qla_fw.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_gbl.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_gs.c SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_init.c scsi: qla2xxx: Move sess cmd list/lock to driver 2020-11-04 22:39:37 -05:00
qla_inline.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_iocb.c SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_isr.c SCSI misc on 20201023 2020-10-23 16:19:02 -07:00
qla_mbx.c scsi: Remove unneeded break statements 2020-10-26 18:23:24 -04:00
qla_mid.c SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_mr.c scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_mr.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_nvme.c SCSI misc on 20201023 2020-10-23 16:19:02 -07:00
qla_nvme.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_nx2.c SCSI misc on 20201023 2020-10-23 16:19:02 -07:00
qla_nx2.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_nx.c scsi: qla2xxx: Remove in_interrupt() from qla82xx-specific code 2020-12-01 00:03:52 -05:00
qla_nx.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_os.c scsi: qla2xxx: Remove in_interrupt() from qla83xx-specific code 2020-12-01 00:03:53 -05:00
qla_settings.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_sup.c scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_target.c scsi: qla2xxx: Move sess cmd list/lock to driver 2020-11-04 22:39:37 -05:00
qla_target.h scsi: qla2xxx: Move sess cmd list/lock to driver 2020-11-04 22:39:37 -05:00
qla_tmpl.c SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_tmpl.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_version.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
tcm_qla2xxx.c scsi: target: tcm_qla2xxx: Remove BUG_ON(in_interrupt()) 2020-12-01 00:03:52 -05:00
tcm_qla2xxx.h scsi: qla2xxx: deadlock by configfs_depend_item 2018-12-19 21:26:38 -05:00