tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 494d311a82bb06a81fa7ef4277367701a792e6ef
commit: b5f025c3f702c1b7e1bc864d52d04e056da94f7d [1662/2764] scsi: mpt3sas: Cancel the
running work during host reset
config: i386-randconfig-m021-20200823 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
New smatch warnings:
drivers/scsi/mpt3sas/mpt3sas_scsih.c:9512 _mpt3sas_fw_work() warn: inconsistent indenting
Old smatch warnings:
drivers/scsi/mpt3sas/mpt3sas_scsih.c:5802 _scsih_expander_add() warn: returning -1 instead
of -ENOMEM is sloppy
#
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout b5f025c3f702c1b7e1bc864d52d04e056da94f7d
vim +9512 drivers/scsi/mpt3sas/mpt3sas_scsih.c
f92363d1235949 Sreekanth Reddy 2012-11-30 9417
f92363d1235949 Sreekanth Reddy 2012-11-30 9418 /**
f92363d1235949 Sreekanth Reddy 2012-11-30 9419 * _mpt3sas_fw_work - delayed
task for processing firmware events
f92363d1235949 Sreekanth Reddy 2012-11-30 9420 * @ioc: per adapter object
f92363d1235949 Sreekanth Reddy 2012-11-30 9421 * @fw_event: The fw_event_work
object
f92363d1235949 Sreekanth Reddy 2012-11-30 9422 * Context: user.
f92363d1235949 Sreekanth Reddy 2012-11-30 9423 */
f92363d1235949 Sreekanth Reddy 2012-11-30 9424 static void
f92363d1235949 Sreekanth Reddy 2012-11-30 9425 _mpt3sas_fw_work(struct
MPT3SAS_ADAPTER *ioc, struct fw_event_work *fw_event)
f92363d1235949 Sreekanth Reddy 2012-11-30 9426 {
b5f025c3f702c1 Suganath Prabu S 2020-07-30 9427 ioc->current_event =
fw_event;
146b16c8071f5f Sreekanth Reddy 2015-11-11 9428
_scsih_fw_event_del_from_list(ioc, fw_event);
146b16c8071f5f Sreekanth Reddy 2015-11-11 9429
f92363d1235949 Sreekanth Reddy 2012-11-30 9430 /* the queue is being flushed
so ignore this event */
146b16c8071f5f Sreekanth Reddy 2015-11-11 9431 if (ioc->remove_host ||
ioc->pci_error_recovery) {
146b16c8071f5f Sreekanth Reddy 2015-11-11 9432 fw_event_work_put(fw_event);
b5f025c3f702c1 Suganath Prabu S 2020-07-30 9433 ioc->current_event = NULL;
f92363d1235949 Sreekanth Reddy 2012-11-30 9434 return;
f92363d1235949 Sreekanth Reddy 2012-11-30 9435 }
f92363d1235949 Sreekanth Reddy 2012-11-30 9436
f92363d1235949 Sreekanth Reddy 2012-11-30 9437 switch (fw_event->event) {
f92363d1235949 Sreekanth Reddy 2012-11-30 9438 case
MPT3SAS_PROCESS_TRIGGER_DIAG:
35b62362803354 Joe Lawrence 2014-06-25 9439
mpt3sas_process_trigger_data(ioc,
35b62362803354 Joe Lawrence 2014-06-25 9440 (struct
SL_WH_TRIGGERS_EVENT_DATA_T *)
35b62362803354 Joe Lawrence 2014-06-25 9441 fw_event->event_data);
f92363d1235949 Sreekanth Reddy 2012-11-30 9442 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9443 case
MPT3SAS_REMOVE_UNRESPONDING_DEVICES:
146b16c8071f5f Sreekanth Reddy 2015-11-11 9444 while
(scsi_host_in_recovery(ioc->shost) ||
146b16c8071f5f Sreekanth Reddy 2015-11-11 9445 ioc->shost_recovery) {
146b16c8071f5f Sreekanth Reddy 2015-11-11 9446 /*
b5f025c3f702c1 Suganath Prabu S 2020-07-30 9447 * If we're unloading or
cancelling the work, bail.
b5f025c3f702c1 Suganath Prabu S 2020-07-30 9448 * Otherwise, this can become
an infinite loop.
146b16c8071f5f Sreekanth Reddy 2015-11-11 9449 */
b5f025c3f702c1 Suganath Prabu S 2020-07-30 9450 if (ioc->remove_host ||
ioc->fw_events_cleanup)
146b16c8071f5f Sreekanth Reddy 2015-11-11 9451 goto out;
f92363d1235949 Sreekanth Reddy 2012-11-30 9452 ssleep(1);
146b16c8071f5f Sreekanth Reddy 2015-11-11 9453 }
3075ac49024e7e Suganath Prabu Subramani 2017-10-31 9454
_scsih_remove_unresponding_devices(ioc);
f92363d1235949 Sreekanth Reddy 2012-11-30 9455
_scsih_scan_for_devices_after_reset(ioc);
d3f623ae8e0323 Sreekanth Reddy 2019-12-26 9456
_scsih_set_nvme_max_shutdown_latency(ioc);
f92363d1235949 Sreekanth Reddy 2012-11-30 9457 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9458 case
MPT3SAS_PORT_ENABLE_COMPLETE:
f92363d1235949 Sreekanth Reddy 2012-11-30 9459 ioc->start_scan = 0;
f92363d1235949 Sreekanth Reddy 2012-11-30 9460 if (missing_delay[0] != -1
&& missing_delay[1] != -1)
f92363d1235949 Sreekanth Reddy 2012-11-30 9461
mpt3sas_base_update_missing_delay(ioc, missing_delay[0],
f92363d1235949 Sreekanth Reddy 2012-11-30 9462 missing_delay[1]);
919d8a3f3fef99 Joe Perches 2018-09-17 9463 dewtprintk(ioc,
919d8a3f3fef99 Joe Perches 2018-09-17 9464 ioc_info(ioc, "port
enable: complete from worker thread\n"));
f92363d1235949 Sreekanth Reddy 2012-11-30 9465 break;
0f624c391ecbf1 Sreekanth Reddy 2014-09-12 9466 case MPT3SAS_TURN_ON_PFA_LED:
0f624c391ecbf1 Sreekanth Reddy 2014-09-12 9467 _scsih_turn_on_pfa_led(ioc,
fw_event->device_handle);
f92363d1235949 Sreekanth Reddy 2012-11-30 9468 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9469 case
MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST:
f92363d1235949 Sreekanth Reddy 2012-11-30 9470
_scsih_sas_topology_change_event(ioc, fw_event);
f92363d1235949 Sreekanth Reddy 2012-11-30 9471 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9472 case
MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE:
54d74e6b9d98bc Suganath Prabu 2019-08-03 9473 if (ioc->logging_level
& MPT_DEBUG_EVENT_WORK_TASK)
54d74e6b9d98bc Suganath Prabu 2019-08-03 9474
_scsih_sas_device_status_change_event_debug(ioc,
54d74e6b9d98bc Suganath Prabu 2019-08-03 9475
(Mpi2EventDataSasDeviceStatusChange_t *)
54d74e6b9d98bc Suganath Prabu 2019-08-03 9476
fw_event->event_data);
f92363d1235949 Sreekanth Reddy 2012-11-30 9477 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9478 case MPI2_EVENT_SAS_DISCOVERY:
f92363d1235949 Sreekanth Reddy 2012-11-30 9479
_scsih_sas_discovery_event(ioc, fw_event);
f92363d1235949 Sreekanth Reddy 2012-11-30 9480 break;
95540b8eaf30d2 Chaitra P B 2018-04-24 9481 case
MPI2_EVENT_SAS_DEVICE_DISCOVERY_ERROR:
95540b8eaf30d2 Chaitra P B 2018-04-24 9482
_scsih_sas_device_discovery_error_event(ioc, fw_event);
95540b8eaf30d2 Chaitra P B 2018-04-24 9483 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9484 case
MPI2_EVENT_SAS_BROADCAST_PRIMITIVE:
f92363d1235949 Sreekanth Reddy 2012-11-30 9485
_scsih_sas_broadcast_primitive_event(ioc, fw_event);
f92363d1235949 Sreekanth Reddy 2012-11-30 9486 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9487 case
MPI2_EVENT_SAS_ENCL_DEVICE_STATUS_CHANGE:
f92363d1235949 Sreekanth Reddy 2012-11-30 9488
_scsih_sas_enclosure_dev_status_change_event(ioc,
f92363d1235949 Sreekanth Reddy 2012-11-30 9489 fw_event);
f92363d1235949 Sreekanth Reddy 2012-11-30 9490 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9491 case
MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST:
f92363d1235949 Sreekanth Reddy 2012-11-30 9492
_scsih_sas_ir_config_change_event(ioc, fw_event);
f92363d1235949 Sreekanth Reddy 2012-11-30 9493 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9494 case MPI2_EVENT_IR_VOLUME:
f92363d1235949 Sreekanth Reddy 2012-11-30 9495
_scsih_sas_ir_volume_event(ioc, fw_event);
f92363d1235949 Sreekanth Reddy 2012-11-30 9496 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9497 case
MPI2_EVENT_IR_PHYSICAL_DISK:
f92363d1235949 Sreekanth Reddy 2012-11-30 9498
_scsih_sas_ir_physical_disk_event(ioc, fw_event);
f92363d1235949 Sreekanth Reddy 2012-11-30 9499 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9500 case
MPI2_EVENT_IR_OPERATION_STATUS:
f92363d1235949 Sreekanth Reddy 2012-11-30 9501
_scsih_sas_ir_operation_status_event(ioc, fw_event);
f92363d1235949 Sreekanth Reddy 2012-11-30 9502 break;
4318c73478474f Suganath Prabu Subramani 2017-10-31 9503 case
MPI2_EVENT_PCIE_DEVICE_STATUS_CHANGE:
4318c73478474f Suganath Prabu Subramani 2017-10-31 9504
_scsih_pcie_device_status_change_event(ioc, fw_event);
4318c73478474f Suganath Prabu Subramani 2017-10-31 9505 break;
4318c73478474f Suganath Prabu Subramani 2017-10-31 9506 case
MPI2_EVENT_PCIE_ENUMERATION:
4318c73478474f Suganath Prabu Subramani 2017-10-31 9507
_scsih_pcie_enumeration_event(ioc, fw_event);
4318c73478474f Suganath Prabu Subramani 2017-10-31 9508 break;
4318c73478474f Suganath Prabu Subramani 2017-10-31 9509 case
MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST:
4318c73478474f Suganath Prabu Subramani 2017-10-31 9510
_scsih_pcie_topology_change_event(ioc, fw_event);
b5f025c3f702c1 Suganath Prabu S 2020-07-30 9511 ioc->current_event = NULL;
4318c73478474f Suganath Prabu Subramani 2017-10-31 @9512 return;
4318c73478474f Suganath Prabu Subramani 2017-10-31 9513 break;
f92363d1235949 Sreekanth Reddy 2012-11-30 9514 }
146b16c8071f5f Sreekanth Reddy 2015-11-11 9515 out:
146b16c8071f5f Sreekanth Reddy 2015-11-11 9516 fw_event_work_put(fw_event);
b5f025c3f702c1 Suganath Prabu S 2020-07-30 9517 ioc->current_event = NULL;
f92363d1235949 Sreekanth Reddy 2012-11-30 9518 }
f92363d1235949 Sreekanth Reddy 2012-11-30 9519
:::::: The code at line 9512 was first introduced by commit
:::::: 4318c73478474f974f1922b3d8946d41e2d855d6 scsi: mpt3sas: Handle NVMe PCIe device
related events generated from firmware.
:::::: TO: Suganath Prabu Subramani <suganath-prabu.subramani(a)broadcom.com>
:::::: CC: Martin K. Petersen <martin.petersen(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org