SCSI bug fixes for 2.6.31-rc5
Subsystems (7)
James Bottomley
maintainerPATCH 1/1 SCSI bug fixes for 2.6.31-rc5
This is basically a bundle of fixes, the largest swathe of which come from s390 (zfcp). The rest are miscellaneous handling and one update to prevent nasty USB fallout from the extended inquiry changes to support dif/dix.
The patch is available here:
master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git
The short changelog is:
Christof Schmitt (10):
zfcp: Fix tracing of request id for abort requests
zfcp: Add port only once to FC transport class
zfcp: Recover from stalled outbound queue
zfcp: Fix erp escalation procedure
zfcp: Fix logic for physical port close
zfcp: Use -EIO for SBAL allocation failures
zfcp: Use unchained mode for small ct and els requests
zfcp: Use correct flags for zfcp_erp_notify
zfcp: Return -ENOMEM for allocation failures in zfcp_fsf
zfcp: Acquire qdio_stat_lock when reading the queue utilization
Karen Higgins (4):
qla4xxx: Remove hiwat code so scsi eh does not get escalated when we can make progress
qla4xxx: Fix srb lookup in qla4xxx_eh_device_reset
qla4xxx: Fix Driver Fault Recovery Completion
qla4xxx: Correct Extended Sense Data Errors
Martin K. Petersen (1):
sd: Avoid sending extended inquiry to legacy devices
Mike Christie (2):
qla4xxx: add timeout handler
libiscsi: disable bh in and abort handler.
Swen Schillig (3):
zfcp: Fix wka port processing
zfcp: avoid double notify in lowmem scenario
zfcp: Fix invalid command order
Tom Peng (2):
libsas: fix wide port hotplug issues
libsas: reuse the original port when hotplugging phys in wide ports
Vasu Dev (1):
libfc: fix a circular locking warning during sending RRQ
The diffstat is:
drivers/s390/scsi/zfcp_erp.c | 68 +++++++++-------- drivers/s390/scsi/zfcp_fc.c | 8 -- drivers/s390/scsi/zfcp_fsf.c | 56 +++++++++----- drivers/s390/scsi/zfcp_scsi.c | 25 ++++-- drivers/s390/scsi/zfcp_sysfs.c | 7 + drivers/scsi/libfc/fc_exch.c | 23 +++-- drivers/scsi/libiscsi.c | 4 - drivers/scsi/libsas/sas_expander.c | 147 ++++++++++++++++++++++++++----------- drivers/scsi/libsas/sas_port.c | 19 +++- drivers/scsi/qla4xxx/ql4_dbg.c | 15 +-- drivers/scsi/qla4xxx/ql4_def.h | 9 +- drivers/scsi/qla4xxx/ql4_fw.h | 7 + drivers/scsi/qla4xxx/ql4_iocb.c | 133 +++++++++++++++------------------ drivers/scsi/qla4xxx/ql4_isr.c | 145 +++++++++++++++++++++++++----------- drivers/scsi/qla4xxx/ql4_mbx.c | 10 -- drivers/scsi/qla4xxx/ql4_os.c | 40 ++++++---- drivers/scsi/qla4xxx/ql4_version.h | 2 drivers/scsi/sd.c | 20 ++++- 18 files changed, 465 insertions(+), 273 deletions(-)
And the patch is below.
James
---
drivers/s390/scsi/zfcp_erp.c +36 -32
@@ -553,40 +553,35 @@ static void _zfcp_erp_unit_reopen_all(struct zfcp_port *port, int clear,_zfcp_erp_unit_reopen (unit, clear, id, ref); } -static void zfcp_erp_strategy_followup_actions (struct zfcp_erp_action *act) +static void zfcp_erp_strategy_followup_failed (struct zfcp_erp_action *act) { -struct zfcp_adapter *adapter = act->adapter; -struct zfcp_port *port = act->port; -struct zfcp_unit *unit = act->unit; -u32 status = act->status; - -/* initiate follow-up actions depending on success of finished action */ switch (act->action) { -case ZFCP_ERP_ACTION_REOPEN_ADAPTER : -if (status ==ZFCP_ERP_SUCCEEDED ) -_zfcp_erp_port_reopen_all (adapter,0 ,"ersfa_1" ,NULL ); -else -_zfcp_erp_adapter_reopen (adapter,0 ,"ersfa_2" ,NULL ); +_zfcp_erp_adapter_reopen (act->adapter,0 ,"ersff_1" ,NULL );break ; -case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED : -if (status ==ZFCP_ERP_SUCCEEDED ) -_zfcp_erp_port_reopen (port,0 ,"ersfa_3" ,NULL ); -else -_zfcp_erp_adapter_reopen (adapter,0 ,"ersfa_4" ,NULL ); +_zfcp_erp_port_forced_reopen (act->port,0 ,"ersff_2" ,NULL );break ; -case ZFCP_ERP_ACTION_REOPEN_PORT : -if (status ==ZFCP_ERP_SUCCEEDED ) -_zfcp_erp_unit_reopen_all (port,0 ,"ersfa_5" ,NULL ); -else -_zfcp_erp_port_forced_reopen (port,0 ,"ersfa_6" ,NULL ); +_zfcp_erp_port_reopen (act->port,0 ,"ersff_3" ,NULL );break ; -case ZFCP_ERP_ACTION_REOPEN_UNIT : -if (status !=ZFCP_ERP_SUCCEEDED ) -_zfcp_erp_port_reopen (unit->port,0 ,"ersfa_7" ,NULL ); +_zfcp_erp_unit_reopen (act->unit,0 ,"ersff_4" ,NULL ); +break ; + } +} + +static void zfcp_erp_strategy_followup_success (struct zfcp_erp_action *act) +{ +switch (act->action) { +case ZFCP_ERP_ACTION_REOPEN_ADAPTER : +_zfcp_erp_port_reopen_all (act->adapter,0 ,"ersfs_1" ,NULL ); +break ; +case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED : +_zfcp_erp_port_reopen (act->port,0 ,"ersfs_2" ,NULL ); +break ; +case ZFCP_ERP_ACTION_REOPEN_PORT : +_zfcp_erp_unit_reopen_all (act->port,0 ,"ersfs_3" ,NULL );break ; } }
@@ -801,7 +796,7 @@ static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action)return ZFCP_ERP_FAILED ;case ZFCP_ERP_STEP_PHYS_PORT_CLOSING : -if (status &ZFCP_STATUS_PORT_PHYS_OPEN ) +if (!(status &ZFCP_STATUS_PORT_PHYS_OPEN ))return ZFCP_ERP_SUCCEEDED ; }return ZFCP_ERP_FAILED ;
@@ -853,11 +848,17 @@ void zfcp_erp_port_strategy_open_lookup(struct work_struct *work) gid_pn_work); retval =zfcp_fc_ns_gid_pn (&port->erp_action); -if (retval == -ENOMEM ) -zfcp_erp_notify (&port->erp_action,ZFCP_ERP_NOMEM ); - port->erp_action.step =ZFCP_ERP_STEP_NAMESERVER_LOOKUP ; -if (retval) -zfcp_erp_notify (&port->erp_action,ZFCP_ERP_FAILED ); +if (!retval) { + port->erp_action.step =ZFCP_ERP_STEP_NAMESERVER_LOOKUP ; + goto out; + } +if (retval == -ENOMEM ) { +zfcp_erp_notify (&port->erp_action,ZFCP_STATUS_ERP_LOWMEM ); + goto out; + } +/* all other error condtions */ +zfcp_erp_notify (&port->erp_action,0 ); +out:zfcp_port_put (port); }
@@ -1289,7 +1290,10 @@ static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action) retval =zfcp_erp_strategy_statechange (erp_action, retval);if (retval ==ZFCP_ERP_EXIT ) goto unlock; -zfcp_erp_strategy_followup_actions (erp_action); +if (retval ==ZFCP_ERP_SUCCEEDED ) +zfcp_erp_strategy_followup_success (erp_action); +if (retval ==ZFCP_ERP_FAILED ) +zfcp_erp_strategy_followup_failed (erp_action); unlock:write_unlock (&adapter->erp_lock);
drivers/s390/scsi/zfcp_fc.c +3 -5
@@ -79,11 +79,9 @@ static int zfcp_wka_port_get(struct zfcp_wka_port *wka_port)mutex_unlock (&wka_port->mutex); -wait_event_timeout ( - wka_port->completion_wq, - wka_port->status ==ZFCP_WKA_PORT_ONLINE || - wka_port->status ==ZFCP_WKA_PORT_OFFLINE , -HZ >>1 ); +wait_event (wka_port->completion_wq, + wka_port->status ==ZFCP_WKA_PORT_ONLINE || + wka_port->status ==ZFCP_WKA_PORT_OFFLINE );if (wka_port->status ==ZFCP_WKA_PORT_ONLINE ) {atomic_inc (&wka_port->refcount);
drivers/s390/scsi/zfcp_fsf.c +38 -18
121 lines not on this page · raw message
drivers/s390/scsi/zfcp_scsi.c +16 -9
@@ -167,20 +167,21 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)struct zfcp_unit *unit = scpnt->device->hostdata;struct zfcp_fsf_req *old_req, *abrt_req;unsigned long flags; -unsigned long old_req_id = (unsigned long ) scpnt->host_scribble; +unsigned long old_reqid = (unsigned long ) scpnt->host_scribble;int retval =SUCCESS ;int retry =3 ; +char *dbf_tag;/* avoid race condition between late normal completion and abort */ write_lock_irqsave (&adapter->abort_lock, flags);spin_lock (&adapter->req_list_lock); - old_req =zfcp_reqlist_find (adapter, old_req_id); + old_req =zfcp_reqlist_find (adapter, old_reqid);spin_unlock (&adapter->req_list_lock);if (!old_req) {write_unlock_irqrestore (&adapter->abort_lock, flags);zfcp_scsi_dbf_event_abort ("lte1" , adapter, scpnt,NULL , - old_req_id); + old_reqid);return FAILED ;/* completion could be in progress */ } old_req->data =NULL ;
@@ -189,7 +190,7 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)write_unlock_irqrestore (&adapter->abort_lock, flags);while (retry--) { - abrt_req =zfcp_fsf_abort_fcp_command (old_req_id, unit); + abrt_req =zfcp_fsf_abort_fcp_command (old_reqid, unit);if (abrt_req)break ;
@@ -197,7 +198,7 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)if (!(atomic_read (&adapter->status) &ZFCP_STATUS_COMMON_RUNNING )) {zfcp_scsi_dbf_event_abort ("nres" , adapter, scpnt,NULL , - old_req_id); + old_reqid);return SUCCESS ; } }
@@ -208,13 +209,14 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) abrt_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);if (abrt_req->status &ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED ) -zfcp_scsi_dbf_event_abort ("okay" , adapter, scpnt, abrt_req,0 ); + dbf_tag ="okay" ;else if (abrt_req->status &ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED ) -zfcp_scsi_dbf_event_abort ("lte2" , adapter, scpnt, abrt_req,0 ); + dbf_tag ="lte2" ;else { -zfcp_scsi_dbf_event_abort ("fail" , adapter, scpnt, abrt_req,0 ); + dbf_tag ="fail" ; retval =FAILED ; } +zfcp_scsi_dbf_event_abort (dbf_tag, adapter, scpnt, abrt_req, old_reqid);zfcp_fsf_req_free (abrt_req);return retval; }
@@ -534,6 +536,9 @@ static void zfcp_scsi_rport_register(struct zfcp_port *port)struct fc_rport_identifiers ids;struct fc_rport *rport; +if (port->rport) +return ; + ids.node_name = port->wwnn; ids.port_name = port->wwpn; ids.port_id = port->d_id;
@@ -557,8 +562,10 @@ static void zfcp_scsi_rport_block(struct zfcp_port *port) {struct fc_rport *rport = port->rport; -if (rport) +if (rport) {fc_remote_port_delete (rport); + port->rport =NULL ; + } }void zfcp_scsi_schedule_rport_register (struct zfcp_port *port)
drivers/s390/scsi/zfcp_sysfs.c +6 -1
@@ -494,9 +494,14 @@ static ssize_t zfcp_sysfs_adapter_q_full_show(struct device *dev,struct Scsi_Host *scsi_host =class_to_shost (dev);struct zfcp_adapter *adapter = (struct zfcp_adapter *) scsi_host->hostdata[0 ]; +u64 util; + +spin_lock_bh (&adapter->qdio_stat_lock); + util = adapter->req_q_util; +spin_unlock_bh (&adapter->qdio_stat_lock);return sprintf (buf,"%d %llu\n" ,atomic_read (&adapter->qdio_outb_full), - (unsigned long long )adapter->req_q_util); + (unsigned long long )util); } static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL);
drivers/scsi/libfc/fc_exch.c +15 -8
@@ -415,9 +415,9 @@ static void fc_exch_timeout(struct work_struct *work) e_stat = ep->esb_stat;if (e_stat &ESB_ST_COMPLETE ) { ep->esb_stat = e_stat & ~ESB_ST_REC_QUAL ; +spin_unlock_bh (&ep->ex_lock);if (e_stat &ESB_ST_REC_QUAL )fc_exch_rrq (ep); -spin_unlock_bh (&ep->ex_lock); goto done; }else { resp = ep->resp;
@@ -1624,14 +1624,14 @@ static void fc_exch_rrq(struct fc_exch *ep)struct fc_lport *lp;struct fc_els_rrq *rrq;struct fc_frame *fp; -struct fc_seq *rrq_sp;u32 did; lp = ep->lp; fp =fc_frame_alloc (lp,sizeof (*rrq));if (!fp) -return ; + goto retry; + rrq =fc_frame_payload_get (fp,sizeof (*rrq));memset (rrq,0 ,sizeof (*rrq)); rrq->rrq_cmd =ELS_RRQ ;
@@ -1647,13 +1647,20 @@ static void fc_exch_rrq(struct fc_exch *ep)fc_host_port_id (lp->host),FC_TYPE_ELS , FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); - rrq_sp =fc_exch_seq_send (lp, fp, fc_exch_rrq_resp,NULL , ep, - lp->e_d_tov); -if (!rrq_sp) { - ep->esb_stat |=ESB_ST_REC_QUAL ; -fc_exch_timer_set_locked (ep, ep->r_a_tov); +if (fc_exch_seq_send (lp, fp, fc_exch_rrq_resp,NULL , ep, lp->e_d_tov)) +return ; + +retry: +spin_lock_bh (&ep->ex_lock); +if (ep->state & (FC_EX_RST_CLEANUP |FC_EX_DONE )) { +spin_unlock_bh (&ep->ex_lock); +/* drop hold for rec qual */ +fc_exch_release (ep);return ; } + ep->esb_stat |=ESB_ST_REC_QUAL ; +fc_exch_timer_set_locked (ep, ep->r_a_tov); +spin_unlock_bh (&ep->ex_lock); }
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 :
drivers/scsi/libsas/sas_expander.c +107 -40
265 lines not on this page · raw message
drivers/scsi/libsas/sas_port.c +15 -4
@@ -56,7 +56,7 @@ static void sas_form_port(struct asd_sas_phy *phy) } } -/* find a port */ +/* see if the phy should be part of a wide port */ spin_lock_irqsave (&sas_ha->phy_port_lock, flags);for (i =0 ; i < sas_ha->num_phys; i++) { port = sas_ha->sas_port[i];
@@ -69,12 +69,23 @@ static void sas_form_port(struct asd_sas_phy *phy)SAS_DPRINTK ("phy%d matched wide port%d\n" , phy->id, port->id);break ; - }else if (*(u64 *) port->sas_addr ==0 && port->num_phys==0 ) { -memcpy (port->sas_addr, phy->sas_addr,SAS_ADDR_SIZE ); -break ; }spin_unlock (&port->phy_list_lock); } +/* The phy does not match any existing port, create a new one */ +if (i == sas_ha->num_phys) { +for (i =0 ; i < sas_ha->num_phys; i++) { + port = sas_ha->sas_port[i]; +spin_lock (&port->phy_list_lock); +if (*(u64 *)port->sas_addr ==0 + && port->num_phys ==0 ) { +memcpy (port->sas_addr, phy->sas_addr, +SAS_ADDR_SIZE ); +break ; + } +spin_unlock (&port->phy_list_lock); + } + }if (i >= sas_ha->num_phys) { printk(KERN_NOTICE "%s: couldn't find a free port, bug?\n",
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 -2
@@ -100,7 +100,6 @@#define MAX_SRBS MAX_CMDS_TO_RISC#define MBOX_AEN_REG_COUNT 5#define MAX_INIT_RETRIES 5 -#define IOCB_HIWAT_CUSHION 16/* * Buffer sizes
@@ -184,6 +183,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; };/*
@@ -302,7 +306,6 @@ struct scsi_qla_host {uint32_t tot_ddbs;uint16_t iocb_cnt; -uint16_t iocb_hiwat;/* SRB cache. */ #define SRB_MIN_REQ 128
@@ -436,6 +439,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_iocb.c +60 -73
193 lines not on this page · raw message
drivers/scsi/qla4xxx/ql4_isr.c +100 -45
188 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 ; }
drivers/scsi/qla4xxx/ql4_os.c +27 -13
@@ -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;
@@ -904,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 );
@@ -1527,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,
@@ -1644,7 +1658,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 ) {
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"
drivers/scsi/sd.c +18 -2
@@ -1840,6 +1840,18 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp)kfree (buffer); } +static int sd_try_extended_inquiry (struct scsi_device *sdp) +{ +/* +* Although VPD inquiries can go to SCSI-2 type devices, +* some USB ones crash on receiving them, and the pages +* we currently ask for are for SPC-3 and beyond +*/ +if (sdp->scsi_level >SCSI_SPC_2 ) +return 1 ; +return 0 ; +} +/** * sd_revalidate_disk - called the first time a new disk is seen, * performs disk spin up, read_capacity, etc.
@@ -1877,8 +1889,12 @@ static int sd_revalidate_disk(struct gendisk *disk)*/ if (sdkp->media_present) {sd_read_capacity (sdkp, buffer); -sd_read_block_limits (sdkp); -sd_read_block_characteristics (sdkp); + +if (sd_try_extended_inquiry (sdp)) { +sd_read_block_limits (sdkp); +sd_read_block_characteristics (sdkp); + } +sd_read_write_protect_flag (sdkp, buffer);sd_read_cache_type (sdkp, buffer);sd_read_app_tag_own (sdkp, buffer);