CC: [email protected]
CC: [email protected]
TO: "Sreekanth, Reddy," <[email protected]>
CC: "Martin K. Petersen" <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   38696e33e2bdf91cbbc7a2291dc6db862d9dfd42
commit: d3f623ae8e0323ca434ee9029100312a8be37773 scsi: mpt3sas: Add support for 
NVMe shutdown
date:   5 months ago
:::::: branch date: 63 minutes ago
:::::: commit date: 5 months ago
config: i386-randconfig-m021-20200603 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
drivers/scsi/mpt3sas/mpt3sas_scsih.c:1128 _scsih_pcie_device_remove() error: 
double unlocked 'ioc->pcie_device_lock' (orig line 1116)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:1171 _scsih_pcie_device_remove_by_handle() 
error: double unlocked 'ioc->pcie_device_lock' (orig line 1159)

Old smatch warnings:
drivers/scsi/mpt3sas/mpt3sas_scsih.c:3313 _scsih_fw_event_cleanup_queue() 
error: double unlocked 'ioc->fw_event_lock' (orig line 3313)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:3313 _scsih_fw_event_cleanup_queue() 
error: double unlocked 'ioc->fw_event_lock' (orig line 3313)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:3313 _scsih_fw_event_cleanup_queue() 
error: double unlocked 'ioc->fw_event_lock' (orig line 3313)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:3313 _scsih_fw_event_cleanup_queue() 
error: double unlocked 'ioc->fw_event_lock' (orig line 3313)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:5759 _scsih_expander_add() error: double 
unlocked 'ioc->sas_node_lock' (orig line 5747)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:5769 _scsih_expander_add() warn: returning 
-1 instead of -ENOMEM is sloppy
drivers/scsi/mpt3sas/mpt3sas_scsih.c:5833 _scsih_expander_add() error: double 
unlocked 'ioc->sas_node_lock' (orig line 5759)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:6212 _scsih_add_device() error: double 
unlocked 'ioc->sas_device_lock' (orig line 6141)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:6476 _scsih_sas_topology_change_event() 
error: double unlocked 'ioc->sas_node_lock' (orig line 6407)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:7571 
_scsih_sas_broadcast_primitive_event() error: double unlocked 
'ioc->scsi_lookup_lock' (orig line 7499)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:7824 _scsih_sas_volume_add() error: double 
unlocked 'ioc->raid_device_lock' (orig line 7808)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:7829 _scsih_sas_volume_add() error: double 
unlocked 'ioc->raid_device_lock' (orig line 7824)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:7833 _scsih_sas_volume_add() error: double 
unlocked 'ioc->raid_device_lock' (orig line 7824)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:8240 _scsih_sas_ir_volume_event() error: 
double unlocked 'ioc->raid_device_lock' (orig line 8217)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:8244 _scsih_sas_ir_volume_event() error: 
double unlocked 'ioc->raid_device_lock' (orig line 8240)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:8771 _scsih_mark_responding_raid_device() 
error: double unlocked 'ioc->raid_device_lock' (orig line 8758)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:8780 _scsih_mark_responding_raid_device() 
error: double unlocked 'ioc->raid_device_lock' (orig line 8758)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:9260 _scsih_scan_for_devices_after_reset() 
error: double unlocked 'ioc->sas_device_lock' (orig line 9150)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:9717 _scsih_expander_node_remove() error: 
double unlocked 'ioc->sas_node_lock' (orig line 9704)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:10150 _scsih_probe_sas() error: double 
unlocked 'ioc->sas_device_lock' (orig line 10150)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:10150 _scsih_probe_sas() error: double 
unlocked 'ioc->sas_device_lock' (orig line 10150)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:10150 _scsih_probe_sas() error: double 
unlocked 'ioc->sas_device_lock' (orig line 10150)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:10150 _scsih_probe_sas() error: double 
unlocked 'ioc->sas_device_lock' (orig line 10150)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:10247 _scsih_probe_pcie() error: double 
unlocked 'ioc->pcie_device_lock' (orig line 10240)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:10273 _scsih_probe_pcie() error: double 
unlocked 'ioc->pcie_device_lock' (orig line 10240)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:10240 _scsih_probe_pcie() error: double 
unlocked 'ioc->pcie_device_lock' (orig line 10273)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:10240 _scsih_probe_pcie() error: double 
unlocked 'ioc->pcie_device_lock' (orig line 10273)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:10240 _scsih_probe_pcie() error: double 
unlocked 'ioc->pcie_device_lock' (orig line 10273)
drivers/scsi/mpt3sas/mpt3sas_scsih.c:10240 _scsih_probe_pcie() error: double 
unlocked 'ioc->pcie_device_lock' (orig line 10273)

# 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d3f623ae8e0323ca434ee9029100312a8be37773
git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout d3f623ae8e0323ca434ee9029100312a8be37773
vim +1128 drivers/scsi/mpt3sas/mpt3sas_scsih.c

