History

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 ...

Linus Torvalds committed 12 years ago

Commit abf04af2 parents 16d52ef c7ee3bd24 files · +715 −369Browse files

Unified · Split

24 files
  1. drivers/scsi/hpsa.c +158 −108
  2. drivers/scsi/hpsa.h +22 −20
  3. drivers/scsi/hpsa_cmd.h +19 −30
  4. drivers/scsi/lpfc/lpfc.h +2 −1
  5. drivers/scsi/lpfc/lpfc_attr.c +14 −9
  6. drivers/scsi/lpfc/lpfc_bsg.c +1 −1
  7. drivers/scsi/lpfc/lpfc_bsg.h +1 −1
  8. drivers/scsi/lpfc/lpfc_crtn.h +5 −1
  9. drivers/scsi/lpfc/lpfc_debugfs.c +2 −2
  10. drivers/scsi/lpfc/lpfc_els.c +1 −1
  11. drivers/scsi/lpfc/lpfc_hbadisc.c +4 −1
  12. drivers/scsi/lpfc/lpfc_hw.h +1 −1
  13. drivers/scsi/lpfc/lpfc_hw4.h +1 −1
  14. drivers/scsi/lpfc/lpfc_init.c +180 −78
  15. drivers/scsi/lpfc/lpfc_mem.c +1 −1
  16. drivers/scsi/lpfc/lpfc_scsi.c +44 −16
  17. drivers/scsi/lpfc/lpfc_scsi.h +1 −1
  18. drivers/scsi/lpfc/lpfc_sli.c +227 −70
  19. drivers/scsi/lpfc/lpfc_sli.h +1 −1
  20. drivers/scsi/lpfc/lpfc_sli4.h +1 −1
  21. drivers/scsi/lpfc/lpfc_version.h +3 −3
  22. drivers/scsi/qla2xxx/qla_def.h +8 −8
  23. drivers/scsi/qla2xxx/qla_target.c +10 −5
  24. drivers/scsi/qla2xxx/qla_target.h +8 −8
