Skip to content

Commit 895a106

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull more SCSI updates from James Bottomley: "The only new stuff which missed the first pull request is an update to the UFS driver. The rest is an assortment of bug fixes and minor tweaks which appeared recently (some are fixes for recent code and some are stuff spotted recently by the checkers or the new gcc-6 compiler [most of Arnd's stuff])" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (32 commits) scsi_common: do not clobber fixed sense information scsi: ufs: select CONFIG_NLS scsi: fc: use get/put_unaligned64 for wwn access fnic: move printk()s outside of the critical code section. qla2xxx: avoid maybe_uninitialized warning megaraid_sas: add missing curly braces in ioctl handler lpfc: fix misleading indentation scsi_transport_sas: add 'scsi_target_id' sysfs attribute scsi_dh_alua: uninitialized variable in alua_check_vpd() scsi: ufs-qcom: add printouts of testbus debug registers scsi: ufs-qcom: enable/disable the device ref clock scsi: ufs-qcom: set PA_Local_TX_LCC_Enable before link startup scsi: ufs: add device quirk delay before putting UFS rails in LPM scsi: ufs: fix leakage during link off state scsi: ufs: tune UniPro parameters to optimize hibern8 exit time scsi: ufs: handle non spec compliant bkops behaviour by device scsi: ufs: add retry for query descriptors scsi: ufs: add error recovery after DL NAC error scsi: ufs: make error handling bit faster scsi: ufs: disable vccq if it's not needed by UFS device ...
2 parents 02fc59a + c6986be commit 895a106

File tree

22 files changed

+1177
-166
lines changed

22 files changed

+1177
-166
lines changed

Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ Optional properties:
3838
defined or a value in the array is "0" then it is assumed
3939
that the frequency is set by the parent clock or a
4040
fixed rate clock source.
41+
-lanes-per-direction : number of lanes available per direction - either 1 or 2.
42+
Note that it is assume same number of lanes is used both
43+
directions at once. If not specified, default is 2 lanes per direction.
4144

4245
Note: If above properties are not defined it can be assumed that the supply
4346
regulators or clocks are always on.

drivers/scsi/device_handler/scsi_dh_alua.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h,
332332
{
333333
int rel_port = -1, group_id;
334334
struct alua_port_group *pg, *old_pg = NULL;
335-
bool pg_updated;
335+
bool pg_updated = false;
336336
unsigned long flags;
337337

338338
group_id = scsi_vpd_tpg_id(sdev, &rel_port);

drivers/scsi/fnic/fnic_scsi.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -958,23 +958,22 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic,
958958
case FCPIO_INVALID_PARAM: /* some parameter in request invalid */
959959
case FCPIO_REQ_NOT_SUPPORTED:/* request type is not supported */
960960
default:
961-
shost_printk(KERN_ERR, fnic->lport->host, "hdr status = %s\n",
962-
fnic_fcpio_status_to_str(hdr_status));
963961
sc->result = (DID_ERROR << 16) | icmnd_cmpl->scsi_status;
964962
break;
965963
}
966964

967-
if (hdr_status != FCPIO_SUCCESS) {
968-
atomic64_inc(&fnic_stats->io_stats.io_failures);
969-
shost_printk(KERN_ERR, fnic->lport->host, "hdr status = %s\n",
970-
fnic_fcpio_status_to_str(hdr_status));
971-
}
972965
/* Break link with the SCSI command */
973966
CMD_SP(sc) = NULL;
974967
CMD_FLAGS(sc) |= FNIC_IO_DONE;
975968

976969
spin_unlock_irqrestore(io_lock, flags);
977970

971+
if (hdr_status != FCPIO_SUCCESS) {
972+
atomic64_inc(&fnic_stats->io_stats.io_failures);
973+
shost_printk(KERN_ERR, fnic->lport->host, "hdr status = %s\n",
974+
fnic_fcpio_status_to_str(hdr_status));
975+
}
976+
978977
fnic_release_ioreq_buf(fnic, io_req, sc);
979978

980979
mempool_free(io_req, fnic->io_req_pool);

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2860,7 +2860,7 @@ lpfc_online(struct lpfc_hba *phba)
28602860
}
28612861

