Skip to content

Commit c5fe7a9

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: "Six small and reasonably obvious fixes, all in drivers" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: pm80xx: Set stopped phy's linkrate to Disabled scsi: pm80xx: Fix 'Unknown' max/min linkrate scsi: ufs: core: Fix missing clk change notification on host reset scsi: ufs: core: Drop loglevel of WriteBoost message scsi: megaraid: Clear READ queue map's nr_queues scsi: target: Fix WRITE_SAME No Data Buffer crash
2 parents 6bca047 + 355bf2e commit c5fe7a9

File tree

8 files changed

+28
-19
lines changed

8 files changed

+28
-19
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3195,6 +3195,9 @@ static int megasas_map_queues(struct Scsi_Host *shost)
31953195
qoff += map->nr_queues;
31963196
offset += map->nr_queues;
31973197

3198+
/* we never use READ queue, so can't cheat blk-mq */
3199+
shost->tag_set.map[HCTX_TYPE_READ].nr_queues = 0;
3200+
31983201
/* Setup Poll hctx */
31993202
map = &shost->tag_set.map[HCTX_TYPE_POLL];
32003203
map->nr_queues = instance->iopoll_q_count;

drivers/scsi/pm8001/pm8001_hwi.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3145,15 +3145,6 @@ void pm8001_bytes_dmaed(struct pm8001_hba_info *pm8001_ha, int i)
31453145
if (!phy->phy_attached)
31463146
return;
31473147

3148-
if (sas_phy->phy) {
3149-
struct sas_phy *sphy = sas_phy->phy;
3150-
sphy->negotiated_linkrate = sas_phy->linkrate;
3151-
sphy->minimum_linkrate = phy->minimum_linkrate;
3152-
sphy->minimum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS;
3153-
sphy->maximum_linkrate = phy->maximum_linkrate;
3154-
sphy->maximum_linkrate_hw = phy->maximum_linkrate;
3155-
}
3156-
31573148
if (phy->phy_type & PORT_TYPE_SAS) {
31583149
struct sas_identify_frame *id;
31593150
id = (struct sas_identify_frame *)phy->frame_rcvd;
@@ -3177,26 +3168,22 @@ void pm8001_get_lrate_mode(struct pm8001_phy *phy, u8 link_rate)
31773168
switch (link_rate) {
31783169
case PHY_SPEED_120:
31793170
phy->sas_phy.linkrate = SAS_LINK_RATE_12_0_GBPS;
3180-
phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_12_0_GBPS;
31813171
break;
31823172
case PHY_SPEED_60:
31833173
phy->sas_phy.linkrate = SAS_LINK_RATE_6_0_GBPS;
3184-
phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_6_0_GBPS;
31853174
break;
31863175
case PHY_SPEED_30:
31873176
phy->sas_phy.linkrate = SAS_LINK_RATE_3_0_GBPS;
3188-
phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS;
31893177
break;
31903178
case PHY_SPEED_15:
31913179
phy->sas_phy.linkrate = SAS_LINK_RATE_1_5_GBPS;
3192-
phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS;
31933180
break;
31943181
}
31953182
sas_phy->negotiated_linkrate = phy->sas_phy.linkrate;
3196-
sas_phy->maximum_linkrate_hw = SAS_LINK_RATE_6_0_GBPS;
3183+
sas_phy->maximum_linkrate_hw = phy->maximum_linkrate;
31973184
sas_phy->minimum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS;
3198-
sas_phy->maximum_linkrate = SAS_LINK_RATE_6_0_GBPS;
3199-
sas_phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS;
3185+
sas_phy->maximum_linkrate = phy->maximum_linkrate;
3186+
sas_phy->minimum_linkrate = phy->minimum_linkrate;
32003187
}
32013188

32023189
/**

drivers/scsi/pm8001/pm8001_init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ static void pm8001_phy_init(struct pm8001_hba_info *pm8001_ha, int phy_id)
143143
struct asd_sas_phy *sas_phy = &phy->sas_phy;
144144
phy->phy_state = PHY_LINK_DISABLE;
145145
phy->pm8001_ha = pm8001_ha;
146+
phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS;
147+
phy->maximum_linkrate = SAS_LINK_RATE_6_0_GBPS;
146148
sas_phy->enabled = (phy_id < pm8001_ha->chip->n_phy) ? 1 : 0;
147149
sas_phy->class = SAS;
148150
sas_phy->iproto = SAS_PROTOCOL_ALL;

drivers/scsi/pm8001/pm80xx_hwi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3723,8 +3723,12 @@ static int mpi_phy_stop_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
37233723
pm8001_dbg(pm8001_ha, MSG, "phy:0x%x status:0x%x\n",
37243724
phyid, status);
37253725
if (status == PHY_STOP_SUCCESS ||
3726-
status == PHY_STOP_ERR_DEVICE_ATTACHED)
3726+
status == PHY_STOP_ERR_DEVICE_ATTACHED) {
37273727
phy->phy_state = PHY_LINK_DISABLE;
3728+
phy->sas_phy.phy->negotiated_linkrate = SAS_PHY_DISABLED;
3729+
phy->sas_phy.linkrate = SAS_PHY_DISABLED;
3730+
}
3731+
37283732
return 0;
37293733
}
37303734

drivers/target/target_core_file.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,9 @@ fd_execute_write_same(struct se_cmd *cmd)
448448
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
449449
}
450450

451+
if (!cmd->t_data_nents)
452+
return TCM_INVALID_CDB_FIELD;
453+
451454
if (cmd->t_data_nents > 1 ||
452455
cmd->t_data_sg[0].length != cmd->se_dev->dev_attrib.block_size) {
453456
pr_err("WRITE_SAME: Illegal SGL t_data_nents: %u length: %u"

drivers/target/target_core_iblock.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,10 @@ iblock_execute_write_same(struct se_cmd *cmd)
494494
" backends not supported\n");
495495
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
496496
}
497+
498+
if (!cmd->t_data_nents)
499+
return TCM_INVALID_CDB_FIELD;
500+
497501
sg = &cmd->t_data_sg[0];
498502

499503
if (cmd->t_data_nents > 1 ||

drivers/target/target_core_sbc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,12 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char flags, struct sbc_ops *op
312312
pr_warn("WRITE SAME with ANCHOR not supported\n");
313313
return TCM_INVALID_CDB_FIELD;
314314
}
315+
316+
if (flags & 0x01) {
317+
pr_warn("WRITE SAME with NDOB not supported\n");
318+
return TCM_INVALID_CDB_FIELD;
319+
}
320+
315321
/*
316322
* Special case for WRITE_SAME w/ UNMAP=1 that ends up getting
317323
* translated into block discard requests within backend code.

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5738,7 +5738,7 @@ int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable)
57385738
}
57395739

57405740
hba->dev_info.wb_enabled = enable;
5741-
dev_info(hba->dev, "%s Write Booster %s\n",
5741+
dev_dbg(hba->dev, "%s Write Booster %s\n",
57425742
__func__, enable ? "enabled" : "disabled");
57435743

57445744
return ret;
@@ -7253,7 +7253,7 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)
72537253
hba->silence_err_logs = false;
72547254

72557255
/* scale up clocks to max frequency before full reinitialization */
7256-
ufshcd_set_clk_freq(hba, true);
7256+
ufshcd_scale_clks(hba, true);
72577257

72587258
err = ufshcd_hba_enable(hba);
72597259

0 commit comments

Comments
 (0)