mpt fusion: [2.6.30-rc6][Reviewed] Adding DeviceResetCtx for internal Device reset frame
Subsystems (2)
PATCH 8/17 mpt fusion: [2.6.30-rc6][Reviewed] Adding DeviceResetCtx for internal Device reset frame
1.) Added taskmgmt_quiesce_io flag in IOC and removed resetPending from
_MPT_SCSI_HOST sturct.
2.) Reset from Scsi mid layer and internal Reset are seperate context.
Adding DeviceResetCtx for internal Device reset frame. mptsas_taskmgmt_complete is optimized as part of implementation.
---
Signed-off-by Kashyap Desai <[email protected]>
---
drivers/message/fusion/mptbase.c +11 -2
@@ -6243,6 +6243,7 @@ mpt_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) {switch (reset_phase) {case MPT_IOC_SETUP_RESET : + ioc->taskmgmt_quiesce_io =1 ;dtmprintk (ioc,printk (MYIOC_s_DEBUG_FMT"%s: MPT_IOC_SETUP_RESET\n" , ioc->name, __func__));break ;
@@ -6595,8 +6596,11 @@ mpt_set_taskmgmt_in_progress_flag(MPT_ADAPTER *ioc) } retval =0 ; ioc->taskmgmt_in_progress =1 ; -if (ioc->alt_ioc) + ioc->taskmgmt_quiesce_io =1 ; +if (ioc->alt_ioc) { ioc->alt_ioc->taskmgmt_in_progress =1 ; + ioc->alt_ioc->taskmgmt_quiesce_io =1 ; + } out:spin_unlock_irqrestore (&ioc->taskmgmt_lock, flags);return retval;
@@ -6615,8 +6619,11 @@ mpt_clear_taskmgmt_in_progress_flag(MPT_ADAPTER *ioc)spin_lock_irqsave (&ioc->taskmgmt_lock, flags); ioc->taskmgmt_in_progress =0 ; -if (ioc->alt_ioc) + ioc->taskmgmt_quiesce_io =0 ; +if (ioc->alt_ioc) { ioc->alt_ioc->taskmgmt_in_progress =0 ; + ioc->alt_ioc->taskmgmt_quiesce_io =0 ; + }spin_unlock_irqrestore (&ioc->taskmgmt_lock, flags); }EXPORT_SYMBOL (mpt_clear_taskmgmt_in_progress_flag);
@@ -6731,9 +6738,11 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)spin_lock_irqsave (&ioc->taskmgmt_lock, flags); ioc->ioc_reset_in_progress =0 ; + ioc->taskmgmt_quiesce_io =0 ; ioc->taskmgmt_in_progress =0 ;if (ioc->alt_ioc) { ioc->alt_ioc->ioc_reset_in_progress =0 ; + ioc->alt_ioc->taskmgmt_quiesce_io =0 ; ioc->alt_ioc->taskmgmt_in_progress =0 ; }spin_unlock_irqrestore (&ioc->taskmgmt_lock, flags);
drivers/message/fusion/mptbase.h +1 -1
@@ -713,6 +713,7 @@ typedef struct _MPT_ADAPTERMPT_MGMT taskmgmt_cmds;spinlock_t taskmgmt_lock;/* diagnostic reset lock */ int taskmgmt_in_progress; +u8 taskmgmt_quiesce_io;u8 ioc_reset_in_progress;struct work_struct sas_persist_task;
@@ -855,7 +856,6 @@ typedef struct _MPT_SCSI_HOST {* OS callbacks. freeQ is the free pool. */ u8 tmPending; -u8 resetPending;u8 negoNvram;/* DV disabled, nego NVRAM */ u8 pad1;u8 tmState;
drivers/message/fusion/mptfc.c +0 -1
@@ -1292,7 +1292,6 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)*/ hd->tmPending =0 ; hd->tmState =TM_STATE_NONE ; - hd->resetPending =0 ; hd->abortSCpnt =NULL ;/* Clear the pointer used to store
drivers/message/fusion/mptsas.c +87 -54
252 lines not on this page · raw message
drivers/message/fusion/mptsas.h +1 -0
@@ -53,6 +53,7 @@ struct mptsas_target_reset_event {struct list_head list;EVENT_DATA_SAS_DEVICE_STATUS_CHANGE sas_event_data;u8 target_reset_issued; +unsigned long time_count; };enum mptsas_hotplug_action {
drivers/message/fusion/mptscsih.c +4 -15
@@ -99,7 +99,7 @@ int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id,int mptscsih_ioc_reset (MPT_ADAPTER *ioc,int post_reset);int mptscsih_event_process (MPT_ADAPTER *ioc,EventNotificationReply_t *pEvReply); -static void +void mptscsih_taskmgmt_response_code (MPT_ADAPTER *ioc,u8 response_code);static int mptscsih_get_completion_code (MPT_ADAPTER *ioc,MPT_FRAME_HDR *req,MPT_FRAME_HDR *reply);
@@ -1304,7 +1304,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))dmfprintk (ioc,printk (MYIOC_s_DEBUG_FMT"qcmd: SCpnt=%p, done()=%p\n" , ioc->name, SCpnt, done)); -if (hd->resetPending) { +if (ioc->taskmgmt_quiesce_io) {dtmprintk (ioc,printk (MYIOC_s_WARN_FMT"qcmd: SCpnt=%p timeout + 60HZ\n" , ioc->name, SCpnt));return SCSI_MLQUEUE_HOST_BUSY ;
@@ -1709,11 +1709,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) goto out; } -if (hd->resetPending) { - retval =FAILED ; - goto out; - } -if (hd->timeouts <-1 ) hd->timeouts++;
@@ -1782,11 +1777,6 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt) ioc->name, SCpnt);scsi_print_command (SCpnt); -if (hd->resetPending) { - retval =FAILED ; - goto out; - } - vdevice = SCpnt->device->hostdata;if (!vdevice || !vdevice->vtarget) { retval =0 ;
@@ -1967,7 +1957,7 @@ mptscsih_taskmgmt_reply(MPT_ADAPTER *ioc, u8 type, }/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static void +void mptscsih_taskmgmt_response_code (MPT_ADAPTER *ioc,u8 response_code) {char *desc;
@@ -2001,6 +1991,7 @@ mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code)printk (MYIOC_s_INFO_FMT"Response Code(0x%08x): F/W: %s\n" , ioc->name, response_code, desc); } +EXPORT_SYMBOL (mptscsih_taskmgmt_response_code);/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /**
@@ -2442,12 +2433,10 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)case MPT_IOC_SETUP_RESET :dtmprintk (ioc,printk (MYIOC_s_DEBUG_FMT"%s: MPT_IOC_SETUP_RESET\n" , ioc->name, __func__)); - hd->resetPending =1 ;break ;case MPT_IOC_PRE_RESET :dtmprintk (ioc,printk (MYIOC_s_DEBUG_FMT"%s: MPT_IOC_PRE_RESET\n" , ioc->name, __func__)); - hd->resetPending =0 ;mptscsih_flush_running_cmds (hd);break ;case MPT_IOC_POST_RESET :
drivers/message/fusion/mptscsih.h +1 -0
@@ -132,3 +132,4 @@ extern void mptscsih_timer_expired(unsigned long data);extern u8 mptscsih_raid_id_to_num (MPT_ADAPTER *ioc,u8 channel,u8 id);extern int mptscsih_is_phys_disk (MPT_ADAPTER *ioc,u8 channel,u8 id);extern struct device_attribute *mptscsih_host_attrs[]; +extern void mptscsih_taskmgmt_response_code (MPT_ADAPTER *ioc,u8 response_code);
drivers/message/fusion/mptspi.c +0 -1
@@ -1476,7 +1476,6 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)*/ hd->tmPending =0 ; hd->tmState =TM_STATE_NONE ; - hd->resetPending =0 ; hd->abortSCpnt =NULL ;/* Clear the pointer used to store