]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: mpt3sas: renamed _base_after_reset_handler function
authorSreekanth Reddy <sreekanth.reddy@broadcom.com>
Thu, 26 Dec 2019 11:13:26 +0000 (06:13 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 3 Jan 2020 03:23:16 +0000 (22:23 -0500)
Renamed _base_after_reset_handler function to
_base_clear_outstanding_commands so that it can be used in multiple
scenarios with suitable name which matches with the operation it does.

Also renamed its child functions. No functional changes.

Link: https://lore.kernel.org/r/20191226111333.26131-4-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_base.c
drivers/scsi/mpt3sas/mpt3sas_base.h
drivers/scsi/mpt3sas/mpt3sas_ctl.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c

index 848fbec7bda6a27f56ccdce67434fef98c04137a..589b41dc5fa0847d660506e9be6dc3897196e1d3 100644 (file)
@@ -7277,14 +7277,14 @@ static void _base_pre_reset_handler(struct MPT3SAS_ADAPTER *ioc)
 }
 
 /**
- * _base_after_reset_handler - after reset handler
+ * _base_clear_outstanding_mpt_commands - clears outstanding mpt commands
  * @ioc: per adapter object
  */
-static void _base_after_reset_handler(struct MPT3SAS_ADAPTER *ioc)
+static void
+_base_clear_outstanding_mpt_commands(struct MPT3SAS_ADAPTER *ioc)
 {
-       mpt3sas_scsih_after_reset_handler(ioc);
-       mpt3sas_ctl_after_reset_handler(ioc);
-       dtmprintk(ioc, ioc_info(ioc, "%s: MPT3_IOC_AFTER_RESET\n", __func__));
+       dtmprintk(ioc,
+           ioc_info(ioc, "%s: clear outstanding mpt cmds\n", __func__));
        if (ioc->transport_cmds.status & MPT3_CMD_PENDING) {
                ioc->transport_cmds.status |= MPT3_CMD_RESET;
                mpt3sas_base_free_smid(ioc, ioc->transport_cmds.smid);
@@ -7317,6 +7317,17 @@ static void _base_after_reset_handler(struct MPT3SAS_ADAPTER *ioc)
        }
 }
 
+/**
+ * _base_clear_outstanding_commands - clear all outstanding commands
+ * @ioc: per adapter object
+ */
+static void _base_clear_outstanding_commands(struct MPT3SAS_ADAPTER *ioc)
+{
+       mpt3sas_scsih_clear_outstanding_scsi_tm_commands(ioc);
+       mpt3sas_ctl_clear_outstanding_ioctls(ioc);
+       _base_clear_outstanding_mpt_commands(ioc);
+}
+
 /**
  * _base_reset_done_handler - reset done handler
  * @ioc: per adapter object
@@ -7484,7 +7495,7 @@ mpt3sas_base_hard_reset_handler(struct MPT3SAS_ADAPTER *ioc,
        r = _base_make_ioc_ready(ioc, type);
        if (r)
                goto out;
-       _base_after_reset_handler(ioc);
+       _base_clear_outstanding_commands(ioc);
 
        /* If this hard reset is called while port enable is active, then
         * there is no reason to call make_ioc_operational
index 00c1247a0a7091018cff8b35547405d53514defd..83b8773d33ce8b767ac4a42e59eed43a0b2d4bd8 100644 (file)
@@ -1567,7 +1567,8 @@ struct scsi_cmnd *mpt3sas_scsih_scsi_lookup_get(struct MPT3SAS_ADAPTER *ioc,
 u8 mpt3sas_scsih_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 msix_index,
        u32 reply);
 void mpt3sas_scsih_pre_reset_handler(struct MPT3SAS_ADAPTER *ioc);
-void mpt3sas_scsih_after_reset_handler(struct MPT3SAS_ADAPTER *ioc);
+void mpt3sas_scsih_clear_outstanding_scsi_tm_commands(
+       struct MPT3SAS_ADAPTER *ioc);
 void mpt3sas_scsih_reset_done_handler(struct MPT3SAS_ADAPTER *ioc);
 
 int mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, u64 lun,
@@ -1701,7 +1702,7 @@ void mpt3sas_ctl_exit(ushort hbas_to_enumerate);
 u8 mpt3sas_ctl_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
        u32 reply);
 void mpt3sas_ctl_pre_reset_handler(struct MPT3SAS_ADAPTER *ioc);
-void mpt3sas_ctl_after_reset_handler(struct MPT3SAS_ADAPTER *ioc);
+void mpt3sas_ctl_clear_outstanding_ioctls(struct MPT3SAS_ADAPTER *ioc);
 void mpt3sas_ctl_reset_done_handler(struct MPT3SAS_ADAPTER *ioc);
 u8 mpt3sas_ctl_event_callback(struct MPT3SAS_ADAPTER *ioc,
        u8 msix_index, u32 reply);
index 6874cf01773950b5ab739bc1ed8961350ba74552..4e726ef83020ec0b4e4a88e2aed24d331354a717 100644 (file)
@@ -478,14 +478,15 @@ void mpt3sas_ctl_pre_reset_handler(struct MPT3SAS_ADAPTER *ioc)
 }
 
 /**
- * mpt3sas_ctl_reset_handler - reset callback handler (for ctl)
+ * mpt3sas_ctl_reset_handler - clears outstanding ioctl cmd.
  * @ioc: per adapter object
  *
  * The handler for doing any required cleanup or initialization.
  */
-void mpt3sas_ctl_after_reset_handler(struct MPT3SAS_ADAPTER *ioc)
+void mpt3sas_ctl_clear_outstanding_ioctls(struct MPT3SAS_ADAPTER *ioc)
 {
-       dtmprintk(ioc, ioc_info(ioc, "%s: MPT3_IOC_AFTER_RESET\n", __func__));
+       dtmprintk(ioc,
+           ioc_info(ioc, "%s: clear outstanding ioctl cmd\n", __func__));
        if (ioc->ctl_cmds.status & MPT3_CMD_PENDING) {
                ioc->ctl_cmds.status |= MPT3_CMD_RESET;
                mpt3sas_base_free_smid(ioc, ioc->ctl_cmds.smid);
index 5dd696a4c75cd832c3fddd7619a782d73f81d47b..9cc12f7ebf07c3e2eefcf2e56ec30afe897ba390 100644 (file)
@@ -9332,15 +9332,17 @@ void mpt3sas_scsih_pre_reset_handler(struct MPT3SAS_ADAPTER *ioc)
 }
 
 /**
- * mpt3sas_scsih_after_reset_handler - reset callback handler (for scsih)
+ * mpt3sas_scsih_clear_outstanding_scsi_tm_commands - clears outstanding
+ *                                                     scsi & tm cmds.
  * @ioc: per adapter object
  *
  * The handler for doing any required cleanup or initialization.
  */
 void
-mpt3sas_scsih_after_reset_handler(struct MPT3SAS_ADAPTER *ioc)
+mpt3sas_scsih_clear_outstanding_scsi_tm_commands(struct MPT3SAS_ADAPTER *ioc)
 {
-       dtmprintk(ioc, ioc_info(ioc, "%s: MPT3_IOC_AFTER_RESET\n", __func__));
+       dtmprintk(ioc,
+           ioc_info(ioc, "%s: clear outstanding scsi & tm cmds\n", __func__));
        if (ioc->scsih_cmds.status & MPT3_CMD_PENDING) {
                ioc->scsih_cmds.status |= MPT3_CMD_RESET;
                mpt3sas_base_free_smid(ioc, ioc->scsih_cmds.smid);