Skip to content

Commit 0da0a8a

Browse files
committed
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 <[email protected]> * 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
2 parents 54c6247 + be25533 commit 0da0a8a

File tree

5 files changed

+19
-22
lines changed

5 files changed

+19
-22
lines changed

drivers/scsi/mpt3sas/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ config SCSI_MPT2SAS
7979
select SCSI_MPT3SAS
8080
depends on PCI && SCSI
8181
help
82-
Dummy config option for backwards compatiblity: configure the MPT3SAS
82+
Dummy config option for backwards compatibility: configure the MPT3SAS
8383
driver instead.

drivers/scsi/qedi/qedi_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,15 +2245,15 @@ qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type,
22452245
chap_name);
22462246
break;
22472247
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,
22492249
chap_secret);
22502250
break;
22512251
case ISCSI_BOOT_TGT_REV_CHAP_NAME:
22522252
rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN,
22532253
mchap_name);
22542254
break;
22552255
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,
22572257
mchap_secret);
22582258
break;
22592259
case ISCSI_BOOT_TGT_FLAGS:

drivers/scsi/scsi_debug.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6740,7 +6740,7 @@ static int __init scsi_debug_init(void)
67406740
k = sdeb_zbc_model_str(sdeb_zbc_model_s);
67416741
if (k < 0) {
67426742
ret = k;
6743-
goto free_vm;
6743+
goto free_q_arr;
67446744
}
67456745
sdeb_zbc_model = k;
67466746
switch (sdeb_zbc_model) {
@@ -6753,7 +6753,8 @@ static int __init scsi_debug_init(void)
67536753
break;
67546754
default:
67556755
pr_err("Invalid ZBC model\n");
6756-
return -EINVAL;
6756+
ret = -EINVAL;
6757+
goto free_q_arr;
67576758
}
67586759
}
67596760
if (sdeb_zbc_model != BLK_ZONED_NONE) {

drivers/scsi/sd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,10 @@ static blk_status_t sd_setup_write_zeroes_cmnd(struct scsi_cmnd *cmd)
984984
}
985985
}
986986

987-
if (sdp->no_write_same)
987+
if (sdp->no_write_same) {
988+
rq->rq_flags |= RQF_QUIET;
988989
return BLK_STS_TARGET;
990+
}
989991

990992
if (sdkp->ws16 || lba > 0xffffffff || nr_blocks > 0xffff)
991993
return sd_setup_write_same16_cmnd(cmd, false);
@@ -3510,10 +3512,8 @@ static int sd_probe(struct device *dev)
35103512
static int sd_remove(struct device *dev)
35113513
{
35123514
struct scsi_disk *sdkp;
3513-
dev_t devt;
35143515

35153516
sdkp = dev_get_drvdata(dev);
3516-
devt = disk_devt(sdkp->disk);
35173517
scsi_autopm_get_device(sdkp->device);
35183518

35193519
async_synchronize_full_domain(&scsi_sd_pm_domain);

drivers/scsi/ufs/ufshcd.c

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ static inline void ufshcd_wb_config(struct ufs_hba *hba)
289289
if (ret)
290290
dev_err(hba->dev, "%s: En WB flush during H8: failed: %d\n",
291291
__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);
293294
}
294295

295296
static void ufshcd_scsi_unblock_requests(struct ufs_hba *hba)
@@ -5436,9 +5437,6 @@ static int ufshcd_wb_toggle_flush_during_h8(struct ufs_hba *hba, bool set)
54365437

54375438
static inline void ufshcd_wb_toggle_flush(struct ufs_hba *hba, bool enable)
54385439
{
5439-
if (hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL)
5440-
return;
5441-
54425440
if (enable)
54435441
ufshcd_wb_buf_flush_enable(hba);
54445442
else
@@ -6661,19 +6659,16 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
66616659
{
66626660
struct Scsi_Host *host;
66636661
struct ufs_hba *hba;
6664-
unsigned int tag;
66656662
u32 pos;
66666663
int err;
6667-
u8 resp = 0xF;
6668-
struct ufshcd_lrb *lrbp;
6664+
u8 resp = 0xF, lun;
66696665
unsigned long flags;
66706666

66716667
host = cmd->device->host;
66726668
hba = shost_priv(host);
6673-
tag = cmd->request->tag;
66746669

6675-
lrbp = &hba->lrb[tag];
6676-
err = ufshcd_issue_tm_cmd(hba, lrbp->lun, 0, UFS_LOGICAL_RESET, &resp);
6670+
lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun);
6671+
err = ufshcd_issue_tm_cmd(hba, lun, 0, UFS_LOGICAL_RESET, &resp);
66776672
if (err || resp != UPIU_TASK_MANAGEMENT_FUNC_COMPL) {
66786673
if (!err)
66796674
err = resp;
@@ -6682,7 +6677,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
66826677

66836678
/* clear the commands that were pending for corresponding LUN */
66846679
for_each_set_bit(pos, &hba->outstanding_reqs, hba->nutrs) {
6685-
if (hba->lrb[pos].lun == lrbp->lun) {
6680+
if (hba->lrb[pos].lun == lun) {
66866681
err = ufshcd_clear_cmd(hba, pos);
66876682
if (err)
66886683
break;
@@ -8698,6 +8693,8 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
86988693
ufshcd_wb_need_flush(hba));
86998694
}
87008695

8696+
flush_work(&hba->eeh_work);
8697+
87018698
if (req_dev_pwr_mode != hba->curr_dev_pwr_mode) {
87028699
if (!ufshcd_is_runtime_pm(pm_op))
87038700
/* ensure that bkops is disabled */
@@ -8710,8 +8707,6 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
87108707
}
87118708
}
87128709

8713-
flush_work(&hba->eeh_work);
8714-
87158710
/*
87168711
* In the case of DeepSleep, the device is expected to remain powered
87178712
* with the link off, so do not check for bkops.
@@ -8938,7 +8933,8 @@ int ufshcd_system_suspend(struct ufs_hba *hba)
89388933
if ((ufs_get_pm_lvl_to_dev_pwr_mode(hba->spm_lvl) ==
89398934
hba->curr_dev_pwr_mode) &&
89408935
(ufs_get_pm_lvl_to_link_pwr_state(hba->spm_lvl) ==
8941-
hba->uic_link_state))
8936+
hba->uic_link_state) &&
8937+
!hba->dev_info.b_rpm_dev_flush_capable)
89428938
goto out;
89438939

89448940
if (pm_runtime_suspended(hba->dev)) {

0 commit comments

Comments
 (0)