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

Pull SCSI fixes from James Bottomley:
"Nine minor fixes, seven in drivers and two in the core SCSI disk
driver (sd) which should be harmless involving removing an unused
variable and quietening a spurious warning"

Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: sd: Remove obsolete variable in sd_remove()
scsi: sd: Suppress spurious errors when WRITE SAME is being disabled
scsi: scsi_debug: Fix memleak in scsi_debug_init()
scsi: mpt3sas: Fix spelling mistake in Kconfig "compatiblity" -> "compatibility"
scsi: qedi: Correct max length of CHAP secret
scsi: ufs: Correct the LUN used in eh_device_reset_handler() callback
scsi: ufs: Relocate flush of exceptional event
scsi: ufs: Relax the condition of UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL
scsi: ufs: Fix possible power drain during system suspend

Changed files
+19 -22
drivers
scsi
+1 -1
drivers/scsi/mpt3sas/Kconfig
··· 79 79 select SCSI_MPT3SAS 80 80 depends on PCI && SCSI 81 81 help 82 - Dummy config option for backwards compatiblity: configure the MPT3SAS 82 + Dummy config option for backwards compatibility: configure the MPT3SAS 83 83 driver instead.
+2 -2
drivers/scsi/qedi/qedi_main.c
··· 2245 2245 chap_name); 2246 2246 break; 2247 2247 case ISCSI_BOOT_TGT_CHAP_SECRET: 2248 - rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN, 2248 + rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN, 2249 2249 chap_secret); 2250 2250 break; 2251 2251 case ISCSI_BOOT_TGT_REV_CHAP_NAME: ··· 2253 2253 mchap_name); 2254 2254 break; 2255 2255 case ISCSI_BOOT_TGT_REV_CHAP_SECRET: 2256 - rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN, 2256 + rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN, 2257 2257 mchap_secret); 2258 2258 break; 2259 2259 case ISCSI_BOOT_TGT_FLAGS:
+3 -2
drivers/scsi/scsi_debug.c
··· 6740 6740 k = sdeb_zbc_model_str(sdeb_zbc_model_s); 6741 6741 if (k < 0) { 6742 6742 ret = k; 6743 - goto free_vm; 6743 + goto free_q_arr; 6744 6744 } 6745 6745 sdeb_zbc_model = k; 6746 6746 switch (sdeb_zbc_model) { ··· 6753 6753 break; 6754 6754 default: 6755 6755 pr_err("Invalid ZBC model\n"); 6756 - return -EINVAL; 6756 + ret = -EINVAL; 6757 + goto free_q_arr; 6757 6758 } 6758 6759 } 6759 6760 if (sdeb_zbc_model != BLK_ZONED_NONE) {
+3 -3
drivers/scsi/sd.c
··· 984 984 } 985 985 } 986 986 987 - if (sdp->no_write_same) 987 + if (sdp->no_write_same) { 988 + rq->rq_flags |= RQF_QUIET; 988 989 return BLK_STS_TARGET; 990 + } 989 991 990 992 if (sdkp->ws16 || lba > 0xffffffff || nr_blocks > 0xffff) 991 993 return sd_setup_write_same16_cmnd(cmd, false); ··· 3512 3510 static int sd_remove(struct device *dev) 3513 3511 { 3514 3512 struct scsi_disk *sdkp; 3515 - dev_t devt; 3516 3513 3517 3514 sdkp = dev_get_drvdata(dev); 3518 - devt = disk_devt(sdkp->disk); 3519 3515 scsi_autopm_get_device(sdkp->device); 3520 3516 3521 3517 async_synchronize_full_domain(&scsi_sd_pm_domain);
+10 -14
drivers/scsi/ufs/ufshcd.c
··· 289 289 if (ret) 290 290 dev_err(hba->dev, "%s: En WB flush during H8: failed: %d\n", 291 291 __func__, ret); 292 - ufshcd_wb_toggle_flush(hba, true); 292 + if (!(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL)) 293 + ufshcd_wb_toggle_flush(hba, true); 293 294 } 294 295 295 296 static void ufshcd_scsi_unblock_requests(struct ufs_hba *hba) ··· 5437 5436 5438 5437 static inline void ufshcd_wb_toggle_flush(struct ufs_hba *hba, bool enable) 5439 5438 { 5440 - if (hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL) 5441 - return; 5442 - 5443 5439 if (enable) 5444 5440 ufshcd_wb_buf_flush_enable(hba); 5445 5441 else ··· 6659 6661 { 6660 6662 struct Scsi_Host *host; 6661 6663 struct ufs_hba *hba; 6662 - unsigned int tag; 6663 6664 u32 pos; 6664 6665 int err; 6665 - u8 resp = 0xF; 6666 - struct ufshcd_lrb *lrbp; 6666 + u8 resp = 0xF, lun; 6667 6667 unsigned long flags; 6668 6668 6669 6669 host = cmd->device->host; 6670 6670 hba = shost_priv(host); 6671 - tag = cmd->request->tag; 6672 6671 6673 - lrbp = &hba->lrb[tag]; 6674 - err = ufshcd_issue_tm_cmd(hba, lrbp->lun, 0, UFS_LOGICAL_RESET, &resp); 6672 + lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun); 6673 + err = ufshcd_issue_tm_cmd(hba, lun, 0, UFS_LOGICAL_RESET, &resp); 6675 6674 if (err || resp != UPIU_TASK_MANAGEMENT_FUNC_COMPL) { 6676 6675 if (!err) 6677 6676 err = resp; ··· 6677 6682 6678 6683 /* clear the commands that were pending for corresponding LUN */ 6679 6684 for_each_set_bit(pos, &hba->outstanding_reqs, hba->nutrs) { 6680 - if (hba->lrb[pos].lun == lrbp->lun) { 6685 + if (hba->lrb[pos].lun == lun) { 6681 6686 err = ufshcd_clear_cmd(hba, pos); 6682 6687 if (err) 6683 6688 break; ··· 8693 8698 ufshcd_wb_need_flush(hba)); 8694 8699 } 8695 8700 8701 + flush_work(&hba->eeh_work); 8702 + 8696 8703 if (req_dev_pwr_mode != hba->curr_dev_pwr_mode) { 8697 8704 if (!ufshcd_is_runtime_pm(pm_op)) 8698 8705 /* ensure that bkops is disabled */ ··· 8706 8709 goto enable_gating; 8707 8710 } 8708 8711 } 8709 - 8710 - flush_work(&hba->eeh_work); 8711 8712 8712 8713 /* 8713 8714 * In the case of DeepSleep, the device is expected to remain powered ··· 8933 8938 if ((ufs_get_pm_lvl_to_dev_pwr_mode(hba->spm_lvl) == 8934 8939 hba->curr_dev_pwr_mode) && 8935 8940 (ufs_get_pm_lvl_to_link_pwr_state(hba->spm_lvl) == 8936 - hba->uic_link_state)) 8941 + hba->uic_link_state) && 8942 + !hba->dev_info.b_rpm_dev_flush_capable) 8937 8943 goto out; 8938 8944 8939 8945 if (pm_runtime_suspended(hba->dev)) {