Merge branch 'svn-trunk'

This commit is contained in:
Bart Van Assche
2021-09-02 21:59:36 -07:00
6 changed files with 55 additions and 24 deletions

View File

@@ -419,7 +419,7 @@ qla2x00_update_portdb(struct device *dev,
printk(KERN_INFO "Reconfiguring fabric on %ld\n",
vha->host_no);
qla2x00_configure_fabric(vha);
/* fall through */
fallthrough;
default:
printk(KERN_INFO "Resyncing loop on %ld\n",

View File

@@ -308,7 +308,7 @@ qla2x00_process_els(struct bsg_job *bsg_job)
srb_t *sp;
const char *type;
int req_sg_cnt, rsp_sg_cnt;
int rval = (DRIVER_ERROR << 16);
int rval = DID_ERROR << 16;
uint16_t nextlid = 0;
#ifdef __COVERITY__
@@ -495,7 +495,7 @@ qla2x00_process_ct(struct bsg_job *bsg_job)
struct fc_bsg_request *bsg_request = bsg_job->request;
scsi_qla_host_t *vha = shost_priv(host);
struct qla_hw_data *ha = vha->hw;
int rval = (DRIVER_ERROR << 16);
int rval = DID_ERROR << 16;
int req_sg_cnt, rsp_sg_cnt;
uint16_t loop_id;
struct fc_port *fcport;

View File

@@ -885,7 +885,7 @@ skip_rio:
case MBA_CHG_IN_CONNECTION: /* Change in connection mode */
if (IS_QLA2100(ha))
break;
/* fall through */
fallthrough;
case MBA_RESET: /* Reset */
case MBA_SYSTEM_ERR: /* System Error */
case MBA_REQ_TRANSFER_ERR: /* Request Transfer Error */
@@ -1667,31 +1667,22 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
/* check guard */
if (e_guard != a_guard) {
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x1);
set_driver_byte(cmd, DRIVER_SENSE);
scsi_build_sense(cmd, 1, ILLEGAL_REQUEST, 0x10, 0x1);
set_host_byte(cmd, DID_ABORT);
cmd->result |= SAM_STAT_CHECK_CONDITION << 1;
return 1;
}
/* check ref tag */
if (e_ref_tag != a_ref_tag) {
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x3);
set_driver_byte(cmd, DRIVER_SENSE);
scsi_build_sense(cmd, 1, ILLEGAL_REQUEST, 0x10, 0x3);
set_host_byte(cmd, DID_ABORT);
cmd->result |= SAM_STAT_CHECK_CONDITION << 1;
return 1;
}
/* check appl tag */
if (e_app_tag != a_app_tag) {
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x2);
set_driver_byte(cmd, DRIVER_SENSE);
scsi_build_sense(cmd, 1, ILLEGAL_REQUEST, 0x10, 0x2);
set_host_byte(cmd, DID_ABORT);
cmd->result |= SAM_STAT_CHECK_CONDITION << 1;
return 1;
}
@@ -2251,7 +2242,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
case ABTS_RECV_24XX:
/* ensure that the ATIO queue is empty */
qla24xx_process_atio_queue(vha);
/* fall through */
fallthrough;
case ABTS_RESP_24XX:
case CTIO_TYPE7:
case NOTIFY_ACK_TYPE:

View File

@@ -2329,8 +2329,7 @@ qla2x00_write_optrom_data(struct scsi_qla_host *vha, uint8_t *buf,
sec_mask = 0x10000;
break;
}
/* Fall through... */
fallthrough;
case 0x1f: /* Atmel flash. */
/* 512k sector size. */
if (flash_id == 0x13) {
@@ -2338,8 +2337,7 @@ qla2x00_write_optrom_data(struct scsi_qla_host *vha, uint8_t *buf,
sec_mask = 0x80000000;
break;
}
/* Fall through... */
fallthrough;
case 0x01: /* AMD flash. */
if (flash_id == 0x38 || flash_id == 0x40 ||
flash_id == 0x4f) {
@@ -2371,7 +2369,7 @@ qla2x00_write_optrom_data(struct scsi_qla_host *vha, uint8_t *buf,
sec_mask = 0x1e000;
break;
}
/* Fall through... */
fallthrough;
default:
/* Default to 16 kb sector size. */
rest_addr = 0x3fff;

View File

@@ -2145,6 +2145,41 @@ static inline void *scsi_cmd_priv(struct scsi_cmnd *cmd)
}
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
/*
* See also commit f2b1e9c6f867 ("scsi: core: Introduce scsi_build_sense()";
* v5.14-rc1).
*/
static inline void scsi_build_sense(struct scsi_cmnd *scmd, int desc,
u8 key, u8 asc, u8 ascq)
{
scsi_build_sense_buffer(desc, scmd->sense_buffer, key, asc, ascq);
scmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;
}
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
/*
* See also 51f3a4788928 ("scsi: core: Introduce the scsi_cmd_to_rq()
* function").
*/
static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
{
return blk_mq_rq_from_pdu(scmd);
}
/*
* See also commit 7ba46799d346 ("scsi: core: Add scsi_prot_ref_tag()
* helper").
*/
static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
{
struct request *rq = blk_mq_rq_from_pdu(scmd);
return t10_pi_ref_tag(rq);
}
#endif
/* <scsi/scsi_request.h> */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)

View File

@@ -1653,7 +1653,14 @@ out:
return ret;
}
static int scst_local_driver_remove(struct device *dev)
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
/* See also commit fc7a6209d571 ("bus: Make remove callback return void") */
#define DRIVER_REMOVE_RET int
#else
#define DRIVER_REMOVE_RET void
#endif
static DRIVER_REMOVE_RET scst_local_driver_remove(struct device *dev)
{
struct scst_local_sess *sess;
struct Scsi_Host *shost = NULL;
@@ -1670,7 +1677,7 @@ static int scst_local_driver_remove(struct device *dev)
scsi_host_put(shost);
TRACE_EXIT();
return 0;
return (DRIVER_REMOVE_RET)0;
}
static int scst_local_bus_match(struct device *dev,