diff options
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index ab3d9d3e805f..66c773662694 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
@@ -119,6 +119,10 @@ module_param(diag_buffer_enable, int, 0); | |||
119 | MODULE_PARM_DESC(diag_buffer_enable, " post diag buffers " | 119 | MODULE_PARM_DESC(diag_buffer_enable, " post diag buffers " |
120 | "(TRACE=1/SNAPSHOT=2/EXTENDED=4/default=0)"); | 120 | "(TRACE=1/SNAPSHOT=2/EXTENDED=4/default=0)"); |
121 | 121 | ||
122 | static int disable_discovery = -1; | ||
123 | module_param(disable_discovery, int, 0); | ||
124 | MODULE_PARM_DESC(disable_discovery, " disable discovery "); | ||
125 | |||
122 | /** | 126 | /** |
123 | * struct sense_info - common structure for obtaining sense keys | 127 | * struct sense_info - common structure for obtaining sense keys |
124 | * @skey: sense key | 128 | * @skey: sense key |
@@ -5973,8 +5977,14 @@ _scsih_sas_discovery_event(struct MPT2SAS_ADAPTER *ioc, | |||
5973 | #endif | 5977 | #endif |
5974 | 5978 | ||
5975 | if (event_data->ReasonCode == MPI2_EVENT_SAS_DISC_RC_STARTED && | 5979 | if (event_data->ReasonCode == MPI2_EVENT_SAS_DISC_RC_STARTED && |
5976 | !ioc->sas_hba.num_phys) | 5980 | !ioc->sas_hba.num_phys) { |
5981 | if (disable_discovery > 0 && ioc->shost_recovery) { | ||
5982 | /* Wait for the reset to complete */ | ||
5983 | while (ioc->shost_recovery) | ||
5984 | ssleep(1); | ||
5985 | } | ||
5977 | _scsih_sas_host_add(ioc); | 5986 | _scsih_sas_host_add(ioc); |
5987 | } | ||
5978 | } | 5988 | } |
5979 | 5989 | ||
5980 | /** | 5990 | /** |
@@ -7929,6 +7939,9 @@ _scsih_scan_start(struct Scsi_Host *shost) | |||
7929 | if (diag_buffer_enable != -1 && diag_buffer_enable != 0) | 7939 | if (diag_buffer_enable != -1 && diag_buffer_enable != 0) |
7930 | mpt2sas_enable_diag_buffer(ioc, diag_buffer_enable); | 7940 | mpt2sas_enable_diag_buffer(ioc, diag_buffer_enable); |
7931 | 7941 | ||
7942 | if (disable_discovery > 0) | ||
7943 | return; | ||
7944 | |||
7932 | ioc->start_scan = 1; | 7945 | ioc->start_scan = 1; |
7933 | rc = mpt2sas_port_enable(ioc); | 7946 | rc = mpt2sas_port_enable(ioc); |
7934 | 7947 | ||
@@ -7950,6 +7963,12 @@ _scsih_scan_finished(struct Scsi_Host *shost, unsigned long time) | |||
7950 | { | 7963 | { |
7951 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | 7964 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); |
7952 | 7965 | ||
7966 | if (disable_discovery > 0) { | ||
7967 | ioc->is_driver_loading = 0; | ||
7968 | ioc->wait_for_discovery_to_complete = 0; | ||
7969 | return 1; | ||
7970 | } | ||
7971 | |||
7953 | if (time >= (300 * HZ)) { | 7972 | if (time >= (300 * HZ)) { |
7954 | ioc->base_cmds.status = MPT2_CMD_NOT_USED; | 7973 | ioc->base_cmds.status = MPT2_CMD_NOT_USED; |
7955 | printk(MPT2SAS_INFO_FMT "port enable: FAILED with timeout " | 7974 | printk(MPT2SAS_INFO_FMT "port enable: FAILED with timeout " |