d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1079  
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1080  /**
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1081   * 
_scsih_pcie_device_remove - remove pcie_device from list.
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1082   * @ioc: per adapter 
object
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1083   * @pcie_device: the 
pcie_device object
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1084   * Context: This 
function will acquire ioc->pcie_device_lock.
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1085   *
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1086   * If pcie_device is 
on the list, remove it and decrement its reference count.
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1087   */
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1088  static void
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1089  
_scsih_pcie_device_remove(struct MPT3SAS_ADAPTER *ioc,
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1090        struct 
_pcie_device *pcie_device)
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1091  {
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1092        unsigned long 
flags;
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1093        int 
was_on_pcie_device_list = 0;
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1094        u8 
update_latency = 0;
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1095  
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1096        if 
(!pcie_device)
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1097                return;
919d8a3f3fef99 Joe Perches              2018-09-17  1098        ioc_info(ioc, 
"removing handle(0x%04x), wwid(0x%016llx)\n",
919d8a3f3fef99 Joe Perches              2018-09-17  1099                 
pcie_device->handle, (u64)pcie_device->wwid);
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1100        if 
(pcie_device->enclosure_handle != 0)
919d8a3f3fef99 Joe Perches              2018-09-17  1101                
ioc_info(ioc, "removing enclosure logical id(0x%016llx), slot(%d)\n",
919d8a3f3fef99 Joe Perches              2018-09-17  1102                        
 (u64)pcie_device->enclosure_logical_id,
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1103                        
 pcie_device->slot);
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1104        if 
(pcie_device->connector_name[0] != '\0')
919d8a3f3fef99 Joe Perches              2018-09-17  1105                
ioc_info(ioc, "removing enclosure level(0x%04x), connector name( %s)\n",
919d8a3f3fef99 Joe Perches              2018-09-17  1106                        
 pcie_device->enclosure_level,
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1107                        
 pcie_device->connector_name);
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1108  
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1109        
spin_lock_irqsave(&ioc->pcie_device_lock, flags);
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1110        if 
(!list_empty(&pcie_device->list)) {
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1111                
list_del_init(&pcie_device->list);
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1112                
was_on_pcie_device_list = 1;
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1113        }
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1114        if 
(pcie_device->shutdown_latency == ioc->max_shutdown_latency)
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1115                
update_latency = 1;
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31 @1116        
spin_unlock_irqrestore(&ioc->pcie_device_lock, flags);
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1117        if 
(was_on_pcie_device_list) {
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1118                
kfree(pcie_device->serial_number);
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1119                
pcie_device_put(pcie_device);
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1120        }
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1121  
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1122        /*
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1123         * This 
device's RTD3 Entry Latency matches IOC's
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1124         * 
max_shutdown_latency. Recalculate IOC's max_shutdown_latency
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1125         * from the 
available drives as current drive is getting removed.
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1126         */
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1127        if 
(update_latency)
d3f623ae8e0323 Sreekanth Reddy          2019-12-26 @1128                
_scsih_set_nvme_max_shutdown_latency(ioc);
d88e1eaba6eee7 Suganath Prabu Subramani 2017-10-31  1129  }
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1130  
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1131  
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1132  /**
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1133   * 
_scsih_pcie_device_remove_by_handle - removing pcie device object by handle
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1134   * @ioc: per adapter 
object
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1135   * @handle: device 
handle
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1136   */
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1137  static void
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1138  
_scsih_pcie_device_remove_by_handle(struct MPT3SAS_ADAPTER *ioc, u16 handle)
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1139  {
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1140        struct 
_pcie_device *pcie_device;
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1141        unsigned long 
flags;
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1142        int 
was_on_pcie_device_list = 0;
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1143        u8 
update_latency = 0;
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1144  
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1145        if 
(ioc->shost_recovery)
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1146                return;
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1147  
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1148        
spin_lock_irqsave(&ioc->pcie_device_lock, flags);
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1149        pcie_device = 
__mpt3sas_get_pdev_by_handle(ioc, handle);
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1150        if 
(pcie_device) {
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1151                if 
(!list_empty(&pcie_device->list)) {
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1152                        
list_del_init(&pcie_device->list);
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1153                        
was_on_pcie_device_list = 1;
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1154                        
pcie_device_put(pcie_device);
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1155                }
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1156                if 
(pcie_device->shutdown_latency == ioc->max_shutdown_latency)
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1157                        
update_latency = 1;
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1158        }
3075ac49024e7e Suganath Prabu Subramani 2017-10-31 @1159        
spin_unlock_irqrestore(&ioc->pcie_device_lock, flags);
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1160        if 
(was_on_pcie_device_list) {
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1161                
_scsih_pcie_device_remove_from_sml(ioc, pcie_device);
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1162                
pcie_device_put(pcie_device);
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1163        }
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1164  
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1165        /*
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1166         * This 
device's RTD3 Entry Latency matches IOC's
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1167         * 
max_shutdown_latency. Recalculate IOC's max_shutdown_latency
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1168         * from the 
available drives as current drive is getting removed.
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1169         */
d3f623ae8e0323 Sreekanth Reddy          2019-12-26  1170        if 
(update_latency)
d3f623ae8e0323 Sreekanth Reddy          2019-12-26 @1171                
_scsih_set_nvme_max_shutdown_latency(ioc);
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1172  }
3075ac49024e7e Suganath Prabu Subramani 2017-10-31  1173  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to