28622862
vports = lpfc_create_vport_work_array(phba);
2863-
if (vports != NULL)
2863+
if (vports != NULL) {
28642864
for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
28652865
struct Scsi_Host *shost;
28662866
shost = lpfc_shost_from_vport(vports[i]);
@@ -2877,7 +2877,8 @@ lpfc_online(struct lpfc_hba *phba)
28772877
}
28782878
spin_unlock_irq(shost->host_lock);
28792879
}
2880-
lpfc_destroy_vport_work_array(phba, vports);
2880+
}
2881+
lpfc_destroy_vport_work_array(phba, vports);
28812882

28822883
lpfc_unblock_mgmt_io(phba);
28832884
return 0;

drivers/scsi/megaraid/megaraid_sas.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2097,7 +2097,7 @@ struct megasas_instance {
20972097
u8 UnevenSpanSupport;
20982098

20992099
u8 supportmax256vd;
2100-
u8 allow_fw_scan;
2100+
u8 pd_list_not_supported;
21012101
u16 fw_supported_vd_count;
21022102
u16 fw_supported_pd_count;
21032103

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ static int megasas_slave_configure(struct scsi_device *sdev)
18381838
struct megasas_instance *instance;
18391839

18401840
instance = megasas_lookup_instance(sdev->host->host_no);
1841-
if (instance->allow_fw_scan) {
1841+
if (instance->pd_list_not_supported) {
18421842
if (sdev->channel < MEGASAS_MAX_PD_CHANNELS &&
18431843
sdev->type == TYPE_DISK) {
18441844
pd_index = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) +
@@ -1874,7 +1874,8 @@ static int megasas_slave_alloc(struct scsi_device *sdev)
18741874
pd_index =
18751875
(sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) +
18761876
sdev->id;
1877-
if ((instance->allow_fw_scan || instance->pd_list[pd_index].driveState ==
1877+
if ((instance->pd_list_not_supported ||
1878+
instance->pd_list[pd_index].driveState ==
18781879
MR_PD_STATE_SYSTEM)) {
18791880
goto scan_target;
18801881
}
@@ -4087,7 +4088,13 @@ megasas_get_pd_list(struct megasas_instance *instance)
40874088

40884089
switch (ret) {
40894090
case DCMD_FAILED:
4090-
megaraid_sas_kill_hba(instance);
4091+
dev_info(&instance->pdev->dev, "MR_DCMD_PD_LIST_QUERY "
4092+
"failed/not supported by firmware\n");
4093+
4094+
if (instance->ctrl_context)
4095+
megaraid_sas_kill_hba(instance);
4096+
else
4097+
instance->pd_list_not_supported = 1;
40914098
break;
40924099
case DCMD_TIMEOUT:
40934100

@@ -5034,7 +5041,6 @@ static int megasas_init_fw(struct megasas_instance *instance)
50345041
case PCI_DEVICE_ID_DELL_PERC5:
50355042
default:
50365043
instance->instancet = &megasas_instance_template_xscale;
5037-
instance->allow_fw_scan = 1;
50385044
break;
50395045
}
50405046

@@ -6650,12 +6656,13 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
66506656
}
66516657

66526658
for (i = 0; i < ioc->sge_count; i++) {
6653-
if (kbuff_arr[i])
6659+
if (kbuff_arr[i]) {
66546660
dma_free_coherent(&instance->pdev->dev,
66556661
le32_to_cpu(kern_sge32[i].length),
66566662
kbuff_arr[i],
66576663
le32_to_cpu(kern_sge32[i].phys_addr));
66586664
kbuff_arr[i] = NULL;
6665+
}
66596666
}
66606667

66616668
megasas_return_cmd(instance, cmd);

drivers/scsi/qla2xxx/qla_target.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,15 +1881,17 @@ static int qlt_check_reserve_free_req(struct scsi_qla_host *vha,
18811881
else
18821882
vha->req->cnt = vha->req->length -
18831883
(vha->req->ring_index - cnt);
1884-
}
18851884

1886-
if (unlikely(vha->req->cnt < (req_cnt + 2))) {
1887-
ql_dbg(ql_dbg_io, vha, 0x305a,
1888-
"qla_target(%d): There is no room in the request ring: vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d Req-in=%d Req-Length=%d\n",
1889-
vha->vp_idx, vha->req->ring_index,
1890-
vha->req->cnt, req_cnt, cnt, cnt_in, vha->req->length);
1891-
return -EAGAIN;
1885+
if (unlikely(vha->req->cnt < (req_cnt + 2))) {
1886+
ql_dbg(ql_dbg_io, vha, 0x305a,
1887+
"qla_target(%d): There is no room in the request ring: vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d Req-in=%d Req-Length=%d\n",
1888+
vha->vp_idx, vha->req->ring_index,
1889+
vha->req->cnt, req_cnt, cnt, cnt_in,
1890+
vha->req->length);
1891+
return -EAGAIN;
1892+
}
18921893
}
1894+
18931895
vha->req->cnt -= req_cnt;
18941896

18951897
return 0;

drivers/scsi/scsi_common.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,16 @@ int scsi_set_sense_information(u8 *buf, int buf_len, u64 info)
278278
ucp[3] = 0;
279279
put_unaligned_be64(info, &ucp[4]);
280280
} else if ((buf[0] & 0x7f) == 0x70) {
281-
buf[0] |= 0x80;
282-
put_unaligned_be64(info, &buf[3]);
281+
/*
282+
* Only set the 'VALID' bit if we can represent the value
283+
* correctly; otherwise just fill out the lower bytes and
284+
* clear the 'VALID' flag.
285+
*/
286+
if (info <= 0xffffffffUL)
287+
buf[0] |= 0x80;
288+
else
289+
buf[0] &= 0x7f;
290+
put_unaligned_be32((u32)info, &buf[3]);
283291
}
284292

285293
return 0;

drivers/scsi/scsi_sas_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define SAS_HOST_ATTRS 0
55
#define SAS_PHY_ATTRS 17
66
#define SAS_PORT_ATTRS 1
7-
#define SAS_RPORT_ATTRS 7
7+
#define SAS_RPORT_ATTRS 8
88
#define SAS_END_DEV_ATTRS 5
99
#define SAS_EXPANDER_ATTRS 7
1010

drivers/scsi/scsi_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ static umode_t scsi_sdev_bin_attr_is_visible(struct kobject *kobj,
11051105
if (attr == &dev_attr_vpd_pg80 && !sdev->vpd_pg80)
11061106
return 0;
11071107

1108-
if (attr == &dev_attr_vpd_pg83 && sdev->vpd_pg83)
1108+
if (attr == &dev_attr_vpd_pg83 && !sdev->vpd_pg83)
11091109
return 0;
11101110

11111111
return S_IRUGO;

drivers/scsi/scsi_transport_sas.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,7 @@ sas_rphy_protocol_attr(identify.target_port_protocols, target_port_protocols);
12861286
sas_rphy_simple_attr(identify.sas_address, sas_address, "0x%016llx\n",
12871287
unsigned long long);
12881288
sas_rphy_simple_attr(identify.phy_identifier, phy_identifier, "%d\n", u8);
1289+
sas_rphy_simple_attr(scsi_target_id, scsi_target_id, "%d\n", u32);
12891290

12901291
/* only need 8 bytes of data plus header (4 or 8) */
12911292
#define BUF_SIZE 64
@@ -1886,6 +1887,7 @@ sas_attach_transport(struct sas_function_template *ft)
18861887
SETUP_RPORT_ATTRIBUTE(rphy_device_type);
18871888
SETUP_RPORT_ATTRIBUTE(rphy_sas_address);
18881889
SETUP_RPORT_ATTRIBUTE(rphy_phy_identifier);
1890+
SETUP_RPORT_ATTRIBUTE(rphy_scsi_target_id);
18891891
SETUP_OPTIONAL_RPORT_ATTRIBUTE(rphy_enclosure_identifier,
18901892
get_enclosure_identifier);
18911893
SETUP_OPTIONAL_RPORT_ATTRIBUTE(rphy_bay_identifier,

drivers/scsi/ufs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ config SCSI_UFSHCD
3737
depends on SCSI && SCSI_DMA
3838
select PM_DEVFREQ
3939
select DEVFREQ_GOV_SIMPLE_ONDEMAND
40+
select NLS
4041
---help---
4142
This selects the support for UFS devices in Linux, say Y and make
4243
sure that you know the name of your UFS host adapter (the card

0 commit comments

Comments
 (0)