libiscsi: disable bh in and abort handler.
Subsystems (3)
PATCH 1/6 libiscsi: disable bh in and abort handler.
From: Mike Christie <[email protected]>
The session lock can be held in the scsi eh thread or the completion paths run from the net softirq. This disables bhs in iscsi_eh_abort when taking the session lock.
Patch was made over scsi-rc-fixes.
--- drivers/scsi/libiscsi.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/libiscsi.c +2 -2
@@ -1974,10 +1974,10 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)* good and have never sent us a successful tmf response * then sent more data for the cmd. */ -spin_lock (&session->lock); +spin_lock_bh (&session->lock);fail_scsi_task (task,DID_ABORT ); conn->tmf_state =TMF_INITIAL ; -spin_unlock (&session->lock); +spin_unlock_bh (&session->lock);iscsi_start_tx (conn); goto success_unlocked;case TMF_TIMEDOUT :
Signature · 1 line
1.6.2.2
PATCH 2/6 qla4xxx: Correct Extended Sense Data Errors
From: Karen Higgins <[email protected]>
Fixed sense data errors occurring above the first 32 bytes, as required by some third party applications. Sense data in the first 32 bytes has always been correct.
Patch updated to use srb data variables instead of scsi command scratchpad data area, as scratchpad area is already used.
Also, corrected debug print alignment bug in dump_buffer routine. Changed KERN_DEBUG to KERN_INFO in printk statements in this routine.
Changed version number to 5.01.00-k9
Patch was made over scsi-rc-fixes.
--- drivers/scsi/qla4xxx/ql4_dbg.c | 15 ++-- drivers/scsi/qla4xxx/ql4_def.h | 7 ++ drivers/scsi/qla4xxx/ql4_fw.h | 7 ++ drivers/scsi/qla4xxx/ql4_isr.c | 145 +++++++++++++++++++++++++----------- drivers/scsi/qla4xxx/ql4_version.h | 2 +- 5 files changed, 122 insertions(+), 54 deletions(-)
drivers/scsi/qla4xxx/ql4_dbg.c +7 -8
@@ -15,19 +15,18 @@ void qla4xxx_dump_buffer(void *b, uint32_t size)uint32_t cnt;uint8_t *c = b; -printk (" 0 1 2 3 4 5 6 7 8 9 Ah Bh Ch Dh Eh " +printk (" 0 1 2 3 4 5 6 7 8 9 Ah Bh Ch Dh Eh " "Fh\n" );printk ("------------------------------------------------------------" "--\n" ); -for (cnt =0 ; cnt < size; cnt++, c++) { -printk (KERN_DEBUG "%02x" , *c); -if (!(cnt %16 )) -printk (KERN_DEBUG "\n" ); +for (cnt =0 ; cnt < size; c++) { +printk (KERN_INFO "%02x" , *c); +if (!(++cnt %16 )) +printk (KERN_INFO "\n" );else -printk (KERN_DEBUG " " ); +printk (KERN_INFO " " ); } -if (cnt %16 ) -printk (KERN_DEBUG "\n" ); +printk (KERN_INFO "\n" ); }
drivers/scsi/qla4xxx/ql4_def.h +7 -0
@@ -184,6 +184,11 @@ struct srb {uint16_t cc_stat;u_long r_start;/* Time we recieve a cmd from OS */ u_long u_start;/* Time when we handed the cmd to F/W */ + +/* Used for extended sense / status continuation */ +uint8_t *req_sense_ptr; +uint16_t req_sense_len; +uint16_t reserved2; };/*
@@ -436,6 +441,8 @@ struct scsi_qla_host {/* Map ddb_list entry by FW ddb index */ struct ddb_entry *fw_ddb_index_map[MAX_DDB_ENTRIES ]; +/* Saved srb for status continuation entry processing */ +struct srb *status_srb; };static inline int is_qla4010 (struct scsi_qla_host *ha)
drivers/scsi/qla4xxx/ql4_fw.h +7 -0
@@ -572,6 +572,7 @@ struct conn_event_log_entry {*************************************************************************/ #define IOCB_MAX_CDB_LEN 16/* Bytes in a CBD */ #define IOCB_MAX_SENSEDATA_LEN 32/* Bytes of sense data */ +#define IOCB_MAX_EXT_SENSEDATA_LEN 60/* Bytes of extended sense data */ /* IOCB header structure */ struct qla4_header {
@@ -733,6 +734,12 @@ struct status_entry { }; +/* Status Continuation entry */ +struct status_cont_entry { +struct qla4_header hdr;/* 00-03 */ +uint8_t ext_sense_data[IOCB_MAX_EXT_SENSEDATA_LEN ];/* 04-63 */ +}; +struct passthru0 {struct qla4_header hdr;/* 00-03 */ uint32_t handle;/* 04-07 */
drivers/scsi/qla4xxx/ql4_isr.c +100 -45
188 lines not on this page · raw message
drivers/scsi/qla4xxx/ql4_version.h +1 -1
@@ -5,5 +5,5 @@* See LICENSE.qla4xxx for copyright and licensing details. */ -#define QLA4XXX_DRIVER_VERSION "5.01.00-k8" +#define QLA4XXX_DRIVER_VERSION "5.01.00-k9"
Signature · 1 line
1.6.2.2
PATCH 3/6 qla4xxx: add timeout handler
From: Mike Christie <[email protected]>
Recently dm-multipath began calling blk_abort_queue. This causes all the commands/request running on the path to have the timeout function called. If a path does go down, and the LLD returns DID_*, dm-multpiath will eventually get this error and begin to call the cmd timeout handler. qla4xxx currently does not set a timed out handler and so the default one could return BLK_EH_NOT_HANDLED and end up firing the scsi eh and stopping IO to all paths on the host when only one path is affected.
For software and offload iscsi we have a timed out handler already. This patch adds a driver specific one to qla4xxx because there are some ddb->state and session->state and command completion races that are better handled in the LLD.
This also handles the problem where if the session is down, we do not need the scsi eh to run until the transport code has tried to reconnect us.
Patch was made over scsi-rc-fixes.
--- drivers/scsi/qla4xxx/ql4_os.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-)
drivers/scsi/qla4xxx/ql4_os.c +17 -0
@@ -66,6 +66,7 @@ static int qla4xxx_sess_get_param(struct iscsi_cls_session *sess,static int qla4xxx_host_get_param (struct Scsi_Host *shost,enum iscsi_host_param param,char *buf);static void qla4xxx_recovery_timedout (struct iscsi_cls_session *session); +static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out (struct scsi_cmnd *sc);/* * SCSI host template entry points
@@ -89,6 +90,7 @@ static struct scsi_host_template qla4xxx_driver_template = { .eh_device_reset_handler = qla4xxx_eh_device_reset, .eh_target_reset_handler = qla4xxx_eh_target_reset, .eh_host_reset_handler = qla4xxx_eh_host_reset, + .eh_timed_out = qla4xxx_eh_cmd_timed_out, .slave_configure = qla4xxx_slave_configure, .slave_alloc = qla4xxx_slave_alloc,
@@ -124,6 +126,21 @@ static struct iscsi_transport qla4xxx_iscsi_transport = {static struct scsi_transport_template *qla4xxx_scsi_transport; +static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out (struct scsi_cmnd *sc) +{ +struct iscsi_cls_session *session; +struct ddb_entry *ddb_entry; + + session =starget_to_session (scsi_target (sc->device)); + ddb_entry = session->dd_data; + +/* if we are not logged in then the LLD is going to clean up the cmd */ +if (atomic_read (&ddb_entry->state) !=DDB_STATE_ONLINE ) +return BLK_EH_RESET_TIMER ; +else +return BLK_EH_NOT_HANDLED ; +} +static void qla4xxx_recovery_timedout (struct iscsi_cls_session *session) {struct ddb_entry *ddb_entry = session->dd_data;
Signature · 1 line
1.6.2.2
PATCH 4/6 qla4xxx: Driver Fault Recovery
From: Karen Higgins <[email protected]>
Fixed driver bug where adapter recovery did not complete if there were outstanding commands detected on that host adapter.
Patch was made over scsi-rc-fixes.
--- drivers/scsi/qla4xxx/ql4_os.c | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-)
drivers/scsi/qla4xxx/ql4_os.c +9 -10
@@ -921,18 +921,17 @@ static int qla4xxx_recover_adapter(struct scsi_qla_host *ha,/* Flush any pending ddb changed AENs */ qla4xxx_process_aen (ha,FLUSH_DDB_CHANGED_AENS ); +qla4xxx_flush_active_srbs (ha); +/* Reset the firmware. If successful, function * returns with ISP interrupts enabled. */ -if (status ==QLA_SUCCESS ) { -DEBUG2 (printk ("scsi%ld: %s - Performing soft reset..\n" , - ha->host_no, __func__)); -qla4xxx_flush_active_srbs (ha); -if (ql4xxx_lock_drvr_wait (ha) ==QLA_SUCCESS ) - status =qla4xxx_soft_reset (ha); -else - status =QLA_ERROR ; - } +DEBUG2 (printk ("scsi%ld: %s - Performing soft reset..\n" , + ha->host_no, __func__)); +if (ql4xxx_lock_drvr_wait (ha) ==QLA_SUCCESS ) + status =qla4xxx_soft_reset (ha); +else + status =QLA_ERROR ;/* Flush any pending ddb changed AENs */ qla4xxx_process_aen (ha,FLUSH_DDB_CHANGED_AENS );
@@ -1661,7 +1660,7 @@ static int qla4xxx_eh_host_reset(struct scsi_cmnd *cmd) ha = (struct scsi_qla_host *) cmd->device->host->hostdata;dev_info (&ha->pdev->dev, -"scsi(%ld:%d:%d:%d): ADAPTER RESET ISSUED.\n" , ha->host_no, +"scsi(%ld:%d:%d:%d): HOST RESET ISSUED.\n" , ha->host_no, cmd->device->channel, cmd->device->id, cmd->device->lun);if (qla4xxx_wait_for_hba_online (ha) !=QLA_SUCCESS ) {
Signature · 1 line
1.6.2.2
PATCH 5/6 qla4xxx: Fix srb lookup in qla4xxx_eh_device_reset
From: Karen Higgins <[email protected]>
eh_device_reset may be called from scsi error handler or sg_reset, etc. When called from sg_reset, there will not be an associated srb. The driver should lookup the corresponding device handle given information from the supplied cmd structure and should not assume that there exists an srb.
Patch was made over scsi-rc-fixes.
--- drivers/scsi/qla4xxx/ql4_os.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/scsi/qla4xxx/ql4_os.c +1 -3
@@ -1543,11 +1543,9 @@ static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd) {struct scsi_qla_host *ha =to_qla_host (cmd->device->host);struct ddb_entry *ddb_entry = cmd->device->hostdata; -struct srb *sp;int ret =FAILED , stat; - sp = (struct srb *) cmd->SCp.ptr; -if (!sp || !ddb_entry) +if (!ddb_entry)return ret; dev_info(&ha->pdev->dev,
Signature · 1 line
1.6.2.2
PATCH 6/6 qla4xxx: Removed unnecessary hiwat code
From: Karen Higgins <[email protected]>
Removed unnecessary hiwat code to free up the number available IOCBs. Eliminates unnecessary eh_ escalations due to inability to obtain IOCB pkt
for marker.
Patch was made over scsi-rc-fixes.
--- drivers/scsi/qla4xxx/ql4_def.h | 1 - drivers/scsi/qla4xxx/ql4_iocb.c | 132 +++++++++++++++++--------------------- drivers/scsi/qla4xxx/ql4_mbx.c | 10 --- 3 files changed, 59 insertions(+), 84 deletions(-)
drivers/scsi/qla4xxx/ql4_def.h +0 -1
@@ -307,7 +307,6 @@ struct scsi_qla_host {uint32_t tot_ddbs;uint16_t iocb_cnt; -uint16_t iocb_hiwat;/* SRB cache. */ #define SRB_MIN_REQ 128
drivers/scsi/qla4xxx/ql4_iocb.c +59 -73
192 lines not on this page · raw message
drivers/scsi/qla4xxx/ql4_mbx.c +0 -10
@@ -385,16 +385,6 @@ int qla4xxx_get_firmware_status(struct scsi_qla_host * ha) mbox_sts[0]));return QLA_ERROR ; } - -/* High-water mark of IOCBs */ - ha->iocb_hiwat = mbox_sts[2 ]; -if (ha->iocb_hiwat >IOCB_HIWAT_CUSHION ) - ha->iocb_hiwat -=IOCB_HIWAT_CUSHION ; -else -dev_info (&ha->pdev->dev,"WARNING!!! You have less than %d " -"firmware IOCBs available (%d).\n" , -IOCB_HIWAT_CUSHION , ha->iocb_hiwat); -return QLA_SUCCESS ; }
Signature · 1 line
1.6.2.2