linux-stable/drivers/scsi/lpfc
James Smart 3ad348d944 scsi: lpfc: Fix oops when fewer hdwqs than cpus
When tearing down the adapter for a reset, online/offline, or driver
unload, the queue free routine would hit a GPF oops.  This only occurs on
conditions where the number of hardware queues created is fewer than the
number of cpus in the system. In this condition cpus share a hardware
queue. And of course, it's the 2nd cpu that shares a hardware that
attempted to free it a second time and hit the oops.

Fix by reworking the cpu to hardware queue mapping such that:
Assignment of hardware queues to cpus occur in two passes:
first pass: is first time assignment of a hardware queue to a cpu.
  This will set the LPFC_CPU_FIRST_IRQ flag for the cpu.
second pass: for cpus that did not get a hardware queue they will
  be assigned one from a primary cpu (one set in first pass).

Deletion of hardware queues is driven by cpu itteration, and queues
will only be deleted if the LPFC_CPU_FIRST_IRQ flag is set.

Also contains a few small cleanup fixes and a little better logging.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-08-19 22:41:09 -04:00
..
lpfc.h lpfc: add sysfs interface to post NVME RSCN 2019-06-21 11:08:38 +02:00
lpfc_attr.c SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
lpfc_attr.h
lpfc_bsg.c scsi: lpfc: remove redundant code 2019-08-19 22:07:50 -04:00
lpfc_bsg.h scsi: lpfc: Update Copyright in driver version 2019-03-19 13:15:10 -04:00
lpfc_compat.h
lpfc_crtn.h SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
lpfc_ct.c scsi: lpfc: Fix discovery when target has no GID_FT information 2019-08-19 22:41:09 -04:00
lpfc_debugfs.c scsi: lpfc: change snprintf to scnprintf for possible overflow 2019-03-25 22:14:16 -04:00
lpfc_debugfs.h scsi: lpfc: reduce stack size with CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE 2019-07-11 20:42:30 -04:00
lpfc_disc.h scsi: lpfc: Fix PLOGI failure with high remoteport count 2019-08-19 22:41:08 -04:00
lpfc_els.c SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
lpfc_hbadisc.c scsi: lpfc: Fix PLOGI failure with high remoteport count 2019-08-19 22:41:08 -04:00
lpfc_hw.h scsi: lpfc: Fix ELS field alignments 2019-08-19 22:41:08 -04:00
lpfc_hw4.h scsi: lpfc: Move trunk_errmsg[] from a header file into a .c file 2019-04-03 23:11:36 -04:00
lpfc_ids.h
lpfc_init.c scsi: lpfc: Fix oops when fewer hdwqs than cpus 2019-08-19 22:41:09 -04:00
lpfc_logmsg.h
lpfc_mbox.c SCSI misc on 20190306 2019-03-09 16:53:47 -08:00
lpfc_mem.c scsi: lpfc: remove NULL check before some freeing functions 2019-08-19 22:21:57 -04:00
lpfc_nl.h
lpfc_nportdisc.c scsi: lpfc: Fix ADISC reception terminating login state if a NVME target 2019-08-19 22:41:09 -04:00
lpfc_nvme.c scsi: lpfc: Fix Oops in nvme_register with target logout/login 2019-08-19 22:41:09 -04:00
lpfc_nvme.h SCSI misc on 20190306 2019-03-09 16:53:47 -08:00
lpfc_nvmet.c SCSI sg on 20190709 2019-07-11 15:17:41 -07:00
lpfc_nvmet.h scsi: lpfc: Fix nvmet handling of received ABTS for unmapped frames 2019-06-18 19:46:21 -04:00
lpfc_scsi.c scsi: lpfc: Fix fcp_rsp_len checking on lun reset 2019-06-18 19:46:22 -04:00
lpfc_scsi.h scsi: lpfc: Update 12.2.0.0 file copyrights to 2019 2019-02-05 22:29:50 -05:00
lpfc_sli.c scsi: lpfc: Fix irq raising in lpfc_sli_hba_down 2019-08-19 22:41:09 -04:00
lpfc_sli.h scsi: lpfc: Coordinate adapter error handling with offline handling 2019-03-19 12:57:02 -04:00
lpfc_sli4.h scsi: lpfc: Fix poor use of hardware queues if fewer irq vectors 2019-06-18 19:46:22 -04:00
lpfc_version.h scsi: lpfc: Update lpfc version to 12.2.0.3 2019-06-18 19:46:22 -04:00
lpfc_vport.c scsi: lpfc: Fix issuing init_vpi mbox on SLI-3 card 2019-08-19 22:41:09 -04:00
lpfc_vport.h
Makefile