scsi: mpt3sas: Separate out mpt3sas_wait_for_ioc
No functional changes. This section of code "wait for IOC to be operational" is used in many places across the driver. Factor this code out into a new mpt3sas_wait_for_ioc(). Signed-off-by: Suganath Prabu <suganath-prabu.subramani@broadcom.com> Reviewed-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
02abcbc25a
commit
f4305749ca
|
@ -5077,6 +5077,41 @@ _base_send_ioc_reset(struct MPT3SAS_ADAPTER *ioc, u8 reset_type, int timeout)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mpt3sas_wait_for_ioc - IOC's operational state is checked here.
|
||||||
|
* @ioc: per adapter object
|
||||||
|
* @wait_count: timeout in seconds
|
||||||
|
*
|
||||||
|
* Return: Waits up to timeout seconds for the IOC to
|
||||||
|
* become operational. Returns 0 if IOC is present
|
||||||
|
* and operational; otherwise returns -EFAULT.
|
||||||
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
mpt3sas_wait_for_ioc(struct MPT3SAS_ADAPTER *ioc, int timeout)
|
||||||
|
{
|
||||||
|
int wait_state_count = 0;
|
||||||
|
u32 ioc_state;
|
||||||
|
|
||||||
|
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
||||||
|
while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
|
||||||
|
|
||||||
|
if (wait_state_count++ == timeout) {
|
||||||
|
ioc_err(ioc, "%s: failed due to ioc not operational\n",
|
||||||
|
__func__);
|
||||||
|
return -EFAULT;
|
||||||
|
}
|
||||||
|
ssleep(1);
|
||||||
|
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
||||||
|
ioc_info(ioc, "%s: waiting for operational state(count=%d)\n",
|
||||||
|
__func__, wait_state_count);
|
||||||
|
}
|
||||||
|
if (wait_state_count)
|
||||||
|
ioc_info(ioc, "ioc is operational\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _base_handshake_req_reply_wait - send request thru doorbell interface
|
* _base_handshake_req_reply_wait - send request thru doorbell interface
|
||||||
* @ioc: per adapter object
|
* @ioc: per adapter object
|
||||||
|
@ -5211,11 +5246,9 @@ mpt3sas_base_sas_iounit_control(struct MPT3SAS_ADAPTER *ioc,
|
||||||
Mpi2SasIoUnitControlRequest_t *mpi_request)
|
Mpi2SasIoUnitControlRequest_t *mpi_request)
|
||||||
{
|
{
|
||||||
u16 smid;
|
u16 smid;
|
||||||
u32 ioc_state;
|
|
||||||
u8 issue_reset = 0;
|
u8 issue_reset = 0;
|
||||||
int rc;
|
int rc;
|
||||||
void *request;
|
void *request;
|
||||||
u16 wait_state_count;
|
|
||||||
|
|
||||||
dinitprintk(ioc, ioc_info(ioc, "%s\n", __func__));
|
dinitprintk(ioc, ioc_info(ioc, "%s\n", __func__));
|
||||||
|
|
||||||
|
@ -5227,20 +5260,9 @@ mpt3sas_base_sas_iounit_control(struct MPT3SAS_ADAPTER *ioc,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
wait_state_count = 0;
|
rc = mpt3sas_wait_for_ioc(ioc, IOC_OPERATIONAL_WAIT_COUNT);
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
if (rc)
|
||||||
while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
|
goto out;
|
||||||
if (wait_state_count++ == IOC_OPERATIONAL_WAIT_COUNT) {
|
|
||||||
ioc_err(ioc, "%s: failed due to ioc not operational\n",
|
|
||||||
__func__);
|
|
||||||
rc = -EFAULT;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
ssleep(1);
|
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
|
||||||
ioc_info(ioc, "%s: waiting for operational state(count=%d)\n",
|
|
||||||
__func__, wait_state_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx);
|
smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx);
|
||||||
if (!smid) {
|
if (!smid) {
|
||||||
|
@ -5306,11 +5328,9 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_ADAPTER *ioc,
|
||||||
Mpi2SepReply_t *mpi_reply, Mpi2SepRequest_t *mpi_request)
|
Mpi2SepReply_t *mpi_reply, Mpi2SepRequest_t *mpi_request)
|
||||||
{
|
{
|
||||||
u16 smid;
|
u16 smid;
|
||||||
u32 ioc_state;
|
|
||||||
u8 issue_reset = 0;
|
u8 issue_reset = 0;
|
||||||
int rc;
|
int rc;
|
||||||
void *request;
|
void *request;
|
||||||
u16 wait_state_count;
|
|
||||||
|
|
||||||
dinitprintk(ioc, ioc_info(ioc, "%s\n", __func__));
|
dinitprintk(ioc, ioc_info(ioc, "%s\n", __func__));
|
||||||
|
|
||||||
|
@ -5322,20 +5342,9 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_ADAPTER *ioc,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
wait_state_count = 0;
|
rc = mpt3sas_wait_for_ioc(ioc, IOC_OPERATIONAL_WAIT_COUNT);
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
if (rc)
|
||||||
while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
|
goto out;
|
||||||
if (wait_state_count++ == IOC_OPERATIONAL_WAIT_COUNT) {
|
|
||||||
ioc_err(ioc, "%s: failed due to ioc not operational\n",
|
|
||||||
__func__);
|
|
||||||
rc = -EFAULT;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
ssleep(1);
|
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
|
||||||
ioc_info(ioc, "%s: waiting for operational state(count=%d)\n",
|
|
||||||
__func__, wait_state_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx);
|
smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx);
|
||||||
if (!smid) {
|
if (!smid) {
|
||||||
|
|
|
@ -1491,6 +1491,7 @@ mpt3sas_wait_for_commands_to_complete(struct MPT3SAS_ADAPTER *ioc);
|
||||||
|
|
||||||
u8 mpt3sas_base_check_cmd_timeout(struct MPT3SAS_ADAPTER *ioc,
|
u8 mpt3sas_base_check_cmd_timeout(struct MPT3SAS_ADAPTER *ioc,
|
||||||
u8 status, void *mpi_request, int sz);
|
u8 status, void *mpi_request, int sz);
|
||||||
|
int mpt3sas_wait_for_ioc(struct MPT3SAS_ADAPTER *ioc, int wait_count);
|
||||||
|
|
||||||
/* scsih shared API */
|
/* scsih shared API */
|
||||||
struct scsi_cmnd *mpt3sas_scsih_scsi_lookup_get(struct MPT3SAS_ADAPTER *ioc,
|
struct scsi_cmnd *mpt3sas_scsih_scsi_lookup_get(struct MPT3SAS_ADAPTER *ioc,
|
||||||
|
|
|
@ -300,11 +300,9 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t
|
||||||
void *config_page, u16 config_page_sz)
|
void *config_page, u16 config_page_sz)
|
||||||
{
|
{
|
||||||
u16 smid;
|
u16 smid;
|
||||||
u32 ioc_state;
|
|
||||||
Mpi2ConfigRequest_t *config_request;
|
Mpi2ConfigRequest_t *config_request;
|
||||||
int r;
|
int r;
|
||||||
u8 retry_count, issue_host_reset = 0;
|
u8 retry_count, issue_host_reset = 0;
|
||||||
u16 wait_state_count;
|
|
||||||
struct config_request mem;
|
struct config_request mem;
|
||||||
u32 ioc_status = UINT_MAX;
|
u32 ioc_status = UINT_MAX;
|
||||||
|
|
||||||
|
@ -361,23 +359,10 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t
|
||||||
ioc_info(ioc, "%s: attempting retry (%d)\n",
|
ioc_info(ioc, "%s: attempting retry (%d)\n",
|
||||||
__func__, retry_count);
|
__func__, retry_count);
|
||||||
}
|
}
|
||||||
wait_state_count = 0;
|
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
r = mpt3sas_wait_for_ioc(ioc, MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT);
|
||||||
while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
|
if (r)
|
||||||
if (wait_state_count++ == MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT) {
|
goto free_mem;
|
||||||
ioc_err(ioc, "%s: failed due to ioc not operational\n",
|
|
||||||
__func__);
|
|
||||||
ioc->config_cmds.status = MPT3_CMD_NOT_USED;
|
|
||||||
r = -EFAULT;
|
|
||||||
goto free_mem;
|
|
||||||
}
|
|
||||||
ssleep(1);
|
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
|
||||||
ioc_info(ioc, "%s: waiting for operational state(count=%d)\n",
|
|
||||||
__func__, wait_state_count);
|
|
||||||
}
|
|
||||||
if (wait_state_count)
|
|
||||||
ioc_info(ioc, "%s: ioc is operational\n", __func__);
|
|
||||||
|
|
||||||
smid = mpt3sas_base_get_smid(ioc, ioc->config_cb_idx);
|
smid = mpt3sas_base_get_smid(ioc, ioc->config_cb_idx);
|
||||||
if (!smid) {
|
if (!smid) {
|
||||||
|
|
|
@ -641,7 +641,6 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
||||||
MPI2DefaultReply_t *mpi_reply;
|
MPI2DefaultReply_t *mpi_reply;
|
||||||
Mpi26NVMeEncapsulatedRequest_t *nvme_encap_request = NULL;
|
Mpi26NVMeEncapsulatedRequest_t *nvme_encap_request = NULL;
|
||||||
struct _pcie_device *pcie_device = NULL;
|
struct _pcie_device *pcie_device = NULL;
|
||||||
u32 ioc_state;
|
|
||||||
u16 smid;
|
u16 smid;
|
||||||
u8 timeout;
|
u8 timeout;
|
||||||
u8 issue_reset;
|
u8 issue_reset;
|
||||||
|
@ -654,7 +653,6 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
||||||
dma_addr_t data_in_dma = 0;
|
dma_addr_t data_in_dma = 0;
|
||||||
size_t data_in_sz = 0;
|
size_t data_in_sz = 0;
|
||||||
long ret;
|
long ret;
|
||||||
u16 wait_state_count;
|
|
||||||
u16 device_handle = MPT3SAS_INVALID_DEVICE_HANDLE;
|
u16 device_handle = MPT3SAS_INVALID_DEVICE_HANDLE;
|
||||||
u8 tr_method = MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE;
|
u8 tr_method = MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE;
|
||||||
|
|
||||||
|
@ -666,22 +664,9 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
wait_state_count = 0;
|
ret = mpt3sas_wait_for_ioc(ioc, IOC_OPERATIONAL_WAIT_COUNT);
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
if (ret)
|
||||||
while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
|
goto out;
|
||||||
if (wait_state_count++ == IOC_OPERATIONAL_WAIT_COUNT) {
|
|
||||||
ioc_err(ioc, "%s: failed due to ioc not operational\n",
|
|
||||||
__func__);
|
|
||||||
ret = -EFAULT;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
ssleep(1);
|
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
|
||||||
ioc_info(ioc, "%s: waiting for operational state(count=%d)\n",
|
|
||||||
__func__, wait_state_count);
|
|
||||||
}
|
|
||||||
if (wait_state_count)
|
|
||||||
ioc_info(ioc, "%s: ioc is operational\n", __func__);
|
|
||||||
|
|
||||||
mpi_request = kzalloc(ioc->request_sz, GFP_KERNEL);
|
mpi_request = kzalloc(ioc->request_sz, GFP_KERNEL);
|
||||||
if (!mpi_request) {
|
if (!mpi_request) {
|
||||||
|
|
|
@ -296,7 +296,6 @@ _transport_expander_report_manufacture(struct MPT3SAS_ADAPTER *ioc,
|
||||||
struct rep_manu_request *manufacture_request;
|
struct rep_manu_request *manufacture_request;
|
||||||
int rc;
|
int rc;
|
||||||
u16 smid;
|
u16 smid;
|
||||||
u32 ioc_state;
|
|
||||||
void *psge;
|
void *psge;
|
||||||
u8 issue_reset = 0;
|
u8 issue_reset = 0;
|
||||||
void *data_out = NULL;
|
void *data_out = NULL;
|
||||||
|
@ -304,7 +303,6 @@ _transport_expander_report_manufacture(struct MPT3SAS_ADAPTER *ioc,
|
||||||
dma_addr_t data_in_dma;
|
dma_addr_t data_in_dma;
|
||||||
size_t data_in_sz;
|
size_t data_in_sz;
|
||||||
size_t data_out_sz;
|
size_t data_out_sz;
|
||||||
u16 wait_state_count;
|
|
||||||
|
|
||||||
if (ioc->shost_recovery || ioc->pci_error_recovery) {
|
if (ioc->shost_recovery || ioc->pci_error_recovery) {
|
||||||
ioc_info(ioc, "%s: host reset in progress!\n", __func__);
|
ioc_info(ioc, "%s: host reset in progress!\n", __func__);
|
||||||
|
@ -320,22 +318,9 @@ _transport_expander_report_manufacture(struct MPT3SAS_ADAPTER *ioc,
|
||||||
}
|
}
|
||||||
ioc->transport_cmds.status = MPT3_CMD_PENDING;
|
ioc->transport_cmds.status = MPT3_CMD_PENDING;
|
||||||
|
|
||||||
wait_state_count = 0;
|
rc = mpt3sas_wait_for_ioc(ioc, IOC_OPERATIONAL_WAIT_COUNT);
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
if (rc)
|
||||||
while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
|
goto out;
|
||||||
if (wait_state_count++ == IOC_OPERATIONAL_WAIT_COUNT) {
|
|
||||||
ioc_err(ioc, "%s: failed due to ioc not operational\n",
|
|
||||||
__func__);
|
|
||||||
rc = -EFAULT;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
ssleep(1);
|
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
|
||||||
ioc_info(ioc, "%s: waiting for operational state(count=%d)\n",
|
|
||||||
__func__, wait_state_count);
|
|
||||||
}
|
|
||||||
if (wait_state_count)
|
|
||||||
ioc_info(ioc, "%s: ioc is operational\n", __func__);
|
|
||||||
|
|
||||||
smid = mpt3sas_base_get_smid(ioc, ioc->transport_cb_idx);
|
smid = mpt3sas_base_get_smid(ioc, ioc->transport_cb_idx);
|
||||||
if (!smid) {
|
if (!smid) {
|
||||||
|
@ -1076,13 +1061,11 @@ _transport_get_expander_phy_error_log(struct MPT3SAS_ADAPTER *ioc,
|
||||||
struct phy_error_log_reply *phy_error_log_reply;
|
struct phy_error_log_reply *phy_error_log_reply;
|
||||||
int rc;
|
int rc;
|
||||||
u16 smid;
|
u16 smid;
|
||||||
u32 ioc_state;
|
|
||||||
void *psge;
|
void *psge;
|
||||||
u8 issue_reset = 0;
|
u8 issue_reset = 0;
|
||||||
void *data_out = NULL;
|
void *data_out = NULL;
|
||||||
dma_addr_t data_out_dma;
|
dma_addr_t data_out_dma;
|
||||||
u32 sz;
|
u32 sz;
|
||||||
u16 wait_state_count;
|
|
||||||
|
|
||||||
if (ioc->shost_recovery || ioc->pci_error_recovery) {
|
if (ioc->shost_recovery || ioc->pci_error_recovery) {
|
||||||
ioc_info(ioc, "%s: host reset in progress!\n", __func__);
|
ioc_info(ioc, "%s: host reset in progress!\n", __func__);
|
||||||
|
@ -1098,22 +1081,9 @@ _transport_get_expander_phy_error_log(struct MPT3SAS_ADAPTER *ioc,
|
||||||
}
|
}
|
||||||
ioc->transport_cmds.status = MPT3_CMD_PENDING;
|
ioc->transport_cmds.status = MPT3_CMD_PENDING;
|
||||||
|
|
||||||
wait_state_count = 0;
|
rc = mpt3sas_wait_for_ioc(ioc, IOC_OPERATIONAL_WAIT_COUNT);
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
if (rc)
|
||||||
while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
|
goto out;
|
||||||
if (wait_state_count++ == IOC_OPERATIONAL_WAIT_COUNT) {
|
|
||||||
ioc_err(ioc, "%s: failed due to ioc not operational\n",
|
|
||||||
__func__);
|
|
||||||
rc = -EFAULT;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
ssleep(1);
|
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
|
||||||
ioc_info(ioc, "%s: waiting for operational state(count=%d)\n",
|
|
||||||
__func__, wait_state_count);
|
|
||||||
}
|
|
||||||
if (wait_state_count)
|
|
||||||
ioc_info(ioc, "%s: ioc is operational\n", __func__);
|
|
||||||
|
|
||||||
smid = mpt3sas_base_get_smid(ioc, ioc->transport_cb_idx);
|
smid = mpt3sas_base_get_smid(ioc, ioc->transport_cb_idx);
|
||||||
if (!smid) {
|
if (!smid) {
|
||||||
|
@ -1381,13 +1351,11 @@ _transport_expander_phy_control(struct MPT3SAS_ADAPTER *ioc,
|
||||||
struct phy_control_reply *phy_control_reply;
|
struct phy_control_reply *phy_control_reply;
|
||||||
int rc;
|
int rc;
|
||||||
u16 smid;
|
u16 smid;
|
||||||
u32 ioc_state;
|
|
||||||
void *psge;
|
void *psge;
|
||||||
u8 issue_reset = 0;
|
u8 issue_reset = 0;
|
||||||
void *data_out = NULL;
|
void *data_out = NULL;
|
||||||
dma_addr_t data_out_dma;
|
dma_addr_t data_out_dma;
|
||||||
u32 sz;
|
u32 sz;
|
||||||
u16 wait_state_count;
|
|
||||||
|
|
||||||
if (ioc->shost_recovery || ioc->pci_error_recovery) {
|
if (ioc->shost_recovery || ioc->pci_error_recovery) {
|
||||||
ioc_info(ioc, "%s: host reset in progress!\n", __func__);
|
ioc_info(ioc, "%s: host reset in progress!\n", __func__);
|
||||||
|
@ -1403,22 +1371,9 @@ _transport_expander_phy_control(struct MPT3SAS_ADAPTER *ioc,
|
||||||
}
|
}
|
||||||
ioc->transport_cmds.status = MPT3_CMD_PENDING;
|
ioc->transport_cmds.status = MPT3_CMD_PENDING;
|
||||||
|
|
||||||
wait_state_count = 0;
|
rc = mpt3sas_wait_for_ioc(ioc, IOC_OPERATIONAL_WAIT_COUNT);
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
if (rc)
|
||||||
while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
|
goto out;
|
||||||
if (wait_state_count++ == IOC_OPERATIONAL_WAIT_COUNT) {
|
|
||||||
ioc_err(ioc, "%s: failed due to ioc not operational\n",
|
|
||||||
__func__);
|
|
||||||
rc = -EFAULT;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
ssleep(1);
|
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
|
||||||
ioc_info(ioc, "%s: waiting for operational state(count=%d)\n",
|
|
||||||
__func__, wait_state_count);
|
|
||||||
}
|
|
||||||
if (wait_state_count)
|
|
||||||
ioc_info(ioc, "%s: ioc is operational\n", __func__);
|
|
||||||
|
|
||||||
smid = mpt3sas_base_get_smid(ioc, ioc->transport_cb_idx);
|
smid = mpt3sas_base_get_smid(ioc, ioc->transport_cb_idx);
|
||||||
if (!smid) {
|
if (!smid) {
|
||||||
|
@ -1880,7 +1835,6 @@ _transport_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
|
||||||
Mpi2SmpPassthroughReply_t *mpi_reply;
|
Mpi2SmpPassthroughReply_t *mpi_reply;
|
||||||
int rc;
|
int rc;
|
||||||
u16 smid;
|
u16 smid;
|
||||||
u32 ioc_state;
|
|
||||||
void *psge;
|
void *psge;
|
||||||
dma_addr_t dma_addr_in;
|
dma_addr_t dma_addr_in;
|
||||||
dma_addr_t dma_addr_out;
|
dma_addr_t dma_addr_out;
|
||||||
|
@ -1888,7 +1842,6 @@ _transport_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
|
||||||
void *addr_out = NULL;
|
void *addr_out = NULL;
|
||||||
size_t dma_len_in;
|
size_t dma_len_in;
|
||||||
size_t dma_len_out;
|
size_t dma_len_out;
|
||||||
u16 wait_state_count;
|
|
||||||
unsigned int reslen = 0;
|
unsigned int reslen = 0;
|
||||||
|
|
||||||
if (ioc->shost_recovery || ioc->pci_error_recovery) {
|
if (ioc->shost_recovery || ioc->pci_error_recovery) {
|
||||||
|
@ -1924,22 +1877,9 @@ _transport_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
|
||||||
if (rc)
|
if (rc)
|
||||||
goto unmap_out;
|
goto unmap_out;
|
||||||
|
|
||||||
wait_state_count = 0;
|
rc = mpt3sas_wait_for_ioc(ioc, IOC_OPERATIONAL_WAIT_COUNT);
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
if (rc)
|
||||||
while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
|
goto unmap_in;
|
||||||
if (wait_state_count++ == IOC_OPERATIONAL_WAIT_COUNT) {
|
|
||||||
ioc_err(ioc, "%s: failed due to ioc not operational\n",
|
|
||||||
__func__);
|
|
||||||
rc = -EFAULT;
|
|
||||||
goto unmap_in;
|
|
||||||
}
|
|
||||||
ssleep(1);
|
|
||||||
ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
|
|
||||||
ioc_info(ioc, "%s: waiting for operational state(count=%d)\n",
|
|
||||||
__func__, wait_state_count);
|
|
||||||
}
|
|
||||||
if (wait_state_count)
|
|
||||||
ioc_info(ioc, "%s: ioc is operational\n", __func__);
|
|
||||||
|
|
||||||
smid = mpt3sas_base_get_smid(ioc, ioc->transport_cb_idx);
|
smid = mpt3sas_base_get_smid(ioc, ioc->transport_cb_idx);
|
||||||
if (!smid) {
|
if (!smid) {
|
||||||
|
|
Loading…
Reference in New Issue