diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-05-29 07:08:14 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-09 18:21:49 -0400 |
commit | 7b5a65b9e649dad9cf9c6d282df4162843070351 (patch) | |
tree | 440645a0fd7d465e10214a4372a0d7a5a15901c3 /drivers/message/fusion/mptbase.c | |
parent | 14d0f0b063f5363984dd305a792854f9c23e9e97 (diff) |
[SCSI] mpt fusion: Added support for MPT discovery completion check
sas_discovery_quiesce_io flag is used to control IO start/resume functionality.
IO will be stoped while doing discovery of topology. Once discovery is completed
It will resume IO. Resending patch including James review.
Signed-off-by: Kashyap Desai <kadesai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index a66369218c97..54326e09629c 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -277,6 +277,56 @@ mpt_get_cb_idx(MPT_DRIVER_CLASS dclass) | |||
277 | } | 277 | } |
278 | 278 | ||
279 | /** | 279 | /** |
280 | * mpt_is_discovery_complete - determine if discovery has completed | ||
281 | * @ioc: per adatper instance | ||
282 | * | ||
283 | * Returns 1 when discovery completed, else zero. | ||
284 | */ | ||
285 | static int | ||
286 | mpt_is_discovery_complete(MPT_ADAPTER *ioc) | ||
287 | { | ||
288 | ConfigExtendedPageHeader_t hdr; | ||
289 | CONFIGPARMS cfg; | ||
290 | SasIOUnitPage0_t *buffer; | ||
291 | dma_addr_t dma_handle; | ||
292 | int rc = 0; | ||
293 | |||
294 | memset(&hdr, 0, sizeof(ConfigExtendedPageHeader_t)); | ||
295 | memset(&cfg, 0, sizeof(CONFIGPARMS)); | ||
296 | hdr.PageVersion = MPI_SASIOUNITPAGE0_PAGEVERSION; | ||
297 | hdr.PageType = MPI_CONFIG_PAGETYPE_EXTENDED; | ||
298 | hdr.ExtPageType = MPI_CONFIG_EXTPAGETYPE_SAS_IO_UNIT; | ||
299 | cfg.cfghdr.ehdr = &hdr; | ||
300 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | ||
301 | |||
302 | if ((mpt_config(ioc, &cfg))) | ||
303 | goto out; | ||
304 | if (!hdr.ExtPageLength) | ||
305 | goto out; | ||
306 | |||
307 | buffer = pci_alloc_consistent(ioc->pcidev, hdr.ExtPageLength * 4, | ||
308 | &dma_handle); | ||
309 | if (!buffer) | ||
310 | goto out; | ||
311 | |||
312 | cfg.physAddr = dma_handle; | ||
313 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; | ||
314 | |||
315 | if ((mpt_config(ioc, &cfg))) | ||
316 | goto out_free_consistent; | ||
317 | |||
318 | if (!(buffer->PhyData[0].PortFlags & | ||
319 | MPI_SAS_IOUNIT0_PORT_FLAGS_DISCOVERY_IN_PROGRESS)) | ||
320 | rc = 1; | ||
321 | |||
322 | out_free_consistent: | ||
323 | pci_free_consistent(ioc->pcidev, hdr.ExtPageLength * 4, | ||
324 | buffer, dma_handle); | ||
325 | out: | ||
326 | return rc; | ||
327 | } | ||
328 | |||
329 | /** | ||
280 | * mpt_fault_reset_work - work performed on workq after ioc fault | 330 | * mpt_fault_reset_work - work performed on workq after ioc fault |
281 | * @work: input argument, used to derive ioc | 331 | * @work: input argument, used to derive ioc |
282 | * | 332 | * |
@@ -307,6 +357,12 @@ mpt_fault_reset_work(struct work_struct *work) | |||
307 | printk(MYIOC_s_WARN_FMT "IOC is in FAULT state after " | 357 | printk(MYIOC_s_WARN_FMT "IOC is in FAULT state after " |
308 | "reset (%04xh)\n", ioc->name, ioc_raw_state & | 358 | "reset (%04xh)\n", ioc->name, ioc_raw_state & |
309 | MPI_DOORBELL_DATA_MASK); | 359 | MPI_DOORBELL_DATA_MASK); |
360 | } else if (ioc->bus_type == SAS && ioc->sas_discovery_quiesce_io) { | ||
361 | if ((mpt_is_discovery_complete(ioc))) { | ||
362 | devtprintk(ioc, printk(MYIOC_s_DEBUG_FMT "clearing " | ||
363 | "discovery_quiesce_io flag\n", ioc->name)); | ||
364 | ioc->sas_discovery_quiesce_io = 0; | ||
365 | } | ||
310 | } | 366 | } |
311 | 367 | ||
312 | out: | 368 | out: |