diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-14 20:49:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-14 20:49:48 -0400 |
commit | abf04af74a9f27a65172a43b43ccabcbc2bbdc39 (patch) | |
tree | a9336a3797f8f6c445b1439278f558310ceae56a /drivers/scsi/lpfc | |
parent | 16d52ef7c026f925893a1c0fc46516349928f319 (diff) | |
parent | c7ee3bd4870ef1d96a1202f92ce858f849670a62 (diff) |
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull more SCSI updates from James Bottomley:
"This is just a couple of drivers (hpsa and lpfc) that got left out for
further testing in linux-next. We also have one fix to a prior
submission (qla2xxx sparse)"
* tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (36 commits)
qla2xxx: fix sparse warnings introduced by previous target mode t10-dif patch
lpfc: Update lpfc version to driver version 10.2.8001.0
lpfc: Fix ExpressLane priority setup
lpfc: mark old devices as obsolete
lpfc: Fix for initializing RRQ bitmap
lpfc: Fix for cleaning up stale ring flag and sp_queue_event entries
lpfc: Update lpfc version to driver version 10.2.8000.0
lpfc: Update Copyright on changed files from 8.3.45 patches
lpfc: Update Copyright on changed files
lpfc: Fixed locking for scsi task management commands
lpfc: Convert runtime references to old xlane cfg param to fof cfg param
lpfc: Fix FW dump using sysfs
lpfc: Fix SLI4 s abort loop to process all FCP rings and under ring_lock
lpfc: Fixed kernel panic in lpfc_abort_handler
lpfc: Fix locking for postbufq when freeing
lpfc: Fix locking for lpfc_hba_down_post
lpfc: Fix dynamic transitions of FirstBurst from on to off
hpsa: fix handling of hpsa_volume_offline return value
hpsa: return -ENOMEM not -1 on kzalloc failure in hpsa_get_device_id
hpsa: remove messages about volume status VPD inquiry page not supported
...
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc.h | 3 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 23 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_bsg.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_bsg.h | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_crtn.h | 6 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_debugfs.c | 4 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 5 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw.h | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw4.h | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 258 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_mem.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 60 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.h | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 297 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.h | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli4.h | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_version.h | 6 |
18 files changed, 490 insertions, 190 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 94a3cafe7197..434e9037908e 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
@@ -640,6 +640,7 @@ struct lpfc_hba { | |||
640 | #define HBA_DEVLOSS_TMO 0x2000 /* HBA in devloss timeout */ | 640 | #define HBA_DEVLOSS_TMO 0x2000 /* HBA in devloss timeout */ |
641 | #define HBA_RRQ_ACTIVE 0x4000 /* process the rrq active list */ | 641 | #define HBA_RRQ_ACTIVE 0x4000 /* process the rrq active list */ |
642 | #define HBA_FCP_IOQ_FLUSH 0x8000 /* FCP I/O queues being flushed */ | 642 | #define HBA_FCP_IOQ_FLUSH 0x8000 /* FCP I/O queues being flushed */ |
643 | #define HBA_FW_DUMP_OP 0x10000 /* Skips fn reset before FW dump */ | ||
643 | uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/ | 644 | uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/ |
644 | struct lpfc_dmabuf slim2p; | 645 | struct lpfc_dmabuf slim2p; |
645 | 646 | ||
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 8d5b6ceec9c9..1d7a5c34ee8c 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
@@ -919,10 +919,15 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode) | |||
919 | phba->cfg_sriov_nr_virtfn = 0; | 919 | phba->cfg_sriov_nr_virtfn = 0; |
920 | } | 920 | } |
921 | 921 | ||
922 | if (opcode == LPFC_FW_DUMP) | ||
923 | phba->hba_flag |= HBA_FW_DUMP_OP; | ||
924 | |||
922 | status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); | 925 | status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); |
923 | 926 | ||
924 | if (status != 0) | 927 | if (status != 0) { |
928 | phba->hba_flag &= ~HBA_FW_DUMP_OP; | ||
925 | return status; | 929 | return status; |
930 | } | ||
926 | 931 | ||
927 | /* wait for the device to be quiesced before firmware reset */ | 932 | /* wait for the device to be quiesced before firmware reset */ |
928 | msleep(100); | 933 | msleep(100); |
@@ -2364,7 +2369,7 @@ lpfc_oas_tgt_store(struct device *dev, struct device_attribute *attr, | |||
2364 | uint8_t wwpn[WWN_SZ]; | 2369 | uint8_t wwpn[WWN_SZ]; |
2365 | int rc; | 2370 | int rc; |
2366 | 2371 | ||
2367 | if (!phba->cfg_EnableXLane) | 2372 | if (!phba->cfg_fof) |
2368 | return -EPERM; | 2373 | return -EPERM; |
2369 | 2374 | ||
2370 | /* count may include a LF at end of string */ | 2375 | /* count may include a LF at end of string */ |
@@ -2432,7 +2437,7 @@ lpfc_oas_vpt_store(struct device *dev, struct device_attribute *attr, | |||
2432 | uint8_t wwpn[WWN_SZ]; | 2437 | uint8_t wwpn[WWN_SZ]; |
2433 | int rc; | 2438 | int rc; |
2434 | 2439 | ||
2435 | if (!phba->cfg_EnableXLane) | 2440 | if (!phba->cfg_fof) |
2436 | return -EPERM; | 2441 | return -EPERM; |
2437 | 2442 | ||
2438 | /* count may include a LF at end of string */ | 2443 | /* count may include a LF at end of string */ |
@@ -2499,7 +2504,7 @@ lpfc_oas_lun_state_store(struct device *dev, struct device_attribute *attr, | |||
2499 | struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; | 2504 | struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; |
2500 | int val = 0; | 2505 | int val = 0; |
2501 | 2506 | ||
2502 | if (!phba->cfg_EnableXLane) | 2507 | if (!phba->cfg_fof) |
2503 | return -EPERM; | 2508 | return -EPERM; |
2504 | 2509 | ||
2505 | if (!isdigit(buf[0])) | 2510 | if (!isdigit(buf[0])) |
@@ -2565,7 +2570,7 @@ lpfc_oas_lun_state_set(struct lpfc_hba *phba, uint8_t vpt_wwpn[], | |||
2565 | 2570 | ||
2566 | int rc = 0; | 2571 | int rc = 0; |
2567 | 2572 | ||
2568 | if (!phba->cfg_EnableXLane) | 2573 | if (!phba->cfg_fof) |
2569 | return -EPERM; | 2574 | return -EPERM; |
2570 | 2575 | ||
2571 | if (oas_state) { | 2576 | if (oas_state) { |
@@ -2670,7 +2675,7 @@ lpfc_oas_lun_show(struct device *dev, struct device_attribute *attr, | |||
2670 | uint64_t oas_lun; | 2675 | uint64_t oas_lun; |
2671 | int len = 0; | 2676 | int len = 0; |
2672 | 2677 | ||
2673 | if (!phba->cfg_EnableXLane) | 2678 | if (!phba->cfg_fof) |
2674 | return -EPERM; | 2679 | return -EPERM; |
2675 | 2680 | ||
2676 | if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0) | 2681 | if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0) |
@@ -2716,7 +2721,7 @@ lpfc_oas_lun_store(struct device *dev, struct device_attribute *attr, | |||
2716 | uint64_t scsi_lun; | 2721 | uint64_t scsi_lun; |
2717 | ssize_t rc; | 2722 | ssize_t rc; |
2718 | 2723 | ||
2719 | if (!phba->cfg_EnableXLane) | 2724 | if (!phba->cfg_fof) |
2720 | return -EPERM; | 2725 | return -EPERM; |
2721 | 2726 | ||
2722 | if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0) | 2727 | if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0) |
@@ -4655,7 +4660,7 @@ LPFC_ATTR_R(EnableXLane, 0, 0, 1, "Enable Express Lane Feature."); | |||
4655 | # 0x0 - 0x7f = CS_CTL field in FC header (high 7 bits) | 4660 | # 0x0 - 0x7f = CS_CTL field in FC header (high 7 bits) |
4656 | # Value range is [0x0,0x7f]. Default value is 0 | 4661 | # Value range is [0x0,0x7f]. Default value is 0 |
4657 | */ | 4662 | */ |
4658 | LPFC_ATTR_R(XLanePriority, 0, 0x0, 0x7f, "CS_CTL for Express Lane Feature."); | 4663 | LPFC_ATTR_RW(XLanePriority, 0, 0x0, 0x7f, "CS_CTL for Express Lane Feature."); |
4659 | 4664 | ||
4660 | /* | 4665 | /* |
4661 | # lpfc_enable_bg: Enable BlockGuard (Emulex's Implementation of T10-DIF) | 4666 | # lpfc_enable_bg: Enable BlockGuard (Emulex's Implementation of T10-DIF) |
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index ca2f4ea7cdef..5b5c825d9576 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2009-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2009-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * * | 7 | * * |
diff --git a/drivers/scsi/lpfc/lpfc_bsg.h b/drivers/scsi/lpfc/lpfc_bsg.h index a94d4c9dfaa5..928ef609f363 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.h +++ b/drivers/scsi/lpfc/lpfc_bsg.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2010-2012 Emulex. All rights reserved. * | 4 | * Copyright (C) 2010-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * * | 7 | * * |
diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index adda0bf7a244..db5604f01a1a 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * * | 7 | * * |
@@ -289,6 +289,7 @@ int lpfc_sli_issue_iocb(struct lpfc_hba *, uint32_t, | |||
289 | void lpfc_sli_pcimem_bcopy(void *, void *, uint32_t); | 289 | void lpfc_sli_pcimem_bcopy(void *, void *, uint32_t); |
290 | void lpfc_sli_bemem_bcopy(void *, void *, uint32_t); | 290 | void lpfc_sli_bemem_bcopy(void *, void *, uint32_t); |
291 | void lpfc_sli_abort_iocb_ring(struct lpfc_hba *, struct lpfc_sli_ring *); | 291 | void lpfc_sli_abort_iocb_ring(struct lpfc_hba *, struct lpfc_sli_ring *); |
292 | void lpfc_sli_abort_fcp_rings(struct lpfc_hba *phba); | ||
292 | void lpfc_sli_hba_iocb_abort(struct lpfc_hba *); | 293 | void lpfc_sli_hba_iocb_abort(struct lpfc_hba *); |
293 | void lpfc_sli_flush_fcp_rings(struct lpfc_hba *); | 294 | void lpfc_sli_flush_fcp_rings(struct lpfc_hba *); |
294 | int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct lpfc_sli_ring *, | 295 | int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct lpfc_sli_ring *, |
@@ -310,6 +311,9 @@ int lpfc_sli_issue_abort_iotag(struct lpfc_hba *, struct lpfc_sli_ring *, | |||
310 | int lpfc_sli_sum_iocb(struct lpfc_vport *, uint16_t, uint64_t, lpfc_ctx_cmd); | 311 | int lpfc_sli_sum_iocb(struct lpfc_vport *, uint16_t, uint64_t, lpfc_ctx_cmd); |
311 | int lpfc_sli_abort_iocb(struct lpfc_vport *, struct lpfc_sli_ring *, uint16_t, | 312 | int lpfc_sli_abort_iocb(struct lpfc_vport *, struct lpfc_sli_ring *, uint16_t, |
312 | uint64_t, lpfc_ctx_cmd); | 313 | uint64_t, lpfc_ctx_cmd); |
314 | int | ||
315 | lpfc_sli_abort_taskmgmt(struct lpfc_vport *, struct lpfc_sli_ring *, | ||
316 | uint16_t, uint64_t, lpfc_ctx_cmd); | ||
313 | 317 | ||
314 | void lpfc_mbox_timeout(unsigned long); | 318 | void lpfc_mbox_timeout(unsigned long); |
315 | void lpfc_mbox_timeout_handler(struct lpfc_hba *); | 319 | void lpfc_mbox_timeout_handler(struct lpfc_hba *); |
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index 828c08e9389e..b0aedce3f54b 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2007-2012 Emulex. All rights reserved. * | 4 | * Copyright (C) 2007-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * * | 7 | * * |
@@ -2314,7 +2314,7 @@ proc_cq: | |||
2314 | goto too_big; | 2314 | goto too_big; |
2315 | } | 2315 | } |
2316 | 2316 | ||
2317 | if (phba->cfg_EnableXLane) { | 2317 | if (phba->cfg_fof) { |
2318 | 2318 | ||
2319 | /* OAS CQ */ | 2319 | /* OAS CQ */ |
2320 | qp = phba->sli4_hba.oas_cq; | 2320 | qp = phba->sli4_hba.oas_cq; |
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 624fe0b3cc0b..7a5d81a65be8 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 294c072e9083..2a17e31265b8 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
@@ -5634,6 +5634,9 @@ lpfc_nlp_init(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
5634 | ndlp->active_rrqs_xri_bitmap = | 5634 | ndlp->active_rrqs_xri_bitmap = |
5635 | mempool_alloc(vport->phba->active_rrq_pool, | 5635 | mempool_alloc(vport->phba->active_rrq_pool, |
5636 | GFP_KERNEL); | 5636 | GFP_KERNEL); |
5637 | if (ndlp->active_rrqs_xri_bitmap) | ||
5638 | memset(ndlp->active_rrqs_xri_bitmap, 0, | ||
5639 | ndlp->phba->cfg_rrq_xri_bitmap_sz); | ||
5637 | } | 5640 | } |
5638 | 5641 | ||
5639 | 5642 | ||
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index 3d9438ce59ab..236259252379 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * * | 7 | * * |
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index fd79f7de7666..f432ec180cf8 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2009-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2009-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * * | 7 | * * |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 635eeb3d6987..06f9a5b79e66 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
@@ -820,57 +820,153 @@ lpfc_hba_down_prep(struct lpfc_hba *phba) | |||
820 | } | 820 | } |
821 | 821 | ||
822 | /** | 822 | /** |
823 | * lpfc_hba_down_post_s3 - Perform lpfc uninitialization after HBA reset | 823 | * lpfc_sli4_free_sp_events - Cleanup sp_queue_events to free |
824 | * rspiocb which got deferred | ||
825 | * | ||
824 | * @phba: pointer to lpfc HBA data structure. | 826 | * @phba: pointer to lpfc HBA data structure. |
825 | * | 827 | * |
826 | * This routine will do uninitialization after the HBA is reset when bring | 828 | * This routine will cleanup completed slow path events after HBA is reset |
827 | * down the SLI Layer. | 829 | * when bringing down the SLI Layer. |
830 | * | ||
828 | * | 831 | * |
829 | * Return codes | 832 | * Return codes |
830 | * 0 - success. | 833 | * void. |
831 | * Any other value - error. | ||
832 | **/ | 834 | **/ |
833 | static int | 835 | static void |
834 | lpfc_hba_down_post_s3(struct lpfc_hba *phba) | 836 | lpfc_sli4_free_sp_events(struct lpfc_hba *phba) |
837 | { | ||
838 | struct lpfc_iocbq *rspiocbq; | ||
839 | struct hbq_dmabuf *dmabuf; | ||
840 | struct lpfc_cq_event *cq_event; | ||
841 | |||
842 | spin_lock_irq(&phba->hbalock); | ||
843 | phba->hba_flag &= ~HBA_SP_QUEUE_EVT; | ||
844 | spin_unlock_irq(&phba->hbalock); | ||
845 | |||
846 | while (!list_empty(&phba->sli4_hba.sp_queue_event)) { | ||
847 | /* Get the response iocb from the head of work queue */ | ||
848 | spin_lock_irq(&phba->hbalock); | ||
849 | list_remove_head(&phba->sli4_hba.sp_queue_event, | ||
850 | cq_event, struct lpfc_cq_event, list); | ||
851 | spin_unlock_irq(&phba->hbalock); | ||
852 | |||
853 | switch (bf_get(lpfc_wcqe_c_code, &cq_event->cqe.wcqe_cmpl)) { | ||
854 | case CQE_CODE_COMPL_WQE: | ||
855 | rspiocbq = container_of(cq_event, struct lpfc_iocbq, | ||
856 | cq_event); | ||
857 | lpfc_sli_release_iocbq(phba, rspiocbq); | ||
858 | break; | ||
859 | case CQE_CODE_RECEIVE: | ||
860 | case CQE_CODE_RECEIVE_V1: | ||
861 | dmabuf = container_of(cq_event, struct hbq_dmabuf, | ||
862 | cq_event); | ||
863 | lpfc_in_buf_free(phba, &dmabuf->dbuf); | ||
864 | } | ||
865 | } | ||
866 | } | ||
867 | |||
868 | /** | ||
869 | * lpfc_hba_free_post_buf - Perform lpfc uninitialization after HBA reset | ||
870 | * @phba: pointer to lpfc HBA data structure. | ||
871 | * | ||
872 | * This routine will cleanup posted ELS buffers after the HBA is reset | ||
873 | * when bringing down the SLI Layer. | ||
874 | * | ||
875 | * | ||
876 | * Return codes | ||
877 | * void. | ||
878 | **/ | ||
879 | static void | ||
880 | lpfc_hba_free_post_buf(struct lpfc_hba *phba) | ||
835 | { | 881 | { |
836 | struct lpfc_sli *psli = &phba->sli; | 882 | struct lpfc_sli *psli = &phba->sli; |
837 | struct lpfc_sli_ring *pring; | 883 | struct lpfc_sli_ring *pring; |
838 | struct lpfc_dmabuf *mp, *next_mp; | 884 | struct lpfc_dmabuf *mp, *next_mp; |
839 | LIST_HEAD(completions); | 885 | LIST_HEAD(buflist); |
840 | int i; | 886 | int count; |
841 | 887 | ||
842 | if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) | 888 | if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) |
843 | lpfc_sli_hbqbuf_free_all(phba); | 889 | lpfc_sli_hbqbuf_free_all(phba); |
844 | else { | 890 | else { |
845 | /* Cleanup preposted buffers on the ELS ring */ | 891 | /* Cleanup preposted buffers on the ELS ring */ |
846 | pring = &psli->ring[LPFC_ELS_RING]; | 892 | pring = &psli->ring[LPFC_ELS_RING]; |
847 | list_for_each_entry_safe(mp, next_mp, &pring->postbufq, list) { | 893 | spin_lock_irq(&phba->hbalock); |
894 | list_splice_init(&pring->postbufq, &buflist); | ||
895 | spin_unlock_irq(&phba->hbalock); | ||
896 | |||
897 | count = 0; | ||
898 | list_for_each_entry_safe(mp, next_mp, &buflist, list) { | ||
848 | list_del(&mp->list); | 899 | list_del(&mp->list); |
849 | pring->postbufq_cnt--; | 900 | count++; |
850 | lpfc_mbuf_free(phba, mp->virt, mp->phys); | 901 | lpfc_mbuf_free(phba, mp->virt, mp->phys); |
851 | kfree(mp); | 902 | kfree(mp); |
852 | } | 903 | } |
904 | |||
905 | spin_lock_irq(&phba->hbalock); | ||
906 | pring->postbufq_cnt -= count; | ||
907 | spin_unlock_irq(&phba->hbalock); | ||
853 | } | 908 | } |
909 | } | ||
910 | |||
911 | /** | ||
912 | * lpfc_hba_clean_txcmplq - Perform lpfc uninitialization after HBA reset | ||
913 | * @phba: pointer to lpfc HBA data structure. | ||
914 | * | ||
915 | * This routine will cleanup the txcmplq after the HBA is reset when bringing | ||
916 | * down the SLI Layer. | ||
917 | * | ||
918 | * Return codes | ||
919 | * void | ||
920 | **/ | ||
921 | static void | ||
922 | lpfc_hba_clean_txcmplq(struct lpfc_hba *phba) | ||
923 | { | ||
924 | struct lpfc_sli *psli = &phba->sli; | ||
925 | struct lpfc_sli_ring *pring; | ||
926 | LIST_HEAD(completions); | ||
927 | int i; | ||
854 | 928 | ||
855 | spin_lock_irq(&phba->hbalock); | ||
856 | for (i = 0; i < psli->num_rings; i++) { | 929 | for (i = 0; i < psli->num_rings; i++) { |
857 | pring = &psli->ring[i]; | 930 | pring = &psli->ring[i]; |
858 | 931 | if (phba->sli_rev >= LPFC_SLI_REV4) | |
932 | spin_lock_irq(&pring->ring_lock); | ||
933 | else | ||
934 | spin_lock_irq(&phba->hbalock); | ||
859 | /* At this point in time the HBA is either reset or DOA. Either | 935 | /* At this point in time the HBA is either reset or DOA. Either |
860 | * way, nothing should be on txcmplq as it will NEVER complete. | 936 | * way, nothing should be on txcmplq as it will NEVER complete. |
861 | */ | 937 | */ |
862 | list_splice_init(&pring->txcmplq, &completions); | 938 | list_splice_init(&pring->txcmplq, &completions); |
863 | spin_unlock_irq(&phba->hbalock); | 939 | pring->txcmplq_cnt = 0; |
940 | |||
941 | if (phba->sli_rev >= LPFC_SLI_REV4) | ||
942 | spin_unlock_irq(&pring->ring_lock); | ||
943 | else | ||
944 | spin_unlock_irq(&phba->hbalock); | ||
864 | 945 | ||
865 | /* Cancel all the IOCBs from the completions list */ | 946 | /* Cancel all the IOCBs from the completions list */ |
866 | lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT, | 947 | lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT, |
867 | IOERR_SLI_ABORTED); | 948 | IOERR_SLI_ABORTED); |
868 | |||
869 | lpfc_sli_abort_iocb_ring(phba, pring); | 949 | lpfc_sli_abort_iocb_ring(phba, pring); |
870 | spin_lock_irq(&phba->hbalock); | ||
871 | } | 950 | } |
872 | spin_unlock_irq(&phba->hbalock); | 951 | } |
873 | 952 | ||
953 | /** | ||
954 | * lpfc_hba_down_post_s3 - Perform lpfc uninitialization after HBA reset | ||
955 | int i; | ||
956 | * @phba: pointer to lpfc HBA data structure. | ||
957 | * | ||
958 | * This routine will do uninitialization after the HBA is reset when bring | ||
959 | * down the SLI Layer. | ||
960 | * | ||
961 | * Return codes | ||
962 | * 0 - success. | ||
963 | * Any other value - error. | ||
964 | **/ | ||
965 | static int | ||
966 | lpfc_hba_down_post_s3(struct lpfc_hba *phba) | ||
967 | { | ||
968 | lpfc_hba_free_post_buf(phba); | ||
969 | lpfc_hba_clean_txcmplq(phba); | ||
874 | return 0; | 970 | return 0; |
875 | } | 971 | } |
876 | 972 | ||
@@ -890,13 +986,12 @@ lpfc_hba_down_post_s4(struct lpfc_hba *phba) | |||
890 | { | 986 | { |
891 | struct lpfc_scsi_buf *psb, *psb_next; | 987 | struct lpfc_scsi_buf *psb, *psb_next; |
892 | LIST_HEAD(aborts); | 988 | LIST_HEAD(aborts); |
893 | int ret; | ||
894 | unsigned long iflag = 0; | 989 | unsigned long iflag = 0; |
895 | struct lpfc_sglq *sglq_entry = NULL; | 990 | struct lpfc_sglq *sglq_entry = NULL; |
896 | 991 | ||
897 | ret = lpfc_hba_down_post_s3(phba); | 992 | lpfc_hba_free_post_buf(phba); |
898 | if (ret) | 993 | lpfc_hba_clean_txcmplq(phba); |
899 | return ret; | 994 | |
900 | /* At this point in time the HBA is either reset or DOA. Either | 995 | /* At this point in time the HBA is either reset or DOA. Either |
901 | * way, nothing should be on lpfc_abts_els_sgl_list, it needs to be | 996 | * way, nothing should be on lpfc_abts_els_sgl_list, it needs to be |
902 | * on the lpfc_sgl_list so that it can either be freed if the | 997 | * on the lpfc_sgl_list so that it can either be freed if the |
@@ -932,6 +1027,8 @@ lpfc_hba_down_post_s4(struct lpfc_hba *phba) | |||
932 | spin_lock_irqsave(&phba->scsi_buf_list_put_lock, iflag); | 1027 | spin_lock_irqsave(&phba->scsi_buf_list_put_lock, iflag); |
933 | list_splice(&aborts, &phba->lpfc_scsi_buf_list_put); | 1028 | list_splice(&aborts, &phba->lpfc_scsi_buf_list_put); |
934 | spin_unlock_irqrestore(&phba->scsi_buf_list_put_lock, iflag); | 1029 | spin_unlock_irqrestore(&phba->scsi_buf_list_put_lock, iflag); |
1030 | |||
1031 | lpfc_sli4_free_sp_events(phba); | ||
935 | return 0; | 1032 | return 0; |
936 | } | 1033 | } |
937 | 1034 | ||
@@ -1250,7 +1347,6 @@ static void | |||
1250 | lpfc_handle_deferred_eratt(struct lpfc_hba *phba) | 1347 | lpfc_handle_deferred_eratt(struct lpfc_hba *phba) |
1251 | { | 1348 | { |
1252 | uint32_t old_host_status = phba->work_hs; | 1349 | uint32_t old_host_status = phba->work_hs; |
1253 | struct lpfc_sli_ring *pring; | ||
1254 | struct lpfc_sli *psli = &phba->sli; | 1350 | struct lpfc_sli *psli = &phba->sli; |
1255 | 1351 | ||
1256 | /* If the pci channel is offline, ignore possible errors, | 1352 | /* If the pci channel is offline, ignore possible errors, |
@@ -1279,8 +1375,7 @@ lpfc_handle_deferred_eratt(struct lpfc_hba *phba) | |||
1279 | * dropped by the firmware. Error iocb (I/O) on txcmplq and let the | 1375 | * dropped by the firmware. Error iocb (I/O) on txcmplq and let the |
1280 | * SCSI layer retry it after re-establishing link. | 1376 | * SCSI layer retry it after re-establishing link. |
1281 | */ | 1377 | */ |
1282 | pring = &psli->ring[psli->fcp_ring]; | 1378 | lpfc_sli_abort_fcp_rings(phba); |
1283 | lpfc_sli_abort_iocb_ring(phba, pring); | ||
1284 | 1379 | ||
1285 | /* | 1380 | /* |
1286 | * There was a firmware error. Take the hba offline and then | 1381 | * There was a firmware error. Take the hba offline and then |
@@ -1348,7 +1443,6 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba) | |||
1348 | { | 1443 | { |
1349 | struct lpfc_vport *vport = phba->pport; | 1444 | struct lpfc_vport *vport = phba->pport; |
1350 | struct lpfc_sli *psli = &phba->sli; | 1445 | struct lpfc_sli *psli = &phba->sli; |
1351 | struct lpfc_sli_ring *pring; | ||
1352 | uint32_t event_data; | 1446 | uint32_t event_data; |
1353 | unsigned long temperature; | 1447 | unsigned long temperature; |
1354 | struct temp_event temp_event_data; | 1448 | struct temp_event temp_event_data; |
@@ -1400,8 +1494,7 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba) | |||
1400 | * Error iocb (I/O) on txcmplq and let the SCSI layer | 1494 | * Error iocb (I/O) on txcmplq and let the SCSI layer |
1401 | * retry it after re-establishing link. | 1495 | * retry it after re-establishing link. |
1402 | */ | 1496 | */ |
1403 | pring = &psli->ring[psli->fcp_ring]; | 1497 | lpfc_sli_abort_fcp_rings(phba); |
1404 | lpfc_sli_abort_iocb_ring(phba, pring); | ||
1405 | 1498 | ||
1406 | /* | 1499 | /* |
1407 | * There was a firmware error. Take the hba offline and then | 1500 | * There was a firmware error. Take the hba offline and then |
@@ -1940,78 +2033,81 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) | |||
1940 | 2033 | ||
1941 | switch (dev_id) { | 2034 | switch (dev_id) { |
1942 | case PCI_DEVICE_ID_FIREFLY: | 2035 | case PCI_DEVICE_ID_FIREFLY: |
1943 | m = (typeof(m)){"LP6000", "PCI", "Fibre Channel Adapter"}; | 2036 | m = (typeof(m)){"LP6000", "PCI", |
2037 | "Obsolete, Unsupported Fibre Channel Adapter"}; | ||
1944 | break; | 2038 | break; |
1945 | case PCI_DEVICE_ID_SUPERFLY: | 2039 | case PCI_DEVICE_ID_SUPERFLY: |
1946 | if (vp->rev.biuRev >= 1 && vp->rev.biuRev <= 3) | 2040 | if (vp->rev.biuRev >= 1 && vp->rev.biuRev <= 3) |
1947 | m = (typeof(m)){"LP7000", "PCI", | 2041 | m = (typeof(m)){"LP7000", "PCI", ""}; |
1948 | "Fibre Channel Adapter"}; | ||
1949 | else | 2042 | else |
1950 | m = (typeof(m)){"LP7000E", "PCI", | 2043 | m = (typeof(m)){"LP7000E", "PCI", ""}; |
1951 | "Fibre Channel Adapter"}; | 2044 | m.function = "Obsolete, Unsupported Fibre Channel Adapter"; |
1952 | break; | 2045 | break; |
1953 | case PCI_DEVICE_ID_DRAGONFLY: | 2046 | case PCI_DEVICE_ID_DRAGONFLY: |
1954 | m = (typeof(m)){"LP8000", "PCI", | 2047 | m = (typeof(m)){"LP8000", "PCI", |
1955 | "Fibre Channel Adapter"}; | 2048 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
1956 | break; | 2049 | break; |
1957 | case PCI_DEVICE_ID_CENTAUR: | 2050 | case PCI_DEVICE_ID_CENTAUR: |
1958 | if (FC_JEDEC_ID(vp->rev.biuRev) == CENTAUR_2G_JEDEC_ID) | 2051 | if (FC_JEDEC_ID(vp->rev.biuRev) == CENTAUR_2G_JEDEC_ID) |
1959 | m = (typeof(m)){"LP9002", "PCI", | 2052 | m = (typeof(m)){"LP9002", "PCI", ""}; |
1960 | "Fibre Channel Adapter"}; | ||
1961 | else | 2053 | else |
1962 | m = (typeof(m)){"LP9000", "PCI", | 2054 | m = (typeof(m)){"LP9000", "PCI", ""}; |
1963 | "Fibre Channel Adapter"}; | 2055 | m.function = "Obsolete, Unsupported Fibre Channel Adapter"; |
1964 | break; | 2056 | break; |
1965 | case PCI_DEVICE_ID_RFLY: | 2057 | case PCI_DEVICE_ID_RFLY: |
1966 | m = (typeof(m)){"LP952", "PCI", | 2058 | m = (typeof(m)){"LP952", "PCI", |
1967 | "Fibre Channel Adapter"}; | 2059 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
1968 | break; | 2060 | break; |
1969 | case PCI_DEVICE_ID_PEGASUS: | 2061 | case PCI_DEVICE_ID_PEGASUS: |
1970 | m = (typeof(m)){"LP9802", "PCI-X", | 2062 | m = (typeof(m)){"LP9802", "PCI-X", |
1971 | "Fibre Channel Adapter"}; | 2063 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
1972 | break; | 2064 | break; |
1973 | case PCI_DEVICE_ID_THOR: | 2065 | case PCI_DEVICE_ID_THOR: |
1974 | m = (typeof(m)){"LP10000", "PCI-X", | 2066 | m = (typeof(m)){"LP10000", "PCI-X", |
1975 | "Fibre Channel Adapter"}; | 2067 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
1976 | break; | 2068 | break; |
1977 | case PCI_DEVICE_ID_VIPER: | 2069 | case PCI_DEVICE_ID_VIPER: |
1978 | m = (typeof(m)){"LPX1000", "PCI-X", | 2070 | m = (typeof(m)){"LPX1000", "PCI-X", |
1979 | "Fibre Channel Adapter"}; | 2071 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
1980 | break; | 2072 | break; |
1981 | case PCI_DEVICE_ID_PFLY: | 2073 | case PCI_DEVICE_ID_PFLY: |
1982 | m = (typeof(m)){"LP982", "PCI-X", | 2074 | m = (typeof(m)){"LP982", "PCI-X", |
1983 | "Fibre Channel Adapter"}; | 2075 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
1984 | break; | 2076 | break; |
1985 | case PCI_DEVICE_ID_TFLY: | 2077 | case PCI_DEVICE_ID_TFLY: |
1986 | m = (typeof(m)){"LP1050", "PCI-X", | 2078 | m = (typeof(m)){"LP1050", "PCI-X", |
1987 | "Fibre Channel Adapter"}; | 2079 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
1988 | break; | 2080 | break; |
1989 | case PCI_DEVICE_ID_HELIOS: | 2081 | case PCI_DEVICE_ID_HELIOS: |
1990 | m = (typeof(m)){"LP11000", "PCI-X2", | 2082 | m = (typeof(m)){"LP11000", "PCI-X2", |
1991 | "Fibre Channel Adapter"}; | 2083 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
1992 | break; | 2084 | break; |
1993 | case PCI_DEVICE_ID_HELIOS_SCSP: | 2085 | case PCI_DEVICE_ID_HELIOS_SCSP: |
1994 | m = (typeof(m)){"LP11000-SP", "PCI-X2", | 2086 | m = (typeof(m)){"LP11000-SP", "PCI-X2", |
1995 | "Fibre Channel Adapter"}; | 2087 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
1996 | break; | 2088 | break; |
1997 | case PCI_DEVICE_ID_HELIOS_DCSP: | 2089 | case PCI_DEVICE_ID_HELIOS_DCSP: |
1998 | m = (typeof(m)){"LP11002-SP", "PCI-X2", | 2090 | m = (typeof(m)){"LP11002-SP", "PCI-X2", |
1999 | "Fibre Channel Adapter"}; | 2091 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
2000 | break; | 2092 | break; |
2001 | case PCI_DEVICE_ID_NEPTUNE: | 2093 | case PCI_DEVICE_ID_NEPTUNE: |
2002 | m = (typeof(m)){"LPe1000", "PCIe", "Fibre Channel Adapter"}; | 2094 | m = (typeof(m)){"LPe1000", "PCIe", |
2095 | "Obsolete, Unsupported Fibre Channel Adapter"}; | ||
2003 | break; | 2096 | break; |
2004 | case PCI_DEVICE_ID_NEPTUNE_SCSP: | 2097 | case PCI_DEVICE_ID_NEPTUNE_SCSP: |
2005 | m = (typeof(m)){"LPe1000-SP", "PCIe", "Fibre Channel Adapter"}; | 2098 | m = (typeof(m)){"LPe1000-SP", "PCIe", |
2099 | "Obsolete, Unsupported Fibre Channel Adapter"}; | ||
2006 | break; | 2100 | break; |
2007 | case PCI_DEVICE_ID_NEPTUNE_DCSP: | 2101 | case PCI_DEVICE_ID_NEPTUNE_DCSP: |
2008 | m = (typeof(m)){"LPe1002-SP", "PCIe", "Fibre Channel Adapter"}; | 2102 | m = (typeof(m)){"LPe1002-SP", "PCIe", |
2103 | "Obsolete, Unsupported Fibre Channel Adapter"}; | ||
2009 | break; | 2104 | break; |
2010 | case PCI_DEVICE_ID_BMID: | 2105 | case PCI_DEVICE_ID_BMID: |
2011 | m = (typeof(m)){"LP1150", "PCI-X2", "Fibre Channel Adapter"}; | 2106 | m = (typeof(m)){"LP1150", "PCI-X2", "Fibre Channel Adapter"}; |
2012 | break; | 2107 | break; |
2013 | case PCI_DEVICE_ID_BSMB: | 2108 | case PCI_DEVICE_ID_BSMB: |
2014 | m = (typeof(m)){"LP111", "PCI-X2", "Fibre Channel Adapter"}; | 2109 | m = (typeof(m)){"LP111", "PCI-X2", |
2110 | "Obsolete, Unsupported Fibre Channel Adapter"}; | ||
2015 | break; | 2111 | break; |
2016 | case PCI_DEVICE_ID_ZEPHYR: | 2112 | case PCI_DEVICE_ID_ZEPHYR: |
2017 | m = (typeof(m)){"LPe11000", "PCIe", "Fibre Channel Adapter"}; | 2113 | m = (typeof(m)){"LPe11000", "PCIe", "Fibre Channel Adapter"}; |
@@ -2030,16 +2126,20 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) | |||
2030 | m = (typeof(m)){"LPe111", "PCIe", "Fibre Channel Adapter"}; | 2126 | m = (typeof(m)){"LPe111", "PCIe", "Fibre Channel Adapter"}; |
2031 | break; | 2127 | break; |
2032 | case PCI_DEVICE_ID_LP101: | 2128 | case PCI_DEVICE_ID_LP101: |
2033 | m = (typeof(m)){"LP101", "PCI-X", "Fibre Channel Adapter"}; | 2129 | m = (typeof(m)){"LP101", "PCI-X", |
2130 | "Obsolete, Unsupported Fibre Channel Adapter"}; | ||
2034 | break; | 2131 | break; |
2035 | case PCI_DEVICE_ID_LP10000S: | 2132 | case PCI_DEVICE_ID_LP10000S: |
2036 | m = (typeof(m)){"LP10000-S", "PCI", "Fibre Channel Adapter"}; | 2133 | m = (typeof(m)){"LP10000-S", "PCI", |
2134 | "Obsolete, Unsupported Fibre Channel Adapter"}; | ||
2037 | break; | 2135 | break; |
2038 | case PCI_DEVICE_ID_LP11000S: | 2136 | case PCI_DEVICE_ID_LP11000S: |
2039 | m = (typeof(m)){"LP11000-S", "PCI-X2", "Fibre Channel Adapter"}; | 2137 | m = (typeof(m)){"LP11000-S", "PCI-X2", |
2138 | "Obsolete, Unsupported Fibre Channel Adapter"}; | ||
2040 | break; | 2139 | break; |
2041 | case PCI_DEVICE_ID_LPE11000S: | 2140 | case PCI_DEVICE_ID_LPE11000S: |
2042 | m = (typeof(m)){"LPe11000-S", "PCIe", "Fibre Channel Adapter"}; | 2141 | m = (typeof(m)){"LPe11000-S", "PCIe", |
2142 | "Obsolete, Unsupported Fibre Channel Adapter"}; | ||
2043 | break; | 2143 | break; |
2044 | case PCI_DEVICE_ID_SAT: | 2144 | case PCI_DEVICE_ID_SAT: |
2045 | m = (typeof(m)){"LPe12000", "PCIe", "Fibre Channel Adapter"}; | 2145 | m = (typeof(m)){"LPe12000", "PCIe", "Fibre Channel Adapter"}; |
@@ -2060,20 +2160,21 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) | |||
2060 | m = (typeof(m)){"LPe12000-S", "PCIe", "Fibre Channel Adapter"}; | 2160 | m = (typeof(m)){"LPe12000-S", "PCIe", "Fibre Channel Adapter"}; |
2061 | break; | 2161 | break; |
2062 | case PCI_DEVICE_ID_HORNET: | 2162 | case PCI_DEVICE_ID_HORNET: |
2063 | m = (typeof(m)){"LP21000", "PCIe", "FCoE Adapter"}; | 2163 | m = (typeof(m)){"LP21000", "PCIe", |
2164 | "Obsolete, Unsupported FCoE Adapter"}; | ||
2064 | GE = 1; | 2165 | GE = 1; |
2065 | break; | 2166 | break; |
2066 | case PCI_DEVICE_ID_PROTEUS_VF: | 2167 | case PCI_DEVICE_ID_PROTEUS_VF: |
2067 | m = (typeof(m)){"LPev12000", "PCIe IOV", | 2168 | m = (typeof(m)){"LPev12000", "PCIe IOV", |
2068 | "Fibre Channel Adapter"}; | 2169 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
2069 | break; | 2170 | break; |
2070 | case PCI_DEVICE_ID_PROTEUS_PF: | 2171 | case PCI_DEVICE_ID_PROTEUS_PF: |
2071 | m = (typeof(m)){"LPev12000", "PCIe IOV", | 2172 | m = (typeof(m)){"LPev12000", "PCIe IOV", |
2072 | "Fibre Channel Adapter"}; | 2173 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
2073 | break; | 2174 | break; |
2074 | case PCI_DEVICE_ID_PROTEUS_S: | 2175 | case PCI_DEVICE_ID_PROTEUS_S: |
2075 | m = (typeof(m)){"LPemv12002-S", "PCIe IOV", | 2176 | m = (typeof(m)){"LPemv12002-S", "PCIe IOV", |
2076 | "Fibre Channel Adapter"}; | 2177 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
2077 | break; | 2178 | break; |
2078 | case PCI_DEVICE_ID_TIGERSHARK: | 2179 | case PCI_DEVICE_ID_TIGERSHARK: |
2079 | oneConnect = 1; | 2180 | oneConnect = 1; |
@@ -2089,17 +2190,24 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) | |||
2089 | break; | 2190 | break; |
2090 | case PCI_DEVICE_ID_BALIUS: | 2191 | case PCI_DEVICE_ID_BALIUS: |
2091 | m = (typeof(m)){"LPVe12002", "PCIe Shared I/O", | 2192 | m = (typeof(m)){"LPVe12002", "PCIe Shared I/O", |
2092 | "Fibre Channel Adapter"}; | 2193 | "Obsolete, Unsupported Fibre Channel Adapter"}; |
2093 | break; | 2194 | break; |
2094 | case PCI_DEVICE_ID_LANCER_FC: | 2195 | case PCI_DEVICE_ID_LANCER_FC: |
2095 | case PCI_DEVICE_ID_LANCER_FC_VF: | ||
2096 | m = (typeof(m)){"LPe16000", "PCIe", "Fibre Channel Adapter"}; | 2196 | m = (typeof(m)){"LPe16000", "PCIe", "Fibre Channel Adapter"}; |
2097 | break; | 2197 | break; |
2198 | case PCI_DEVICE_ID_LANCER_FC_VF: | ||
2199 | m = (typeof(m)){"LPe16000", "PCIe", | ||
2200 | "Obsolete, Unsupported Fibre Channel Adapter"}; | ||
2201 | break; | ||
2098 | case PCI_DEVICE_ID_LANCER_FCOE: | 2202 | case PCI_DEVICE_ID_LANCER_FCOE: |
2099 | case PCI_DEVICE_ID_LANCER_FCOE_VF: | ||
2100 | oneConnect = 1; | 2203 | oneConnect = 1; |
2101 | m = (typeof(m)){"OCe15100", "PCIe", "FCoE"}; | 2204 | m = (typeof(m)){"OCe15100", "PCIe", "FCoE"}; |
2102 | break; | 2205 | break; |
2206 | case PCI_DEVICE_ID_LANCER_FCOE_VF: | ||
2207 | oneConnect = 1; | ||
2208 | m = (typeof(m)){"OCe15100", "PCIe", | ||
2209 | "Obsolete, Unsupported FCoE"}; | ||
2210 | break; | ||
2103 | case PCI_DEVICE_ID_SKYHAWK: | 2211 | case PCI_DEVICE_ID_SKYHAWK: |
2104 | case PCI_DEVICE_ID_SKYHAWK_VF: | 2212 | case PCI_DEVICE_ID_SKYHAWK_VF: |
2105 | oneConnect = 1; | 2213 | oneConnect = 1; |
@@ -4614,7 +4722,10 @@ lpfc_reset_hba(struct lpfc_hba *phba) | |||
4614 | phba->link_state = LPFC_HBA_ERROR; | 4722 | phba->link_state = LPFC_HBA_ERROR; |
4615 | return; | 4723 | return; |
4616 | } | 4724 | } |
4617 | lpfc_offline_prep(phba, LPFC_MBX_WAIT); | 4725 | if (phba->sli.sli_flag & LPFC_SLI_ACTIVE) |
4726 | lpfc_offline_prep(phba, LPFC_MBX_WAIT); | ||
4727 | else | ||
4728 | lpfc_offline_prep(phba, LPFC_MBX_NO_WAIT); | ||
4618 | lpfc_offline(phba); | 4729 | lpfc_offline(phba); |
4619 | lpfc_sli_brdrestart(phba); | 4730 | lpfc_sli_brdrestart(phba); |
4620 | lpfc_online(phba); | 4731 | lpfc_online(phba); |
@@ -9663,9 +9774,6 @@ lpfc_pci_resume_one_s3(struct pci_dev *pdev) | |||
9663 | static void | 9774 | static void |
9664 | lpfc_sli_prep_dev_for_recover(struct lpfc_hba *phba) | 9775 | lpfc_sli_prep_dev_for_recover(struct lpfc_hba *phba) |
9665 | { | 9776 | { |
9666 | struct lpfc_sli *psli = &phba->sli; | ||
9667 | struct lpfc_sli_ring *pring; | ||
9668 | |||
9669 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, | 9777 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
9670 | "2723 PCI channel I/O abort preparing for recovery\n"); | 9778 | "2723 PCI channel I/O abort preparing for recovery\n"); |
9671 | 9779 | ||
@@ -9673,8 +9781,7 @@ lpfc_sli_prep_dev_for_recover(struct lpfc_hba *phba) | |||
9673 | * There may be errored I/Os through HBA, abort all I/Os on txcmplq | 9781 | * There may be errored I/Os through HBA, abort all I/Os on txcmplq |
9674 | * and let the SCSI mid-layer to retry them to recover. | 9782 | * and let the SCSI mid-layer to retry them to recover. |
9675 | */ | 9783 | */ |
9676 | pring = &psli->ring[psli->fcp_ring]; | 9784 | lpfc_sli_abort_fcp_rings(phba); |
9677 | lpfc_sli_abort_iocb_ring(phba, pring); | ||
9678 | } | 9785 | } |
9679 | 9786 | ||
9680 | /** | 9787 | /** |
@@ -10417,17 +10524,13 @@ lpfc_pci_resume_one_s4(struct pci_dev *pdev) | |||
10417 | static void | 10524 | static void |
10418 | lpfc_sli4_prep_dev_for_recover(struct lpfc_hba *phba) | 10525 | lpfc_sli4_prep_dev_for_recover(struct lpfc_hba *phba) |
10419 | { | 10526 | { |
10420 | struct lpfc_sli *psli = &phba->sli; | ||
10421 | struct lpfc_sli_ring *pring; | ||
10422 | |||
10423 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, | 10527 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
10424 | "2828 PCI channel I/O abort preparing for recovery\n"); | 10528 | "2828 PCI channel I/O abort preparing for recovery\n"); |
10425 | /* | 10529 | /* |
10426 | * There may be errored I/Os through HBA, abort all I/Os on txcmplq | 10530 | * There may be errored I/Os through HBA, abort all I/Os on txcmplq |
10427 | * and let the SCSI mid-layer to retry them to recover. | 10531 | * and let the SCSI mid-layer to retry them to recover. |
10428 | */ | 10532 | */ |
10429 | pring = &psli->ring[psli->fcp_ring]; | 10533 | lpfc_sli_abort_fcp_rings(phba); |
10430 | lpfc_sli_abort_iocb_ring(phba, pring); | ||
10431 | } | 10534 | } |
10432 | 10535 | ||
10433 | /** | 10536 | /** |
@@ -10898,7 +11001,7 @@ lpfc_sli4_oas_verify(struct lpfc_hba *phba) | |||
10898 | if (phba->sli4_hba.pc_sli4_params.oas_supported) { | 11001 | if (phba->sli4_hba.pc_sli4_params.oas_supported) { |
10899 | phba->cfg_fof = 1; | 11002 | phba->cfg_fof = 1; |
10900 | } else { | 11003 | } else { |
10901 | phba->cfg_EnableXLane = 0; | 11004 | phba->cfg_fof = 0; |
10902 | if (phba->device_data_mem_pool) | 11005 | if (phba->device_data_mem_pool) |
10903 | mempool_destroy(phba->device_data_mem_pool); | 11006 | mempool_destroy(phba->device_data_mem_pool); |
10904 | phba->device_data_mem_pool = NULL; | 11007 | phba->device_data_mem_pool = NULL; |
@@ -10928,7 +11031,7 @@ lpfc_fof_queue_setup(struct lpfc_hba *phba) | |||
10928 | if (rc) | 11031 | if (rc) |
10929 | return -ENOMEM; | 11032 | return -ENOMEM; |
10930 | 11033 | ||
10931 | if (phba->cfg_EnableXLane) { | 11034 | if (phba->cfg_fof) { |
10932 | 11035 | ||
10933 | rc = lpfc_cq_create(phba, phba->sli4_hba.oas_cq, | 11036 | rc = lpfc_cq_create(phba, phba->sli4_hba.oas_cq, |
10934 | phba->sli4_hba.fof_eq, LPFC_WCQ, LPFC_FCP); | 11037 | phba->sli4_hba.fof_eq, LPFC_WCQ, LPFC_FCP); |
@@ -10947,8 +11050,7 @@ lpfc_fof_queue_setup(struct lpfc_hba *phba) | |||
10947 | return 0; | 11050 | return 0; |
10948 | 11051 | ||
10949 | out_oas_wq: | 11052 | out_oas_wq: |
10950 | if (phba->cfg_EnableXLane) | 11053 | lpfc_cq_destroy(phba, phba->sli4_hba.oas_cq); |
10951 | lpfc_cq_destroy(phba, phba->sli4_hba.oas_cq); | ||
10952 | out_oas_cq: | 11054 | out_oas_cq: |
10953 | lpfc_eq_destroy(phba, phba->sli4_hba.fof_eq); | 11055 | lpfc_eq_destroy(phba, phba->sli4_hba.fof_eq); |
10954 | return rc; | 11056 | return rc; |
@@ -10982,7 +11084,7 @@ lpfc_fof_queue_create(struct lpfc_hba *phba) | |||
10982 | 11084 | ||
10983 | phba->sli4_hba.fof_eq = qdesc; | 11085 | phba->sli4_hba.fof_eq = qdesc; |
10984 | 11086 | ||
10985 | if (phba->cfg_EnableXLane) { | 11087 | if (phba->cfg_fof) { |
10986 | 11088 | ||
10987 | /* Create OAS CQ */ | 11089 | /* Create OAS CQ */ |
10988 | qdesc = lpfc_sli4_queue_alloc(phba, phba->sli4_hba.cq_esize, | 11090 | qdesc = lpfc_sli4_queue_alloc(phba, phba->sli4_hba.cq_esize, |
diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c index ed419aad2b1f..3fa65338d3f5 100644 --- a/drivers/scsi/lpfc/lpfc_mem.c +++ b/drivers/scsi/lpfc/lpfc_mem.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2012 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 462453ee0bda..2df11daad85b 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
@@ -73,7 +73,7 @@ lpfc_rport_data_from_scsi_device(struct scsi_device *sdev) | |||
73 | { | 73 | { |
74 | struct lpfc_vport *vport = (struct lpfc_vport *)sdev->host->hostdata; | 74 | struct lpfc_vport *vport = (struct lpfc_vport *)sdev->host->hostdata; |
75 | 75 | ||
76 | if (vport->phba->cfg_EnableXLane) | 76 | if (vport->phba->cfg_fof) |
77 | return ((struct lpfc_device_data *)sdev->hostdata)->rport_data; | 77 | return ((struct lpfc_device_data *)sdev->hostdata)->rport_data; |
78 | else | 78 | else |
79 | return (struct lpfc_rport_data *)sdev->hostdata; | 79 | return (struct lpfc_rport_data *)sdev->hostdata; |
@@ -3462,7 +3462,7 @@ lpfc_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd) | |||
3462 | * If the OAS driver feature is enabled and the lun is enabled for | 3462 | * If the OAS driver feature is enabled and the lun is enabled for |
3463 | * OAS, set the oas iocb related flags. | 3463 | * OAS, set the oas iocb related flags. |
3464 | */ | 3464 | */ |
3465 | if ((phba->cfg_EnableXLane) && ((struct lpfc_device_data *) | 3465 | if ((phba->cfg_fof) && ((struct lpfc_device_data *) |
3466 | scsi_cmnd->device->hostdata)->oas_enabled) | 3466 | scsi_cmnd->device->hostdata)->oas_enabled) |
3467 | lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_OAS; | 3467 | lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_OAS; |
3468 | return 0; | 3468 | return 0; |
@@ -4314,6 +4314,7 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, | |||
4314 | fcp_cmnd->fcpCntl1 = SIMPLE_Q; | 4314 | fcp_cmnd->fcpCntl1 = SIMPLE_Q; |
4315 | 4315 | ||
4316 | sli4 = (phba->sli_rev == LPFC_SLI_REV4); | 4316 | sli4 = (phba->sli_rev == LPFC_SLI_REV4); |
4317 | piocbq->iocb.un.fcpi.fcpi_XRdy = 0; | ||
4317 | 4318 | ||
4318 | /* | 4319 | /* |
4319 | * There are three possibilities here - use scatter-gather segment, use | 4320 | * There are three possibilities here - use scatter-gather segment, use |
@@ -4782,7 +4783,9 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) | |||
4782 | struct lpfc_scsi_buf *lpfc_cmd; | 4783 | struct lpfc_scsi_buf *lpfc_cmd; |
4783 | IOCB_t *cmd, *icmd; | 4784 | IOCB_t *cmd, *icmd; |
4784 | int ret = SUCCESS, status = 0; | 4785 | int ret = SUCCESS, status = 0; |
4785 | unsigned long flags; | 4786 | struct lpfc_sli_ring *pring_s4; |
4787 | int ring_number, ret_val; | ||
4788 | unsigned long flags, iflags; | ||
4786 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waitq); | 4789 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waitq); |
4787 | 4790 | ||
4788 | status = fc_block_scsi_eh(cmnd); | 4791 | status = fc_block_scsi_eh(cmnd); |
@@ -4833,6 +4836,14 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) | |||
4833 | 4836 | ||
4834 | BUG_ON(iocb->context1 != lpfc_cmd); | 4837 | BUG_ON(iocb->context1 != lpfc_cmd); |
4835 | 4838 | ||
4839 | /* abort issued in recovery is still in progress */ | ||
4840 | if (iocb->iocb_flag & LPFC_DRIVER_ABORTED) { | ||
4841 | lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP, | ||
4842 | "3389 SCSI Layer I/O Abort Request is pending\n"); | ||
4843 | spin_unlock_irqrestore(&phba->hbalock, flags); | ||
4844 | goto wait_for_cmpl; | ||
4845 | } | ||
4846 | |||
4836 | abtsiocb = __lpfc_sli_get_iocbq(phba); | 4847 | abtsiocb = __lpfc_sli_get_iocbq(phba); |
4837 | if (abtsiocb == NULL) { | 4848 | if (abtsiocb == NULL) { |
4838 | ret = FAILED; | 4849 | ret = FAILED; |
@@ -4871,11 +4882,23 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) | |||
4871 | 4882 | ||
4872 | abtsiocb->iocb_cmpl = lpfc_sli_abort_fcp_cmpl; | 4883 | abtsiocb->iocb_cmpl = lpfc_sli_abort_fcp_cmpl; |
4873 | abtsiocb->vport = vport; | 4884 | abtsiocb->vport = vport; |
4885 | if (phba->sli_rev == LPFC_SLI_REV4) { | ||
4886 | ring_number = MAX_SLI3_CONFIGURED_RINGS + iocb->fcp_wqidx; | ||
4887 | pring_s4 = &phba->sli.ring[ring_number]; | ||
4888 | /* Note: both hbalock and ring_lock must be set here */ | ||
4889 | spin_lock_irqsave(&pring_s4->ring_lock, iflags); | ||
4890 | ret_val = __lpfc_sli_issue_iocb(phba, pring_s4->ringno, | ||
4891 | abtsiocb, 0); | ||
4892 | spin_unlock_irqrestore(&pring_s4->ring_lock, iflags); | ||
4893 | } else { | ||
4894 | ret_val = __lpfc_sli_issue_iocb(phba, LPFC_FCP_RING, | ||
4895 | abtsiocb, 0); | ||
4896 | } | ||
4874 | /* no longer need the lock after this point */ | 4897 | /* no longer need the lock after this point */ |
4875 | spin_unlock_irqrestore(&phba->hbalock, flags); | 4898 | spin_unlock_irqrestore(&phba->hbalock, flags); |
4876 | 4899 | ||
4877 | if (lpfc_sli_issue_iocb(phba, LPFC_FCP_RING, abtsiocb, 0) == | 4900 | |
4878 | IOCB_ERROR) { | 4901 | if (ret_val == IOCB_ERROR) { |
4879 | lpfc_sli_release_iocbq(phba, abtsiocb); | 4902 | lpfc_sli_release_iocbq(phba, abtsiocb); |
4880 | ret = FAILED; | 4903 | ret = FAILED; |
4881 | goto out; | 4904 | goto out; |
@@ -4885,12 +4908,16 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) | |||
4885 | lpfc_sli_handle_fast_ring_event(phba, | 4908 | lpfc_sli_handle_fast_ring_event(phba, |
4886 | &phba->sli.ring[LPFC_FCP_RING], HA_R0RE_REQ); | 4909 | &phba->sli.ring[LPFC_FCP_RING], HA_R0RE_REQ); |
4887 | 4910 | ||
4911 | wait_for_cmpl: | ||
4888 | lpfc_cmd->waitq = &waitq; | 4912 | lpfc_cmd->waitq = &waitq; |
4889 | /* Wait for abort to complete */ | 4913 | /* Wait for abort to complete */ |
4890 | wait_event_timeout(waitq, | 4914 | wait_event_timeout(waitq, |
4891 | (lpfc_cmd->pCmd != cmnd), | 4915 | (lpfc_cmd->pCmd != cmnd), |
4892 | msecs_to_jiffies(2*vport->cfg_devloss_tmo*1000)); | 4916 | msecs_to_jiffies(2*vport->cfg_devloss_tmo*1000)); |
4917 | |||
4918 | spin_lock_irqsave(shost->host_lock, flags); | ||
4893 | lpfc_cmd->waitq = NULL; | 4919 | lpfc_cmd->waitq = NULL; |
4920 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
4894 | 4921 | ||
4895 | if (lpfc_cmd->pCmd == cmnd) { | 4922 | if (lpfc_cmd->pCmd == cmnd) { |
4896 | ret = FAILED; | 4923 | ret = FAILED; |
@@ -5172,8 +5199,9 @@ lpfc_reset_flush_io_context(struct lpfc_vport *vport, uint16_t tgt_id, | |||
5172 | 5199 | ||
5173 | cnt = lpfc_sli_sum_iocb(vport, tgt_id, lun_id, context); | 5200 | cnt = lpfc_sli_sum_iocb(vport, tgt_id, lun_id, context); |
5174 | if (cnt) | 5201 | if (cnt) |
5175 | lpfc_sli_abort_iocb(vport, &phba->sli.ring[phba->sli.fcp_ring], | 5202 | lpfc_sli_abort_taskmgmt(vport, |
5176 | tgt_id, lun_id, context); | 5203 | &phba->sli.ring[phba->sli.fcp_ring], |
5204 | tgt_id, lun_id, context); | ||
5177 | later = msecs_to_jiffies(2 * vport->cfg_devloss_tmo * 1000) + jiffies; | 5205 | later = msecs_to_jiffies(2 * vport->cfg_devloss_tmo * 1000) + jiffies; |
5178 | while (time_after(later, jiffies) && cnt) { | 5206 | while (time_after(later, jiffies) && cnt) { |
5179 | schedule_timeout_uninterruptible(msecs_to_jiffies(20)); | 5207 | schedule_timeout_uninterruptible(msecs_to_jiffies(20)); |
@@ -5491,7 +5519,7 @@ lpfc_slave_alloc(struct scsi_device *sdev) | |||
5491 | if (!rport || fc_remote_port_chkready(rport)) | 5519 | if (!rport || fc_remote_port_chkready(rport)) |
5492 | return -ENXIO; | 5520 | return -ENXIO; |
5493 | 5521 | ||
5494 | if (phba->cfg_EnableXLane) { | 5522 | if (phba->cfg_fof) { |
5495 | 5523 | ||
5496 | /* | 5524 | /* |
5497 | * Check to see if the device data structure for the lun | 5525 | * Check to see if the device data structure for the lun |
@@ -5616,7 +5644,7 @@ lpfc_slave_destroy(struct scsi_device *sdev) | |||
5616 | struct lpfc_device_data *device_data = sdev->hostdata; | 5644 | struct lpfc_device_data *device_data = sdev->hostdata; |
5617 | 5645 | ||
5618 | atomic_dec(&phba->sdev_cnt); | 5646 | atomic_dec(&phba->sdev_cnt); |
5619 | if ((phba->cfg_EnableXLane) && (device_data)) { | 5647 | if ((phba->cfg_fof) && (device_data)) { |
5620 | spin_lock_irqsave(&phba->devicelock, flags); | 5648 | spin_lock_irqsave(&phba->devicelock, flags); |
5621 | device_data->available = false; | 5649 | device_data->available = false; |
5622 | if (!device_data->oas_enabled) | 5650 | if (!device_data->oas_enabled) |
@@ -5655,7 +5683,7 @@ lpfc_create_device_data(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn, | |||
5655 | int memory_flags; | 5683 | int memory_flags; |
5656 | 5684 | ||
5657 | if (unlikely(!phba) || !vport_wwpn || !target_wwpn || | 5685 | if (unlikely(!phba) || !vport_wwpn || !target_wwpn || |
5658 | !(phba->cfg_EnableXLane)) | 5686 | !(phba->cfg_fof)) |
5659 | return NULL; | 5687 | return NULL; |
5660 | 5688 | ||
5661 | /* Attempt to create the device data to contain lun info */ | 5689 | /* Attempt to create the device data to contain lun info */ |
@@ -5693,7 +5721,7 @@ lpfc_delete_device_data(struct lpfc_hba *phba, | |||
5693 | { | 5721 | { |
5694 | 5722 | ||
5695 | if (unlikely(!phba) || !lun_info || | 5723 | if (unlikely(!phba) || !lun_info || |
5696 | !(phba->cfg_EnableXLane)) | 5724 | !(phba->cfg_fof)) |
5697 | return; | 5725 | return; |
5698 | 5726 | ||
5699 | if (!list_empty(&lun_info->listentry)) | 5727 | if (!list_empty(&lun_info->listentry)) |
@@ -5727,7 +5755,7 @@ __lpfc_get_device_data(struct lpfc_hba *phba, struct list_head *list, | |||
5727 | struct lpfc_device_data *lun_info; | 5755 | struct lpfc_device_data *lun_info; |
5728 | 5756 | ||
5729 | if (unlikely(!phba) || !list || !vport_wwpn || !target_wwpn || | 5757 | if (unlikely(!phba) || !list || !vport_wwpn || !target_wwpn || |
5730 | !phba->cfg_EnableXLane) | 5758 | !phba->cfg_fof) |
5731 | return NULL; | 5759 | return NULL; |
5732 | 5760 | ||
5733 | /* Check to see if the lun is already enabled for OAS. */ | 5761 | /* Check to see if the lun is already enabled for OAS. */ |
@@ -5789,7 +5817,7 @@ lpfc_find_next_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn, | |||
5789 | !starting_lun || !found_vport_wwpn || | 5817 | !starting_lun || !found_vport_wwpn || |
5790 | !found_target_wwpn || !found_lun || !found_lun_status || | 5818 | !found_target_wwpn || !found_lun || !found_lun_status || |
5791 | (*starting_lun == NO_MORE_OAS_LUN) || | 5819 | (*starting_lun == NO_MORE_OAS_LUN) || |
5792 | !phba->cfg_EnableXLane) | 5820 | !phba->cfg_fof) |
5793 | return false; | 5821 | return false; |
5794 | 5822 | ||
5795 | lun = *starting_lun; | 5823 | lun = *starting_lun; |
@@ -5873,7 +5901,7 @@ lpfc_enable_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn, | |||
5873 | unsigned long flags; | 5901 | unsigned long flags; |
5874 | 5902 | ||
5875 | if (unlikely(!phba) || !vport_wwpn || !target_wwpn || | 5903 | if (unlikely(!phba) || !vport_wwpn || !target_wwpn || |
5876 | !phba->cfg_EnableXLane) | 5904 | !phba->cfg_fof) |
5877 | return false; | 5905 | return false; |
5878 | 5906 | ||
5879 | spin_lock_irqsave(&phba->devicelock, flags); | 5907 | spin_lock_irqsave(&phba->devicelock, flags); |
@@ -5930,7 +5958,7 @@ lpfc_disable_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn, | |||
5930 | unsigned long flags; | 5958 | unsigned long flags; |
5931 | 5959 | ||
5932 | if (unlikely(!phba) || !vport_wwpn || !target_wwpn || | 5960 | if (unlikely(!phba) || !vport_wwpn || !target_wwpn || |
5933 | !phba->cfg_EnableXLane) | 5961 | !phba->cfg_fof) |
5934 | return false; | 5962 | return false; |
5935 | 5963 | ||
5936 | spin_lock_irqsave(&phba->devicelock, flags); | 5964 | spin_lock_irqsave(&phba->devicelock, flags); |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.h b/drivers/scsi/lpfc/lpfc_scsi.h index 0120bfccf50b..0389ac1e7b83 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.h +++ b/drivers/scsi/lpfc/lpfc_scsi.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * * | 7 | * * |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 393662c24df5..32ada0505576 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
@@ -3532,14 +3532,27 @@ lpfc_sli_abort_iocb_ring(struct lpfc_hba *phba, struct lpfc_sli_ring *pring) | |||
3532 | /* Error everything on txq and txcmplq | 3532 | /* Error everything on txq and txcmplq |
3533 | * First do the txq. | 3533 | * First do the txq. |
3534 | */ | 3534 | */ |
3535 | spin_lock_irq(&phba->hbalock); | 3535 | if (phba->sli_rev >= LPFC_SLI_REV4) { |
3536 | list_splice_init(&pring->txq, &completions); | 3536 | spin_lock_irq(&pring->ring_lock); |
3537 | list_splice_init(&pring->txq, &completions); | ||
3538 | pring->txq_cnt = 0; | ||
3539 | spin_unlock_irq(&pring->ring_lock); | ||
3537 | 3540 | ||
3538 | /* Next issue ABTS for everything on the txcmplq */ | 3541 | spin_lock_irq(&phba->hbalock); |
3539 | list_for_each_entry_safe(iocb, next_iocb, &pring->txcmplq, list) | 3542 | /* Next issue ABTS for everything on the txcmplq */ |
3540 | lpfc_sli_issue_abort_iotag(phba, pring, iocb); | 3543 | list_for_each_entry_safe(iocb, next_iocb, &pring->txcmplq, list) |
3544 | lpfc_sli_issue_abort_iotag(phba, pring, iocb); | ||
3545 | spin_unlock_irq(&phba->hbalock); | ||
3546 | } else { | ||
3547 | spin_lock_irq(&phba->hbalock); | ||
3548 | list_splice_init(&pring->txq, &completions); | ||
3549 | pring->txq_cnt = 0; | ||
3541 | 3550 | ||
3542 | spin_unlock_irq(&phba->hbalock); | 3551 | /* Next issue ABTS for everything on the txcmplq */ |
3552 | list_for_each_entry_safe(iocb, next_iocb, &pring->txcmplq, list) | ||
3553 | lpfc_sli_issue_abort_iotag(phba, pring, iocb); | ||
3554 | spin_unlock_irq(&phba->hbalock); | ||
3555 | } | ||
3543 | 3556 | ||
3544 | /* Cancel all the IOCBs from the completions list */ | 3557 | /* Cancel all the IOCBs from the completions list */ |
3545 | lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT, | 3558 | lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT, |
@@ -3547,6 +3560,36 @@ lpfc_sli_abort_iocb_ring(struct lpfc_hba *phba, struct lpfc_sli_ring *pring) | |||
3547 | } | 3560 | } |
3548 | 3561 | ||
3549 | /** | 3562 | /** |
3563 | * lpfc_sli_abort_fcp_rings - Abort all iocbs in all FCP rings | ||
3564 | * @phba: Pointer to HBA context object. | ||
3565 | * @pring: Pointer to driver SLI ring object. | ||
3566 | * | ||
3567 | * This function aborts all iocbs in FCP rings and frees all the iocb | ||
3568 | * objects in txq. This function issues an abort iocb for all the iocb commands | ||
3569 | * in txcmplq. The iocbs in the txcmplq is not guaranteed to complete before | ||
3570 | * the return of this function. The caller is not required to hold any locks. | ||
3571 | **/ | ||
3572 | void | ||
3573 | lpfc_sli_abort_fcp_rings(struct lpfc_hba *phba) | ||
3574 | { | ||
3575 | struct lpfc_sli *psli = &phba->sli; | ||
3576 | struct lpfc_sli_ring *pring; | ||
3577 | uint32_t i; | ||
3578 | |||
3579 | /* Look on all the FCP Rings for the iotag */ | ||
3580 | if (phba->sli_rev >= LPFC_SLI_REV4) { | ||
3581 | for (i = 0; i < phba->cfg_fcp_io_channel; i++) { | ||
3582 | pring = &psli->ring[i + MAX_SLI3_CONFIGURED_RINGS]; | ||
3583 | lpfc_sli_abort_iocb_ring(phba, pring); | ||
3584 | } | ||
3585 | } else { | ||
3586 | pring = &psli->ring[psli->fcp_ring]; | ||
3587 | lpfc_sli_abort_iocb_ring(phba, pring); | ||
3588 | } | ||
3589 | } | ||
3590 | |||
3591 | |||
3592 | /** | ||
3550 | * lpfc_sli_flush_fcp_rings - flush all iocbs in the fcp ring | 3593 | * lpfc_sli_flush_fcp_rings - flush all iocbs in the fcp ring |
3551 | * @phba: Pointer to HBA context object. | 3594 | * @phba: Pointer to HBA context object. |
3552 | * | 3595 | * |
@@ -3563,28 +3606,55 @@ lpfc_sli_flush_fcp_rings(struct lpfc_hba *phba) | |||
3563 | LIST_HEAD(txcmplq); | 3606 | LIST_HEAD(txcmplq); |
3564 | struct lpfc_sli *psli = &phba->sli; | 3607 | struct lpfc_sli *psli = &phba->sli; |
3565 | struct lpfc_sli_ring *pring; | 3608 | struct lpfc_sli_ring *pring; |
3566 | 3609 | uint32_t i; | |
3567 | /* Currently, only one fcp ring */ | ||
3568 | pring = &psli->ring[psli->fcp_ring]; | ||
3569 | 3610 | ||
3570 | spin_lock_irq(&phba->hbalock); | 3611 | spin_lock_irq(&phba->hbalock); |
3571 | /* Retrieve everything on txq */ | ||
3572 | list_splice_init(&pring->txq, &txq); | ||
3573 | |||
3574 | /* Retrieve everything on the txcmplq */ | ||
3575 | list_splice_init(&pring->txcmplq, &txcmplq); | ||
3576 | |||
3577 | /* Indicate the I/O queues are flushed */ | 3612 | /* Indicate the I/O queues are flushed */ |
3578 | phba->hba_flag |= HBA_FCP_IOQ_FLUSH; | 3613 | phba->hba_flag |= HBA_FCP_IOQ_FLUSH; |
3579 | spin_unlock_irq(&phba->hbalock); | 3614 | spin_unlock_irq(&phba->hbalock); |
3580 | 3615 | ||
3581 | /* Flush the txq */ | 3616 | /* Look on all the FCP Rings for the iotag */ |
3582 | lpfc_sli_cancel_iocbs(phba, &txq, IOSTAT_LOCAL_REJECT, | 3617 | if (phba->sli_rev >= LPFC_SLI_REV4) { |
3583 | IOERR_SLI_DOWN); | 3618 | for (i = 0; i < phba->cfg_fcp_io_channel; i++) { |
3619 | pring = &psli->ring[i + MAX_SLI3_CONFIGURED_RINGS]; | ||
3620 | |||
3621 | spin_lock_irq(&pring->ring_lock); | ||
3622 | /* Retrieve everything on txq */ | ||
3623 | list_splice_init(&pring->txq, &txq); | ||
3624 | /* Retrieve everything on the txcmplq */ | ||
3625 | list_splice_init(&pring->txcmplq, &txcmplq); | ||
3626 | pring->txq_cnt = 0; | ||
3627 | pring->txcmplq_cnt = 0; | ||
3628 | spin_unlock_irq(&pring->ring_lock); | ||
3629 | |||
3630 | /* Flush the txq */ | ||
3631 | lpfc_sli_cancel_iocbs(phba, &txq, | ||
3632 | IOSTAT_LOCAL_REJECT, | ||
3633 | IOERR_SLI_DOWN); | ||
3634 | /* Flush the txcmpq */ | ||
3635 | lpfc_sli_cancel_iocbs(phba, &txcmplq, | ||
3636 | IOSTAT_LOCAL_REJECT, | ||
3637 | IOERR_SLI_DOWN); | ||
3638 | } | ||
3639 | } else { | ||
3640 | pring = &psli->ring[psli->fcp_ring]; | ||
3584 | 3641 | ||
3585 | /* Flush the txcmpq */ | 3642 | spin_lock_irq(&phba->hbalock); |
3586 | lpfc_sli_cancel_iocbs(phba, &txcmplq, IOSTAT_LOCAL_REJECT, | 3643 | /* Retrieve everything on txq */ |
3587 | IOERR_SLI_DOWN); | 3644 | list_splice_init(&pring->txq, &txq); |
3645 | /* Retrieve everything on the txcmplq */ | ||
3646 | list_splice_init(&pring->txcmplq, &txcmplq); | ||
3647 | pring->txq_cnt = 0; | ||
3648 | pring->txcmplq_cnt = 0; | ||
3649 | spin_unlock_irq(&phba->hbalock); | ||
3650 | |||
3651 | /* Flush the txq */ | ||
3652 | lpfc_sli_cancel_iocbs(phba, &txq, IOSTAT_LOCAL_REJECT, | ||
3653 | IOERR_SLI_DOWN); | ||
3654 | /* Flush the txcmpq */ | ||
3655 | lpfc_sli_cancel_iocbs(phba, &txcmplq, IOSTAT_LOCAL_REJECT, | ||
3656 | IOERR_SLI_DOWN); | ||
3657 | } | ||
3588 | } | 3658 | } |
3589 | 3659 | ||
3590 | /** | 3660 | /** |
@@ -3987,12 +4057,13 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba) | |||
3987 | { | 4057 | { |
3988 | struct lpfc_sli *psli = &phba->sli; | 4058 | struct lpfc_sli *psli = &phba->sli; |
3989 | uint16_t cfg_value; | 4059 | uint16_t cfg_value; |
3990 | int rc; | 4060 | int rc = 0; |
3991 | 4061 | ||
3992 | /* Reset HBA */ | 4062 | /* Reset HBA */ |
3993 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, | 4063 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, |
3994 | "0295 Reset HBA Data: x%x x%x\n", | 4064 | "0295 Reset HBA Data: x%x x%x x%x\n", |
3995 | phba->pport->port_state, psli->sli_flag); | 4065 | phba->pport->port_state, psli->sli_flag, |
4066 | phba->hba_flag); | ||
3996 | 4067 | ||
3997 | /* perform board reset */ | 4068 | /* perform board reset */ |
3998 | phba->fc_eventTag = 0; | 4069 | phba->fc_eventTag = 0; |
@@ -4005,6 +4076,12 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba) | |||
4005 | phba->fcf.fcf_flag = 0; | 4076 | phba->fcf.fcf_flag = 0; |
4006 | spin_unlock_irq(&phba->hbalock); | 4077 | spin_unlock_irq(&phba->hbalock); |
4007 | 4078 | ||
4079 | /* SLI4 INTF 2: if FW dump is being taken skip INIT_PORT */ | ||
4080 | if (phba->hba_flag & HBA_FW_DUMP_OP) { | ||
4081 | phba->hba_flag &= ~HBA_FW_DUMP_OP; | ||
4082 | return rc; | ||
4083 | } | ||
4084 | |||
4008 | /* Now physically reset the device */ | 4085 | /* Now physically reset the device */ |
4009 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, | 4086 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, |
4010 | "0389 Performing PCI function reset!\n"); | 4087 | "0389 Performing PCI function reset!\n"); |
@@ -5002,7 +5079,7 @@ lpfc_sli4_arm_cqeq_intr(struct lpfc_hba *phba) | |||
5002 | } while (++fcp_eqidx < phba->cfg_fcp_io_channel); | 5079 | } while (++fcp_eqidx < phba->cfg_fcp_io_channel); |
5003 | } | 5080 | } |
5004 | 5081 | ||
5005 | if (phba->cfg_EnableXLane) | 5082 | if (phba->cfg_fof) |
5006 | lpfc_sli4_cq_release(phba->sli4_hba.oas_cq, LPFC_QUEUE_REARM); | 5083 | lpfc_sli4_cq_release(phba->sli4_hba.oas_cq, LPFC_QUEUE_REARM); |
5007 | 5084 | ||
5008 | if (phba->sli4_hba.hba_eq) { | 5085 | if (phba->sli4_hba.hba_eq) { |
@@ -6722,7 +6799,6 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) | |||
6722 | LPFC_MBOXQ_t *pmbox = phba->sli.mbox_active; | 6799 | LPFC_MBOXQ_t *pmbox = phba->sli.mbox_active; |
6723 | MAILBOX_t *mb = &pmbox->u.mb; | 6800 | MAILBOX_t *mb = &pmbox->u.mb; |
6724 | struct lpfc_sli *psli = &phba->sli; | 6801 | struct lpfc_sli *psli = &phba->sli; |
6725 | struct lpfc_sli_ring *pring; | ||
6726 | 6802 | ||
6727 | /* If the mailbox completed, process the completion and return */ | 6803 | /* If the mailbox completed, process the completion and return */ |
6728 | if (lpfc_sli4_process_missed_mbox_completions(phba)) | 6804 | if (lpfc_sli4_process_missed_mbox_completions(phba)) |
@@ -6764,8 +6840,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) | |||
6764 | psli->sli_flag &= ~LPFC_SLI_ACTIVE; | 6840 | psli->sli_flag &= ~LPFC_SLI_ACTIVE; |
6765 | spin_unlock_irq(&phba->hbalock); | 6841 | spin_unlock_irq(&phba->hbalock); |
6766 | 6842 | ||
6767 | pring = &psli->ring[psli->fcp_ring]; | 6843 | lpfc_sli_abort_fcp_rings(phba); |
6768 | lpfc_sli_abort_iocb_ring(phba, pring); | ||
6769 | 6844 | ||
6770 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, | 6845 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, |
6771 | "0345 Resetting board due to mailbox timeout\n"); | 6846 | "0345 Resetting board due to mailbox timeout\n"); |
@@ -8133,6 +8208,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
8133 | abort_tag = (uint32_t) iocbq->iotag; | 8208 | abort_tag = (uint32_t) iocbq->iotag; |
8134 | xritag = iocbq->sli4_xritag; | 8209 | xritag = iocbq->sli4_xritag; |
8135 | wqe->generic.wqe_com.word7 = 0; /* The ct field has moved so reset */ | 8210 | wqe->generic.wqe_com.word7 = 0; /* The ct field has moved so reset */ |
8211 | wqe->generic.wqe_com.word10 = 0; | ||
8136 | /* words0-2 bpl convert bde */ | 8212 | /* words0-2 bpl convert bde */ |
8137 | if (iocbq->iocb.un.genreq64.bdl.bdeFlags == BUFF_TYPE_BLP_64) { | 8213 | if (iocbq->iocb.un.genreq64.bdl.bdeFlags == BUFF_TYPE_BLP_64) { |
8138 | numBdes = iocbq->iocb.un.genreq64.bdl.bdeSize / | 8214 | numBdes = iocbq->iocb.un.genreq64.bdl.bdeSize / |
@@ -8639,8 +8715,7 @@ __lpfc_sli_issue_iocb_s4(struct lpfc_hba *phba, uint32_t ring_number, | |||
8639 | 8715 | ||
8640 | if ((piocb->iocb_flag & LPFC_IO_FCP) || | 8716 | if ((piocb->iocb_flag & LPFC_IO_FCP) || |
8641 | (piocb->iocb_flag & LPFC_USE_FCPWQIDX)) { | 8717 | (piocb->iocb_flag & LPFC_USE_FCPWQIDX)) { |
8642 | if (!phba->cfg_EnableXLane || (!(piocb->iocb_flag & | 8718 | if (!phba->cfg_fof || (!(piocb->iocb_flag & LPFC_IO_OAS))) { |
8643 | LPFC_IO_OAS))) { | ||
8644 | wq = phba->sli4_hba.fcp_wq[piocb->fcp_wqidx]; | 8719 | wq = phba->sli4_hba.fcp_wq[piocb->fcp_wqidx]; |
8645 | } else { | 8720 | } else { |
8646 | wq = phba->sli4_hba.oas_wq; | 8721 | wq = phba->sli4_hba.oas_wq; |
@@ -8735,7 +8810,7 @@ lpfc_sli_issue_iocb(struct lpfc_hba *phba, uint32_t ring_number, | |||
8735 | 8810 | ||
8736 | if (phba->sli_rev == LPFC_SLI_REV4) { | 8811 | if (phba->sli_rev == LPFC_SLI_REV4) { |
8737 | if (piocb->iocb_flag & LPFC_IO_FCP) { | 8812 | if (piocb->iocb_flag & LPFC_IO_FCP) { |
8738 | if (!phba->cfg_EnableXLane || (!(piocb->iocb_flag & | 8813 | if (!phba->cfg_fof || (!(piocb->iocb_flag & |
8739 | LPFC_IO_OAS))) { | 8814 | LPFC_IO_OAS))) { |
8740 | if (unlikely(!phba->sli4_hba.fcp_wq)) | 8815 | if (unlikely(!phba->sli4_hba.fcp_wq)) |
8741 | return IOCB_ERROR; | 8816 | return IOCB_ERROR; |
@@ -9170,6 +9245,7 @@ lpfc_sli_queue_setup(struct lpfc_hba *phba) | |||
9170 | pring->sli.sli3.next_cmdidx = 0; | 9245 | pring->sli.sli3.next_cmdidx = 0; |
9171 | pring->sli.sli3.local_getidx = 0; | 9246 | pring->sli.sli3.local_getidx = 0; |
9172 | pring->sli.sli3.cmdidx = 0; | 9247 | pring->sli.sli3.cmdidx = 0; |
9248 | pring->flag = 0; | ||
9173 | INIT_LIST_HEAD(&pring->txq); | 9249 | INIT_LIST_HEAD(&pring->txq); |
9174 | INIT_LIST_HEAD(&pring->txcmplq); | 9250 | INIT_LIST_HEAD(&pring->txcmplq); |
9175 | INIT_LIST_HEAD(&pring->iocb_continueq); | 9251 | INIT_LIST_HEAD(&pring->iocb_continueq); |
@@ -9805,43 +9881,6 @@ abort_iotag_exit: | |||
9805 | } | 9881 | } |
9806 | 9882 | ||
9807 | /** | 9883 | /** |
9808 | * lpfc_sli_iocb_ring_abort - Unconditionally abort all iocbs on an iocb ring | ||
9809 | * @phba: Pointer to HBA context object. | ||
9810 | * @pring: Pointer to driver SLI ring object. | ||
9811 | * | ||
9812 | * This function aborts all iocbs in the given ring and frees all the iocb | ||
9813 | * objects in txq. This function issues abort iocbs unconditionally for all | ||
9814 | * the iocb commands in txcmplq. The iocbs in the txcmplq is not guaranteed | ||
9815 | * to complete before the return of this function. The caller is not required | ||
9816 | * to hold any locks. | ||
9817 | **/ | ||
9818 | static void | ||
9819 | lpfc_sli_iocb_ring_abort(struct lpfc_hba *phba, struct lpfc_sli_ring *pring) | ||
9820 | { | ||
9821 | LIST_HEAD(completions); | ||
9822 | struct lpfc_iocbq *iocb, *next_iocb; | ||
9823 | |||
9824 | if (pring->ringno == LPFC_ELS_RING) | ||
9825 | lpfc_fabric_abort_hba(phba); | ||
9826 | |||
9827 | spin_lock_irq(&phba->hbalock); | ||
9828 | |||
9829 | /* Take off all the iocbs on txq for cancelling */ | ||
9830 | list_splice_init(&pring->txq, &completions); | ||
9831 | pring->txq_cnt = 0; | ||
9832 | |||
9833 | /* Next issue ABTS for everything on the txcmplq */ | ||
9834 | list_for_each_entry_safe(iocb, next_iocb, &pring->txcmplq, list) | ||
9835 | lpfc_sli_abort_iotag_issue(phba, pring, iocb); | ||
9836 | |||
9837 | spin_unlock_irq(&phba->hbalock); | ||
9838 | |||
9839 | /* Cancel all the IOCBs from the completions list */ | ||
9840 | lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT, | ||
9841 | IOERR_SLI_ABORTED); | ||
9842 | } | ||
9843 | |||
9844 | /** | ||
9845 | * lpfc_sli_hba_iocb_abort - Abort all iocbs to an hba. | 9884 | * lpfc_sli_hba_iocb_abort - Abort all iocbs to an hba. |
9846 | * @phba: pointer to lpfc HBA data structure. | 9885 | * @phba: pointer to lpfc HBA data structure. |
9847 | * | 9886 | * |
@@ -9856,7 +9895,7 @@ lpfc_sli_hba_iocb_abort(struct lpfc_hba *phba) | |||
9856 | 9895 | ||
9857 | for (i = 0; i < psli->num_rings; i++) { | 9896 | for (i = 0; i < psli->num_rings; i++) { |
9858 | pring = &psli->ring[i]; | 9897 | pring = &psli->ring[i]; |
9859 | lpfc_sli_iocb_ring_abort(phba, pring); | 9898 | lpfc_sli_abort_iocb_ring(phba, pring); |
9860 | } | 9899 | } |
9861 | } | 9900 | } |
9862 | 9901 | ||
@@ -10081,6 +10120,124 @@ lpfc_sli_abort_iocb(struct lpfc_vport *vport, struct lpfc_sli_ring *pring, | |||
10081 | } | 10120 | } |
10082 | 10121 | ||
10083 | /** | 10122 | /** |
10123 | * lpfc_sli_abort_taskmgmt - issue abort for all commands on a host/target/LUN | ||
10124 | * @vport: Pointer to virtual port. | ||
10125 | * @pring: Pointer to driver SLI ring object. | ||
10126 | * @tgt_id: SCSI ID of the target. | ||
10127 | * @lun_id: LUN ID of the scsi device. | ||
10128 | * @taskmgmt_cmd: LPFC_CTX_LUN/LPFC_CTX_TGT/LPFC_CTX_HOST. | ||
10129 | * | ||
10130 | * This function sends an abort command for every SCSI command | ||
10131 | * associated with the given virtual port pending on the ring | ||
10132 | * filtered by lpfc_sli_validate_fcp_iocb function. | ||
10133 | * When taskmgmt_cmd == LPFC_CTX_LUN, the function sends abort only to the | ||
10134 | * FCP iocbs associated with lun specified by tgt_id and lun_id | ||
10135 | * parameters | ||
10136 | * When taskmgmt_cmd == LPFC_CTX_TGT, the function sends abort only to the | ||
10137 | * FCP iocbs associated with SCSI target specified by tgt_id parameter. | ||
10138 | * When taskmgmt_cmd == LPFC_CTX_HOST, the function sends abort to all | ||
10139 | * FCP iocbs associated with virtual port. | ||
10140 | * This function returns number of iocbs it aborted . | ||
10141 | * This function is called with no locks held right after a taskmgmt | ||
10142 | * command is sent. | ||
10143 | **/ | ||
10144 | int | ||
10145 | lpfc_sli_abort_taskmgmt(struct lpfc_vport *vport, struct lpfc_sli_ring *pring, | ||
10146 | uint16_t tgt_id, uint64_t lun_id, lpfc_ctx_cmd cmd) | ||
10147 | { | ||
10148 | struct lpfc_hba *phba = vport->phba; | ||
10149 | struct lpfc_iocbq *abtsiocbq; | ||
10150 | struct lpfc_iocbq *iocbq; | ||
10151 | IOCB_t *icmd; | ||
10152 | int sum, i, ret_val; | ||
10153 | unsigned long iflags; | ||
10154 | struct lpfc_sli_ring *pring_s4; | ||
10155 | uint32_t ring_number; | ||
10156 | |||
10157 | spin_lock_irq(&phba->hbalock); | ||
10158 | |||
10159 | /* all I/Os are in process of being flushed */ | ||
10160 | if (phba->hba_flag & HBA_FCP_IOQ_FLUSH) { | ||
10161 | spin_unlock_irq(&phba->hbalock); | ||
10162 | return 0; | ||
10163 | } | ||
10164 | sum = 0; | ||
10165 | |||
10166 | for (i = 1; i <= phba->sli.last_iotag; i++) { | ||
10167 | iocbq = phba->sli.iocbq_lookup[i]; | ||
10168 | |||
10169 | if (lpfc_sli_validate_fcp_iocb(iocbq, vport, tgt_id, lun_id, | ||
10170 | cmd) != 0) | ||
10171 | continue; | ||
10172 | |||
10173 | /* | ||
10174 | * If the iocbq is already being aborted, don't take a second | ||
10175 | * action, but do count it. | ||
10176 | */ | ||
10177 | if (iocbq->iocb_flag & LPFC_DRIVER_ABORTED) | ||
10178 | continue; | ||
10179 | |||
10180 | /* issue ABTS for this IOCB based on iotag */ | ||
10181 | abtsiocbq = __lpfc_sli_get_iocbq(phba); | ||
10182 | if (abtsiocbq == NULL) | ||
10183 | continue; | ||
10184 | |||
10185 | icmd = &iocbq->iocb; | ||
10186 | abtsiocbq->iocb.un.acxri.abortType = ABORT_TYPE_ABTS; | ||
10187 | abtsiocbq->iocb.un.acxri.abortContextTag = icmd->ulpContext; | ||
10188 | if (phba->sli_rev == LPFC_SLI_REV4) | ||
10189 | abtsiocbq->iocb.un.acxri.abortIoTag = | ||
10190 | iocbq->sli4_xritag; | ||
10191 | else | ||
10192 | abtsiocbq->iocb.un.acxri.abortIoTag = icmd->ulpIoTag; | ||
10193 | abtsiocbq->iocb.ulpLe = 1; | ||
10194 | abtsiocbq->iocb.ulpClass = icmd->ulpClass; | ||
10195 | abtsiocbq->vport = vport; | ||
10196 | |||
10197 | /* ABTS WQE must go to the same WQ as the WQE to be aborted */ | ||
10198 | abtsiocbq->fcp_wqidx = iocbq->fcp_wqidx; | ||
10199 | if (iocbq->iocb_flag & LPFC_IO_FCP) | ||
10200 | abtsiocbq->iocb_flag |= LPFC_USE_FCPWQIDX; | ||
10201 | |||
10202 | if (lpfc_is_link_up(phba)) | ||
10203 | abtsiocbq->iocb.ulpCommand = CMD_ABORT_XRI_CN; | ||
10204 | else | ||
10205 | abtsiocbq->iocb.ulpCommand = CMD_CLOSE_XRI_CN; | ||
10206 | |||
10207 | /* Setup callback routine and issue the command. */ | ||
10208 | abtsiocbq->iocb_cmpl = lpfc_sli_abort_fcp_cmpl; | ||
10209 | |||
10210 | /* | ||
10211 | * Indicate the IO is being aborted by the driver and set | ||
10212 | * the caller's flag into the aborted IO. | ||
10213 | */ | ||
10214 | iocbq->iocb_flag |= LPFC_DRIVER_ABORTED; | ||
10215 | |||
10216 | if (phba->sli_rev == LPFC_SLI_REV4) { | ||
10217 | ring_number = MAX_SLI3_CONFIGURED_RINGS + | ||
10218 | iocbq->fcp_wqidx; | ||
10219 | pring_s4 = &phba->sli.ring[ring_number]; | ||
10220 | /* Note: both hbalock and ring_lock must be set here */ | ||
10221 | spin_lock_irqsave(&pring_s4->ring_lock, iflags); | ||
10222 | ret_val = __lpfc_sli_issue_iocb(phba, pring_s4->ringno, | ||
10223 | abtsiocbq, 0); | ||
10224 | spin_unlock_irqrestore(&pring_s4->ring_lock, iflags); | ||
10225 | } else { | ||
10226 | ret_val = __lpfc_sli_issue_iocb(phba, pring->ringno, | ||
10227 | abtsiocbq, 0); | ||
10228 | } | ||
10229 | |||
10230 | |||
10231 | if (ret_val == IOCB_ERROR) | ||
10232 | __lpfc_sli_release_iocbq(phba, abtsiocbq); | ||
10233 | else | ||
10234 | sum++; | ||
10235 | } | ||
10236 | spin_unlock_irq(&phba->hbalock); | ||
10237 | return sum; | ||
10238 | } | ||
10239 | |||
10240 | /** | ||
10084 | * lpfc_sli_wake_iocb_wait - lpfc_sli_issue_iocb_wait's completion handler | 10241 | * lpfc_sli_wake_iocb_wait - lpfc_sli_issue_iocb_wait's completion handler |
10085 | * @phba: Pointer to HBA context object. | 10242 | * @phba: Pointer to HBA context object. |
10086 | * @cmdiocbq: Pointer to command iocb. | 10243 | * @cmdiocbq: Pointer to command iocb. |
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h index 6f04080f4ea8..edb48832c39b 100644 --- a/drivers/scsi/lpfc/lpfc_sli.h +++ b/drivers/scsi/lpfc/lpfc_sli.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * * | 7 | * * |
diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h index 9b8cda866176..7f50aa04d66a 100644 --- a/drivers/scsi/lpfc/lpfc_sli4.h +++ b/drivers/scsi/lpfc/lpfc_sli4.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2009-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2009-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * * | 7 | * * |
diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index e32cbec70324..41675c1193e7 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2013 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * * | 7 | * * |
@@ -18,7 +18,7 @@ | |||
18 | * included with this package. * | 18 | * included with this package. * |
19 | *******************************************************************/ | 19 | *******************************************************************/ |
20 | 20 | ||
21 | #define LPFC_DRIVER_VERSION "8.3.45" | 21 | #define LPFC_DRIVER_VERSION "10.2.8001.0." |
22 | #define LPFC_DRIVER_NAME "lpfc" | 22 | #define LPFC_DRIVER_NAME "lpfc" |
23 | 23 | ||
24 | /* Used for SLI 2/3 */ | 24 | /* Used for SLI 2/3 */ |
@@ -30,4 +30,4 @@ | |||
30 | 30 | ||
31 | #define LPFC_MODULE_DESC "Emulex LightPulse Fibre Channel SCSI driver " \ | 31 | #define LPFC_MODULE_DESC "Emulex LightPulse Fibre Channel SCSI driver " \ |
32 | LPFC_DRIVER_VERSION | 32 | LPFC_DRIVER_VERSION |
33 | #define LPFC_COPYRIGHT "Copyright(c) 2004-2013 Emulex. All rights reserved." | 33 | #define LPFC_COPYRIGHT "Copyright(c) 2004-2014 Emulex. All rights reserved." |