History

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley: "All fixes for drivers. The core change in the error handler is simply to translate an ALUA specific sense code into a retry the ALUA components can handle and won't impact any other devices" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: error: alua: I/O errors for ALUA state transitions scsi: storvsc: Increase the timeouts to storvsc_timeout scsi: s390: zfcp: Ensure synchronous unit_add scsi: iscsi: Fix incorrect error path labels for flashnode operations scsi: mvsas: Fix typos in per-phy comments and SAS cmd port registers scsi: core: ufs: Fix a hang in the error handler

Linus Torvalds committed 1 year ago

Commit 4774cfe2 parents 25294cb 5c3ba816 files · +23 −14Browse files

Unified · Split

6 files
  1. drivers/s390/scsi/zfcp_sysfs.c +2 −0
  2. drivers/scsi/mvsas/mv_defs.h +2 −2
  3. drivers/scsi/scsi_error.c +2 −1
  4. drivers/scsi/scsi_transport_iscsi.c +5 −6
  5. drivers/scsi/storvsc_drv.c +6 −4
  6. drivers/ufs/core/ufshcd.c +6 −1
drivers/s390/scsi/zfcp_sysfs.c+2−0
@@ -449,6 +449,8 @@ static ssize_t zfcp_sysfs_unit_add_store(struct device *dev, · 448 unmodified lines
449 if (kstrtoull(buf, 0, (unsigned long long *) &fcp_lun))449 if (kstrtoull(buf, 0, (unsigned long long *) &fcp_lun))
450 return -EINVAL;450 return -EINVAL;
451 451
452 flush_work(&port->rport_work);
453
452 retval = zfcp_unit_add(port, fcp_lun);454 retval = zfcp_unit_add(port, fcp_lun);
453 if (retval)455 if (retval)
454 return retval;456 return retval;
drivers/scsi/mvsas/mv_defs.h+2−2
@@ -215,7 +215,7 @@ enum hw_register_bits { · 214 unmodified lines
215 215
216 /* MVS_Px_INT_STAT, MVS_Px_INT_MASK (per-phy events) */216 /* MVS_Px_INT_STAT, MVS_Px_INT_MASK (per-phy events) */
217 PHYEV_DEC_ERR = (1U << 24), /* Phy Decoding Error */217 PHYEV_DEC_ERR = (1U << 24), /* Phy Decoding Error */
218 PHYEV_DCDR_ERR = (1U << 23), /* STP Deocder Error */218 PHYEV_DCDR_ERR = (1U << 23), /* STP Decoder Error */
219 PHYEV_CRC_ERR = (1U << 22), /* STP CRC Error */219 PHYEV_CRC_ERR = (1U << 22), /* STP CRC Error */
220 PHYEV_UNASSOC_FIS = (1U << 19), /* unassociated FIS rx'd */220 PHYEV_UNASSOC_FIS = (1U << 19), /* unassociated FIS rx'd */
221 PHYEV_AN = (1U << 18), /* SATA async notification */221 PHYEV_AN = (1U << 18), /* SATA async notification */
@@ -347,7 +347,7 @@ enum sas_cmd_port_registers { · 125 unmodified lines
347 CMD_SATA_PORT_MEM_CTL0 = 0x158, /* SATA Port Memory Control 0 */347 CMD_SATA_PORT_MEM_CTL0 = 0x158, /* SATA Port Memory Control 0 */
348 CMD_SATA_PORT_MEM_CTL1 = 0x15c, /* SATA Port Memory Control 1 */348 CMD_SATA_PORT_MEM_CTL1 = 0x15c, /* SATA Port Memory Control 1 */
349 CMD_XOR_MEM_BIST_CTL = 0x160, /* XOR Memory BIST Control */349 CMD_XOR_MEM_BIST_CTL = 0x160, /* XOR Memory BIST Control */
350 CMD_XOR_MEM_BIST_STAT = 0x164, /* XOR Memroy BIST Status */350 CMD_XOR_MEM_BIST_STAT = 0x164, /* XOR Memory BIST Status */
351 CMD_DMA_MEM_BIST_CTL = 0x168, /* DMA Memory BIST Control */351 CMD_DMA_MEM_BIST_CTL = 0x168, /* DMA Memory BIST Control */
352 CMD_DMA_MEM_BIST_STAT = 0x16c, /* DMA Memory BIST Status */352 CMD_DMA_MEM_BIST_STAT = 0x16c, /* DMA Memory BIST Status */
353 CMD_PORT_MEM_BIST_CTL = 0x170, /* Port Memory BIST Control */353 CMD_PORT_MEM_BIST_CTL = 0x170, /* Port Memory BIST Control */
drivers/scsi/scsi_error.c+2−1
@@ -665,7 +665,8 @@ enum scsi_disposition scsi_check_sense(struct scsi_cmnd *scmd) · 664 unmodified lines
665 * if the device is in the process of becoming ready, we665 * if the device is in the process of becoming ready, we
666 * should retry.666 * should retry.
667 */667 */
668 if ((sshdr.asc == 0x04) && (sshdr.ascq == 0x01))668 if ((sshdr.asc == 0x04) &&
669 (sshdr.ascq == 0x01 || sshdr.ascq == 0x0a))
669 return NEEDS_RETRY;670 return NEEDS_RETRY;
670 /*671 /*
671 * if the device is not started, we need to wake672 * if the device is not started, we need to wake
drivers/scsi/scsi_transport_iscsi.c+5−6
@@ -3499,7 +3499,7 @@ static int iscsi_new_flashnode(struct iscsi_transport *transport, · 3498 unmodified lines
3499 pr_err("%s could not find host no %u\n",3499 pr_err("%s could not find host no %u\n",
3500 __func__, ev->u.new_flashnode.host_no);3500 __func__, ev->u.new_flashnode.host_no);
3501 err = -ENODEV;3501 err = -ENODEV;
3502 goto put_host;3502 goto exit_new_fnode;
3503 }3503 }
3504 3504
3505 index = transport->new_flashnode(shost, data, len);3505 index = transport->new_flashnode(shost, data, len);
@@ -3509,7 +3509,6 @@ static int iscsi_new_flashnode(struct iscsi_transport *transport, · 3 unmodified lines
3509 else3509 else
3510 err = -EIO;3510 err = -EIO;
3511 3511
3512put_host:
3513 scsi_host_put(shost);3512 scsi_host_put(shost);
3514 3513
3515exit_new_fnode:3514exit_new_fnode:
@@ -3534,7 +3533,7 @@ static int iscsi_del_flashnode(struct iscsi_transport *transport, · 18 unmodified lines
3534 pr_err("%s could not find host no %u\n",3533 pr_err("%s could not find host no %u\n",
3535 __func__, ev->u.del_flashnode.host_no);3534 __func__, ev->u.del_flashnode.host_no);
3536 err = -ENODEV;3535 err = -ENODEV;
3537 goto put_host;3536 goto exit_del_fnode;
3538 }3537 }
3539 3538
3540 idx = ev->u.del_flashnode.flashnode_idx;3539 idx = ev->u.del_flashnode.flashnode_idx;
@@ -3576,7 +3575,7 @@ static int iscsi_login_flashnode(struct iscsi_transport *transport, · 35 unmodified lines
3576 pr_err("%s could not find host no %u\n",3575 pr_err("%s could not find host no %u\n",
3577 __func__, ev->u.login_flashnode.host_no);3576 __func__, ev->u.login_flashnode.host_no);
3578 err = -ENODEV;3577 err = -ENODEV;
3579 goto put_host;3578 goto exit_login_fnode;
3580 }3579 }
3581 3580
3582 idx = ev->u.login_flashnode.flashnode_idx;3581 idx = ev->u.login_flashnode.flashnode_idx;
@@ -3628,7 +3627,7 @@ static int iscsi_logout_flashnode(struct iscsi_transport *transport, · 45 unmodified lines
3628 pr_err("%s could not find host no %u\n",3627 pr_err("%s could not find host no %u\n",
3629 __func__, ev->u.logout_flashnode.host_no);3628 __func__, ev->u.logout_flashnode.host_no);
3630 err = -ENODEV;3629 err = -ENODEV;
3631 goto put_host;3630 goto exit_logout_fnode;
3632 }3631 }
3633 3632
3634 idx = ev->u.logout_flashnode.flashnode_idx;3633 idx = ev->u.logout_flashnode.flashnode_idx;
@@ -3678,7 +3677,7 @@ static int iscsi_logout_flashnode_sid(struct iscsi_transport *transport, · 43 unmodified lines
3678 pr_err("%s could not find host no %u\n",3677 pr_err("%s could not find host no %u\n",
3679 __func__, ev->u.logout_flashnode.host_no);3678 __func__, ev->u.logout_flashnode.host_no);
3680 err = -ENODEV;3679 err = -ENODEV;
3681 goto put_host;3680 goto exit_logout_sid;
3682 }3681 }
3683 3682
3684 session = iscsi_session_lookup(ev->u.logout_flashnode_sid.sid);3683 session = iscsi_session_lookup(ev->u.logout_flashnode_sid.sid);
drivers/scsi/storvsc_drv.c+6−4
@@ -362,7 +362,7 @@ MODULE_PARM_DESC(ring_avail_percent_lowater, · 361 unmodified lines
362/*362/*
363 * Timeout in seconds for all devices managed by this driver.363 * Timeout in seconds for all devices managed by this driver.
364 */364 */
365static int storvsc_timeout = 180;365static const int storvsc_timeout = 180;
366 366
367#if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)367#if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)
368static struct scsi_transport_template *fc_transport_template;368static struct scsi_transport_template *fc_transport_template;
@@ -768,7 +768,7 @@ static void handle_multichannel_storage(struct hv_device *device, int max_chns) · 399 unmodified lines
768 return;768 return;
769 }769 }
770 770
771 t = wait_for_completion_timeout(&request->wait_event, 10*HZ);771 t = wait_for_completion_timeout(&request->wait_event, storvsc_timeout * HZ);
772 if (t == 0) {772 if (t == 0) {
773 dev_err(dev, "Failed to create sub-channel: timed out\n");773 dev_err(dev, "Failed to create sub-channel: timed out\n");
774 return;774 return;
@@ -833,7 +833,7 @@ static int storvsc_execute_vstor_op(struct hv_device *device, · 58 unmodified lines
833 if (ret != 0)833 if (ret != 0)
834 return ret;834 return ret;
835 835
836 t = wait_for_completion_timeout(&request->wait_event, 5*HZ);836 t = wait_for_completion_timeout(&request->wait_event, storvsc_timeout * HZ);
837 if (t == 0)837 if (t == 0)
838 return -ETIMEDOUT;838 return -ETIMEDOUT;
839 839
@@ -1350,6 +1350,8 @@ static int storvsc_connect_to_vsp(struct hv_device *device, u32 ring_size, · 510 unmodified lines
1350 return ret;1350 return ret;
1351 1351
1352 ret = storvsc_channel_init(device, is_fc);1352 ret = storvsc_channel_init(device, is_fc);
1353 if (ret)
1354 vmbus_close(device->channel);
1353 1355
1354 return ret;1356 return ret;
1355}1357}
@@ -1668,7 +1670,7 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd) · 312 unmodified lines
1668 if (ret != 0)1670 if (ret != 0)
1669 return FAILED;1671 return FAILED;
1670 1672
1671 t = wait_for_completion_timeout(&request->wait_event, 5*HZ);1673 t = wait_for_completion_timeout(&request->wait_event, storvsc_timeout * HZ);
1672 if (t == 0)1674 if (t == 0)
1673 return TIMEOUT_ERROR;1675 return TIMEOUT_ERROR;
1674 1676
drivers/ufs/core/ufshcd.c+6−1
@@ -6623,9 +6623,14 @@ static void ufshcd_err_handler(struct work_struct *work) · 6622 unmodified lines
6623 up(&hba->host_sem);6623 up(&hba->host_sem);
6624 return;6624 return;
6625 }6625 }
6626 ufshcd_set_eh_in_progress(hba);
6627 spin_unlock_irqrestore(hba->host->host_lock, flags);6626 spin_unlock_irqrestore(hba->host->host_lock, flags);
6627
6628 ufshcd_err_handling_prepare(hba);6628 ufshcd_err_handling_prepare(hba);
6629
6630 spin_lock_irqsave(hba->host->host_lock, flags);
6631 ufshcd_set_eh_in_progress(hba);
6632 spin_unlock_irqrestore(hba->host->host_lock, flags);
6633
6629 /* Complete requests that have door-bell cleared by h/w */6634 /* Complete requests that have door-bell cleared by h/w */
6630 ufshcd_complete_requests(hba, false);6635 ufshcd_complete_requests(hba, false);
6631 spin_lock_irqsave(hba->host->host_lock, flags);6636 spin_lock_irqsave(hba->host->host_lock, flags);