aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_sli.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2008-08-24 21:50:11 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-13 09:28:54 -0400
commita8e497d51e6adb2dd6ef307ae76f3433a4dbe895 (patch)
tree35c1a66bcd2fc8903cc7f25cfbafb919f5cd7b9a /drivers/scsi/lpfc/lpfc_sli.c
parent84774a4d0a4dba8a5767da6c58ea5a8c5b0cfe25 (diff)
[SCSI] lpfc 8.2.8 : Add support for PCI-EEH permanent disabling
Add support for PCI-EEH permanent-disabling a device via lpfc_pci_remove_one() Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 857bc0a57c47..1812e18246d5 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -2377,6 +2377,70 @@ lpfc_sli_abort_iocb_ring(struct lpfc_hba *phba, struct lpfc_sli_ring *pring)
2377} 2377}
2378 2378
2379/** 2379/**
2380 * lpfc_sli_flush_fcp_rings: flush all iocbs in the fcp ring.
2381 * @phba: Pointer to HBA context object.
2382 *
2383 * This function flushes all iocbs in the fcp ring and frees all the iocb
2384 * objects in txq and txcmplq. This function will not issue abort iocbs
2385 * for all the iocb commands in txcmplq, they will just be returned with
2386 * IOERR_SLI_DOWN. This function is invoked with EEH when device's PCI
2387 * slot has been permanently disabled.
2388 **/
2389void
2390lpfc_sli_flush_fcp_rings(struct lpfc_hba *phba)
2391{
2392 LIST_HEAD(txq);
2393 LIST_HEAD(txcmplq);
2394 struct lpfc_iocbq *iocb;
2395 IOCB_t *cmd = NULL;
2396 struct lpfc_sli *psli = &phba->sli;
2397 struct lpfc_sli_ring *pring;
2398
2399 /* Currently, only one fcp ring */
2400 pring = &psli->ring[psli->fcp_ring];
2401
2402 spin_lock_irq(&phba->hbalock);
2403 /* Retrieve everything on txq */
2404 list_splice_init(&pring->txq, &txq);
2405 pring->txq_cnt = 0;
2406
2407 /* Retrieve everything on the txcmplq */
2408 list_splice_init(&pring->txcmplq, &txcmplq);
2409 pring->txcmplq_cnt = 0;
2410 spin_unlock_irq(&phba->hbalock);
2411
2412 /* Flush the txq */
2413 while (!list_empty(&txq)) {
2414 iocb = list_get_first(&txq, struct lpfc_iocbq, list);
2415 cmd = &iocb->iocb;
2416 list_del_init(&iocb->list);
2417
2418 if (!iocb->iocb_cmpl)
2419 lpfc_sli_release_iocbq(phba, iocb);
2420 else {
2421 cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
2422 cmd->un.ulpWord[4] = IOERR_SLI_DOWN;
2423 (iocb->iocb_cmpl) (phba, iocb, iocb);
2424 }
2425 }
2426
2427 /* Flush the txcmpq */
2428 while (!list_empty(&txcmplq)) {
2429 iocb = list_get_first(&txcmplq, struct lpfc_iocbq, list);
2430 cmd = &iocb->iocb;
2431 list_del_init(&iocb->list);
2432
2433 if (!iocb->iocb_cmpl)
2434 lpfc_sli_release_iocbq(phba, iocb);
2435 else {
2436 cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
2437 cmd->un.ulpWord[4] = IOERR_SLI_DOWN;
2438 (iocb->iocb_cmpl) (phba, iocb, iocb);
2439 }
2440 }
2441}
2442
2443/**
2380 * lpfc_sli_brdready: Check for host status bits. 2444 * lpfc_sli_brdready: Check for host status bits.
2381 * @phba: Pointer to HBA context object. 2445 * @phba: Pointer to HBA context object.
2382 * @mask: Bit mask to be checked. 2446 * @mask: Bit mask to be checked.