diff options
| -rw-r--r-- | drivers/scsi/hisi_sas/hisi_sas_main.c | 6 | ||||
| -rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 23 | ||||
| -rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 7 | ||||
| -rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/scsi_lib.c | 15 | ||||
| -rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 2 |
6 files changed, 47 insertions, 8 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 3c3cf89f713f..14bac4966c87 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c | |||
| @@ -1801,6 +1801,12 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device) | |||
| 1801 | } | 1801 | } |
| 1802 | hisi_sas_dereg_device(hisi_hba, device); | 1802 | hisi_sas_dereg_device(hisi_hba, device); |
| 1803 | 1803 | ||
| 1804 | if (dev_is_sata(device)) { | ||
| 1805 | rc = hisi_sas_softreset_ata_disk(device); | ||
| 1806 | if (rc) | ||
| 1807 | return TMF_RESP_FUNC_FAILED; | ||
| 1808 | } | ||
| 1809 | |||
| 1804 | rc = hisi_sas_debug_I_T_nexus_reset(device); | 1810 | rc = hisi_sas_debug_I_T_nexus_reset(device); |
| 1805 | 1811 | ||
| 1806 | if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV)) | 1812 | if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV)) |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 1135e74646e2..8cec5230fe31 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
| @@ -96,6 +96,7 @@ static int client_reserve = 1; | |||
| 96 | static char partition_name[96] = "UNKNOWN"; | 96 | static char partition_name[96] = "UNKNOWN"; |
| 97 | static unsigned int partition_number = -1; | 97 | static unsigned int partition_number = -1; |
| 98 | static LIST_HEAD(ibmvscsi_head); | 98 | static LIST_HEAD(ibmvscsi_head); |
| 99 | static DEFINE_SPINLOCK(ibmvscsi_driver_lock); | ||
| 99 | 100 | ||
| 100 | static struct scsi_transport_template *ibmvscsi_transport_template; | 101 | static struct scsi_transport_template *ibmvscsi_transport_template; |
| 101 | 102 | ||
| @@ -2270,7 +2271,9 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) | |||
| 2270 | } | 2271 | } |
| 2271 | 2272 | ||
| 2272 | dev_set_drvdata(&vdev->dev, hostdata); | 2273 | dev_set_drvdata(&vdev->dev, hostdata); |
| 2274 | spin_lock(&ibmvscsi_driver_lock); | ||
| 2273 | list_add_tail(&hostdata->host_list, &ibmvscsi_head); | 2275 | list_add_tail(&hostdata->host_list, &ibmvscsi_head); |
| 2276 | spin_unlock(&ibmvscsi_driver_lock); | ||
| 2274 | return 0; | 2277 | return 0; |
| 2275 | 2278 | ||
| 2276 | add_srp_port_failed: | 2279 | add_srp_port_failed: |
| @@ -2292,15 +2295,27 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) | |||
| 2292 | static int ibmvscsi_remove(struct vio_dev *vdev) | 2295 | static int ibmvscsi_remove(struct vio_dev *vdev) |
| 2293 | { | 2296 | { |
| 2294 | struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev); | 2297 | struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev); |
| 2295 | list_del(&hostdata->host_list); | 2298 | unsigned long flags; |
| 2296 | unmap_persist_bufs(hostdata); | 2299 | |
| 2300 | srp_remove_host(hostdata->host); | ||
| 2301 | scsi_remove_host(hostdata->host); | ||
| 2302 | |||
| 2303 | purge_requests(hostdata, DID_ERROR); | ||
| 2304 | |||
| 2305 | spin_lock_irqsave(hostdata->host->host_lock, flags); | ||
| 2297 | release_event_pool(&hostdata->pool, hostdata); | 2306 | release_event_pool(&hostdata->pool, hostdata); |
| 2307 | spin_unlock_irqrestore(hostdata->host->host_lock, flags); | ||
| 2308 | |||
| 2298 | ibmvscsi_release_crq_queue(&hostdata->queue, hostdata, | 2309 | ibmvscsi_release_crq_queue(&hostdata->queue, hostdata, |
| 2299 | max_events); | 2310 | max_events); |
| 2300 | 2311 | ||
| 2301 | kthread_stop(hostdata->work_thread); | 2312 | kthread_stop(hostdata->work_thread); |
| 2302 | srp_remove_host(hostdata->host); | 2313 | unmap_persist_bufs(hostdata); |
| 2303 | scsi_remove_host(hostdata->host); | 2314 | |
| 2315 | spin_lock(&ibmvscsi_driver_lock); | ||
| 2316 | list_del(&hostdata->host_list); | ||
| 2317 | spin_unlock(&ibmvscsi_driver_lock); | ||
| 2318 | |||
| 2304 | scsi_host_put(hostdata->host); | 2319 | scsi_host_put(hostdata->host); |
| 2305 | 2320 | ||
| 2306 | return 0; | 2321 | return 0; |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 420045155ba0..0c700b140ce7 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
| @@ -4991,6 +4991,13 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha) | |||
| 4991 | if ((domain & 0xf0) == 0xf0) | 4991 | if ((domain & 0xf0) == 0xf0) |
| 4992 | continue; | 4992 | continue; |
| 4993 | 4993 | ||
| 4994 | /* Bypass if not same domain and area of adapter. */ | ||
| 4995 | if (area && domain && ((area != vha->d_id.b.area) || | ||
| 4996 | (domain != vha->d_id.b.domain)) && | ||
| 4997 | (ha->current_topology == ISP_CFG_NL)) | ||
| 4998 | continue; | ||
| 4999 | |||
| 5000 | |||
| 4994 | /* Bypass invalid local loop ID. */ | 5001 | /* Bypass invalid local loop ID. */ |
| 4995 | if (loop_id > LAST_LOCAL_LOOP_ID) | 5002 | if (loop_id > LAST_LOCAL_LOOP_ID) |
| 4996 | continue; | 5003 | continue; |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 677f82fdf56f..91f576d743fe 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
| @@ -1517,7 +1517,7 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type, | |||
| 1517 | goto eh_reset_failed; | 1517 | goto eh_reset_failed; |
| 1518 | } | 1518 | } |
| 1519 | err = 2; | 1519 | err = 2; |
| 1520 | if (do_reset(fcport, cmd->device->lun, blk_mq_rq_cpu(cmd->request) + 1) | 1520 | if (do_reset(fcport, cmd->device->lun, 1) |
| 1521 | != QLA_SUCCESS) { | 1521 | != QLA_SUCCESS) { |
| 1522 | ql_log(ql_log_warn, vha, 0x800c, | 1522 | ql_log(ql_log_warn, vha, 0x800c, |
| 1523 | "do_reset failed for cmd=%p.\n", cmd); | 1523 | "do_reset failed for cmd=%p.\n", cmd); |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 20189675677a..601b9f1de267 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
| @@ -585,10 +585,17 @@ static bool scsi_end_request(struct request *req, blk_status_t error, | |||
| 585 | if (!blk_rq_is_scsi(req)) { | 585 | if (!blk_rq_is_scsi(req)) { |
| 586 | WARN_ON_ONCE(!(cmd->flags & SCMD_INITIALIZED)); | 586 | WARN_ON_ONCE(!(cmd->flags & SCMD_INITIALIZED)); |
| 587 | cmd->flags &= ~SCMD_INITIALIZED; | 587 | cmd->flags &= ~SCMD_INITIALIZED; |
| 588 | destroy_rcu_head(&cmd->rcu); | ||
| 589 | } | 588 | } |
| 590 | 589 | ||
| 591 | /* | 590 | /* |
| 591 | * Calling rcu_barrier() is not necessary here because the | ||
| 592 | * SCSI error handler guarantees that the function called by | ||
| 593 | * call_rcu() has been called before scsi_end_request() is | ||
| 594 | * called. | ||
| 595 | */ | ||
| 596 | destroy_rcu_head(&cmd->rcu); | ||
| 597 | |||
| 598 | /* | ||
| 592 | * In the MQ case the command gets freed by __blk_mq_end_request, | 599 | * In the MQ case the command gets freed by __blk_mq_end_request, |
| 593 | * so we have to do all cleanup that depends on it earlier. | 600 | * so we have to do all cleanup that depends on it earlier. |
| 594 | * | 601 | * |
| @@ -2541,8 +2548,10 @@ void scsi_device_resume(struct scsi_device *sdev) | |||
| 2541 | * device deleted during suspend) | 2548 | * device deleted during suspend) |
| 2542 | */ | 2549 | */ |
| 2543 | mutex_lock(&sdev->state_mutex); | 2550 | mutex_lock(&sdev->state_mutex); |
| 2544 | sdev->quiesced_by = NULL; | 2551 | if (sdev->quiesced_by) { |
| 2545 | blk_clear_pm_only(sdev->request_queue); | 2552 | sdev->quiesced_by = NULL; |
| 2553 | blk_clear_pm_only(sdev->request_queue); | ||
| 2554 | } | ||
| 2546 | if (sdev->sdev_state == SDEV_QUIESCE) | 2555 | if (sdev->sdev_state == SDEV_QUIESCE) |
| 2547 | scsi_device_set_state(sdev, SDEV_RUNNING); | 2556 | scsi_device_set_state(sdev, SDEV_RUNNING); |
| 2548 | mutex_unlock(&sdev->state_mutex); | 2557 | mutex_unlock(&sdev->state_mutex); |
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 0508831d6fb9..0a82e93566dc 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c | |||
| @@ -2200,6 +2200,8 @@ void iscsi_remove_session(struct iscsi_cls_session *session) | |||
| 2200 | scsi_target_unblock(&session->dev, SDEV_TRANSPORT_OFFLINE); | 2200 | scsi_target_unblock(&session->dev, SDEV_TRANSPORT_OFFLINE); |
| 2201 | /* flush running scans then delete devices */ | 2201 | /* flush running scans then delete devices */ |
| 2202 | flush_work(&session->scan_work); | 2202 | flush_work(&session->scan_work); |
| 2203 | /* flush running unbind operations */ | ||
| 2204 | flush_work(&session->unbind_work); | ||
| 2203 | __iscsi_unbind_session(&session->unbind_work); | 2205 | __iscsi_unbind_session(&session->unbind_work); |
| 2204 | 2206 | ||
| 2205 | /* hw iscsi may not have removed all connections from session */ | 2207 | /* hw iscsi may not have removed all connections from session */ |
