Patch "[PATCH 073/135] mpt3sas: Fix for Asynchronous completion of timedout" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
[PATCH 073/135] mpt3sas: Fix for Asynchronous completion of timedout
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
0073-mpt3sas-Fix-for-Asynchronous-completion-of-timedout-.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
6b229d64e5b93e67a6c29c5149f72236a1bfe42bMon Sep 17 00:00:00 2001
From: Suganath prabu Subramani <[email protected]>
Date: Thu, 28 Jan 2016 12:07:06 +0530
Subject: [PATCH 073/135] mpt3sas: Fix for Asynchronous completion of timedout
IO and task abort of timedout IO.
[ Upstream commit 03d1fb3a65783979f23bd58b5a0387e6992d9e26 ]
Track msix of each IO and use the same msix for issuing abort to timed out IO. With this driver will process IO's reply first followed by TM.
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 20 +++++++++++--------- drivers/scsi/mpt3sas/mpt3sas_base.h | 5 ++++- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 2 +- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 12 +++++++++--- 4 files changed, 25 insertions(+), 14 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +11 -9
@@ -2242,6 +2242,12 @@ mpt3sas_base_get_reply_virt_addr(structreturn ioc->reply + (phys_addr - (u32 )ioc->reply_dma); } +static inline u8 +_base_get_msix_index (struct MPT3SAS_ADAPTER *ioc) +{ +return ioc->cpu_msix_table[raw_smp_processor_id ()]; +} +/** * mpt3sas_base_get_smid - obtain a free smid from internal queue * @ioc: per adapter object
@@ -2302,6 +2308,7 @@ mpt3sas_base_get_smid_scsiio(struct MPT3 request->scmd = scmd; request->cb_idx = cb_idx; smid = request->smid; + request->msix_io =_base_get_msix_index (ioc);list_del (&request->tracker_list);spin_unlock_irqrestore (&ioc->scsi_lookup_lock, flags);return smid;
@@ -2424,12 +2431,6 @@ _base_writeq(__u64 b, volatile void __io }#endif -static inline u8 -_base_get_msix_index (struct MPT3SAS_ADAPTER *ioc) -{ -return ioc->cpu_msix_table[raw_smp_processor_id ()]; -} -/** * mpt3sas_base_put_smid_scsi_io - send SCSI_IO request to firmware * @ioc: per adapter object
@@ -2483,18 +2484,19 @@ mpt3sas_base_put_smid_fast_path(struct M* mpt3sas_base_put_smid_hi_priority - send Task Managment request to firmware * @ioc: per adapter object * @smid: system request message index -* +* @msix_task: msix_task will be same as msix of IO incase of task abort else 0. * Return nothing. */ void -mpt3sas_base_put_smid_hi_priority (struct MPT3SAS_ADAPTER *ioc,u16 smid) +mpt3sas_base_put_smid_hi_priority (struct MPT3SAS_ADAPTER *ioc,u16 smid, +u16 msix_task) {Mpi2RequestDescriptorUnion_t descriptor;u64 *request = (u64 *)&descriptor; descriptor.HighPriority.RequestFlags =MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY ; - descriptor.HighPriority.MSIxIndex =0 ; + descriptor.HighPriority.MSIxIndex = msix_task; descriptor.HighPriority.SMID =cpu_to_le16 (smid); descriptor.HighPriority.LMID =0 ; descriptor.HighPriority.Reserved1 =0 ;
drivers/scsi/mpt3sas/mpt3sas_base.h +4 -1
@@ -643,6 +643,7 @@ struct chain_tracker {* @cb_idx: callback index * @direct_io: To indicate whether I/O is direct (WARPDRIVE) * @tracker_list: list of free request (ioc->free_list) +* @msix_io: IO's msix */ struct scsiio_tracker {u16 smid;
@@ -651,6 +652,7 @@ struct scsiio_tracker {u8 direct_io;struct list_head chain_list;struct list_head tracker_list; +u16 msix_io; };/**
@@ -1213,7 +1215,8 @@ void mpt3sas_base_put_smid_scsi_io(struc u16 handle);void mpt3sas_base_put_smid_fast_path (struct MPT3SAS_ADAPTER *ioc,u16 smid,u16 handle); -void mpt3sas_base_put_smid_hi_priority (struct MPT3SAS_ADAPTER *ioc,u16 smid); +void mpt3sas_base_put_smid_hi_priority (struct MPT3SAS_ADAPTER *ioc, +u16 smid,u16 msix_task);void mpt3sas_base_put_smid_default (struct MPT3SAS_ADAPTER *ioc,u16 smid);void mpt3sas_base_initialize_callback_handler (void );u8 mpt3sas_base_register_callback_handler (MPT_CALLBACK cb_func);
drivers/scsi/mpt3sas/mpt3sas_ctl.c +1 -1
@@ -817,7 +817,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPT tm_request->DevHandle)); ioc->build_sg_mpi (ioc, psge, data_out_dma, data_out_sz, data_in_dma, data_in_sz); -mpt3sas_base_put_smid_hi_priority (ioc, smid); +mpt3sas_base_put_smid_hi_priority (ioc, smid,0 );break ; }case MPI2_FUNCTION_SMP_PASSTHROUGH :
drivers/scsi/mpt3sas/mpt3sas_scsih.c +9 -3
@@ -2193,6 +2193,7 @@ mpt3sas_scsih_issue_tm(struct MPT3SAS_ADunsigned long timeleft;struct scsiio_tracker *scsi_lookup =NULL ;int rc; +u16 msix_task =0 ;if (m_type ==TM_MUTEX_ON )mutex_lock (&ioc->tm_cmds.mutex);
@@ -2256,7 +2257,12 @@ mpt3sas_scsih_issue_tm(struct MPT3SAS_ADint_to_scsilun (lun, (struct scsi_lun *)mpi_request->LUN);mpt3sas_scsih_set_tm_flag (ioc, handle);init_completion (&ioc->tm_cmds.done); -mpt3sas_base_put_smid_hi_priority (ioc, smid); +if ((type ==MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK ) && + (scsi_lookup->msix_io < ioc->reply_queue_count)) + msix_task = scsi_lookup->msix_io; +else + msix_task =0 ; +mpt3sas_base_put_smid_hi_priority (ioc, smid, msix_task); timeleft =wait_for_completion_timeout (&ioc->tm_cmds.done, timeout*HZ );if (!(ioc->tm_cmds.status &MPT3_CMD_COMPLETE )) { pr_err(MPT3SAS_FMT "%s: timeout\n",
@@ -3151,7 +3157,7 @@ _scsih_tm_tr_send(struct MPT3SAS_ADAPTER mpi_request->Function =MPI2_FUNCTION_SCSI_TASK_MGMT ; mpi_request->DevHandle =cpu_to_le16 (handle); mpi_request->TaskType =MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET ; -mpt3sas_base_put_smid_hi_priority (ioc, smid); +mpt3sas_base_put_smid_hi_priority (ioc, smid,0 );mpt3sas_trigger_master (ioc,MASTER_TRIGGER_DEVICE_REMOVAL ); out:
@@ -3332,7 +3338,7 @@ _scsih_tm_tr_volume_send(struct MPT3SAS_ mpi_request->Function =MPI2_FUNCTION_SCSI_TASK_MGMT ; mpi_request->DevHandle =cpu_to_le16 (handle); mpi_request->TaskType =MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET ; -mpt3sas_base_put_smid_hi_priority (ioc, smid); +mpt3sas_base_put_smid_hi_priority (ioc, smid,0 ); }/**
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/0073-mpt3sas-Fix-for-Asynchronous-completion-of-timedout-.patch