Skip to content

Commit c6986be

Browse files
James BottomleyJames Bottomley
authored andcommitted
Merge remote-tracking branch 'mkp-scsi/4.6/scsi-fixes' into misc
2 parents b86c75f + ba08311 commit c6986be

File tree

7 files changed

+34
-31
lines changed

7 files changed

+34
-31
lines changed

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_base.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6656,12 +6656,13 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
66566656
}
66576657

66586658
for (i = 0; i < ioc->sge_count; i++) {
6659-
if (kbuff_arr[i])
6659+
if (kbuff_arr[i]) {
66606660
dma_free_coherent(&instance->pdev->dev,
66616661
le32_to_cpu(kern_sge32[i].length),
66626662
kbuff_arr[i],
66636663
le32_to_cpu(kern_sge32[i].phys_addr));
66646664
kbuff_arr[i] = NULL;
6665+
}
66656666
}
66666667

66676668
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
@@ -1872,15 +1872,17 @@ static int qlt_check_reserve_free_req(struct scsi_qla_host *vha,
18721872
else
18731873
vha->req->cnt = vha->req->length -
18741874
(vha->req->ring_index - cnt);
1875-
}
18761875

1877-
if (unlikely(vha->req->cnt < (req_cnt + 2))) {
1878-
ql_dbg(ql_dbg_io, vha, 0x305a,
1879-
"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",
1880-
vha->vp_idx, vha->req->ring_index,
1881-
vha->req->cnt, req_cnt, cnt, cnt_in, vha->req->length);
1882-
return -EAGAIN;
1876+
if (unlikely(vha->req->cnt < (req_cnt + 2))) {
1877+
ql_dbg(ql_dbg_io, vha, 0x305a,
1878+
"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",
1879+
vha->vp_idx, vha->req->ring_index,
1880+
vha->req->cnt, req_cnt, cnt, cnt_in,
1881+
vha->req->length);
1882+
return -EAGAIN;
1883+
}
18831884
}
1885+
18841886
vha->req->cnt -= req_cnt;
18851887

18861888
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/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

include/scsi/scsi_transport_fc.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#define SCSI_TRANSPORT_FC_H
2929

3030
#include <linux/sched.h>
31+
#include <asm/unaligned.h>
3132
#include <scsi/scsi.h>
3233
#include <scsi/scsi_netlink.h>
3334

@@ -797,22 +798,12 @@ fc_remote_port_chkready(struct fc_rport *rport)
797798

798799
static inline u64 wwn_to_u64(u8 *wwn)
799800
{
800-
return (u64)wwn[0] << 56 | (u64)wwn[1] << 48 |
801-
(u64)wwn[2] << 40 | (u64)wwn[3] << 32 |
802-
(u64)wwn[4] << 24 | (u64)wwn[5] << 16 |
803-
(u64)wwn[6] << 8 | (u64)wwn[7];
801+
return get_unaligned_be64(wwn);
804802
}
805803

806804
static inline void u64_to_wwn(u64 inm, u8 *wwn)
807805
{
808-
wwn[0] = (inm >> 56) & 0xff;
809-
wwn[1] = (inm >> 48) & 0xff;
810-
wwn[2] = (inm >> 40) & 0xff;
811-
wwn[3] = (inm >> 32) & 0xff;
812-
wwn[4] = (inm >> 24) & 0xff;
813-
wwn[5] = (inm >> 16) & 0xff;
814-
wwn[6] = (inm >> 8) & 0xff;
815-
wwn[7] = inm & 0xff;
806+
put_unaligned_be64(inm, wwn);
816807
}
817808

818809
/**

0 commit comments

Comments
 (0)