drivers/scsi/hpsa.c+158−108
@@ -48,6 +48,7 @@ · 47 unmodified lines
4848 #include <linux/bitmap.h>
4949 #include <linux/atomic.h>
5050 #include <linux/jiffies.h>
51+#include <linux/percpu.h>
5152 #include <asm/div64.h>
5253 #include "hpsa_cmd.h"
5354 #include "hpsa.h"
@@ -193,7 +194,8 @@ static int number_of_controllers; · 139 unmodified lines
193194 static irqreturn_t do_hpsa_intr_intx(int irq, void *dev_id);
194195 static irqreturn_t do_hpsa_intr_msi(int irq, void *dev_id);
195196 static int hpsa_ioctl(struct scsi_device *dev, int cmd, void *arg);
196−static void start_io(struct ctlr_info *h);
197+static void lock_and_start_io(struct ctlr_info *h);
198+static void start_io(struct ctlr_info *h, unsigned long *flags);
197199
198200 #ifdef CONFIG_COMPAT
199201 static int hpsa_compat_ioctl(struct scsi_device *dev, int cmd, void *arg);
@@ -695,7 +697,7 @@ static inline void addQ(struct list_head *list, struct CommandList *c) · 495 unmodified lines
695697 static inline u32 next_command(struct ctlr_info *h, u8 q)
696698 {
697699 u32 a;
698− struct reply_pool *rq = &h->reply_queue[q];
700+ struct reply_queue_buffer *rq = &h->reply_queue[q];
699701 unsigned long flags;
700702
701703 if (h->transMethod & CFGTBL_Trans_io_accel1)
@@ -844,8 +846,8 @@ static void enqueue_cmd_and_start_io(struct ctlr_info *h, · 142 unmodified lines
844846 spin_lock_irqsave(&h->lock, flags);
845847 addQ(&h->reqQ, c);
846848 h->Qdepth++;
849+ start_io(h, &flags);
847850 spin_unlock_irqrestore(&h->lock, flags);
848− start_io(h);
849851 }
850852
851853 static inline void removeQ(struct CommandList *c)
@@ -1554,9 +1556,13 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, · 702 unmodified lines
15541556 dev_warn(&h->pdev->dev,
15551557 "%s: task complete with check condition.\n",
15561558 "HP SSD Smart Path");
1559+ cmd->result |= SAM_STAT_CHECK_CONDITION;
15571560 if (c2->error_data.data_present !=
1558− IOACCEL2_SENSE_DATA_PRESENT)
1561+ IOACCEL2_SENSE_DATA_PRESENT) {
1562+ memset(cmd->sense_buffer, 0,
1563+ SCSI_SENSE_BUFFERSIZE);
15591564 break;
1565+ }
15601566 /* copy the sense data */
15611567 data_len = c2->error_data.sense_data_len;
15621568 if (data_len > SCSI_SENSE_BUFFERSIZE)
@@ -1566,7 +1572,6 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, · 3 unmodified lines
15661572 sizeof(c2->error_data.sense_data_buff);
15671573 memcpy(cmd->sense_buffer,
15681574 c2->error_data.sense_data_buff, data_len);
1569− cmd->result |= SAM_STAT_CHECK_CONDITION;
15701575 retry = 1;
15711576 break;
15721577 case IOACCEL2_STATUS_SR_TASK_COMP_BUSY:
@@ -1651,16 +1656,6 @@ static void process_ioaccel2_completion(struct ctlr_info *h, · 78 unmodified lines
16511656 if (is_logical_dev_addr_mode(dev->scsi3addr) &&
16521657 c2->error_data.serv_response ==
16531658 IOACCEL2_SERV_RESPONSE_FAILURE) {
1654− if (c2->error_data.status ==
1655− IOACCEL2_STATUS_SR_IOACCEL_DISABLED)
1656− dev_warn(&h->pdev->dev,
1657− "%s: Path is unavailable, retrying on standard path.\n",
1658− "HP SSD Smart Path");
1659− else
1660− dev_warn(&h->pdev->dev,
1661− "%s: Error 0x%02x, retrying on standard path.\n",
1662− "HP SSD Smart Path", c2->error_data.status);
1663−
16641659 dev->offload_enabled = 0;
16651660 h->drv_req_rescan = 1; /* schedule controller for a rescan */
16661661 cmd->result = DID_SOFT_ERROR << 16;
@@ -1991,20 +1986,26 @@ static inline void hpsa_scsi_do_simple_cmd_core(struct ctlr_info *h, · 324 unmodified lines
19911986 wait_for_completion(&wait);
19921987 }
19931988
1989+static u32 lockup_detected(struct ctlr_info *h)
1990+{
1991+ int cpu;
1992+ u32 rc, *lockup_detected;
1993+
1994+ cpu = get_cpu();
1995+ lockup_detected = per_cpu_ptr(h->lockup_detected, cpu);
1996+ rc = *lockup_detected;
1997+ put_cpu();
1998+ return rc;
1999+}
2000+
19942001 static void hpsa_scsi_do_simple_cmd_core_if_no_lockup(struct ctlr_info *h,
19952002 struct CommandList *c)
19962003 {
1997− unsigned long flags;
1998−
19992004 /* If controller lockup detected, fake a hardware error. */
2000− spin_lock_irqsave(&h->lock, flags);
2001− if (unlikely(h->lockup_detected)) {
2002− spin_unlock_irqrestore(&h->lock, flags);
2005+ if (unlikely(lockup_detected(h)))
20032006 c->err_info->CommandStatus = CMD_HARDWARE_ERR;
2004− } else {
2005− spin_unlock_irqrestore(&h->lock, flags);
2007+ else
20062008 hpsa_scsi_do_simple_cmd_core(h, c);
2007− }
20082009 }
20092010
20102011 #define MAX_DRIVER_CMD_RETRIES 25
@@ -2429,7 +2430,7 @@ static int hpsa_get_device_id(struct ctlr_info *h, unsigned char *scsi3addr, · 418 unmodified lines
24292430 buflen = 16;
24302431 buf = kzalloc(64, GFP_KERNEL);
24312432 if (!buf)
2432− return -1;
2433+ return -ENOMEM;
24332434 rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | 0x83, buf, 64);
24342435 if (rc == 0)
24352436 memcpy(device_id, &buf[8], buflen);
@@ -2515,27 +2516,21 @@ static int hpsa_get_volume_status(struct ctlr_info *h, · 79 unmodified lines
25152516 return HPSA_VPD_LV_STATUS_UNSUPPORTED;
25162517
25172518 /* Does controller have VPD for logical volume status? */
2518− if (!hpsa_vpd_page_supported(h, scsi3addr, HPSA_VPD_LV_STATUS)) {
2519− dev_warn(&h->pdev->dev, "Logical volume status VPD page is unsupported.\n");
2519+ if (!hpsa_vpd_page_supported(h, scsi3addr, HPSA_VPD_LV_STATUS))
25202520 goto exit_failed;
2521− }
25222521
25232522 /* Get the size of the VPD return buffer */
25242523 rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | HPSA_VPD_LV_STATUS,
25252524 buf, HPSA_VPD_HEADER_SZ);
2526− if (rc != 0) {
2527− dev_warn(&h->pdev->dev, "Logical volume status VPD inquiry failed.\n");
2525+ if (rc != 0)
25282526 goto exit_failed;
2529− }
25302527 size = buf[3];
25312528
25322529 /* Now get the whole VPD buffer */
25332530 rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | HPSA_VPD_LV_STATUS,
25342531 buf, size + HPSA_VPD_HEADER_SZ);
2535− if (rc != 0) {
2536− dev_warn(&h->pdev->dev, "Logical volume status VPD inquiry failed.\n");
2532+ if (rc != 0)
25372533 goto exit_failed;
2538− }
25392534 status = buf[4]; /* status byte */
25402535
25412536 kfree(buf);
@@ -2548,11 +2543,11 @@ exit_failed: · 6 unmodified lines
25482543 /* Determine offline status of a volume.
25492544 * Return either:
25502545 * 0 (not offline)
2551− * -1 (offline for unknown reasons)
2546+ * 0xff (offline for unknown reasons)
25522547 * # (integer code indicating one of several NOT READY states
25532548 * describing why a volume is to be kept offline)
25542549 */
2555−static unsigned char hpsa_volume_offline(struct ctlr_info *h,
2550+static int hpsa_volume_offline(struct ctlr_info *h,
25562551 unsigned char scsi3addr[])
25572552 {
25582553 struct CommandList *c;
@@ -2651,11 +2646,15 @@ static int hpsa_update_device_info(struct ctlr_info *h, · 92 unmodified lines
26512646
26522647 if (this_device->devtype == TYPE_DISK &&
26532648 is_logical_dev_addr_mode(scsi3addr)) {
2649+ int volume_offline;
2650+
26542651 hpsa_get_raid_level(h, scsi3addr, &this_device->raid_level);
26552652 if (h->fw_support & MISC_FW_RAID_OFFLOAD_BASIC)
26562653 hpsa_get_ioaccel_status(h, scsi3addr, this_device);
2657− this_device->volume_offline =
2658− hpsa_volume_offline(h, scsi3addr);
2654+ volume_offline = hpsa_volume_offline(h, scsi3addr);
2655+ if (volume_offline < 0 || volume_offline > 0xff)
2656+ volume_offline = HPSA_VPD_LV_STATUS_UNSUPPORTED;
2657+ this_device->volume_offline = volume_offline & 0xff;
26592658 } else {
26602659 this_device->raid_level = RAID_UNKNOWN;
26612660 this_device->offload_config = 0;
@@ -2861,26 +2860,20 @@ static int hpsa_get_pdisk_of_ioaccel2(struct ctlr_info *h, · 199 unmodified lines
28612860 nphysicals = be32_to_cpu(*((__be32 *)physicals->LUNListLength)) /
28622861 responsesize;
28632862
2864−
28652863 /* find ioaccel2 handle in list of physicals: */
28662864 for (i = 0; i < nphysicals; i++) {
2865+ struct ext_report_lun_entry *entry = &physicals->LUN[i];
2866+
28672867 /* handle is in bytes 28-31 of each lun */
2868− if (memcmp(&((struct ReportExtendedLUNdata *)
2869− physicals)->LUN[i][20], &find, 4) != 0) {
2868+ if (entry->ioaccel_handle != find)
28702869 continue; /* didn't match */
2871− }
28722870 found = 1;
2873− memcpy(scsi3addr, &((struct ReportExtendedLUNdata *)
2874− physicals)->LUN[i][0], 8);
2871+ memcpy(scsi3addr, entry->lunid, 8);
28752872 if (h->raid_offload_debug > 0)
28762873 dev_info(&h->pdev->dev,
2877− "%s: Searched h=0x%08x, Found h=0x%08x, scsiaddr 0x%02x%02x%02x%02x%02x%02x%02x%02x\n",
2874+ "%s: Searched h=0x%08x, Found h=0x%08x, scsiaddr 0x%8phN\n",
28782875 __func__, find,
2879− ((struct ReportExtendedLUNdata *)
2880− physicals)->LUN[i][20],
2881− scsi3addr[0], scsi3addr[1], scsi3addr[2],
2882− scsi3addr[3], scsi3addr[4], scsi3addr[5],
2883− scsi3addr[6], scsi3addr[7]);
2876+ entry->ioaccel_handle, scsi3addr);
28842877 break; /* found it */
28852878 }
28862879
@@ -2965,7 +2958,8 @@ u8 *figure_lunaddrbytes(struct ctlr_info *h, int raid_ctlr_position, int i, · 78 unmodified lines
29652958 return RAID_CTLR_LUNID;
29662959
29672960 if (i < logicals_start)
2968− return &physdev_list->LUN[i - (raid_ctlr_position == 0)][0];
2961+ return &physdev_list->LUN[i -
2962+ (raid_ctlr_position == 0)].lunid[0];
29692963
29702964 if (i < last_device)
29712965 return &logdev_list->LUN[i - nphysicals -
@@ -3074,7 +3068,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno) · 102 unmodified lines
30743068 ndev_allocated++;
30753069 }
30763070
3077− if (unlikely(is_scsi_rev_5(h)))
3071+ if (is_scsi_rev_5(h))
30783072 raid_ctlr_position = 0;
30793073 else
30803074 raid_ctlr_position = nphysicals + nlogicals;
@@ -3971,7 +3965,6 @@ static int hpsa_scsi_queue_command_lck(struct scsi_cmnd *cmd, · 890 unmodified lines
39713965 struct hpsa_scsi_dev_t *dev;
39723966 unsigned char scsi3addr[8];
39733967 struct CommandList *c;
3974− unsigned long flags;
39753968 int rc = 0;
39763969
39773970 /* Get the ptr to our adapter structure out of cmd->host. */
@@ -3984,14 +3977,11 @@ static int hpsa_scsi_queue_command_lck(struct scsi_cmnd *cmd, · 6 unmodified lines
39843977 }
39853978 memcpy(scsi3addr, dev->scsi3addr, sizeof(scsi3addr));
39863979
3987− spin_lock_irqsave(&h->lock, flags);
3988− if (unlikely(h->lockup_detected)) {
3989− spin_unlock_irqrestore(&h->lock, flags);
3980+ if (unlikely(lockup_detected(h))) {
39903981 cmd->result = DID_ERROR << 16;
39913982 done(cmd);
39923983 return 0;
39933984 }
3994− spin_unlock_irqrestore(&h->lock, flags);
39953985 c = cmd_alloc(h);
39963986 if (c == NULL) { /* trouble... */
39973987 dev_err(&h->pdev->dev, "cmd_alloc returned NULL!\n");
@@ -4103,16 +4093,13 @@ static int do_not_scan_if_controller_locked_up(struct ctlr_info *h) · 105 unmodified lines
41034093 * we can prevent new rescan threads from piling up on a
41044094 * locked up controller.
41054095 */
4106− spin_lock_irqsave(&h->lock, flags);
4107− if (unlikely(h->lockup_detected)) {
4108− spin_unlock_irqrestore(&h->lock, flags);
4096+ if (unlikely(lockup_detected(h))) {
41094097 spin_lock_irqsave(&h->scan_lock, flags);
41104098 h->scan_finished = 1;
41114099 wake_up_all(&h->scan_wait_queue);
41124100 spin_unlock_irqrestore(&h->scan_lock, flags);
41134101 return 1;
41144102 }
4115− spin_unlock_irqrestore(&h->lock, flags);
41164103 return 0;
41174104 }
41184105
@@ -4963,7 +4950,7 @@ static int hpsa_passthru_ioctl(struct ctlr_info *h, void __user *argp) · 844 unmodified lines
49634950 buff = kmalloc(iocommand.buf_size, GFP_KERNEL);
49644951 if (buff == NULL)
49654952 return -EFAULT;
4966− if (iocommand.Request.Type.Direction == XFER_WRITE) {
4953+ if (iocommand.Request.Type.Direction & XFER_WRITE) {
49674954 /* Copy the data into the buffer we created */
49684955 if (copy_from_user(buff, iocommand.buf,
49694956 iocommand.buf_size)) {
@@ -5026,7 +5013,7 @@ static int hpsa_passthru_ioctl(struct ctlr_info *h, void __user *argp) · 56 unmodified lines
50265013 rc = -EFAULT;
50275014 goto out;
50285015 }
5029− if (iocommand.Request.Type.Direction == XFER_READ &&
5016+ if ((iocommand.Request.Type.Direction & XFER_READ) &&
50305017 iocommand.buf_size > 0) {
50315018 /* Copy the data out of the buffer we created */
50325019 if (copy_to_user(iocommand.buf, buff, iocommand.buf_size)) {
@@ -5103,7 +5090,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp) · 70 unmodified lines
51035090 status = -ENOMEM;
51045091 goto cleanup1;
51055092 }
5106− if (ioc->Request.Type.Direction == XFER_WRITE) {
5093+ if (ioc->Request.Type.Direction & XFER_WRITE) {
51075094 if (copy_from_user(buff[sg_used], data_ptr, sz)) {
51085095 status = -ENOMEM;
51095096 goto cleanup1;
@@ -5155,7 +5142,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp) · 45 unmodified lines
51555142 status = -EFAULT;
51565143 goto cleanup0;
51575144 }
5158− if (ioc->Request.Type.Direction == XFER_READ && ioc->buf_size > 0) {
5145+ if ((ioc->Request.Type.Direction & XFER_READ) && ioc->buf_size > 0) {
51595146 /* Copy the data out of the buffer we created */
51605147 BYTE __user *ptr = ioc->buf;
51615148 for (i = 0; i < sg_used; i++) {
@@ -5459,13 +5446,12 @@ static void __iomem *remap_pci_mem(ulong base, ulong size) · 297 unmodified lines
54595446
54605447 /* Takes cmds off the submission queue and sends them to the hardware,
54615448 * then puts them on the queue of cmds waiting for completion.
5449+ * Assumes h->lock is held
54625450 */
5463−static void start_io(struct ctlr_info *h)
5451+static void start_io(struct ctlr_info *h, unsigned long *flags)
54645452 {
54655453 struct CommandList *c;
5466− unsigned long flags;
54675454
5468− spin_lock_irqsave(&h->lock, flags);
54695455 while (!list_empty(&h->reqQ)) {
54705456 c = list_entry(h->reqQ.next, struct CommandList, list);
54715457 /* can't do anything if fifo is full */
@@ -5488,14 +5474,20 @@ static void start_io(struct ctlr_info *h) · 16 unmodified lines
54885474 * condition.
54895475 */
54905476 h->commands_outstanding++;
5491− if (h->commands_outstanding > h->max_outstanding)
5492− h->max_outstanding = h->commands_outstanding;
54935477
54945478 /* Tell the controller execute command */
5495− spin_unlock_irqrestore(&h->lock, flags);
5479+ spin_unlock_irqrestore(&h->lock, *flags);
54965480 h->access.submit_command(h, c);
5497− spin_lock_irqsave(&h->lock, flags);
5481+ spin_lock_irqsave(&h->lock, *flags);
54985482 }
5483+}
5484+
5485+static void lock_and_start_io(struct ctlr_info *h)
5486+{
5487+ unsigned long flags;
5488+
5489+ spin_lock_irqsave(&h->lock, flags);
5490+ start_io(h, &flags);
54995491 spin_unlock_irqrestore(&h->lock, flags);
55005492 }
55015493
@@ -5563,7 +5555,7 @@ static inline void finish_cmd(struct CommandList *c) · 61 unmodified lines
55635555 else if (c->cmd_type == CMD_IOCTL_PEND)
55645556 complete(c->waiting);
55655557 if (unlikely(io_may_be_stalled))
5566− start_io(h);
5558+ lock_and_start_io(h);
55675559 }
55685560
55695561 static inline u32 hpsa_tag_contains_index(u32 tag)
@@ -5840,12 +5832,12 @@ static int hpsa_controller_hard_reset(struct pci_dev *pdev, · 270 unmodified lines
58405832 dev_info(&pdev->dev, "using doorbell to reset controller\n");
58415833 writel(use_doorbell, vaddr + SA5_DOORBELL);
58425834
5843− /* PMC hardware guys tell us we need a 5 second delay after
5835+ /* PMC hardware guys tell us we need a 10 second delay after
58445836 * doorbell reset and before any attempt to talk to the board
58455837 * at all to ensure that this actually works and doesn't fall
58465838 * over in some weird corner cases.
58475839 */
5848− msleep(5000);
5840+ msleep(10000);
58495841 } else { /* Try to do it the PCI power state way */
58505842
58515843 /* Quoting from the Open CISS Specification: "The Power
@@ -6166,6 +6158,8 @@ static void hpsa_interrupt_mode(struct ctlr_info *h) · 314 unmodified lines
61666158 if (pci_find_capability(h->pdev, PCI_CAP_ID_MSIX)) {
61676159 dev_info(&h->pdev->dev, "MSIX\n");
61686160 h->msix_vector = MAX_REPLY_QUEUES;
6161+ if (h->msix_vector > num_online_cpus())
6162+ h->msix_vector = num_online_cpus();
61696163 err = pci_enable_msix(h->pdev, hpsa_msix_entries,
61706164 h->msix_vector);
61716165 if (err > 0) {
@@ -6615,6 +6609,17 @@ static void hpsa_free_cmd_pool(struct ctlr_info *h) · 443 unmodified lines
66156609 h->ioaccel_cmd_pool, h->ioaccel_cmd_pool_dhandle);
66166610 }
66176611
6612+static void hpsa_irq_affinity_hints(struct ctlr_info *h)
6613+{
6614+ int i, cpu, rc;
6615+
6616+ cpu = cpumask_first(cpu_online_mask);
6617+ for (i = 0; i < h->msix_vector; i++) {
6618+ rc = irq_set_affinity_hint(h->intr[i], get_cpu_mask(cpu));
6619+ cpu = cpumask_next(cpu, cpu_online_mask);
6620+ }
6621+}
6622+
66186623 static int hpsa_request_irq(struct ctlr_info *h,
66196624 irqreturn_t (*msixhandler)(int, void *),
66206625 irqreturn_t (*intxhandler)(int, void *))
@@ -6634,6 +6639,7 @@ static int hpsa_request_irq(struct ctlr_info *h, · 13 unmodified lines
66346639 rc = request_irq(h->intr[i], msixhandler,
66356640 0, h->devname,
66366641 &h->q[i]);
6642+ hpsa_irq_affinity_hints(h);
66376643 } else {
66386644 /* Use single reply pool */
66396645 if (h->msix_vector > 0 || h->msi_vector) {
@@ -6685,12 +6691,15 @@ static void free_irqs(struct ctlr_info *h) · 45 unmodified lines
66856691 if (!h->msix_vector || h->intr_mode != PERF_MODE_INT) {
66866692 /* Single reply queue, only one irq to free */
66876693 i = h->intr_mode;
6694+ irq_set_affinity_hint(h->intr[i], NULL);
66886695 free_irq(h->intr[i], &h->q[i]);
66896696 return;
66906697 }
66916698
6692− for (i = 0; i < h->msix_vector; i++)
6699+ for (i = 0; i < h->msix_vector; i++) {
6700+ irq_set_affinity_hint(h->intr[i], NULL);
66936701 free_irq(h->intr[i], &h->q[i]);
6702+ }
66946703 }
66956704
66966705 static void hpsa_free_irqs_and_disable_msix(struct ctlr_info *h)
@@ -6707,6 +6716,20 @@ static void hpsa_free_irqs_and_disable_msix(struct ctlr_info *h) · 10 unmodified lines
67076716 #endif /* CONFIG_PCI_MSI */
67086717 }
67096718
6719+static void hpsa_free_reply_queues(struct ctlr_info *h)
6720+{
6721+ int i;
6722+
6723+ for (i = 0; i < h->nreply_queues; i++) {
6724+ if (!h->reply_queue[i].head)
6725+ continue;
6726+ pci_free_consistent(h->pdev, h->reply_queue_size,
6727+ h->reply_queue[i].head, h->reply_queue[i].busaddr);
6728+ h->reply_queue[i].head = NULL;
6729+ h->reply_queue[i].busaddr = 0;
6730+ }
6731+}
6732+
67106733 static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h)
67116734 {
67126735 hpsa_free_irqs_and_disable_msix(h);
@@ -6714,8 +6737,7 @@ static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h) · 1 unmodified line
67146737 hpsa_free_cmd_pool(h);
67156738 kfree(h->ioaccel1_blockFetchTable);
67166739 kfree(h->blockFetchTable);
6717− pci_free_consistent(h->pdev, h->reply_pool_size,
6718− h->reply_pool, h->reply_pool_dhandle);
6740+ hpsa_free_reply_queues(h);
67196741 if (h->vaddr)
67206742 iounmap(h->vaddr);
67216743 if (h->transtable)
@@ -6740,16 +6762,38 @@ static void fail_all_cmds_on_list(struct ctlr_info *h, struct list_head *list) · 18 unmodified lines
67406762 }
67416763 }
67426764
6765+static void set_lockup_detected_for_all_cpus(struct ctlr_info *h, u32 value)
6766+{
6767+ int i, cpu;
6768+
6769+ cpu = cpumask_first(cpu_online_mask);
6770+ for (i = 0; i < num_online_cpus(); i++) {
6771+ u32 *lockup_detected;
6772+ lockup_detected = per_cpu_ptr(h->lockup_detected, cpu);
6773+ *lockup_detected = value;
6774+ cpu = cpumask_next(cpu, cpu_online_mask);
6775+ }
6776+ wmb(); /* be sure the per-cpu variables are out to memory */
6777+}
6778+
67436779 static void controller_lockup_detected(struct ctlr_info *h)
67446780 {
67456781 unsigned long flags;
6782+ u32 lockup_detected;
67466783
67476784 h->access.set_intr_mask(h, HPSA_INTR_OFF);
67486785 spin_lock_irqsave(&h->lock, flags);
6749− h->lockup_detected = readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
6786+ lockup_detected = readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
6787+ if (!lockup_detected) {
6788+ /* no heartbeat, but controller gave us a zero. */
6789+ dev_warn(&h->pdev->dev,
6790+ "lockup detected but scratchpad register is zero\n");
6791+ lockup_detected = 0xffffffff;
6792+ }
6793+ set_lockup_detected_for_all_cpus(h, lockup_detected);
67506794 spin_unlock_irqrestore(&h->lock, flags);
67516795 dev_warn(&h->pdev->dev, "Controller lockup detected: 0x%08x\n",
6752− h->lockup_detected);
6796+ lockup_detected);
67536797 pci_disable_device(h->pdev);
67546798 spin_lock_irqsave(&h->lock, flags);
67556799 fail_all_cmds_on_list(h, &h->cmpQ);
@@ -6884,7 +6928,7 @@ static void hpsa_monitor_ctlr_worker(struct work_struct *work) · 128 unmodified lines
68846928 struct ctlr_info *h = container_of(to_delayed_work(work),
68856929 struct ctlr_info, monitor_ctlr_work);
68866930 detect_controller_lockup(h);
6887− if (h->lockup_detected)
6931+ if (lockup_detected(h))
68886932 return;
68896933
68906934 if (hpsa_ctlr_needs_rescan(h) || hpsa_offline_devices_ready(h)) {
@@ -6934,7 +6978,6 @@ reinit_after_soft_reset: · 43 unmodified lines
69346978 * the 5 lower bits of the address are used by the hardware. and by
69356979 * the driver. See comments in hpsa.h for more info.
69366980 */
6937−#define COMMANDLIST_ALIGNMENT 128
69386981 BUILD_BUG_ON(sizeof(struct CommandList) % COMMANDLIST_ALIGNMENT);
69396982 h = kzalloc(sizeof(*h), GFP_KERNEL);
69406983 if (!h)
@@ -6949,6 +6992,13 @@ reinit_after_soft_reset: · 8 unmodified lines
69496992 spin_lock_init(&h->offline_device_lock);
69506993 spin_lock_init(&h->scan_lock);
69516994 spin_lock_init(&h->passthru_count_lock);
6995+
6996+ /* Allocate and clear per-cpu variable lockup_detected */
6997+ h->lockup_detected = alloc_percpu(u32);
6998+ if (!h->lockup_detected)
6999+ goto clean1;
7000+ set_lockup_detected_for_all_cpus(h, 0);
7001+
69527002 rc = hpsa_pci_init(h);
69537003 if (rc != 0)
69547004 goto clean1;
@@ -7072,6 +7122,8 @@ clean4: · 117 unmodified lines
70727122 free_irqs(h);
70737123 clean2:
70747124 clean1:
7125+ if (h->lockup_detected)
7126+ free_percpu(h->lockup_detected);
70757127 kfree(h);
70767128 return rc;
70777129 }
@@ -7080,16 +7132,10 @@ static void hpsa_flush_cache(struct ctlr_info *h) · 2 unmodified lines
70807132 {
70817133 char *flush_buf;
70827134 struct CommandList *c;
7083− unsigned long flags;
70847135
70857136 /* Don't bother trying to flush the cache if locked up */
7086− spin_lock_irqsave(&h->lock, flags);
7087− if (unlikely(h->lockup_detected)) {
7088− spin_unlock_irqrestore(&h->lock, flags);
7137+ if (unlikely(lockup_detected(h)))
70897138 return;
7090− }
7091− spin_unlock_irqrestore(&h->lock, flags);
7092−
70937139 flush_buf = kzalloc(4, GFP_KERNEL);
70947140 if (!flush_buf)
70957141 return;
@@ -7165,8 +7211,7 @@ static void hpsa_remove_one(struct pci_dev *pdev) · 69 unmodified lines
71657211 pci_free_consistent(h->pdev,
71667212 h->nr_cmds * sizeof(struct ErrorInfo),
71677213 h->errinfo_pool, h->errinfo_pool_dhandle);
7168− pci_free_consistent(h->pdev, h->reply_pool_size,
7169− h->reply_pool, h->reply_pool_dhandle);
7214+ hpsa_free_reply_queues(h);
71707215 kfree(h->cmd_pool_bits);
71717216 kfree(h->blockFetchTable);
71727217 kfree(h->ioaccel1_blockFetchTable);
@@ -7174,6 +7219,7 @@ static void hpsa_remove_one(struct pci_dev *pdev) · 1 unmodified line
71747219 kfree(h->hba_inquiry_data);
71757220 pci_disable_device(pdev);
71767221 pci_release_regions(pdev);
7222+ free_percpu(h->lockup_detected);
71777223 kfree(h);
71787224 }
71797225
@@ -7278,8 +7324,16 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support) · 98 unmodified lines
72787324 * 10 = 6 s/g entry or 24k
72797325 */
72807326
7327+ /* If the controller supports either ioaccel method then
7328+ * we can also use the RAID stack submit path that does not
7329+ * perform the superfluous readl() after each command submission.
7330+ */
7331+ if (trans_support & (CFGTBL_Trans_io_accel1 | CFGTBL_Trans_io_accel2))
7332+ access = SA5_performant_access_no_read;
7333+
72817334 /* Controller spec: zero out this buffer. */
7282− memset(h->reply_pool, 0, h->reply_pool_size);
7335+ for (i = 0; i < h->nreply_queues; i++)
7336+ memset(h->reply_queue[i].head, 0, h->reply_queue_size);
72837337
72847338 bft[7] = SG_ENTRIES_IN_CMD + 4;
72857339 calc_bucket_map(bft, ARRAY_SIZE(bft),
@@ -7295,8 +7349,7 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support) · 9 unmodified lines
72957349
72967350 for (i = 0; i < h->nreply_queues; i++) {
72977351 writel(0, &h->transtable->RepQAddr[i].upper);
7298− writel(h->reply_pool_dhandle +
7299− (h->max_commands * sizeof(u64) * i),
7352+ writel(h->reply_queue[i].busaddr,
73007353 &h->transtable->RepQAddr[i].lower);
73017354 }
73027355
@@ -7344,8 +7397,10 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support) · 41 unmodified lines
73447397 h->ioaccel1_blockFetchTable);
73457398
73467399 /* initialize all reply queue entries to unused */
7347− memset(h->reply_pool, (u8) IOACCEL_MODE1_REPLY_UNUSED,
7348− h->reply_pool_size);
7400+ for (i = 0; i < h->nreply_queues; i++)
7401+ memset(h->reply_queue[i].head,
7402+ (u8) IOACCEL_MODE1_REPLY_UNUSED,
7403+ h->reply_queue_size);
73497404
73507405 /* set all the constant fields in the accelerator command
73517406 * frames once at init time to save CPU cycles later.
@@ -7407,7 +7462,6 @@ static int hpsa_alloc_ioaccel_cmd_and_bft(struct ctlr_info *h) · 55 unmodified lines
74077462 * because the 7 lower bits of the address are used by the
74087463 * hardware.
74097464 */
7410−#define IOACCEL1_COMMANDLIST_ALIGNMENT 128
74117465 BUILD_BUG_ON(sizeof(struct io_accel1_cmd) %
74127466 IOACCEL1_COMMANDLIST_ALIGNMENT);
74137467 h->ioaccel_cmd_pool =
@@ -7445,7 +7499,6 @@ static int ioaccel2_alloc_cmds_and_bft(struct ctlr_info *h) · 31 unmodified lines
74457499 if (h->ioaccel_maxsg > IOACCEL2_MAXSGENTRIES)
74467500 h->ioaccel_maxsg = IOACCEL2_MAXSGENTRIES;
74477501
7448−#define IOACCEL2_COMMANDLIST_ALIGNMENT 128
74497502 BUILD_BUG_ON(sizeof(struct io_accel2_cmd) %
74507503 IOACCEL2_COMMANDLIST_ALIGNMENT);
74517504 h->ioaccel2_cmd_pool =
@@ -7503,16 +7556,17 @@ static void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h) · 51 unmodified lines
75037556 }
75047557 }
75057558
7506− /* TODO, check that this next line h->nreply_queues is correct */
75077559 h->nreply_queues = h->msix_vector > 0 ? h->msix_vector : 1;
75087560 hpsa_get_max_perf_mode_cmds(h);
75097561 /* Performant mode ring buffer and supporting data structures */
7510− h->reply_pool_size = h->max_commands * sizeof(u64) * h->nreply_queues;
7511− h->reply_pool = pci_alloc_consistent(h->pdev, h->reply_pool_size,
7512− &(h->reply_pool_dhandle));
7562+ h->reply_queue_size = h->max_commands * sizeof(u64);
75137563
75147564 for (i = 0; i < h->nreply_queues; i++) {
7515− h->reply_queue[i].head = &h->reply_pool[h->max_commands * i];
7565+ h->reply_queue[i].head = pci_alloc_consistent(h->pdev,
7566+ h->reply_queue_size,
7567+ &(h->reply_queue[i].busaddr));
7568+ if (!h->reply_queue[i].head)
7569+ goto clean_up;
75167570 h->reply_queue[i].size = h->max_commands;
75177571 h->reply_queue[i].wraparound = 1; /* spec: init to 1 */
75187572 h->reply_queue[i].current_entry = 0;
@@ -7521,18 +7575,14 @@ static void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h) · 2 unmodified lines
75217575 /* Need a block fetch table for performant mode */
75227576 h->blockFetchTable = kmalloc(((SG_ENTRIES_IN_CMD + 1) *
75237577 sizeof(u32)), GFP_KERNEL);
7524−
7525− if ((h->reply_pool == NULL)
7526− || (h->blockFetchTable == NULL))
7578+ if (!h->blockFetchTable)
75277579 goto clean_up;
75287580
75297581 hpsa_enter_performant_mode(h, trans_support);
75307582 return;
75317583
75327584 clean_up:
7533− if (h->reply_pool)
7534− pci_free_consistent(h->pdev, h->reply_pool_size,
7535− h->reply_pool, h->reply_pool_dhandle);
7585+ hpsa_free_reply_queues(h);
75367586 kfree(h->blockFetchTable);
75377587 }
75387588
drivers/scsi/hpsa.h+22−20
@@ -57,11 +57,12 @@ struct hpsa_scsi_dev_t { · 56 unmodified lines
5757
5858 };
5959
60−struct reply_pool {
60+struct reply_queue_buffer {
6161 u64 *head;
6262 size_t size;
6363 u8 wraparound;
6464 u32 current_entry;
65+ dma_addr_t busaddr;
6566 };
6667
6768 #pragma pack(1)
@@ -116,11 +117,8 @@ struct ctlr_info { · 48 unmodified lines
116117 int nr_cmds; /* Number of commands allowed on this controller */
117118 struct CfgTable __iomem *cfgtable;
118119 int interrupts_enabled;
119− int major;
120120 int max_commands;
121121 int commands_outstanding;
122− int max_outstanding; /* Debug */
123− int usage_count; /* number of opens all all minor devices */
124122 # define PERF_MODE_INT 0
125123 # define DOORBELL_INT 1
126124 # define SIMPLE_MODE_INT 2
@@ -177,11 +175,9 @@ struct ctlr_info { · 50 unmodified lines
177175 /*
178176 * Performant mode completion buffers
179177 */
180− u64 *reply_pool;
181− size_t reply_pool_size;
182− struct reply_pool reply_queue[MAX_REPLY_QUEUES];
178+ size_t reply_queue_size;
179+ struct reply_queue_buffer reply_queue[MAX_REPLY_QUEUES];
183180 u8 nreply_queues;
184− dma_addr_t reply_pool_dhandle;
185181 u32 *blockFetchTable;
186182 u32 *ioaccel1_blockFetchTable;
187183 u32 *ioaccel2_blockFetchTable;
@@ -196,7 +192,7 @@ struct ctlr_info { · 8 unmodified lines
196192 u64 last_heartbeat_timestamp;
197193 u32 heartbeat_sample_interval;
198194 atomic_t firmware_flash_in_progress;
199− u32 lockup_detected;
195+ u32 *lockup_detected;
200196 struct delayed_work monitor_ctlr_work;
201197 int remove_in_progress;
202198 u32 fifo_recently_full;
@@ -233,11 +229,9 @@ struct ctlr_info { · 30 unmodified lines
233229 #define CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE (1 << 31)
234230
235231 #define RESCAN_REQUIRED_EVENT_BITS \
236− (CTLR_STATE_CHANGE_EVENT | \
237− CTLR_ENCLOSURE_HOT_PLUG_EVENT | \
232+ (CTLR_ENCLOSURE_HOT_PLUG_EVENT | \
238233 CTLR_STATE_CHANGE_EVENT_PHYSICAL_DRV | \
239234 CTLR_STATE_CHANGE_EVENT_LOGICAL_DRV | \
240− CTLR_STATE_CHANGE_EVENT_REDUNDANT_CNTRL | \
241235 CTLR_STATE_CHANGE_EVENT_AIO_ENABLED_DISABLED | \
242236 CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE)
243237 spinlock_t offline_device_lock;
@@ -346,22 +340,23 @@ struct offline_device_entry { · 102 unmodified lines
346340 static void SA5_submit_command(struct ctlr_info *h,
347341 struct CommandList *c)
348342 {
349− dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr,
350− c->Header.Tag.lower);
351343 writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
352344 (void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
353345 }
354346
347+static void SA5_submit_command_no_read(struct ctlr_info *h,
348+ struct CommandList *c)
349+{
350+ writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
351+}
352+
355353 static void SA5_submit_command_ioaccel2(struct ctlr_info *h,
356354 struct CommandList *c)
357355 {
358− dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr,
359− c->Header.Tag.lower);
360356 if (c->cmd_type == CMD_IOACCEL2)
361357 writel(c->busaddr, h->vaddr + IOACCEL2_INBOUND_POSTQ_32);
362358 else
363359 writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
364− (void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
365360 }
366361
367362 /*
@@ -399,7 +394,7 @@ static void SA5_performant_intr_mask(struct ctlr_info *h, unsigned long val) · 31 unmodified lines
399394
400395 static unsigned long SA5_performant_completed(struct ctlr_info *h, u8 q)
401396 {
402− struct reply_pool *rq = &h->reply_queue[q];
397+ struct reply_queue_buffer *rq = &h->reply_queue[q];
403398 unsigned long flags, register_value = FIFO_EMPTY;
404399
405400 /* msi auto clears the interrupt pending bit. */
@@ -478,7 +473,6 @@ static bool SA5_intr_pending(struct ctlr_info *h) · 72 unmodified lines
478473 {
479474 unsigned long register_value =
480475 readl(h->vaddr + SA5_INTR_STATUS);
481− dev_dbg(&h->pdev->dev, "intr_pending %lx\n", register_value);
482476 return register_value & SA5_INTR_PENDING;
483477 }
484478
@@ -515,7 +509,7 @@ static bool SA5_ioaccel_mode1_intr_pending(struct ctlr_info *h) · 30 unmodified lines
515509 static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
516510 {
517511 u64 register_value;
518− struct reply_pool *rq = &h->reply_queue[q];
512+ struct reply_queue_buffer *rq = &h->reply_queue[q];
519513 unsigned long flags;
520514
521515 BUG_ON(q >= h->nreply_queues);
@@ -573,6 +567,14 @@ static struct access_method SA5_performant_access = { · 51 unmodified lines
573567 SA5_performant_completed,
574568 };
575569
570+static struct access_method SA5_performant_access_no_read = {
571+ SA5_submit_command_no_read,
572+ SA5_performant_intr_mask,
573+ SA5_fifo_full,
574+ SA5_performant_intr_pending,
575+ SA5_performant_completed,
576+};
577+
576578 struct board_type {
577579 u32 board_id;
578580 char *product_name;
drivers/scsi/hpsa_cmd.h+19−30
@@ -151,7 +151,7 @@ · 150 unmodified lines
151151 #define HPSA_VPD_HEADER_SZ 4
152152
153153 /* Logical volume states */
154−#define HPSA_VPD_LV_STATUS_UNSUPPORTED -1
154+#define HPSA_VPD_LV_STATUS_UNSUPPORTED 0xff
155155 #define HPSA_LV_OK 0x0
156156 #define HPSA_LV_UNDERGOING_ERASE 0x0F
157157 #define HPSA_LV_UNDERGOING_RPI 0x12
@@ -238,11 +238,21 @@ struct ReportLUNdata { · 80 unmodified lines
238238 u8 LUN[HPSA_MAX_LUN][8];
239239 };
240240
241+struct ext_report_lun_entry {
242+ u8 lunid[8];
243+ u8 wwid[8];
244+ u8 device_type;
245+ u8 device_flags;
246+ u8 lun_count; /* multi-lun device, how many luns */
247+ u8 redundant_paths;
248+ u32 ioaccel_handle; /* ioaccel1 only uses lower 16 bits */
249+};
250+
241251 struct ReportExtendedLUNdata {
242252 u8 LUNListLength[4];
243253 u8 extended_response_flag;
244254 u8 reserved[3];
245− u8 LUN[HPSA_MAX_LUN][24];
255+ struct ext_report_lun_entry LUN[HPSA_MAX_LUN];
246256 };
247257
248258 struct SenseSubsystem_info {
@@ -375,6 +385,7 @@ struct ctlr_info; /* defined in hpsa.h */ · 126 unmodified lines
375385 * or a bus address.
376386 */
377387
388+#define COMMANDLIST_ALIGNMENT 128
378389 struct CommandList {
379390 struct CommandListHeader Header;
380391 struct RequestBlock Request;
@@ -389,21 +400,7 @@ struct CommandList { · 8 unmodified lines
389400 struct list_head list;
390401 struct completion *waiting;
391402 void *scsi_cmd;
392−
393−/* on 64 bit architectures, to get this to be 32-byte-aligned
394− * it so happens we need PAD_64 bytes of padding, on 32 bit systems,
395− * we need PAD_32 bytes of padding (see below). This does that.
396− * If it happens that 64 bit and 32 bit systems need different
397− * padding, PAD_32 and PAD_64 can be set independently, and.
398− * the code below will do the right thing.
399− */
400−#define IS_32_BIT ((8 - sizeof(long))/4)
401−#define IS_64_BIT (!IS_32_BIT)
402−#define PAD_32 (40)
403−#define PAD_64 (12)
404−#define COMMANDLIST_PAD (IS_32_BIT * PAD_32 + IS_64_BIT * PAD_64)
405− u8 pad[COMMANDLIST_PAD];
406−};
403+} __aligned(COMMANDLIST_ALIGNMENT);
407404
408405 /* Max S/G elements in I/O accelerator command */
409406 #define IOACCEL1_MAXSGENTRIES 24
@@ -413,6 +410,7 @@ struct CommandList { · 3 unmodified lines
413410 * Structure for I/O accelerator (mode 1) commands.
414411 * Note that this structure must be 128-byte aligned in size.
415412 */
413+#define IOACCEL1_COMMANDLIST_ALIGNMENT 128
416414 struct io_accel1_cmd {
417415 u16 dev_handle; /* 0x00 - 0x01 */
418416 u8 reserved1; /* 0x02 */
@@ -440,12 +438,7 @@ struct io_accel1_cmd { · 21 unmodified lines
440438 struct vals32 host_addr; /* 0x70 - 0x77 */
441439 u8 CISS_LUN[8]; /* 0x78 - 0x7F */
442440 struct SGDescriptor SG[IOACCEL1_MAXSGENTRIES];
443−#define IOACCEL1_PAD_64 0
444−#define IOACCEL1_PAD_32 0
445−#define IOACCEL1_PAD (IS_32_BIT * IOACCEL1_PAD_32 + \
446− IS_64_BIT * IOACCEL1_PAD_64)
447− u8 pad[IOACCEL1_PAD];
448−};
441+} __aligned(IOACCEL1_COMMANDLIST_ALIGNMENT);
449442
450443 #define IOACCEL1_FUNCTION_SCSIIO 0x00
451444 #define IOACCEL1_SGLOFFSET 32
@@ -510,14 +503,11 @@ struct io_accel2_scsi_response { · 58 unmodified lines
510503 u8 sense_data_buff[32]; /* sense/response data buffer */
511504 };
512505
513−#define IOACCEL2_64_PAD 76
514−#define IOACCEL2_32_PAD 76
515−#define IOACCEL2_PAD (IS_32_BIT * IOACCEL2_32_PAD + \
516− IS_64_BIT * IOACCEL2_64_PAD)
517506 /*
518507 * Structure for I/O accelerator (mode 2 or m2) commands.
519508 * Note that this structure must be 128-byte aligned in size.
520509 */
510+#define IOACCEL2_COMMANDLIST_ALIGNMENT 128
521511 struct io_accel2_cmd {
522512 u8 IU_type; /* IU Type */
523513 u8 direction; /* direction, memtype, and encryption */
@@ -544,8 +534,7 @@ struct io_accel2_cmd { · 20 unmodified lines
544534 u32 tweak_upper; /* Encryption tweak, upper 4 bytes */
545535 struct ioaccel2_sg_element sg[IOACCEL2_MAXSGENTRIES];
546536 struct io_accel2_scsi_response error_data;
547− u8 pad[IOACCEL2_PAD];
548−};
537+} __aligned(IOACCEL2_COMMANDLIST_ALIGNMENT);
549538
550539 /*
551540 * defines for Mode 2 command struct
@@ -636,7 +625,7 @@ struct TransTable_struct { · 84 unmodified lines
636625 u32 RepQCount;
637626 u32 RepQCtrAddrLow32;
638627 u32 RepQCtrAddrHigh32;
639−#define MAX_REPLY_QUEUES 8
628+#define MAX_REPLY_QUEUES 64
640629 struct vals32 RepQAddr[MAX_REPLY_QUEUES];
641630 };
642631
drivers/scsi/lpfc/lpfc.h+2−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
@@ -640,6 +640,7 @@ struct lpfc_hba { · 632 unmodified lines
640640 #define HBA_DEVLOSS_TMO 0x2000 /* HBA in devloss timeout */
641641 #define HBA_RRQ_ACTIVE 0x4000 /* process the rrq active list */
642642 #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 */
643644 uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/
644645 struct lpfc_dmabuf slim2p;
645646
drivers/scsi/lpfc/lpfc_attr.c+14−9
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
@@ -919,10 +919,15 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode) · 911 unmodified lines
919919 phba->cfg_sriov_nr_virtfn = 0;
920920 }
921921
922+ if (opcode == LPFC_FW_DUMP)
923+ phba->hba_flag |= HBA_FW_DUMP_OP;
924+
922925 status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE);
923926
924− if (status != 0)
927+ if (status != 0) {
928+ phba->hba_flag &= ~HBA_FW_DUMP_OP;
925929 return status;
930+ }
926931
927932 /* wait for the device to be quiesced before firmware reset */
928933 msleep(100);
@@ -2364,7 +2369,7 @@ lpfc_oas_tgt_store(struct device *dev, struct device_attribute *attr, · 1435 unmodified lines
23642369 uint8_t wwpn[WWN_SZ];
23652370 int rc;
23662371
2367− if (!phba->cfg_EnableXLane)
2372+ if (!phba->cfg_fof)
23682373 return -EPERM;
23692374
23702375 /* count may include a LF at end of string */
@@ -2432,7 +2437,7 @@ lpfc_oas_vpt_store(struct device *dev, struct device_attribute *attr, · 61 unmodified lines
24322437 uint8_t wwpn[WWN_SZ];
24332438 int rc;
24342439
2435− if (!phba->cfg_EnableXLane)
2440+ if (!phba->cfg_fof)
24362441 return -EPERM;
24372442
24382443 /* 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, · 60 unmodified lines
24992504 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
25002505 int val = 0;
25012506
2502− if (!phba->cfg_EnableXLane)
2507+ if (!phba->cfg_fof)
25032508 return -EPERM;
25042509
25052510 if (!isdigit(buf[0]))
@@ -2565,7 +2570,7 @@ lpfc_oas_lun_state_set(struct lpfc_hba *phba, uint8_t vpt_wwpn[], · 59 unmodified lines
25652570
25662571 int rc = 0;
25672572
2568− if (!phba->cfg_EnableXLane)
2573+ if (!phba->cfg_fof)
25692574 return -EPERM;
25702575
25712576 if (oas_state) {
@@ -2670,7 +2675,7 @@ lpfc_oas_lun_show(struct device *dev, struct device_attribute *attr, · 98 unmodified lines
26702675 uint64_t oas_lun;
26712676 int len = 0;
26722677
2673− if (!phba->cfg_EnableXLane)
2678+ if (!phba->cfg_fof)
26742679 return -EPERM;
26752680
26762681 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, · 39 unmodified lines
27162721 uint64_t scsi_lun;
27172722 ssize_t rc;
27182723
2719− if (!phba->cfg_EnableXLane)
2724+ if (!phba->cfg_fof)
27202725 return -EPERM;
27212726
27222727 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."); · 1932 unmodified lines
46554660 # 0x0 - 0x7f = CS_CTL field in FC header (high 7 bits)
46564661 # Value range is [0x0,0x7f]. Default value is 0
46574662 */
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.");
46594664
46604665 /*
46614666 # lpfc_enable_bg: Enable BlockGuard (Emulex's Implementation of T10-DIF)
drivers/scsi/lpfc/lpfc_bsg.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2009-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2009-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * *
drivers/scsi/lpfc/lpfc_bsg.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2010-2012 Emulex. All rights reserved. *
4+ * Copyright (C) 2010-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * *
drivers/scsi/lpfc/lpfc_crtn.h+5−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * *
@@ -289,6 +289,7 @@ int lpfc_sli_issue_iocb(struct lpfc_hba *, uint32_t, · 281 unmodified lines
289289 void lpfc_sli_pcimem_bcopy(void *, void *, uint32_t);
290290 void lpfc_sli_bemem_bcopy(void *, void *, uint32_t);
291291 void lpfc_sli_abort_iocb_ring(struct lpfc_hba *, struct lpfc_sli_ring *);
292+void lpfc_sli_abort_fcp_rings(struct lpfc_hba *phba);
292293 void lpfc_sli_hba_iocb_abort(struct lpfc_hba *);
293294 void lpfc_sli_flush_fcp_rings(struct lpfc_hba *);
294295 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 *, · 15 unmodified lines
310311 int lpfc_sli_sum_iocb(struct lpfc_vport *, uint16_t, uint64_t, lpfc_ctx_cmd);
311312 int lpfc_sli_abort_iocb(struct lpfc_vport *, struct lpfc_sli_ring *, uint16_t,
312313 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);
313317
314318 void lpfc_mbox_timeout(unsigned long);
315319 void lpfc_mbox_timeout_handler(struct lpfc_hba *);
drivers/scsi/lpfc/lpfc_debugfs.c+2−2
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2007-2012 Emulex. All rights reserved. *
4+ * Copyright (C) 2007-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * *
@@ -2314,7 +2314,7 @@ proc_cq: · 2306 unmodified lines
23142314 goto too_big;
23152315 }
23162316
2317− if (phba->cfg_EnableXLane) {
2317+ if (phba->cfg_fof) {
23182318
23192319 /* OAS CQ */
23202320 qp = phba->sli4_hba.oas_cq;
drivers/scsi/lpfc/lpfc_els.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
drivers/scsi/lpfc/lpfc_hbadisc.c+4−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
@@ -5634,6 +5634,9 @@ lpfc_nlp_init(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 5626 unmodified lines
56345634 ndlp->active_rrqs_xri_bitmap =
56355635 mempool_alloc(vport->phba->active_rrq_pool,
56365636 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);
56375640 }
56385641
56395642
drivers/scsi/lpfc/lpfc_hw.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * *
drivers/scsi/lpfc/lpfc_hw4.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2009-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2009-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * *
drivers/scsi/lpfc/lpfc_init.c+180−78
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
@@ -820,57 +820,153 @@ lpfc_hba_down_prep(struct lpfc_hba *phba) · 812 unmodified lines
820820 }
821821
822822 /**
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+ *
824826 * @phba: pointer to lpfc HBA data structure.
825827 *
826− * This routine will do uninitialization after the HBA is reset when bring
827− * down the SLI Layer.
828+ * This routine will cleanup completed slow path events after HBA is reset
829+ * when bringing down the SLI Layer.
830+ *
828831 *
829832 * Return codes
830− * 0 - success.
831− * Any other value - error.
833+ * void.
832834 **/
833−static int
834−lpfc_hba_down_post_s3(struct lpfc_hba *phba)
835+static void
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)
835881 {
836882 struct lpfc_sli *psli = &phba->sli;
837883 struct lpfc_sli_ring *pring;
838884 struct lpfc_dmabuf *mp, *next_mp;
839− LIST_HEAD(completions);
840− int i;
885+ LIST_HEAD(buflist);
886+ int count;
841887
842888 if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED)
843889 lpfc_sli_hbqbuf_free_all(phba);
844890 else {
845891 /* Cleanup preposted buffers on the ELS ring */
846892 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) {
848899 list_del(&mp->list);
849− pring->postbufq_cnt--;
900+ count++;
850901 lpfc_mbuf_free(phba, mp->virt, mp->phys);
851902 kfree(mp);
852903 }
904+
905+ spin_lock_irq(&phba->hbalock);
906+ pring->postbufq_cnt -= count;
907+ spin_unlock_irq(&phba->hbalock);
853908 }
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;
854928
855− spin_lock_irq(&phba->hbalock);
856929 for (i = 0; i < psli->num_rings; i++) {
857930 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);
859935 /* At this point in time the HBA is either reset or DOA. Either
860936 * way, nothing should be on txcmplq as it will NEVER complete.
861937 */
862938 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);
864945
865946 /* Cancel all the IOCBs from the completions list */
866947 lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
867948 IOERR_SLI_ABORTED);
868−
869949 lpfc_sli_abort_iocb_ring(phba, pring);
870− spin_lock_irq(&phba->hbalock);
871950 }
872− spin_unlock_irq(&phba->hbalock);
951+}
873952
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);
874970 return 0;
875971 }
876972
@@ -890,13 +986,12 @@ lpfc_hba_down_post_s4(struct lpfc_hba *phba) · 13 unmodified lines
890986 {
891987 struct lpfc_scsi_buf *psb, *psb_next;
892988 LIST_HEAD(aborts);
893− int ret;
894989 unsigned long iflag = 0;
895990 struct lpfc_sglq *sglq_entry = NULL;
896991
897− ret = lpfc_hba_down_post_s3(phba);
898− if (ret)
899− return ret;
992+ lpfc_hba_free_post_buf(phba);
993+ lpfc_hba_clean_txcmplq(phba);
994+
900995 /* At this point in time the HBA is either reset or DOA. Either
901996 * way, nothing should be on lpfc_abts_els_sgl_list, it needs to be
902997 * 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) · 29 unmodified lines
9321027 spin_lock_irqsave(&phba->scsi_buf_list_put_lock, iflag);
9331028 list_splice(&aborts, &phba->lpfc_scsi_buf_list_put);
9341029 spin_unlock_irqrestore(&phba->scsi_buf_list_put_lock, iflag);
1030+
1031+ lpfc_sli4_free_sp_events(phba);
9351032 return 0;
9361033 }
9371034
@@ -1250,7 +1347,6 @@ static void · 312 unmodified lines
12501347 lpfc_handle_deferred_eratt(struct lpfc_hba *phba)
12511348 {
12521349 uint32_t old_host_status = phba->work_hs;
1253− struct lpfc_sli_ring *pring;
12541350 struct lpfc_sli *psli = &phba->sli;
12551351
12561352 /* If the pci channel is offline, ignore possible errors,
@@ -1279,8 +1375,7 @@ lpfc_handle_deferred_eratt(struct lpfc_hba *phba) · 22 unmodified lines
12791375 * dropped by the firmware. Error iocb (I/O) on txcmplq and let the
12801376 * SCSI layer retry it after re-establishing link.
12811377 */
1282− pring = &psli->ring[psli->fcp_ring];
1283− lpfc_sli_abort_iocb_ring(phba, pring);
1378+ lpfc_sli_abort_fcp_rings(phba);
12841379
12851380 /*
12861381 * There was a firmware error. Take the hba offline and then
@@ -1348,7 +1443,6 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba) · 61 unmodified lines
13481443 {
13491444 struct lpfc_vport *vport = phba->pport;
13501445 struct lpfc_sli *psli = &phba->sli;
1351− struct lpfc_sli_ring *pring;
13521446 uint32_t event_data;
13531447 unsigned long temperature;
13541448 struct temp_event temp_event_data;
@@ -1400,8 +1494,7 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba) · 45 unmodified lines
14001494 * Error iocb (I/O) on txcmplq and let the SCSI layer
14011495 * retry it after re-establishing link.
14021496 */
1403− pring = &psli->ring[psli->fcp_ring];
1404− lpfc_sli_abort_iocb_ring(phba, pring);
1497+ lpfc_sli_abort_fcp_rings(phba);
14051498
14061499 /*
14071500 * 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) · 532 unmodified lines
19402033
19412034 switch (dev_id) {
19422035 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"};
19442038 break;
19452039 case PCI_DEVICE_ID_SUPERFLY:
19462040 if (vp->rev.biuRev >= 1 && vp->rev.biuRev <= 3)
1947− m = (typeof(m)){"LP7000", "PCI",
1948− "Fibre Channel Adapter"};
2041+ m = (typeof(m)){"LP7000", "PCI", ""};
19492042 else
1950− m = (typeof(m)){"LP7000E", "PCI",
1951− "Fibre Channel Adapter"};
2043+ m = (typeof(m)){"LP7000E", "PCI", ""};
2044+ m.function = "Obsolete, Unsupported Fibre Channel Adapter";
19522045 break;
19532046 case PCI_DEVICE_ID_DRAGONFLY:
19542047 m = (typeof(m)){"LP8000", "PCI",
1955− "Fibre Channel Adapter"};
2048+ "Obsolete, Unsupported Fibre Channel Adapter"};
19562049 break;
19572050 case PCI_DEVICE_ID_CENTAUR:
19582051 if (FC_JEDEC_ID(vp->rev.biuRev) == CENTAUR_2G_JEDEC_ID)
1959− m = (typeof(m)){"LP9002", "PCI",
1960− "Fibre Channel Adapter"};
2052+ m = (typeof(m)){"LP9002", "PCI", ""};
19612053 else
1962− m = (typeof(m)){"LP9000", "PCI",
1963− "Fibre Channel Adapter"};
2054+ m = (typeof(m)){"LP9000", "PCI", ""};
2055+ m.function = "Obsolete, Unsupported Fibre Channel Adapter";
19642056 break;
19652057 case PCI_DEVICE_ID_RFLY:
19662058 m = (typeof(m)){"LP952", "PCI",
1967− "Fibre Channel Adapter"};
2059+ "Obsolete, Unsupported Fibre Channel Adapter"};
19682060 break;
19692061 case PCI_DEVICE_ID_PEGASUS:
19702062 m = (typeof(m)){"LP9802", "PCI-X",
1971− "Fibre Channel Adapter"};
2063+ "Obsolete, Unsupported Fibre Channel Adapter"};
19722064 break;
19732065 case PCI_DEVICE_ID_THOR:
19742066 m = (typeof(m)){"LP10000", "PCI-X",
1975− "Fibre Channel Adapter"};
2067+ "Obsolete, Unsupported Fibre Channel Adapter"};
19762068 break;
19772069 case PCI_DEVICE_ID_VIPER:
19782070 m = (typeof(m)){"LPX1000", "PCI-X",
1979− "Fibre Channel Adapter"};
2071+ "Obsolete, Unsupported Fibre Channel Adapter"};
19802072 break;
19812073 case PCI_DEVICE_ID_PFLY:
19822074 m = (typeof(m)){"LP982", "PCI-X",
1983− "Fibre Channel Adapter"};
2075+ "Obsolete, Unsupported Fibre Channel Adapter"};
19842076 break;
19852077 case PCI_DEVICE_ID_TFLY:
19862078 m = (typeof(m)){"LP1050", "PCI-X",
1987− "Fibre Channel Adapter"};
2079+ "Obsolete, Unsupported Fibre Channel Adapter"};
19882080 break;
19892081 case PCI_DEVICE_ID_HELIOS:
19902082 m = (typeof(m)){"LP11000", "PCI-X2",
1991− "Fibre Channel Adapter"};
2083+ "Obsolete, Unsupported Fibre Channel Adapter"};
19922084 break;
19932085 case PCI_DEVICE_ID_HELIOS_SCSP:
19942086 m = (typeof(m)){"LP11000-SP", "PCI-X2",
1995− "Fibre Channel Adapter"};
2087+ "Obsolete, Unsupported Fibre Channel Adapter"};
19962088 break;
19972089 case PCI_DEVICE_ID_HELIOS_DCSP:
19982090 m = (typeof(m)){"LP11002-SP", "PCI-X2",
1999− "Fibre Channel Adapter"};
2091+ "Obsolete, Unsupported Fibre Channel Adapter"};
20002092 break;
20012093 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"};
20032096 break;
20042097 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"};
20062100 break;
20072101 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"};
20092104 break;
20102105 case PCI_DEVICE_ID_BMID:
20112106 m = (typeof(m)){"LP1150", "PCI-X2", "Fibre Channel Adapter"};
20122107 break;
20132108 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"};
20152111 break;
20162112 case PCI_DEVICE_ID_ZEPHYR:
20172113 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) · 12 unmodified lines
20302126 m = (typeof(m)){"LPe111", "PCIe", "Fibre Channel Adapter"};
20312127 break;
20322128 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"};
20342131 break;
20352132 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"};
20372135 break;
20382136 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"};
20402139 break;
20412140 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"};
20432143 break;
20442144 case PCI_DEVICE_ID_SAT:
20452145 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) · 14 unmodified lines
20602160 m = (typeof(m)){"LPe12000-S", "PCIe", "Fibre Channel Adapter"};
20612161 break;
20622162 case PCI_DEVICE_ID_HORNET:
2063− m = (typeof(m)){"LP21000", "PCIe", "FCoE Adapter"};
2163+ m = (typeof(m)){"LP21000", "PCIe",
2164+ "Obsolete, Unsupported FCoE Adapter"};
20642165 GE = 1;
20652166 break;
20662167 case PCI_DEVICE_ID_PROTEUS_VF:
20672168 m = (typeof(m)){"LPev12000", "PCIe IOV",
2068− "Fibre Channel Adapter"};
2169+ "Obsolete, Unsupported Fibre Channel Adapter"};
20692170 break;
20702171 case PCI_DEVICE_ID_PROTEUS_PF:
20712172 m = (typeof(m)){"LPev12000", "PCIe IOV",
2072− "Fibre Channel Adapter"};
2173+ "Obsolete, Unsupported Fibre Channel Adapter"};
20732174 break;
20742175 case PCI_DEVICE_ID_PROTEUS_S:
20752176 m = (typeof(m)){"LPemv12002-S", "PCIe IOV",
2076− "Fibre Channel Adapter"};
2177+ "Obsolete, Unsupported Fibre Channel Adapter"};
20772178 break;
20782179 case PCI_DEVICE_ID_TIGERSHARK:
20792180 oneConnect = 1;
@@ -2089,17 +2190,24 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) · 9 unmodified lines
20892190 break;
20902191 case PCI_DEVICE_ID_BALIUS:
20912192 m = (typeof(m)){"LPVe12002", "PCIe Shared I/O",
2092− "Fibre Channel Adapter"};
2193+ "Obsolete, Unsupported Fibre Channel Adapter"};
20932194 break;
20942195 case PCI_DEVICE_ID_LANCER_FC:
2095− case PCI_DEVICE_ID_LANCER_FC_VF:
20962196 m = (typeof(m)){"LPe16000", "PCIe", "Fibre Channel Adapter"};
20972197 break;
2198+ case PCI_DEVICE_ID_LANCER_FC_VF:
2199+ m = (typeof(m)){"LPe16000", "PCIe",
2200+ "Obsolete, Unsupported Fibre Channel Adapter"};
2201+ break;
20982202 case PCI_DEVICE_ID_LANCER_FCOE:
2099− case PCI_DEVICE_ID_LANCER_FCOE_VF:
21002203 oneConnect = 1;
21012204 m = (typeof(m)){"OCe15100", "PCIe", "FCoE"};
21022205 break;
2206+ case PCI_DEVICE_ID_LANCER_FCOE_VF:
2207+ oneConnect = 1;
2208+ m = (typeof(m)){"OCe15100", "PCIe",
2209+ "Obsolete, Unsupported FCoE"};
2210+ break;
21032211 case PCI_DEVICE_ID_SKYHAWK:
21042212 case PCI_DEVICE_ID_SKYHAWK_VF:
21052213 oneConnect = 1;
@@ -4614,7 +4722,10 @@ lpfc_reset_hba(struct lpfc_hba *phba) · 2508 unmodified lines
46144722 phba->link_state = LPFC_HBA_ERROR;
46154723 return;
46164724 }
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);
46184729 lpfc_offline(phba);
46194730 lpfc_sli_brdrestart(phba);
46204731 lpfc_online(phba);
@@ -9663,9 +9774,6 @@ lpfc_pci_resume_one_s3(struct pci_dev *pdev) · 5042 unmodified lines
96639774 static void
96649775 lpfc_sli_prep_dev_for_recover(struct lpfc_hba *phba)
96659776 {
9666− struct lpfc_sli *psli = &phba->sli;
9667− struct lpfc_sli_ring *pring;
9668−
96699777 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
96709778 "2723 PCI channel I/O abort preparing for recovery\n");
96719779
@@ -9673,8 +9781,7 @@ lpfc_sli_prep_dev_for_recover(struct lpfc_hba *phba) · 1 unmodified line
96739781 * There may be errored I/Os through HBA, abort all I/Os on txcmplq
96749782 * and let the SCSI mid-layer to retry them to recover.
96759783 */
9676− pring = &psli->ring[psli->fcp_ring];
9677− lpfc_sli_abort_iocb_ring(phba, pring);
9784+ lpfc_sli_abort_fcp_rings(phba);
96789785 }
96799786
96809787 /**
@@ -10417,17 +10524,13 @@ lpfc_pci_resume_one_s4(struct pci_dev *pdev) · 736 unmodified lines
1041710524 static void
1041810525 lpfc_sli4_prep_dev_for_recover(struct lpfc_hba *phba)
1041910526 {
10420− struct lpfc_sli *psli = &phba->sli;
10421− struct lpfc_sli_ring *pring;
10422−
1042310527 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1042410528 "2828 PCI channel I/O abort preparing for recovery\n");
1042510529 /*
1042610530 * There may be errored I/Os through HBA, abort all I/Os on txcmplq
1042710531 * and let the SCSI mid-layer to retry them to recover.
1042810532 */
10429− pring = &psli->ring[psli->fcp_ring];
10430− lpfc_sli_abort_iocb_ring(phba, pring);
10533+ lpfc_sli_abort_fcp_rings(phba);
1043110534 }
1043210535
1043310536 /**
@@ -10898,7 +11001,7 @@ lpfc_sli4_oas_verify(struct lpfc_hba *phba) · 464 unmodified lines
1089811001 if (phba->sli4_hba.pc_sli4_params.oas_supported) {
1089911002 phba->cfg_fof = 1;
1090011003 } else {
10901− phba->cfg_EnableXLane = 0;
11004+ phba->cfg_fof = 0;
1090211005 if (phba->device_data_mem_pool)
1090311006 mempool_destroy(phba->device_data_mem_pool);
1090411007 phba->device_data_mem_pool = NULL;
@@ -10928,7 +11031,7 @@ lpfc_fof_queue_setup(struct lpfc_hba *phba) · 23 unmodified lines
1092811031 if (rc)
1092911032 return -ENOMEM;
1093011033
10931− if (phba->cfg_EnableXLane) {
11034+ if (phba->cfg_fof) {
1093211035
1093311036 rc = lpfc_cq_create(phba, phba->sli4_hba.oas_cq,
1093411037 phba->sli4_hba.fof_eq, LPFC_WCQ, LPFC_FCP);
@@ -10947,8 +11050,7 @@ lpfc_fof_queue_setup(struct lpfc_hba *phba) · 12 unmodified lines
1094711050 return 0;
1094811051
1094911052 out_oas_wq:
10950− if (phba->cfg_EnableXLane)
10951− lpfc_cq_destroy(phba, phba->sli4_hba.oas_cq);
11053+ lpfc_cq_destroy(phba, phba->sli4_hba.oas_cq);
1095211054 out_oas_cq:
1095311055 lpfc_eq_destroy(phba, phba->sli4_hba.fof_eq);
1095411056 return rc;
@@ -10982,7 +11084,7 @@ lpfc_fof_queue_create(struct lpfc_hba *phba) · 27 unmodified lines
1098211084
1098311085 phba->sli4_hba.fof_eq = qdesc;
1098411086
10985− if (phba->cfg_EnableXLane) {
11087+ if (phba->cfg_fof) {
1098611088
1098711089 /* Create OAS CQ */
1098811090 qdesc = lpfc_sli4_queue_alloc(phba, phba->sli4_hba.cq_esize,
drivers/scsi/lpfc/lpfc_mem.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2012 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
drivers/scsi/lpfc/lpfc_scsi.c+44−16
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
@@ -73,7 +73,7 @@ lpfc_rport_data_from_scsi_device(struct scsi_device *sdev) · 65 unmodified lines
7373 {
7474 struct lpfc_vport *vport = (struct lpfc_vport *)sdev->host->hostdata;
7575
76− if (vport->phba->cfg_EnableXLane)
76+ if (vport->phba->cfg_fof)
7777 return ((struct lpfc_device_data *)sdev->hostdata)->rport_data;
7878 else
7979 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) · 3382 unmodified lines
34623462 * If the OAS driver feature is enabled and the lun is enabled for
34633463 * OAS, set the oas iocb related flags.
34643464 */
3465− if ((phba->cfg_EnableXLane) && ((struct lpfc_device_data *)
3465+ if ((phba->cfg_fof) && ((struct lpfc_device_data *)
34663466 scsi_cmnd->device->hostdata)->oas_enabled)
34673467 lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_OAS;
34683468 return 0;
@@ -4314,6 +4314,7 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, · 845 unmodified lines
43144314 fcp_cmnd->fcpCntl1 = SIMPLE_Q;
43154315
43164316 sli4 = (phba->sli_rev == LPFC_SLI_REV4);
4317+ piocbq->iocb.un.fcpi.fcpi_XRdy = 0;
43174318
43184319 /*
43194320 * There are three possibilities here - use scatter-gather segment, use
@@ -4782,7 +4783,9 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) · 462 unmodified lines
47824783 struct lpfc_scsi_buf *lpfc_cmd;
47834784 IOCB_t *cmd, *icmd;
47844785 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;
47864789 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waitq);
47874790
47884791 status = fc_block_scsi_eh(cmnd);
@@ -4833,6 +4836,14 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) · 44 unmodified lines
48334836
48344837 BUG_ON(iocb->context1 != lpfc_cmd);
48354838
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+
48364847 abtsiocb = __lpfc_sli_get_iocbq(phba);
48374848 if (abtsiocb == NULL) {
48384849 ret = FAILED;
@@ -4871,11 +4882,23 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) · 32 unmodified lines
48714882
48724883 abtsiocb->iocb_cmpl = lpfc_sli_abort_fcp_cmpl;
48734884 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+ }
48744897 /* no longer need the lock after this point */
48754898 spin_unlock_irqrestore(&phba->hbalock, flags);
48764899
4877− if (lpfc_sli_issue_iocb(phba, LPFC_FCP_RING, abtsiocb, 0) ==
4878− IOCB_ERROR) {
4900+
4901+ if (ret_val == IOCB_ERROR) {
48794902 lpfc_sli_release_iocbq(phba, abtsiocb);
48804903 ret = FAILED;
48814904 goto out;
@@ -4885,12 +4908,16 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) · 3 unmodified lines
48854908 lpfc_sli_handle_fast_ring_event(phba,
48864909 &phba->sli.ring[LPFC_FCP_RING], HA_R0RE_REQ);
48874910
4911+wait_for_cmpl:
48884912 lpfc_cmd->waitq = &waitq;
48894913 /* Wait for abort to complete */
48904914 wait_event_timeout(waitq,
48914915 (lpfc_cmd->pCmd != cmnd),
48924916 msecs_to_jiffies(2*vport->cfg_devloss_tmo*1000));
4917+
4918+ spin_lock_irqsave(shost->host_lock, flags);
48934919 lpfc_cmd->waitq = NULL;
4920+ spin_unlock_irqrestore(shost->host_lock, flags);
48944921
48954922 if (lpfc_cmd->pCmd == cmnd) {
48964923 ret = FAILED;
@@ -5172,8 +5199,9 @@ lpfc_reset_flush_io_context(struct lpfc_vport *vport, uint16_t tgt_id, · 275 unmodified lines
51725199
51735200 cnt = lpfc_sli_sum_iocb(vport, tgt_id, lun_id, context);
51745201 if (cnt)
5175− lpfc_sli_abort_iocb(vport, &phba->sli.ring[phba->sli.fcp_ring],
5176− tgt_id, lun_id, context);
5202+ lpfc_sli_abort_taskmgmt(vport,
5203+ &phba->sli.ring[phba->sli.fcp_ring],
5204+ tgt_id, lun_id, context);
51775205 later = msecs_to_jiffies(2 * vport->cfg_devloss_tmo * 1000) + jiffies;
51785206 while (time_after(later, jiffies) && cnt) {
51795207 schedule_timeout_uninterruptible(msecs_to_jiffies(20));
@@ -5491,7 +5519,7 @@ lpfc_slave_alloc(struct scsi_device *sdev) · 311 unmodified lines
54915519 if (!rport || fc_remote_port_chkready(rport))
54925520 return -ENXIO;
54935521
5494− if (phba->cfg_EnableXLane) {
5522+ if (phba->cfg_fof) {
54955523
54965524 /*
54975525 * Check to see if the device data structure for the lun
@@ -5616,7 +5644,7 @@ lpfc_slave_destroy(struct scsi_device *sdev) · 118 unmodified lines
56165644 struct lpfc_device_data *device_data = sdev->hostdata;
56175645
56185646 atomic_dec(&phba->sdev_cnt);
5619− if ((phba->cfg_EnableXLane) && (device_data)) {
5647+ if ((phba->cfg_fof) && (device_data)) {
56205648 spin_lock_irqsave(&phba->devicelock, flags);
56215649 device_data->available = false;
56225650 if (!device_data->oas_enabled)
@@ -5655,7 +5683,7 @@ lpfc_create_device_data(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn, · 32 unmodified lines
56555683 int memory_flags;
56565684
56575685 if (unlikely(!phba) || !vport_wwpn || !target_wwpn ||
5658− !(phba->cfg_EnableXLane))
5686+ !(phba->cfg_fof))
56595687 return NULL;
56605688
56615689 /* Attempt to create the device data to contain lun info */
@@ -5693,7 +5721,7 @@ lpfc_delete_device_data(struct lpfc_hba *phba, · 31 unmodified lines
56935721 {
56945722
56955723 if (unlikely(!phba) || !lun_info ||
5696− !(phba->cfg_EnableXLane))
5724+ !(phba->cfg_fof))
56975725 return;
56985726
56995727 if (!list_empty(&lun_info->listentry))
@@ -5727,7 +5755,7 @@ __lpfc_get_device_data(struct lpfc_hba *phba, struct list_head *list, · 27 unmodified lines
57275755 struct lpfc_device_data *lun_info;
57285756
57295757 if (unlikely(!phba) || !list || !vport_wwpn || !target_wwpn ||
5730− !phba->cfg_EnableXLane)
5758+ !phba->cfg_fof)
57315759 return NULL;
57325760
57335761 /* 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, · 55 unmodified lines
57895817 !starting_lun || !found_vport_wwpn ||
57905818 !found_target_wwpn || !found_lun || !found_lun_status ||
57915819 (*starting_lun == NO_MORE_OAS_LUN) ||
5792− !phba->cfg_EnableXLane)
5820+ !phba->cfg_fof)
57935821 return false;
57945822
57955823 lun = *starting_lun;
@@ -5873,7 +5901,7 @@ lpfc_enable_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn, · 77 unmodified lines
58735901 unsigned long flags;
58745902
58755903 if (unlikely(!phba) || !vport_wwpn || !target_wwpn ||
5876− !phba->cfg_EnableXLane)
5904+ !phba->cfg_fof)
58775905 return false;
58785906
58795907 spin_lock_irqsave(&phba->devicelock, flags);
@@ -5930,7 +5958,7 @@ lpfc_disable_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn, · 50 unmodified lines
59305958 unsigned long flags;
59315959
59325960 if (unlikely(!phba) || !vport_wwpn || !target_wwpn ||
5933− !phba->cfg_EnableXLane)
5961+ !phba->cfg_fof)
59345962 return false;
59355963
59365964 spin_lock_irqsave(&phba->devicelock, flags);
drivers/scsi/lpfc/lpfc_scsi.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * *
drivers/scsi/lpfc/lpfc_sli.c+227−70
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
@@ -3532,20 +3532,63 @@ lpfc_sli_abort_iocb_ring(struct lpfc_hba *phba, struct lpfc_sli_ring *pring) · 3524 unmodified lines
35323532 /* Error everything on txq and txcmplq
35333533 * First do the txq.
35343534 */
3535− spin_lock_irq(&phba->hbalock);
3536− list_splice_init(&pring->txq, &completions);
3535+ if (phba->sli_rev >= LPFC_SLI_REV4) {
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);
35373540
3538− /* Next issue ABTS for everything on the txcmplq */
3539− list_for_each_entry_safe(iocb, next_iocb, &pring->txcmplq, list)
3540− lpfc_sli_issue_abort_iotag(phba, pring, iocb);
3541+ spin_lock_irq(&phba->hbalock);
3542+ /* Next issue ABTS for everything on the txcmplq */
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;
35413550
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+ }
35433556
35443557 /* Cancel all the IOCBs from the completions list */
35453558 lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT,
35463559 IOERR_SLI_ABORTED);
35473560 }
35483561
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+
35493592 /**
35503593 * lpfc_sli_flush_fcp_rings - flush all iocbs in the fcp ring
35513594 * @phba: Pointer to HBA context object.
@@ -3563,28 +3606,55 @@ lpfc_sli_flush_fcp_rings(struct lpfc_hba *phba) · 11 unmodified lines
35633606 LIST_HEAD(txcmplq);
35643607 struct lpfc_sli *psli = &phba->sli;
35653608 struct lpfc_sli_ring *pring;
3566−
3567− /* Currently, only one fcp ring */
3568− pring = &psli->ring[psli->fcp_ring];
3609+ uint32_t i;
35693610
35703611 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−
35773612 /* Indicate the I/O queues are flushed */
35783613 phba->hba_flag |= HBA_FCP_IOQ_FLUSH;
35793614 spin_unlock_irq(&phba->hbalock);
35803615
3581− /* Flush the txq */
3582− lpfc_sli_cancel_iocbs(phba, &txq, IOSTAT_LOCAL_REJECT,
3583− IOERR_SLI_DOWN);
3616+ /* Look on all the FCP Rings for the iotag */
3617+ if (phba->sli_rev >= LPFC_SLI_REV4) {
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];
35843641
3585− /* Flush the txcmpq */
3586− lpfc_sli_cancel_iocbs(phba, &txcmplq, IOSTAT_LOCAL_REJECT,
3587− IOERR_SLI_DOWN);
3642+ spin_lock_irq(&phba->hbalock);
3643+ /* Retrieve everything on txq */
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+ }
35883658 }
35893659
35903660 /**
@@ -3987,12 +4057,13 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba) · 396 unmodified lines
39874057 {
39884058 struct lpfc_sli *psli = &phba->sli;
39894059 uint16_t cfg_value;
3990− int rc;
4060+ int rc = 0;
39914061
39924062 /* Reset HBA */
39934063 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
3994− "0295 Reset HBA Data: x%x x%x\n",
3995− phba->pport->port_state, psli->sli_flag);
4064+ "0295 Reset HBA Data: x%x x%x x%x\n",
4065+ phba->pport->port_state, psli->sli_flag,
4066+ phba->hba_flag);
39964067
39974068 /* perform board reset */
39984069 phba->fc_eventTag = 0;
@@ -4005,6 +4076,12 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba) · 6 unmodified lines
40054076 phba->fcf.fcf_flag = 0;
40064077 spin_unlock_irq(&phba->hbalock);
40074078
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+
40084085 /* Now physically reset the device */
40094086 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
40104087 "0389 Performing PCI function reset!\n");
@@ -5002,7 +5079,7 @@ lpfc_sli4_arm_cqeq_intr(struct lpfc_hba *phba) · 991 unmodified lines
50025079 } while (++fcp_eqidx < phba->cfg_fcp_io_channel);
50035080 }
50045081
5005− if (phba->cfg_EnableXLane)
5082+ if (phba->cfg_fof)
50065083 lpfc_sli4_cq_release(phba->sli4_hba.oas_cq, LPFC_QUEUE_REARM);
50075084
50085085 if (phba->sli4_hba.hba_eq) {
@@ -6722,7 +6799,6 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) · 1713 unmodified lines
67226799 LPFC_MBOXQ_t *pmbox = phba->sli.mbox_active;
67236800 MAILBOX_t *mb = &pmbox->u.mb;
67246801 struct lpfc_sli *psli = &phba->sli;
6725− struct lpfc_sli_ring *pring;
67266802
67276803 /* If the mailbox completed, process the completion and return */
67286804 if (lpfc_sli4_process_missed_mbox_completions(phba))
@@ -6764,8 +6840,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) · 35 unmodified lines
67646840 psli->sli_flag &= ~LPFC_SLI_ACTIVE;
67656841 spin_unlock_irq(&phba->hbalock);
67666842
6767− pring = &psli->ring[psli->fcp_ring];
6768− lpfc_sli_abort_iocb_ring(phba, pring);
6843+ lpfc_sli_abort_fcp_rings(phba);
67696844
67706845 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
67716846 "0345 Resetting board due to mailbox timeout\n");
@@ -8133,6 +8208,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, · 1361 unmodified lines
81338208 abort_tag = (uint32_t) iocbq->iotag;
81348209 xritag = iocbq->sli4_xritag;
81358210 wqe->generic.wqe_com.word7 = 0; /* The ct field has moved so reset */
8211+ wqe->generic.wqe_com.word10 = 0;
81368212 /* words0-2 bpl convert bde */
81378213 if (iocbq->iocb.un.genreq64.bdl.bdeFlags == BUFF_TYPE_BLP_64) {
81388214 numBdes = iocbq->iocb.un.genreq64.bdl.bdeSize /
@@ -8639,8 +8715,7 @@ __lpfc_sli_issue_iocb_s4(struct lpfc_hba *phba, uint32_t ring_number, · 500 unmodified lines
86398715
86408716 if ((piocb->iocb_flag & LPFC_IO_FCP) ||
86418717 (piocb->iocb_flag & LPFC_USE_FCPWQIDX)) {
8642− if (!phba->cfg_EnableXLane || (!(piocb->iocb_flag &
8643− LPFC_IO_OAS))) {
8718+ if (!phba->cfg_fof || (!(piocb->iocb_flag & LPFC_IO_OAS))) {
86448719 wq = phba->sli4_hba.fcp_wq[piocb->fcp_wqidx];
86458720 } else {
86468721 wq = phba->sli4_hba.oas_wq;
@@ -8735,7 +8810,7 @@ lpfc_sli_issue_iocb(struct lpfc_hba *phba, uint32_t ring_number, · 88 unmodified lines
87358810
87368811 if (phba->sli_rev == LPFC_SLI_REV4) {
87378812 if (piocb->iocb_flag & LPFC_IO_FCP) {
8738− if (!phba->cfg_EnableXLane || (!(piocb->iocb_flag &
8813+ if (!phba->cfg_fof || (!(piocb->iocb_flag &
87398814 LPFC_IO_OAS))) {
87408815 if (unlikely(!phba->sli4_hba.fcp_wq))
87418816 return IOCB_ERROR;
@@ -9170,6 +9245,7 @@ lpfc_sli_queue_setup(struct lpfc_hba *phba) · 428 unmodified lines
91709245 pring->sli.sli3.next_cmdidx = 0;
91719246 pring->sli.sli3.local_getidx = 0;
91729247 pring->sli.sli3.cmdidx = 0;
9248+ pring->flag = 0;
91739249 INIT_LIST_HEAD(&pring->txq);
91749250 INIT_LIST_HEAD(&pring->txcmplq);
91759251 INIT_LIST_HEAD(&pring->iocb_continueq);
@@ -9804,43 +9880,6 @@ abort_iotag_exit: · 628 unmodified lines
98049880 return retval;
98059881 }
98069882
9807−/**
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−
98449883 /**
98459884 * lpfc_sli_hba_iocb_abort - Abort all iocbs to an hba.
98469885 * @phba: pointer to lpfc HBA data structure.
@@ -9856,7 +9895,7 @@ lpfc_sli_hba_iocb_abort(struct lpfc_hba *phba) · 9 unmodified lines
98569895
98579896 for (i = 0; i < psli->num_rings; i++) {
98589897 pring = &psli->ring[i];
9859− lpfc_sli_iocb_ring_abort(phba, pring);
9898+ lpfc_sli_abort_iocb_ring(phba, pring);
98609899 }
98619900 }
98629901
@@ -10080,6 +10119,124 @@ lpfc_sli_abort_iocb(struct lpfc_vport *vport, struct lpfc_sli_ring *pring, · 217 unmodified lines
1008010119 return errcnt;
1008110120 }
1008210121
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+
1008310240 /**
1008410241 * lpfc_sli_wake_iocb_wait - lpfc_sli_issue_iocb_wait's completion handler
1008510242 * @phba: Pointer to HBA context object.
drivers/scsi/lpfc/lpfc_sli.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * *
drivers/scsi/lpfc/lpfc_sli4.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2009-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2009-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * *
drivers/scsi/lpfc/lpfc_version.h+3−3
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+ * Copyright (C) 2004-2014 Emulex. All rights reserved. *
55 * EMULEX and SLI are trademarks of Emulex. *
66 * www.emulex.com *
77 * *
@@ -18,7 +18,7 @@ · 10 unmodified lines
1818 * included with this package. *
1919 *******************************************************************/
2020
21−#define LPFC_DRIVER_VERSION "8.3.45"
21+#define LPFC_DRIVER_VERSION "10.2.8001.0."
2222 #define LPFC_DRIVER_NAME "lpfc"
2323
2424 /* Used for SLI 2/3 */
@@ -30,4 +30,4 @@ · 5 unmodified lines
3030
3131 #define LPFC_MODULE_DESC "Emulex LightPulse Fibre Channel SCSI driver " \
3232 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."
drivers/scsi/qla2xxx/qla_def.h+8−8
@@ -1648,16 +1648,16 @@ typedef struct { · 1647 unmodified lines
16481648 */
16491649 struct crc_context {
16501650 uint32_t handle; /* System handle. */
1651− uint32_t ref_tag;
1652− uint16_t app_tag;
1651+ __le32 ref_tag;
1652+ __le16 app_tag;
16531653 uint8_t ref_tag_mask[4]; /* Validation/Replacement Mask*/
16541654 uint8_t app_tag_mask[2]; /* Validation/Replacement Mask*/
1655− uint16_t guard_seed; /* Initial Guard Seed */
1656− uint16_t prot_opts; /* Requested Data Protection Mode */
1657− uint16_t blk_size; /* Data size in bytes */
1655+ __le16 guard_seed; /* Initial Guard Seed */
1656+ __le16 prot_opts; /* Requested Data Protection Mode */
1657+ __le16 blk_size; /* Data size in bytes */
16581658 uint16_t runt_blk_guard; /* Guard value for runt block (tape
16591659 * only) */
1660− uint32_t byte_count; /* Total byte count/ total data
1660+ __le32 byte_count; /* Total byte count/ total data
16611661 * transfer count */
16621662 union {
16631663 struct {
@@ -1671,10 +1671,10 @@ struct crc_context { · 7 unmodified lines
16711671 uint32_t reserved_6;
16721672 } nobundling;
16731673 struct {
1674− uint32_t dif_byte_count; /* Total DIF byte
1674+ __le32 dif_byte_count; /* Total DIF byte
16751675 * count */
16761676 uint16_t reserved_1;
1677− uint16_t dseg_count; /* Data segment count */
1677+ __le16 dseg_count; /* Data segment count */
16781678 uint32_t reserved_2;
16791679 uint32_t data_address[2];
16801680 uint32_t data_length;
drivers/scsi/qla2xxx/qla_target.c+10−5
@@ -1996,7 +1996,7 @@ qlt_set_t10dif_tags(struct se_cmd *se_cmd, struct crc_context *ctx) · 1995 unmodified lines
19961996 * have been immplemented by TCM, before AppTag is avail.
19971997 * Look for modesense_handlers[]
19981998 */
1999− ctx->app_tag = __constant_cpu_to_le16(0);
1999+ ctx->app_tag = 0;
20002000 ctx->app_tag_mask[0] = 0x0;
20012001 ctx->app_tag_mask[1] = 0x0;
20022002
@@ -2078,6 +2078,7 @@ qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha) · 75 unmodified lines
20782078 struct se_cmd *se_cmd = &cmd->se_cmd;
20792079 uint32_t h;
20802080 struct atio_from_isp *atio = &prm->cmd->atio;
2081+ uint16_t t16;
20812082
20822083 sgc = 0;
20832084 ha = vha->hw;
@@ -2174,8 +2175,13 @@ qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha) · 90 unmodified lines
21742175 pkt->initiator_id[1] = atio->u.isp24.fcp_hdr.s_id[1];
21752176 pkt->initiator_id[2] = atio->u.isp24.fcp_hdr.s_id[0];
21762177 pkt->exchange_addr = atio->u.isp24.exchange_addr;
2177− pkt->ox_id = swab16(atio->u.isp24.fcp_hdr.ox_id);
2178− pkt->flags |= (atio->u.isp24.attr << 9);
2178+
2179+ /* silence compile warning */
2180+ t16 = be16_to_cpu(atio->u.isp24.fcp_hdr.ox_id);
2181+ pkt->ox_id = cpu_to_le16(t16);
2182+
2183+ t16 = (atio->u.isp24.attr << 9);
2184+ pkt->flags |= cpu_to_le16(t16);
21792185 pkt->relative_offset = cpu_to_le32(prm->cmd->offset);
21802186
21812187 /* Set transfer direction */
@@ -2250,8 +2256,7 @@ qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha) · 68 unmodified lines
22502256
22512257 if (bundling && prm->prot_seg_cnt) {
22522258 /* Walks dif segments */
2253− pkt->add_flags |=
2254− __constant_cpu_to_le16(CTIO_CRC2_AF_DIF_DSD_ENA);
2259+ pkt->add_flags |= CTIO_CRC2_AF_DIF_DSD_ENA;
22552260
22562261 cur_dsd = (uint32_t *) &crc_ctx_pkt->u.bundling.dif_address;
22572262 if (qla24xx_walk_and_build_prot_sglist(ha, NULL, cur_dsd,
drivers/scsi/qla2xxx/qla_target.h+8−8
@@ -316,7 +316,7 @@ struct fcp_hdr { · 315 unmodified lines
316316 uint8_t seq_id;
317317 uint8_t df_ctl;
318318 uint16_t seq_cnt;
319− uint16_t ox_id;
319+ __be16 ox_id;
320320 uint16_t rx_id;
321321 uint32_t parameter;
322322 } __packed;
@@ -441,7 +441,7 @@ struct ctio7_to_24xx { · 118 unmodified lines
441441 union {
442442 struct {
443443 uint16_t reserved1;
444− uint16_t flags;
444+ __le16 flags;
445445 uint32_t residual;
446446 uint16_t ox_id;
447447 uint16_t scsi_status;
@@ -527,7 +527,7 @@ struct ctio_crc2_to_fw { · 79 unmodified lines
527527
528528 uint32_t handle; /* System handle. */
529529 uint16_t nport_handle; /* N_PORT handle. */
530− uint16_t timeout; /* Command timeout. */
530+ __le16 timeout; /* Command timeout. */
531531
532532 uint16_t dseg_count; /* Data segment count. */
533533 uint8_t vp_index;
@@ -538,15 +538,15 @@ struct ctio_crc2_to_fw { · 4 unmodified lines
538538 uint8_t reserved1;
539539 uint32_t exchange_addr; /* rcv exchange address */
540540 uint16_t reserved2;
541− uint16_t flags; /* refer to CTIO7 flags values */
541+ __le16 flags; /* refer to CTIO7 flags values */
542542 uint32_t residual;
543− uint16_t ox_id;
543+ __le16 ox_id;
544544 uint16_t scsi_status;
545− uint32_t relative_offset;
545+ __le32 relative_offset;
546546 uint32_t reserved5;
547− uint32_t transfer_length; /* total fc transfer length */
547+ __le32 transfer_length; /* total fc transfer length */
548548 uint32_t reserved6;
549− uint32_t crc_context_address[2];/* Data segment address. */
549+ __le32 crc_context_address[2];/* Data segment address. */
550550 uint16_t crc_context_len; /* Data segment length. */
551551 uint16_t reserved_1; /* MUST be set to 0. */
552552 } __packed;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t