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 ...
Unified · Split
| @@ -48,6 +48,7 @@ · 47 unmodified lines | ||
| 48 | 48 | #include <linux/bitmap.h> |
| 49 | 49 | #include <linux/atomic.h> |
| 50 | 50 | #include <linux/jiffies.h> |
| 51 | +#include <linux/percpu.h> | |
| 51 | 52 | #include <asm/div64.h> |
| 52 | 53 | #include "hpsa_cmd.h" |
| 53 | 54 | #include "hpsa.h" |
| @@ -193,7 +194,8 @@ static int number_of_controllers; · 139 unmodified lines | ||
| 193 | 194 | static irqreturn_t do_hpsa_intr_intx(int irq, void *dev_id); |
| 194 | 195 | static irqreturn_t do_hpsa_intr_msi(int irq, void *dev_id); |
| 195 | 196 | 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); | |
| 197 | 199 | |
| 198 | 200 | #ifdef CONFIG_COMPAT |
| 199 | 201 | 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 | ||
| 695 | 697 | static inline u32 next_command(struct ctlr_info *h, u8 q) |
| 696 | 698 | { |
| 697 | 699 | u32 a; |
| 698 | − struct reply_pool *rq = &h->reply_queue[q]; | |
| 700 | + struct reply_queue_buffer *rq = &h->reply_queue[q]; | |
| 699 | 701 | unsigned long flags; |
| 700 | 702 | |
| 701 | 703 | 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 | ||
| 844 | 846 | spin_lock_irqsave(&h->lock, flags); |
| 845 | 847 | addQ(&h->reqQ, c); |
| 846 | 848 | h->Qdepth++; |
| 849 | + start_io(h, &flags); | |
| 847 | 850 | spin_unlock_irqrestore(&h->lock, flags); |
| 848 | − start_io(h); | |
| 849 | 851 | } |
| 850 | 852 | |
| 851 | 853 | static inline void removeQ(struct CommandList *c) |
| @@ -1554,9 +1556,13 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, · 702 unmodified lines | ||
| 1554 | 1556 | dev_warn(&h->pdev->dev, |
| 1555 | 1557 | "%s: task complete with check condition.\n", |
| 1556 | 1558 | "HP SSD Smart Path"); |
| 1559 | + cmd->result |= SAM_STAT_CHECK_CONDITION; | |
| 1557 | 1560 | 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); | |
| 1559 | 1564 | break; |
| 1565 | + } | |
| 1560 | 1566 | /* copy the sense data */ |
| 1561 | 1567 | data_len = c2->error_data.sense_data_len; |
| 1562 | 1568 | if (data_len > SCSI_SENSE_BUFFERSIZE) |
| @@ -1566,7 +1572,6 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, · 3 unmodified lines | ||
| 1566 | 1572 | sizeof(c2->error_data.sense_data_buff); |
| 1567 | 1573 | memcpy(cmd->sense_buffer, |
| 1568 | 1574 | c2->error_data.sense_data_buff, data_len); |
| 1569 | − cmd->result |= SAM_STAT_CHECK_CONDITION; | |
| 1570 | 1575 | retry = 1; |
| 1571 | 1576 | break; |
| 1572 | 1577 | case IOACCEL2_STATUS_SR_TASK_COMP_BUSY: |
| @@ -1651,16 +1656,6 @@ static void process_ioaccel2_completion(struct ctlr_info *h, · 78 unmodified lines | ||
| 1651 | 1656 | if (is_logical_dev_addr_mode(dev->scsi3addr) && |
| 1652 | 1657 | c2->error_data.serv_response == |
| 1653 | 1658 | 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 | − | |
| 1664 | 1659 | dev->offload_enabled = 0; |
| 1665 | 1660 | h->drv_req_rescan = 1; /* schedule controller for a rescan */ |
| 1666 | 1661 | 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 | ||
| 1991 | 1986 | wait_for_completion(&wait); |
| 1992 | 1987 | } |
| 1993 | 1988 | |
| 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 | + | |
| 1994 | 2001 | static void hpsa_scsi_do_simple_cmd_core_if_no_lockup(struct ctlr_info *h, |
| 1995 | 2002 | struct CommandList *c) |
| 1996 | 2003 | { |
| 1997 | − unsigned long flags; | |
| 1998 | − | |
| 1999 | 2004 | /* 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))) | |
| 2003 | 2006 | c->err_info->CommandStatus = CMD_HARDWARE_ERR; |
| 2004 | − } else { | |
| 2005 | − spin_unlock_irqrestore(&h->lock, flags); | |
| 2007 | + else | |
| 2006 | 2008 | hpsa_scsi_do_simple_cmd_core(h, c); |
| 2007 | − } | |
| 2008 | 2009 | } |
| 2009 | 2010 | |
| 2010 | 2011 | #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 | ||
| 2429 | 2430 | buflen = 16; |
| 2430 | 2431 | buf = kzalloc(64, GFP_KERNEL); |
| 2431 | 2432 | if (!buf) |
| 2432 | − return -1; | |
| 2433 | + return -ENOMEM; | |
| 2433 | 2434 | rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | 0x83, buf, 64); |
| 2434 | 2435 | if (rc == 0) |
| 2435 | 2436 | memcpy(device_id, &buf[8], buflen); |
| @@ -2515,27 +2516,21 @@ static int hpsa_get_volume_status(struct ctlr_info *h, · 79 unmodified lines | ||
| 2515 | 2516 | return HPSA_VPD_LV_STATUS_UNSUPPORTED; |
| 2516 | 2517 | |
| 2517 | 2518 | /* 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)) | |
| 2520 | 2520 | goto exit_failed; |
| 2521 | − } | |
| 2522 | 2521 | |
| 2523 | 2522 | /* Get the size of the VPD return buffer */ |
| 2524 | 2523 | rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | HPSA_VPD_LV_STATUS, |
| 2525 | 2524 | 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) | |
| 2528 | 2526 | goto exit_failed; |
| 2529 | − } | |
| 2530 | 2527 | size = buf[3]; |
| 2531 | 2528 | |
| 2532 | 2529 | /* Now get the whole VPD buffer */ |
| 2533 | 2530 | rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | HPSA_VPD_LV_STATUS, |
| 2534 | 2531 | 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) | |
| 2537 | 2533 | goto exit_failed; |
| 2538 | − } | |
| 2539 | 2534 | status = buf[4]; /* status byte */ |
| 2540 | 2535 | |
| 2541 | 2536 | kfree(buf); |
| @@ -2548,11 +2543,11 @@ exit_failed: · 6 unmodified lines | ||
| 2548 | 2543 | /* Determine offline status of a volume. |
| 2549 | 2544 | * Return either: |
| 2550 | 2545 | * 0 (not offline) |
| 2551 | − * -1 (offline for unknown reasons) | |
| 2546 | + * 0xff (offline for unknown reasons) | |
| 2552 | 2547 | * # (integer code indicating one of several NOT READY states |
| 2553 | 2548 | * describing why a volume is to be kept offline) |
| 2554 | 2549 | */ |
| 2555 | −static unsigned char hpsa_volume_offline(struct ctlr_info *h, | |
| 2550 | +static int hpsa_volume_offline(struct ctlr_info *h, | |
| 2556 | 2551 | unsigned char scsi3addr[]) |
| 2557 | 2552 | { |
| 2558 | 2553 | struct CommandList *c; |
| @@ -2651,11 +2646,15 @@ static int hpsa_update_device_info(struct ctlr_info *h, · 92 unmodified lines | ||
| 2651 | 2646 | |
| 2652 | 2647 | if (this_device->devtype == TYPE_DISK && |
| 2653 | 2648 | is_logical_dev_addr_mode(scsi3addr)) { |
| 2649 | + int volume_offline; | |
| 2650 | + | |
| 2654 | 2651 | hpsa_get_raid_level(h, scsi3addr, &this_device->raid_level); |
| 2655 | 2652 | if (h->fw_support & MISC_FW_RAID_OFFLOAD_BASIC) |
| 2656 | 2653 | 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; | |
| 2659 | 2658 | } else { |
| 2660 | 2659 | this_device->raid_level = RAID_UNKNOWN; |
| 2661 | 2660 | this_device->offload_config = 0; |
| @@ -2861,26 +2860,20 @@ static int hpsa_get_pdisk_of_ioaccel2(struct ctlr_info *h, · 199 unmodified lines | ||
| 2861 | 2860 | nphysicals = be32_to_cpu(*((__be32 *)physicals->LUNListLength)) / |
| 2862 | 2861 | responsesize; |
| 2863 | 2862 | |
| 2864 | − | |
| 2865 | 2863 | /* find ioaccel2 handle in list of physicals: */ |
| 2866 | 2864 | for (i = 0; i < nphysicals; i++) { |
| 2865 | + struct ext_report_lun_entry *entry = &physicals->LUN[i]; | |
| 2866 | + | |
| 2867 | 2867 | /* 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) | |
| 2870 | 2869 | continue; /* didn't match */ |
| 2871 | − } | |
| 2872 | 2870 | found = 1; |
| 2873 | − memcpy(scsi3addr, &((struct ReportExtendedLUNdata *) | |
| 2874 | − physicals)->LUN[i][0], 8); | |
| 2871 | + memcpy(scsi3addr, entry->lunid, 8); | |
| 2875 | 2872 | if (h->raid_offload_debug > 0) |
| 2876 | 2873 | 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", | |
| 2878 | 2875 | __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); | |
| 2884 | 2877 | break; /* found it */ |
| 2885 | 2878 | } |
| 2886 | 2879 | |
| @@ -2965,7 +2958,8 @@ u8 *figure_lunaddrbytes(struct ctlr_info *h, int raid_ctlr_position, int i, · 78 unmodified lines | ||
| 2965 | 2958 | return RAID_CTLR_LUNID; |
| 2966 | 2959 | |
| 2967 | 2960 | 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]; | |
| 2969 | 2963 | |
| 2970 | 2964 | if (i < last_device) |
| 2971 | 2965 | 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 | ||
| 3074 | 3068 | ndev_allocated++; |
| 3075 | 3069 | } |
| 3076 | 3070 | |
| 3077 | − if (unlikely(is_scsi_rev_5(h))) | |
| 3071 | + if (is_scsi_rev_5(h)) | |
| 3078 | 3072 | raid_ctlr_position = 0; |
| 3079 | 3073 | else |
| 3080 | 3074 | raid_ctlr_position = nphysicals + nlogicals; |
| @@ -3971,7 +3965,6 @@ static int hpsa_scsi_queue_command_lck(struct scsi_cmnd *cmd, · 890 unmodified lines | ||
| 3971 | 3965 | struct hpsa_scsi_dev_t *dev; |
| 3972 | 3966 | unsigned char scsi3addr[8]; |
| 3973 | 3967 | struct CommandList *c; |
| 3974 | − unsigned long flags; | |
| 3975 | 3968 | int rc = 0; |
| 3976 | 3969 | |
| 3977 | 3970 | /* 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 | ||
| 3984 | 3977 | } |
| 3985 | 3978 | memcpy(scsi3addr, dev->scsi3addr, sizeof(scsi3addr)); |
| 3986 | 3979 | |
| 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))) { | |
| 3990 | 3981 | cmd->result = DID_ERROR << 16; |
| 3991 | 3982 | done(cmd); |
| 3992 | 3983 | return 0; |
| 3993 | 3984 | } |
| 3994 | − spin_unlock_irqrestore(&h->lock, flags); | |
| 3995 | 3985 | c = cmd_alloc(h); |
| 3996 | 3986 | if (c == NULL) { /* trouble... */ |
| 3997 | 3987 | 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 | ||
| 4103 | 4093 | * we can prevent new rescan threads from piling up on a |
| 4104 | 4094 | * locked up controller. |
| 4105 | 4095 | */ |
| 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))) { | |
| 4109 | 4097 | spin_lock_irqsave(&h->scan_lock, flags); |
| 4110 | 4098 | h->scan_finished = 1; |
| 4111 | 4099 | wake_up_all(&h->scan_wait_queue); |
| 4112 | 4100 | spin_unlock_irqrestore(&h->scan_lock, flags); |
| 4113 | 4101 | return 1; |
| 4114 | 4102 | } |
| 4115 | − spin_unlock_irqrestore(&h->lock, flags); | |
| 4116 | 4103 | return 0; |
| 4117 | 4104 | } |
| 4118 | 4105 | |
| @@ -4963,7 +4950,7 @@ static int hpsa_passthru_ioctl(struct ctlr_info *h, void __user *argp) · 844 unmodified lines | ||
| 4963 | 4950 | buff = kmalloc(iocommand.buf_size, GFP_KERNEL); |
| 4964 | 4951 | if (buff == NULL) |
| 4965 | 4952 | return -EFAULT; |
| 4966 | − if (iocommand.Request.Type.Direction == XFER_WRITE) { | |
| 4953 | + if (iocommand.Request.Type.Direction & XFER_WRITE) { | |
| 4967 | 4954 | /* Copy the data into the buffer we created */ |
| 4968 | 4955 | if (copy_from_user(buff, iocommand.buf, |
| 4969 | 4956 | iocommand.buf_size)) { |
| @@ -5026,7 +5013,7 @@ static int hpsa_passthru_ioctl(struct ctlr_info *h, void __user *argp) · 56 unmodified lines | ||
| 5026 | 5013 | rc = -EFAULT; |
| 5027 | 5014 | goto out; |
| 5028 | 5015 | } |
| 5029 | − if (iocommand.Request.Type.Direction == XFER_READ && | |
| 5016 | + if ((iocommand.Request.Type.Direction & XFER_READ) && | |
| 5030 | 5017 | iocommand.buf_size > 0) { |
| 5031 | 5018 | /* Copy the data out of the buffer we created */ |
| 5032 | 5019 | 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 | ||
| 5103 | 5090 | status = -ENOMEM; |
| 5104 | 5091 | goto cleanup1; |
| 5105 | 5092 | } |
| 5106 | − if (ioc->Request.Type.Direction == XFER_WRITE) { | |
| 5093 | + if (ioc->Request.Type.Direction & XFER_WRITE) { | |
| 5107 | 5094 | if (copy_from_user(buff[sg_used], data_ptr, sz)) { |
| 5108 | 5095 | status = -ENOMEM; |
| 5109 | 5096 | goto cleanup1; |
| @@ -5155,7 +5142,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp) · 45 unmodified lines | ||
| 5155 | 5142 | status = -EFAULT; |
| 5156 | 5143 | goto cleanup0; |
| 5157 | 5144 | } |
| 5158 | − if (ioc->Request.Type.Direction == XFER_READ && ioc->buf_size > 0) { | |
| 5145 | + if ((ioc->Request.Type.Direction & XFER_READ) && ioc->buf_size > 0) { | |
| 5159 | 5146 | /* Copy the data out of the buffer we created */ |
| 5160 | 5147 | BYTE __user *ptr = ioc->buf; |
| 5161 | 5148 | for (i = 0; i < sg_used; i++) { |
| @@ -5459,13 +5446,12 @@ static void __iomem *remap_pci_mem(ulong base, ulong size) · 297 unmodified lines | ||
| 5459 | 5446 | |
| 5460 | 5447 | /* Takes cmds off the submission queue and sends them to the hardware, |
| 5461 | 5448 | * then puts them on the queue of cmds waiting for completion. |
| 5449 | + * Assumes h->lock is held | |
| 5462 | 5450 | */ |
| 5463 | −static void start_io(struct ctlr_info *h) | |
| 5451 | +static void start_io(struct ctlr_info *h, unsigned long *flags) | |
| 5464 | 5452 | { |
| 5465 | 5453 | struct CommandList *c; |
| 5466 | − unsigned long flags; | |
| 5467 | 5454 | |
| 5468 | − spin_lock_irqsave(&h->lock, flags); | |
| 5469 | 5455 | while (!list_empty(&h->reqQ)) { |
| 5470 | 5456 | c = list_entry(h->reqQ.next, struct CommandList, list); |
| 5471 | 5457 | /* can't do anything if fifo is full */ |
| @@ -5488,14 +5474,20 @@ static void start_io(struct ctlr_info *h) · 16 unmodified lines | ||
| 5488 | 5474 | * condition. |
| 5489 | 5475 | */ |
| 5490 | 5476 | h->commands_outstanding++; |
| 5491 | − if (h->commands_outstanding > h->max_outstanding) | |
| 5492 | − h->max_outstanding = h->commands_outstanding; | |
| 5493 | 5477 | |
| 5494 | 5478 | /* Tell the controller execute command */ |
| 5495 | − spin_unlock_irqrestore(&h->lock, flags); | |
| 5479 | + spin_unlock_irqrestore(&h->lock, *flags); | |
| 5496 | 5480 | h->access.submit_command(h, c); |
| 5497 | − spin_lock_irqsave(&h->lock, flags); | |
| 5481 | + spin_lock_irqsave(&h->lock, *flags); | |
| 5498 | 5482 | } |
| 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); | |
| 5499 | 5491 | spin_unlock_irqrestore(&h->lock, flags); |
| 5500 | 5492 | } |
| 5501 | 5493 | |
| @@ -5563,7 +5555,7 @@ static inline void finish_cmd(struct CommandList *c) · 61 unmodified lines | ||
| 5563 | 5555 | else if (c->cmd_type == CMD_IOCTL_PEND) |
| 5564 | 5556 | complete(c->waiting); |
| 5565 | 5557 | if (unlikely(io_may_be_stalled)) |
| 5566 | − start_io(h); | |
| 5558 | + lock_and_start_io(h); | |
| 5567 | 5559 | } |
| 5568 | 5560 | |
| 5569 | 5561 | 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 | ||
| 5840 | 5832 | dev_info(&pdev->dev, "using doorbell to reset controller\n"); |
| 5841 | 5833 | writel(use_doorbell, vaddr + SA5_DOORBELL); |
| 5842 | 5834 | |
| 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 | |
| 5844 | 5836 | * doorbell reset and before any attempt to talk to the board |
| 5845 | 5837 | * at all to ensure that this actually works and doesn't fall |
| 5846 | 5838 | * over in some weird corner cases. |
| 5847 | 5839 | */ |
| 5848 | − msleep(5000); | |
| 5840 | + msleep(10000); | |
| 5849 | 5841 | } else { /* Try to do it the PCI power state way */ |
| 5850 | 5842 | |
| 5851 | 5843 | /* Quoting from the Open CISS Specification: "The Power |
| @@ -6166,6 +6158,8 @@ static void hpsa_interrupt_mode(struct ctlr_info *h) · 314 unmodified lines | ||
| 6166 | 6158 | if (pci_find_capability(h->pdev, PCI_CAP_ID_MSIX)) { |
| 6167 | 6159 | dev_info(&h->pdev->dev, "MSIX\n"); |
| 6168 | 6160 | h->msix_vector = MAX_REPLY_QUEUES; |
| 6161 | + if (h->msix_vector > num_online_cpus()) | |
| 6162 | + h->msix_vector = num_online_cpus(); | |
| 6169 | 6163 | err = pci_enable_msix(h->pdev, hpsa_msix_entries, |
| 6170 | 6164 | h->msix_vector); |
| 6171 | 6165 | if (err > 0) { |
| @@ -6615,6 +6609,17 @@ static void hpsa_free_cmd_pool(struct ctlr_info *h) · 443 unmodified lines | ||
| 6615 | 6609 | h->ioaccel_cmd_pool, h->ioaccel_cmd_pool_dhandle); |
| 6616 | 6610 | } |
| 6617 | 6611 | |
| 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 | + | |
| 6618 | 6623 | static int hpsa_request_irq(struct ctlr_info *h, |
| 6619 | 6624 | irqreturn_t (*msixhandler)(int, void *), |
| 6620 | 6625 | irqreturn_t (*intxhandler)(int, void *)) |
| @@ -6634,6 +6639,7 @@ static int hpsa_request_irq(struct ctlr_info *h, · 13 unmodified lines | ||
| 6634 | 6639 | rc = request_irq(h->intr[i], msixhandler, |
| 6635 | 6640 | 0, h->devname, |
| 6636 | 6641 | &h->q[i]); |
| 6642 | + hpsa_irq_affinity_hints(h); | |
| 6637 | 6643 | } else { |
| 6638 | 6644 | /* Use single reply pool */ |
| 6639 | 6645 | if (h->msix_vector > 0 || h->msi_vector) { |
| @@ -6685,12 +6691,15 @@ static void free_irqs(struct ctlr_info *h) · 45 unmodified lines | ||
| 6685 | 6691 | if (!h->msix_vector || h->intr_mode != PERF_MODE_INT) { |
| 6686 | 6692 | /* Single reply queue, only one irq to free */ |
| 6687 | 6693 | i = h->intr_mode; |
| 6694 | + irq_set_affinity_hint(h->intr[i], NULL); | |
| 6688 | 6695 | free_irq(h->intr[i], &h->q[i]); |
| 6689 | 6696 | return; |
| 6690 | 6697 | } |
| 6691 | 6698 | |
| 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); | |
| 6693 | 6701 | free_irq(h->intr[i], &h->q[i]); |
| 6702 | + } | |
| 6694 | 6703 | } |
| 6695 | 6704 | |
| 6696 | 6705 | 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 | ||
| 6707 | 6716 | #endif /* CONFIG_PCI_MSI */ |
| 6708 | 6717 | } |
| 6709 | 6718 | |
| 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 | + | |
| 6710 | 6733 | static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h) |
| 6711 | 6734 | { |
| 6712 | 6735 | 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 | ||
| 6714 | 6737 | hpsa_free_cmd_pool(h); |
| 6715 | 6738 | kfree(h->ioaccel1_blockFetchTable); |
| 6716 | 6739 | 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); | |
| 6719 | 6741 | if (h->vaddr) |
| 6720 | 6742 | iounmap(h->vaddr); |
| 6721 | 6743 | 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 | ||
| 6740 | 6762 | } |
| 6741 | 6763 | } |
| 6742 | 6764 | |
| 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 | + | |
| 6743 | 6779 | static void controller_lockup_detected(struct ctlr_info *h) |
| 6744 | 6780 | { |
| 6745 | 6781 | unsigned long flags; |
| 6782 | + u32 lockup_detected; | |
| 6746 | 6783 | |
| 6747 | 6784 | h->access.set_intr_mask(h, HPSA_INTR_OFF); |
| 6748 | 6785 | 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); | |
| 6750 | 6794 | spin_unlock_irqrestore(&h->lock, flags); |
| 6751 | 6795 | dev_warn(&h->pdev->dev, "Controller lockup detected: 0x%08x\n", |
| 6752 | − h->lockup_detected); | |
| 6796 | + lockup_detected); | |
| 6753 | 6797 | pci_disable_device(h->pdev); |
| 6754 | 6798 | spin_lock_irqsave(&h->lock, flags); |
| 6755 | 6799 | 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 | ||
| 6884 | 6928 | struct ctlr_info *h = container_of(to_delayed_work(work), |
| 6885 | 6929 | struct ctlr_info, monitor_ctlr_work); |
| 6886 | 6930 | detect_controller_lockup(h); |
| 6887 | − if (h->lockup_detected) | |
| 6931 | + if (lockup_detected(h)) | |
| 6888 | 6932 | return; |
| 6889 | 6933 | |
| 6890 | 6934 | if (hpsa_ctlr_needs_rescan(h) || hpsa_offline_devices_ready(h)) { |
| @@ -6934,7 +6978,6 @@ reinit_after_soft_reset: · 43 unmodified lines | ||
| 6934 | 6978 | * the 5 lower bits of the address are used by the hardware. and by |
| 6935 | 6979 | * the driver. See comments in hpsa.h for more info. |
| 6936 | 6980 | */ |
| 6937 | −#define COMMANDLIST_ALIGNMENT 128 | |
| 6938 | 6981 | BUILD_BUG_ON(sizeof(struct CommandList) % COMMANDLIST_ALIGNMENT); |
| 6939 | 6982 | h = kzalloc(sizeof(*h), GFP_KERNEL); |
| 6940 | 6983 | if (!h) |
| @@ -6949,6 +6992,13 @@ reinit_after_soft_reset: · 8 unmodified lines | ||
| 6949 | 6992 | spin_lock_init(&h->offline_device_lock); |
| 6950 | 6993 | spin_lock_init(&h->scan_lock); |
| 6951 | 6994 | 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 | + | |
| 6952 | 7002 | rc = hpsa_pci_init(h); |
| 6953 | 7003 | if (rc != 0) |
| 6954 | 7004 | goto clean1; |
| @@ -7072,6 +7122,8 @@ clean4: · 117 unmodified lines | ||
| 7072 | 7122 | free_irqs(h); |
| 7073 | 7123 | clean2: |
| 7074 | 7124 | clean1: |
| 7125 | + if (h->lockup_detected) | |
| 7126 | + free_percpu(h->lockup_detected); | |
| 7075 | 7127 | kfree(h); |
| 7076 | 7128 | return rc; |
| 7077 | 7129 | } |
| @@ -7080,16 +7132,10 @@ static void hpsa_flush_cache(struct ctlr_info *h) · 2 unmodified lines | ||
| 7080 | 7132 | { |
| 7081 | 7133 | char *flush_buf; |
| 7082 | 7134 | struct CommandList *c; |
| 7083 | − unsigned long flags; | |
| 7084 | 7135 | |
| 7085 | 7136 | /* 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))) | |
| 7089 | 7138 | return; |
| 7090 | − } | |
| 7091 | − spin_unlock_irqrestore(&h->lock, flags); | |
| 7092 | − | |
| 7093 | 7139 | flush_buf = kzalloc(4, GFP_KERNEL); |
| 7094 | 7140 | if (!flush_buf) |
| 7095 | 7141 | return; |
| @@ -7165,8 +7211,7 @@ static void hpsa_remove_one(struct pci_dev *pdev) · 69 unmodified lines | ||
| 7165 | 7211 | pci_free_consistent(h->pdev, |
| 7166 | 7212 | h->nr_cmds * sizeof(struct ErrorInfo), |
| 7167 | 7213 | 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); | |
| 7170 | 7215 | kfree(h->cmd_pool_bits); |
| 7171 | 7216 | kfree(h->blockFetchTable); |
| 7172 | 7217 | kfree(h->ioaccel1_blockFetchTable); |
| @@ -7174,6 +7219,7 @@ static void hpsa_remove_one(struct pci_dev *pdev) · 1 unmodified line | ||
| 7174 | 7219 | kfree(h->hba_inquiry_data); |
| 7175 | 7220 | pci_disable_device(pdev); |
| 7176 | 7221 | pci_release_regions(pdev); |
| 7222 | + free_percpu(h->lockup_detected); | |
| 7177 | 7223 | kfree(h); |
| 7178 | 7224 | } |
| 7179 | 7225 | |
| @@ -7278,8 +7324,16 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support) · 98 unmodified lines | ||
| 7278 | 7324 | * 10 = 6 s/g entry or 24k |
| 7279 | 7325 | */ |
| 7280 | 7326 | |
| 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 | + | |
| 7281 | 7334 | /* 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); | |
| 7283 | 7337 | |
| 7284 | 7338 | bft[7] = SG_ENTRIES_IN_CMD + 4; |
| 7285 | 7339 | 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 | ||
| 7295 | 7349 | |
| 7296 | 7350 | for (i = 0; i < h->nreply_queues; i++) { |
| 7297 | 7351 | 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, | |
| 7300 | 7353 | &h->transtable->RepQAddr[i].lower); |
| 7301 | 7354 | } |
| 7302 | 7355 | |
| @@ -7344,8 +7397,10 @@ static void hpsa_enter_performant_mode(struct ctlr_info *h, u32 trans_support) · 41 unmodified lines | ||
| 7344 | 7397 | h->ioaccel1_blockFetchTable); |
| 7345 | 7398 | |
| 7346 | 7399 | /* 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); | |
| 7349 | 7404 | |
| 7350 | 7405 | /* set all the constant fields in the accelerator command |
| 7351 | 7406 | * 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 | ||
| 7407 | 7462 | * because the 7 lower bits of the address are used by the |
| 7408 | 7463 | * hardware. |
| 7409 | 7464 | */ |
| 7410 | −#define IOACCEL1_COMMANDLIST_ALIGNMENT 128 | |
| 7411 | 7465 | BUILD_BUG_ON(sizeof(struct io_accel1_cmd) % |
| 7412 | 7466 | IOACCEL1_COMMANDLIST_ALIGNMENT); |
| 7413 | 7467 | h->ioaccel_cmd_pool = |
| @@ -7445,7 +7499,6 @@ static int ioaccel2_alloc_cmds_and_bft(struct ctlr_info *h) · 31 unmodified lines | ||
| 7445 | 7499 | if (h->ioaccel_maxsg > IOACCEL2_MAXSGENTRIES) |
| 7446 | 7500 | h->ioaccel_maxsg = IOACCEL2_MAXSGENTRIES; |
| 7447 | 7501 | |
| 7448 | −#define IOACCEL2_COMMANDLIST_ALIGNMENT 128 | |
| 7449 | 7502 | BUILD_BUG_ON(sizeof(struct io_accel2_cmd) % |
| 7450 | 7503 | IOACCEL2_COMMANDLIST_ALIGNMENT); |
| 7451 | 7504 | h->ioaccel2_cmd_pool = |
| @@ -7503,16 +7556,17 @@ static void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h) · 51 unmodified lines | ||
| 7503 | 7556 | } |
| 7504 | 7557 | } |
| 7505 | 7558 | |
| 7506 | − /* TODO, check that this next line h->nreply_queues is correct */ | |
| 7507 | 7559 | h->nreply_queues = h->msix_vector > 0 ? h->msix_vector : 1; |
| 7508 | 7560 | hpsa_get_max_perf_mode_cmds(h); |
| 7509 | 7561 | /* 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); | |
| 7513 | 7563 | |
| 7514 | 7564 | 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; | |
| 7516 | 7570 | h->reply_queue[i].size = h->max_commands; |
| 7517 | 7571 | h->reply_queue[i].wraparound = 1; /* spec: init to 1 */ |
| 7518 | 7572 | 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 | ||
| 7521 | 7575 | /* Need a block fetch table for performant mode */ |
| 7522 | 7576 | h->blockFetchTable = kmalloc(((SG_ENTRIES_IN_CMD + 1) * |
| 7523 | 7577 | sizeof(u32)), GFP_KERNEL); |
| 7524 | − | |
| 7525 | − if ((h->reply_pool == NULL) | |
| 7526 | − || (h->blockFetchTable == NULL)) | |
| 7578 | + if (!h->blockFetchTable) | |
| 7527 | 7579 | goto clean_up; |
| 7528 | 7580 | |
| 7529 | 7581 | hpsa_enter_performant_mode(h, trans_support); |
| 7530 | 7582 | return; |
| 7531 | 7583 | |
| 7532 | 7584 | 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); | |
| 7536 | 7586 | kfree(h->blockFetchTable); |
| 7537 | 7587 | } |
| 7538 | 7588 | |
| @@ -57,11 +57,12 @@ struct hpsa_scsi_dev_t { · 56 unmodified lines | ||
| 57 | 57 | |
| 58 | 58 | }; |
| 59 | 59 | |
| 60 | −struct reply_pool { | |
| 60 | +struct reply_queue_buffer { | |
| 61 | 61 | u64 *head; |
| 62 | 62 | size_t size; |
| 63 | 63 | u8 wraparound; |
| 64 | 64 | u32 current_entry; |
| 65 | + dma_addr_t busaddr; | |
| 65 | 66 | }; |
| 66 | 67 | |
| 67 | 68 | #pragma pack(1) |
| @@ -116,11 +117,8 @@ struct ctlr_info { · 48 unmodified lines | ||
| 116 | 117 | int nr_cmds; /* Number of commands allowed on this controller */ |
| 117 | 118 | struct CfgTable __iomem *cfgtable; |
| 118 | 119 | int interrupts_enabled; |
| 119 | − int major; | |
| 120 | 120 | int max_commands; |
| 121 | 121 | int commands_outstanding; |
| 122 | − int max_outstanding; /* Debug */ | |
| 123 | − int usage_count; /* number of opens all all minor devices */ | |
| 124 | 122 | # define PERF_MODE_INT 0 |
| 125 | 123 | # define DOORBELL_INT 1 |
| 126 | 124 | # define SIMPLE_MODE_INT 2 |
| @@ -177,11 +175,9 @@ struct ctlr_info { · 50 unmodified lines | ||
| 177 | 175 | /* |
| 178 | 176 | * Performant mode completion buffers |
| 179 | 177 | */ |
| 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]; | |
| 183 | 180 | u8 nreply_queues; |
| 184 | − dma_addr_t reply_pool_dhandle; | |
| 185 | 181 | u32 *blockFetchTable; |
| 186 | 182 | u32 *ioaccel1_blockFetchTable; |
| 187 | 183 | u32 *ioaccel2_blockFetchTable; |
| @@ -196,7 +192,7 @@ struct ctlr_info { · 8 unmodified lines | ||
| 196 | 192 | u64 last_heartbeat_timestamp; |
| 197 | 193 | u32 heartbeat_sample_interval; |
| 198 | 194 | atomic_t firmware_flash_in_progress; |
| 199 | − u32 lockup_detected; | |
| 195 | + u32 *lockup_detected; | |
| 200 | 196 | struct delayed_work monitor_ctlr_work; |
| 201 | 197 | int remove_in_progress; |
| 202 | 198 | u32 fifo_recently_full; |
| @@ -233,11 +229,9 @@ struct ctlr_info { · 30 unmodified lines | ||
| 233 | 229 | #define CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE (1 << 31) |
| 234 | 230 | |
| 235 | 231 | #define RESCAN_REQUIRED_EVENT_BITS \ |
| 236 | − (CTLR_STATE_CHANGE_EVENT | \ | |
| 237 | − CTLR_ENCLOSURE_HOT_PLUG_EVENT | \ | |
| 232 | + (CTLR_ENCLOSURE_HOT_PLUG_EVENT | \ | |
| 238 | 233 | CTLR_STATE_CHANGE_EVENT_PHYSICAL_DRV | \ |
| 239 | 234 | CTLR_STATE_CHANGE_EVENT_LOGICAL_DRV | \ |
| 240 | − CTLR_STATE_CHANGE_EVENT_REDUNDANT_CNTRL | \ | |
| 241 | 235 | CTLR_STATE_CHANGE_EVENT_AIO_ENABLED_DISABLED | \ |
| 242 | 236 | CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE) |
| 243 | 237 | spinlock_t offline_device_lock; |
| @@ -346,22 +340,23 @@ struct offline_device_entry { · 102 unmodified lines | ||
| 346 | 340 | static void SA5_submit_command(struct ctlr_info *h, |
| 347 | 341 | struct CommandList *c) |
| 348 | 342 | { |
| 349 | − dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr, | |
| 350 | − c->Header.Tag.lower); | |
| 351 | 343 | writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET); |
| 352 | 344 | (void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET); |
| 353 | 345 | } |
| 354 | 346 | |
| 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 | + | |
| 355 | 353 | static void SA5_submit_command_ioaccel2(struct ctlr_info *h, |
| 356 | 354 | struct CommandList *c) |
| 357 | 355 | { |
| 358 | − dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr, | |
| 359 | − c->Header.Tag.lower); | |
| 360 | 356 | if (c->cmd_type == CMD_IOACCEL2) |
| 361 | 357 | writel(c->busaddr, h->vaddr + IOACCEL2_INBOUND_POSTQ_32); |
| 362 | 358 | else |
| 363 | 359 | writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET); |
| 364 | − (void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET); | |
| 365 | 360 | } |
| 366 | 361 | |
| 367 | 362 | /* |
| @@ -399,7 +394,7 @@ static void SA5_performant_intr_mask(struct ctlr_info *h, unsigned long val) · 31 unmodified lines | ||
| 399 | 394 | |
| 400 | 395 | static unsigned long SA5_performant_completed(struct ctlr_info *h, u8 q) |
| 401 | 396 | { |
| 402 | − struct reply_pool *rq = &h->reply_queue[q]; | |
| 397 | + struct reply_queue_buffer *rq = &h->reply_queue[q]; | |
| 403 | 398 | unsigned long flags, register_value = FIFO_EMPTY; |
| 404 | 399 | |
| 405 | 400 | /* msi auto clears the interrupt pending bit. */ |
| @@ -478,7 +473,6 @@ static bool SA5_intr_pending(struct ctlr_info *h) · 72 unmodified lines | ||
| 478 | 473 | { |
| 479 | 474 | unsigned long register_value = |
| 480 | 475 | readl(h->vaddr + SA5_INTR_STATUS); |
| 481 | − dev_dbg(&h->pdev->dev, "intr_pending %lx\n", register_value); | |
| 482 | 476 | return register_value & SA5_INTR_PENDING; |
| 483 | 477 | } |
| 484 | 478 | |
| @@ -515,7 +509,7 @@ static bool SA5_ioaccel_mode1_intr_pending(struct ctlr_info *h) · 30 unmodified lines | ||
| 515 | 509 | static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q) |
| 516 | 510 | { |
| 517 | 511 | u64 register_value; |
| 518 | − struct reply_pool *rq = &h->reply_queue[q]; | |
| 512 | + struct reply_queue_buffer *rq = &h->reply_queue[q]; | |
| 519 | 513 | unsigned long flags; |
| 520 | 514 | |
| 521 | 515 | BUG_ON(q >= h->nreply_queues); |
| @@ -573,6 +567,14 @@ static struct access_method SA5_performant_access = { · 51 unmodified lines | ||
| 573 | 567 | SA5_performant_completed, |
| 574 | 568 | }; |
| 575 | 569 | |
| 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 | + | |
| 576 | 578 | struct board_type { |
| 577 | 579 | u32 board_id; |
| 578 | 580 | char *product_name; |
| @@ -151,7 +151,7 @@ · 150 unmodified lines | ||
| 151 | 151 | #define HPSA_VPD_HEADER_SZ 4 |
| 152 | 152 | |
| 153 | 153 | /* Logical volume states */ |
| 154 | −#define HPSA_VPD_LV_STATUS_UNSUPPORTED -1 | |
| 154 | +#define HPSA_VPD_LV_STATUS_UNSUPPORTED 0xff | |
| 155 | 155 | #define HPSA_LV_OK 0x0 |
| 156 | 156 | #define HPSA_LV_UNDERGOING_ERASE 0x0F |
| 157 | 157 | #define HPSA_LV_UNDERGOING_RPI 0x12 |
| @@ -238,11 +238,21 @@ struct ReportLUNdata { · 80 unmodified lines | ||
| 238 | 238 | u8 LUN[HPSA_MAX_LUN][8]; |
| 239 | 239 | }; |
| 240 | 240 | |
| 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 | + | |
| 241 | 251 | struct ReportExtendedLUNdata { |
| 242 | 252 | u8 LUNListLength[4]; |
| 243 | 253 | u8 extended_response_flag; |
| 244 | 254 | u8 reserved[3]; |
| 245 | − u8 LUN[HPSA_MAX_LUN][24]; | |
| 255 | + struct ext_report_lun_entry LUN[HPSA_MAX_LUN]; | |
| 246 | 256 | }; |
| 247 | 257 | |
| 248 | 258 | struct SenseSubsystem_info { |
| @@ -375,6 +385,7 @@ struct ctlr_info; /* defined in hpsa.h */ · 126 unmodified lines | ||
| 375 | 385 | * or a bus address. |
| 376 | 386 | */ |
| 377 | 387 | |
| 388 | +#define COMMANDLIST_ALIGNMENT 128 | |
| 378 | 389 | struct CommandList { |
| 379 | 390 | struct CommandListHeader Header; |
| 380 | 391 | struct RequestBlock Request; |
| @@ -389,21 +400,7 @@ struct CommandList { · 8 unmodified lines | ||
| 389 | 400 | struct list_head list; |
| 390 | 401 | struct completion *waiting; |
| 391 | 402 | 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); | |
| 407 | 404 | |
| 408 | 405 | /* Max S/G elements in I/O accelerator command */ |
| 409 | 406 | #define IOACCEL1_MAXSGENTRIES 24 |
| @@ -413,6 +410,7 @@ struct CommandList { · 3 unmodified lines | ||
| 413 | 410 | * Structure for I/O accelerator (mode 1) commands. |
| 414 | 411 | * Note that this structure must be 128-byte aligned in size. |
| 415 | 412 | */ |
| 413 | +#define IOACCEL1_COMMANDLIST_ALIGNMENT 128 | |
| 416 | 414 | struct io_accel1_cmd { |
| 417 | 415 | u16 dev_handle; /* 0x00 - 0x01 */ |
| 418 | 416 | u8 reserved1; /* 0x02 */ |
| @@ -440,12 +438,7 @@ struct io_accel1_cmd { · 21 unmodified lines | ||
| 440 | 438 | struct vals32 host_addr; /* 0x70 - 0x77 */ |
| 441 | 439 | u8 CISS_LUN[8]; /* 0x78 - 0x7F */ |
| 442 | 440 | 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); | |
| 449 | 442 | |
| 450 | 443 | #define IOACCEL1_FUNCTION_SCSIIO 0x00 |
| 451 | 444 | #define IOACCEL1_SGLOFFSET 32 |
| @@ -510,14 +503,11 @@ struct io_accel2_scsi_response { · 58 unmodified lines | ||
| 510 | 503 | u8 sense_data_buff[32]; /* sense/response data buffer */ |
| 511 | 504 | }; |
| 512 | 505 | |
| 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) | |
| 517 | 506 | /* |
| 518 | 507 | * Structure for I/O accelerator (mode 2 or m2) commands. |
| 519 | 508 | * Note that this structure must be 128-byte aligned in size. |
| 520 | 509 | */ |
| 510 | +#define IOACCEL2_COMMANDLIST_ALIGNMENT 128 | |
| 521 | 511 | struct io_accel2_cmd { |
| 522 | 512 | u8 IU_type; /* IU Type */ |
| 523 | 513 | u8 direction; /* direction, memtype, and encryption */ |
| @@ -544,8 +534,7 @@ struct io_accel2_cmd { · 20 unmodified lines | ||
| 544 | 534 | u32 tweak_upper; /* Encryption tweak, upper 4 bytes */ |
| 545 | 535 | struct ioaccel2_sg_element sg[IOACCEL2_MAXSGENTRIES]; |
| 546 | 536 | struct io_accel2_scsi_response error_data; |
| 547 | − u8 pad[IOACCEL2_PAD]; | |
| 548 | −}; | |
| 537 | +} __aligned(IOACCEL2_COMMANDLIST_ALIGNMENT); | |
| 549 | 538 | |
| 550 | 539 | /* |
| 551 | 540 | * defines for Mode 2 command struct |
| @@ -636,7 +625,7 @@ struct TransTable_struct { · 84 unmodified lines | ||
| 636 | 625 | u32 RepQCount; |
| 637 | 626 | u32 RepQCtrAddrLow32; |
| 638 | 627 | u32 RepQCtrAddrHigh32; |
| 639 | −#define MAX_REPLY_QUEUES 8 | |
| 628 | +#define MAX_REPLY_QUEUES 64 | |
| 640 | 629 | struct vals32 RepQAddr[MAX_REPLY_QUEUES]; |
| 641 | 630 | }; |
| 642 | 631 | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
| @@ -640,6 +640,7 @@ struct lpfc_hba { · 632 unmodified lines | ||
| 640 | 640 | #define HBA_DEVLOSS_TMO 0x2000 /* HBA in devloss timeout */ |
| 641 | 641 | #define HBA_RRQ_ACTIVE 0x4000 /* process the rrq active list */ |
| 642 | 642 | #define HBA_FCP_IOQ_FLUSH 0x8000 /* FCP I/O queues being flushed */ |
| 643 | +#define HBA_FW_DUMP_OP 0x10000 /* Skips fn reset before FW dump */ | |
| 643 | 644 | uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/ |
| 644 | 645 | struct lpfc_dmabuf slim2p; |
| 645 | 646 | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * 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 | ||
| 919 | 919 | phba->cfg_sriov_nr_virtfn = 0; |
| 920 | 920 | } |
| 921 | 921 | |
| 922 | + if (opcode == LPFC_FW_DUMP) | |
| 923 | + phba->hba_flag |= HBA_FW_DUMP_OP; | |
| 924 | + | |
| 922 | 925 | status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); |
| 923 | 926 | |
| 924 | − if (status != 0) | |
| 927 | + if (status != 0) { | |
| 928 | + phba->hba_flag &= ~HBA_FW_DUMP_OP; | |
| 925 | 929 | return status; |
| 930 | + } | |
| 926 | 931 | |
| 927 | 932 | /* wait for the device to be quiesced before firmware reset */ |
| 928 | 933 | msleep(100); |
| @@ -2364,7 +2369,7 @@ lpfc_oas_tgt_store(struct device *dev, struct device_attribute *attr, · 1435 unmodified lines | ||
| 2364 | 2369 | uint8_t wwpn[WWN_SZ]; |
| 2365 | 2370 | int rc; |
| 2366 | 2371 | |
| 2367 | − if (!phba->cfg_EnableXLane) | |
| 2372 | + if (!phba->cfg_fof) | |
| 2368 | 2373 | return -EPERM; |
| 2369 | 2374 | |
| 2370 | 2375 | /* count may include a LF at end of string */ |
| @@ -2432,7 +2437,7 @@ lpfc_oas_vpt_store(struct device *dev, struct device_attribute *attr, · 61 unmodified lines | ||
| 2432 | 2437 | uint8_t wwpn[WWN_SZ]; |
| 2433 | 2438 | int rc; |
| 2434 | 2439 | |
| 2435 | − if (!phba->cfg_EnableXLane) | |
| 2440 | + if (!phba->cfg_fof) | |
| 2436 | 2441 | return -EPERM; |
| 2437 | 2442 | |
| 2438 | 2443 | /* count may include a LF at end of string */ |
| @@ -2499,7 +2504,7 @@ lpfc_oas_lun_state_store(struct device *dev, struct device_attribute *attr, · 60 unmodified lines | ||
| 2499 | 2504 | struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; |
| 2500 | 2505 | int val = 0; |
| 2501 | 2506 | |
| 2502 | − if (!phba->cfg_EnableXLane) | |
| 2507 | + if (!phba->cfg_fof) | |
| 2503 | 2508 | return -EPERM; |
| 2504 | 2509 | |
| 2505 | 2510 | if (!isdigit(buf[0])) |
| @@ -2565,7 +2570,7 @@ lpfc_oas_lun_state_set(struct lpfc_hba *phba, uint8_t vpt_wwpn[], · 59 unmodified lines | ||
| 2565 | 2570 | |
| 2566 | 2571 | int rc = 0; |
| 2567 | 2572 | |
| 2568 | − if (!phba->cfg_EnableXLane) | |
| 2573 | + if (!phba->cfg_fof) | |
| 2569 | 2574 | return -EPERM; |
| 2570 | 2575 | |
| 2571 | 2576 | if (oas_state) { |
| @@ -2670,7 +2675,7 @@ lpfc_oas_lun_show(struct device *dev, struct device_attribute *attr, · 98 unmodified lines | ||
| 2670 | 2675 | uint64_t oas_lun; |
| 2671 | 2676 | int len = 0; |
| 2672 | 2677 | |
| 2673 | − if (!phba->cfg_EnableXLane) | |
| 2678 | + if (!phba->cfg_fof) | |
| 2674 | 2679 | return -EPERM; |
| 2675 | 2680 | |
| 2676 | 2681 | if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0) |
| @@ -2716,7 +2721,7 @@ lpfc_oas_lun_store(struct device *dev, struct device_attribute *attr, · 39 unmodified lines | ||
| 2716 | 2721 | uint64_t scsi_lun; |
| 2717 | 2722 | ssize_t rc; |
| 2718 | 2723 | |
| 2719 | − if (!phba->cfg_EnableXLane) | |
| 2724 | + if (!phba->cfg_fof) | |
| 2720 | 2725 | return -EPERM; |
| 2721 | 2726 | |
| 2722 | 2727 | if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0) |
| @@ -4655,7 +4660,7 @@ LPFC_ATTR_R(EnableXLane, 0, 0, 1, "Enable Express Lane Feature."); · 1932 unmodified lines | ||
| 4655 | 4660 | # 0x0 - 0x7f = CS_CTL field in FC header (high 7 bits) |
| 4656 | 4661 | # Value range is [0x0,0x7f]. Default value is 0 |
| 4657 | 4662 | */ |
| 4658 | −LPFC_ATTR_R(XLanePriority, 0, 0x0, 0x7f, "CS_CTL for Express Lane Feature."); | |
| 4663 | +LPFC_ATTR_RW(XLanePriority, 0, 0x0, 0x7f, "CS_CTL for Express Lane Feature."); | |
| 4659 | 4664 | |
| 4660 | 4665 | /* |
| 4661 | 4666 | # lpfc_enable_bg: Enable BlockGuard (Emulex's Implementation of T10-DIF) |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2009-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2009-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2010-2012 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2010-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * * |
| @@ -289,6 +289,7 @@ int lpfc_sli_issue_iocb(struct lpfc_hba *, uint32_t, · 281 unmodified lines | ||
| 289 | 289 | void lpfc_sli_pcimem_bcopy(void *, void *, uint32_t); |
| 290 | 290 | void lpfc_sli_bemem_bcopy(void *, void *, uint32_t); |
| 291 | 291 | void lpfc_sli_abort_iocb_ring(struct lpfc_hba *, struct lpfc_sli_ring *); |
| 292 | +void lpfc_sli_abort_fcp_rings(struct lpfc_hba *phba); | |
| 292 | 293 | void lpfc_sli_hba_iocb_abort(struct lpfc_hba *); |
| 293 | 294 | void lpfc_sli_flush_fcp_rings(struct lpfc_hba *); |
| 294 | 295 | int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct lpfc_sli_ring *, |
| @@ -310,6 +311,9 @@ int lpfc_sli_issue_abort_iotag(struct lpfc_hba *, struct lpfc_sli_ring *, · 15 unmodified lines | ||
| 310 | 311 | int lpfc_sli_sum_iocb(struct lpfc_vport *, uint16_t, uint64_t, lpfc_ctx_cmd); |
| 311 | 312 | int lpfc_sli_abort_iocb(struct lpfc_vport *, struct lpfc_sli_ring *, uint16_t, |
| 312 | 313 | uint64_t, lpfc_ctx_cmd); |
| 314 | +int | |
| 315 | +lpfc_sli_abort_taskmgmt(struct lpfc_vport *, struct lpfc_sli_ring *, | |
| 316 | + uint16_t, uint64_t, lpfc_ctx_cmd); | |
| 313 | 317 | |
| 314 | 318 | void lpfc_mbox_timeout(unsigned long); |
| 315 | 319 | void lpfc_mbox_timeout_handler(struct lpfc_hba *); |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2007-2012 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2007-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * * |
| @@ -2314,7 +2314,7 @@ proc_cq: · 2306 unmodified lines | ||
| 2314 | 2314 | goto too_big; |
| 2315 | 2315 | } |
| 2316 | 2316 | |
| 2317 | − if (phba->cfg_EnableXLane) { | |
| 2317 | + if (phba->cfg_fof) { | |
| 2318 | 2318 | |
| 2319 | 2319 | /* OAS CQ */ |
| 2320 | 2320 | qp = phba->sli4_hba.oas_cq; |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * 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 | ||
| 5634 | 5634 | ndlp->active_rrqs_xri_bitmap = |
| 5635 | 5635 | mempool_alloc(vport->phba->active_rrq_pool, |
| 5636 | 5636 | GFP_KERNEL); |
| 5637 | + if (ndlp->active_rrqs_xri_bitmap) | |
| 5638 | + memset(ndlp->active_rrqs_xri_bitmap, 0, | |
| 5639 | + ndlp->phba->cfg_rrq_xri_bitmap_sz); | |
| 5637 | 5640 | } |
| 5638 | 5641 | |
| 5639 | 5642 | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2009-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2009-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
| @@ -820,57 +820,153 @@ lpfc_hba_down_prep(struct lpfc_hba *phba) · 812 unmodified lines | ||
| 820 | 820 | } |
| 821 | 821 | |
| 822 | 822 | /** |
| 823 | − * lpfc_hba_down_post_s3 - Perform lpfc uninitialization after HBA reset | |
| 823 | + * lpfc_sli4_free_sp_events - Cleanup sp_queue_events to free | |
| 824 | + * rspiocb which got deferred | |
| 825 | + * | |
| 824 | 826 | * @phba: pointer to lpfc HBA data structure. |
| 825 | 827 | * |
| 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 | + * | |
| 828 | 831 | * |
| 829 | 832 | * Return codes |
| 830 | − * 0 - success. | |
| 831 | − * Any other value - error. | |
| 833 | + * void. | |
| 832 | 834 | **/ |
| 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) | |
| 835 | 881 | { |
| 836 | 882 | struct lpfc_sli *psli = &phba->sli; |
| 837 | 883 | struct lpfc_sli_ring *pring; |
| 838 | 884 | struct lpfc_dmabuf *mp, *next_mp; |
| 839 | − LIST_HEAD(completions); | |
| 840 | − int i; | |
| 885 | + LIST_HEAD(buflist); | |
| 886 | + int count; | |
| 841 | 887 | |
| 842 | 888 | if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) |
| 843 | 889 | lpfc_sli_hbqbuf_free_all(phba); |
| 844 | 890 | else { |
| 845 | 891 | /* Cleanup preposted buffers on the ELS ring */ |
| 846 | 892 | pring = &psli->ring[LPFC_ELS_RING]; |
| 847 | − list_for_each_entry_safe(mp, next_mp, &pring->postbufq, list) { | |
| 893 | + spin_lock_irq(&phba->hbalock); | |
| 894 | + list_splice_init(&pring->postbufq, &buflist); | |
| 895 | + spin_unlock_irq(&phba->hbalock); | |
| 896 | + | |
| 897 | + count = 0; | |
| 898 | + list_for_each_entry_safe(mp, next_mp, &buflist, list) { | |
| 848 | 899 | list_del(&mp->list); |
| 849 | − pring->postbufq_cnt--; | |
| 900 | + count++; | |
| 850 | 901 | lpfc_mbuf_free(phba, mp->virt, mp->phys); |
| 851 | 902 | kfree(mp); |
| 852 | 903 | } |
| 904 | + | |
| 905 | + spin_lock_irq(&phba->hbalock); | |
| 906 | + pring->postbufq_cnt -= count; | |
| 907 | + spin_unlock_irq(&phba->hbalock); | |
| 853 | 908 | } |
| 909 | +} | |
| 910 | + | |
| 911 | +/** | |
| 912 | + * lpfc_hba_clean_txcmplq - Perform lpfc uninitialization after HBA reset | |
| 913 | + * @phba: pointer to lpfc HBA data structure. | |
| 914 | + * | |
| 915 | + * This routine will cleanup the txcmplq after the HBA is reset when bringing | |
| 916 | + * down the SLI Layer. | |
| 917 | + * | |
| 918 | + * Return codes | |
| 919 | + * void | |
| 920 | + **/ | |
| 921 | +static void | |
| 922 | +lpfc_hba_clean_txcmplq(struct lpfc_hba *phba) | |
| 923 | +{ | |
| 924 | + struct lpfc_sli *psli = &phba->sli; | |
| 925 | + struct lpfc_sli_ring *pring; | |
| 926 | + LIST_HEAD(completions); | |
| 927 | + int i; | |
| 854 | 928 | |
| 855 | − spin_lock_irq(&phba->hbalock); | |
| 856 | 929 | for (i = 0; i < psli->num_rings; i++) { |
| 857 | 930 | pring = &psli->ring[i]; |
| 858 | − | |
| 931 | + if (phba->sli_rev >= LPFC_SLI_REV4) | |
| 932 | + spin_lock_irq(&pring->ring_lock); | |
| 933 | + else | |
| 934 | + spin_lock_irq(&phba->hbalock); | |
| 859 | 935 | /* At this point in time the HBA is either reset or DOA. Either |
| 860 | 936 | * way, nothing should be on txcmplq as it will NEVER complete. |
| 861 | 937 | */ |
| 862 | 938 | list_splice_init(&pring->txcmplq, &completions); |
| 863 | − spin_unlock_irq(&phba->hbalock); | |
| 939 | + pring->txcmplq_cnt = 0; | |
| 940 | + | |
| 941 | + if (phba->sli_rev >= LPFC_SLI_REV4) | |
| 942 | + spin_unlock_irq(&pring->ring_lock); | |
| 943 | + else | |
| 944 | + spin_unlock_irq(&phba->hbalock); | |
| 864 | 945 | |
| 865 | 946 | /* Cancel all the IOCBs from the completions list */ |
| 866 | 947 | lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT, |
| 867 | 948 | IOERR_SLI_ABORTED); |
| 868 | − | |
| 869 | 949 | lpfc_sli_abort_iocb_ring(phba, pring); |
| 870 | − spin_lock_irq(&phba->hbalock); | |
| 871 | 950 | } |
| 872 | − spin_unlock_irq(&phba->hbalock); | |
| 951 | +} | |
| 873 | 952 | |
| 953 | +/** | |
| 954 | + * lpfc_hba_down_post_s3 - Perform lpfc uninitialization after HBA reset | |
| 955 | + int i; | |
| 956 | + * @phba: pointer to lpfc HBA data structure. | |
| 957 | + * | |
| 958 | + * This routine will do uninitialization after the HBA is reset when bring | |
| 959 | + * down the SLI Layer. | |
| 960 | + * | |
| 961 | + * Return codes | |
| 962 | + * 0 - success. | |
| 963 | + * Any other value - error. | |
| 964 | + **/ | |
| 965 | +static int | |
| 966 | +lpfc_hba_down_post_s3(struct lpfc_hba *phba) | |
| 967 | +{ | |
| 968 | + lpfc_hba_free_post_buf(phba); | |
| 969 | + lpfc_hba_clean_txcmplq(phba); | |
| 874 | 970 | return 0; |
| 875 | 971 | } |
| 876 | 972 | |
| @@ -890,13 +986,12 @@ lpfc_hba_down_post_s4(struct lpfc_hba *phba) · 13 unmodified lines | ||
| 890 | 986 | { |
| 891 | 987 | struct lpfc_scsi_buf *psb, *psb_next; |
| 892 | 988 | LIST_HEAD(aborts); |
| 893 | − int ret; | |
| 894 | 989 | unsigned long iflag = 0; |
| 895 | 990 | struct lpfc_sglq *sglq_entry = NULL; |
| 896 | 991 | |
| 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 | + | |
| 900 | 995 | /* At this point in time the HBA is either reset or DOA. Either |
| 901 | 996 | * way, nothing should be on lpfc_abts_els_sgl_list, it needs to be |
| 902 | 997 | * on the lpfc_sgl_list so that it can either be freed if the |
| @@ -932,6 +1027,8 @@ lpfc_hba_down_post_s4(struct lpfc_hba *phba) · 29 unmodified lines | ||
| 932 | 1027 | spin_lock_irqsave(&phba->scsi_buf_list_put_lock, iflag); |
| 933 | 1028 | list_splice(&aborts, &phba->lpfc_scsi_buf_list_put); |
| 934 | 1029 | spin_unlock_irqrestore(&phba->scsi_buf_list_put_lock, iflag); |
| 1030 | + | |
| 1031 | + lpfc_sli4_free_sp_events(phba); | |
| 935 | 1032 | return 0; |
| 936 | 1033 | } |
| 937 | 1034 | |
| @@ -1250,7 +1347,6 @@ static void · 312 unmodified lines | ||
| 1250 | 1347 | lpfc_handle_deferred_eratt(struct lpfc_hba *phba) |
| 1251 | 1348 | { |
| 1252 | 1349 | uint32_t old_host_status = phba->work_hs; |
| 1253 | − struct lpfc_sli_ring *pring; | |
| 1254 | 1350 | struct lpfc_sli *psli = &phba->sli; |
| 1255 | 1351 | |
| 1256 | 1352 | /* If the pci channel is offline, ignore possible errors, |
| @@ -1279,8 +1375,7 @@ lpfc_handle_deferred_eratt(struct lpfc_hba *phba) · 22 unmodified lines | ||
| 1279 | 1375 | * dropped by the firmware. Error iocb (I/O) on txcmplq and let the |
| 1280 | 1376 | * SCSI layer retry it after re-establishing link. |
| 1281 | 1377 | */ |
| 1282 | − pring = &psli->ring[psli->fcp_ring]; | |
| 1283 | − lpfc_sli_abort_iocb_ring(phba, pring); | |
| 1378 | + lpfc_sli_abort_fcp_rings(phba); | |
| 1284 | 1379 | |
| 1285 | 1380 | /* |
| 1286 | 1381 | * 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 | ||
| 1348 | 1443 | { |
| 1349 | 1444 | struct lpfc_vport *vport = phba->pport; |
| 1350 | 1445 | struct lpfc_sli *psli = &phba->sli; |
| 1351 | − struct lpfc_sli_ring *pring; | |
| 1352 | 1446 | uint32_t event_data; |
| 1353 | 1447 | unsigned long temperature; |
| 1354 | 1448 | struct temp_event temp_event_data; |
| @@ -1400,8 +1494,7 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba) · 45 unmodified lines | ||
| 1400 | 1494 | * Error iocb (I/O) on txcmplq and let the SCSI layer |
| 1401 | 1495 | * retry it after re-establishing link. |
| 1402 | 1496 | */ |
| 1403 | − pring = &psli->ring[psli->fcp_ring]; | |
| 1404 | − lpfc_sli_abort_iocb_ring(phba, pring); | |
| 1497 | + lpfc_sli_abort_fcp_rings(phba); | |
| 1405 | 1498 | |
| 1406 | 1499 | /* |
| 1407 | 1500 | * There was a firmware error. Take the hba offline and then |
| @@ -1940,78 +2033,81 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) · 532 unmodified lines | ||
| 1940 | 2033 | |
| 1941 | 2034 | switch (dev_id) { |
| 1942 | 2035 | case PCI_DEVICE_ID_FIREFLY: |
| 1943 | − m = (typeof(m)){"LP6000", "PCI", "Fibre Channel Adapter"}; | |
| 2036 | + m = (typeof(m)){"LP6000", "PCI", | |
| 2037 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 1944 | 2038 | break; |
| 1945 | 2039 | case PCI_DEVICE_ID_SUPERFLY: |
| 1946 | 2040 | 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", ""}; | |
| 1949 | 2042 | 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"; | |
| 1952 | 2045 | break; |
| 1953 | 2046 | case PCI_DEVICE_ID_DRAGONFLY: |
| 1954 | 2047 | m = (typeof(m)){"LP8000", "PCI", |
| 1955 | − "Fibre Channel Adapter"}; | |
| 2048 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 1956 | 2049 | break; |
| 1957 | 2050 | case PCI_DEVICE_ID_CENTAUR: |
| 1958 | 2051 | 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", ""}; | |
| 1961 | 2053 | 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"; | |
| 1964 | 2056 | break; |
| 1965 | 2057 | case PCI_DEVICE_ID_RFLY: |
| 1966 | 2058 | m = (typeof(m)){"LP952", "PCI", |
| 1967 | − "Fibre Channel Adapter"}; | |
| 2059 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 1968 | 2060 | break; |
| 1969 | 2061 | case PCI_DEVICE_ID_PEGASUS: |
| 1970 | 2062 | m = (typeof(m)){"LP9802", "PCI-X", |
| 1971 | − "Fibre Channel Adapter"}; | |
| 2063 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 1972 | 2064 | break; |
| 1973 | 2065 | case PCI_DEVICE_ID_THOR: |
| 1974 | 2066 | m = (typeof(m)){"LP10000", "PCI-X", |
| 1975 | − "Fibre Channel Adapter"}; | |
| 2067 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 1976 | 2068 | break; |
| 1977 | 2069 | case PCI_DEVICE_ID_VIPER: |
| 1978 | 2070 | m = (typeof(m)){"LPX1000", "PCI-X", |
| 1979 | − "Fibre Channel Adapter"}; | |
| 2071 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 1980 | 2072 | break; |
| 1981 | 2073 | case PCI_DEVICE_ID_PFLY: |
| 1982 | 2074 | m = (typeof(m)){"LP982", "PCI-X", |
| 1983 | − "Fibre Channel Adapter"}; | |
| 2075 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 1984 | 2076 | break; |
| 1985 | 2077 | case PCI_DEVICE_ID_TFLY: |
| 1986 | 2078 | m = (typeof(m)){"LP1050", "PCI-X", |
| 1987 | − "Fibre Channel Adapter"}; | |
| 2079 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 1988 | 2080 | break; |
| 1989 | 2081 | case PCI_DEVICE_ID_HELIOS: |
| 1990 | 2082 | m = (typeof(m)){"LP11000", "PCI-X2", |
| 1991 | − "Fibre Channel Adapter"}; | |
| 2083 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 1992 | 2084 | break; |
| 1993 | 2085 | case PCI_DEVICE_ID_HELIOS_SCSP: |
| 1994 | 2086 | m = (typeof(m)){"LP11000-SP", "PCI-X2", |
| 1995 | − "Fibre Channel Adapter"}; | |
| 2087 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 1996 | 2088 | break; |
| 1997 | 2089 | case PCI_DEVICE_ID_HELIOS_DCSP: |
| 1998 | 2090 | m = (typeof(m)){"LP11002-SP", "PCI-X2", |
| 1999 | − "Fibre Channel Adapter"}; | |
| 2091 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2000 | 2092 | break; |
| 2001 | 2093 | case PCI_DEVICE_ID_NEPTUNE: |
| 2002 | − m = (typeof(m)){"LPe1000", "PCIe", "Fibre Channel Adapter"}; | |
| 2094 | + m = (typeof(m)){"LPe1000", "PCIe", | |
| 2095 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2003 | 2096 | break; |
| 2004 | 2097 | case PCI_DEVICE_ID_NEPTUNE_SCSP: |
| 2005 | − m = (typeof(m)){"LPe1000-SP", "PCIe", "Fibre Channel Adapter"}; | |
| 2098 | + m = (typeof(m)){"LPe1000-SP", "PCIe", | |
| 2099 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2006 | 2100 | break; |
| 2007 | 2101 | case PCI_DEVICE_ID_NEPTUNE_DCSP: |
| 2008 | − m = (typeof(m)){"LPe1002-SP", "PCIe", "Fibre Channel Adapter"}; | |
| 2102 | + m = (typeof(m)){"LPe1002-SP", "PCIe", | |
| 2103 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2009 | 2104 | break; |
| 2010 | 2105 | case PCI_DEVICE_ID_BMID: |
| 2011 | 2106 | m = (typeof(m)){"LP1150", "PCI-X2", "Fibre Channel Adapter"}; |
| 2012 | 2107 | break; |
| 2013 | 2108 | case PCI_DEVICE_ID_BSMB: |
| 2014 | − m = (typeof(m)){"LP111", "PCI-X2", "Fibre Channel Adapter"}; | |
| 2109 | + m = (typeof(m)){"LP111", "PCI-X2", | |
| 2110 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2015 | 2111 | break; |
| 2016 | 2112 | case PCI_DEVICE_ID_ZEPHYR: |
| 2017 | 2113 | m = (typeof(m)){"LPe11000", "PCIe", "Fibre Channel Adapter"}; |
| @@ -2030,16 +2126,20 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) · 12 unmodified lines | ||
| 2030 | 2126 | m = (typeof(m)){"LPe111", "PCIe", "Fibre Channel Adapter"}; |
| 2031 | 2127 | break; |
| 2032 | 2128 | case PCI_DEVICE_ID_LP101: |
| 2033 | − m = (typeof(m)){"LP101", "PCI-X", "Fibre Channel Adapter"}; | |
| 2129 | + m = (typeof(m)){"LP101", "PCI-X", | |
| 2130 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2034 | 2131 | break; |
| 2035 | 2132 | case PCI_DEVICE_ID_LP10000S: |
| 2036 | − m = (typeof(m)){"LP10000-S", "PCI", "Fibre Channel Adapter"}; | |
| 2133 | + m = (typeof(m)){"LP10000-S", "PCI", | |
| 2134 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2037 | 2135 | break; |
| 2038 | 2136 | case PCI_DEVICE_ID_LP11000S: |
| 2039 | − m = (typeof(m)){"LP11000-S", "PCI-X2", "Fibre Channel Adapter"}; | |
| 2137 | + m = (typeof(m)){"LP11000-S", "PCI-X2", | |
| 2138 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2040 | 2139 | break; |
| 2041 | 2140 | case PCI_DEVICE_ID_LPE11000S: |
| 2042 | − m = (typeof(m)){"LPe11000-S", "PCIe", "Fibre Channel Adapter"}; | |
| 2141 | + m = (typeof(m)){"LPe11000-S", "PCIe", | |
| 2142 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2043 | 2143 | break; |
| 2044 | 2144 | case PCI_DEVICE_ID_SAT: |
| 2045 | 2145 | m = (typeof(m)){"LPe12000", "PCIe", "Fibre Channel Adapter"}; |
| @@ -2060,20 +2160,21 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) · 14 unmodified lines | ||
| 2060 | 2160 | m = (typeof(m)){"LPe12000-S", "PCIe", "Fibre Channel Adapter"}; |
| 2061 | 2161 | break; |
| 2062 | 2162 | case PCI_DEVICE_ID_HORNET: |
| 2063 | − m = (typeof(m)){"LP21000", "PCIe", "FCoE Adapter"}; | |
| 2163 | + m = (typeof(m)){"LP21000", "PCIe", | |
| 2164 | + "Obsolete, Unsupported FCoE Adapter"}; | |
| 2064 | 2165 | GE = 1; |
| 2065 | 2166 | break; |
| 2066 | 2167 | case PCI_DEVICE_ID_PROTEUS_VF: |
| 2067 | 2168 | m = (typeof(m)){"LPev12000", "PCIe IOV", |
| 2068 | − "Fibre Channel Adapter"}; | |
| 2169 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2069 | 2170 | break; |
| 2070 | 2171 | case PCI_DEVICE_ID_PROTEUS_PF: |
| 2071 | 2172 | m = (typeof(m)){"LPev12000", "PCIe IOV", |
| 2072 | − "Fibre Channel Adapter"}; | |
| 2173 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2073 | 2174 | break; |
| 2074 | 2175 | case PCI_DEVICE_ID_PROTEUS_S: |
| 2075 | 2176 | m = (typeof(m)){"LPemv12002-S", "PCIe IOV", |
| 2076 | − "Fibre Channel Adapter"}; | |
| 2177 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2077 | 2178 | break; |
| 2078 | 2179 | case PCI_DEVICE_ID_TIGERSHARK: |
| 2079 | 2180 | oneConnect = 1; |
| @@ -2089,17 +2190,24 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) · 9 unmodified lines | ||
| 2089 | 2190 | break; |
| 2090 | 2191 | case PCI_DEVICE_ID_BALIUS: |
| 2091 | 2192 | m = (typeof(m)){"LPVe12002", "PCIe Shared I/O", |
| 2092 | − "Fibre Channel Adapter"}; | |
| 2193 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2093 | 2194 | break; |
| 2094 | 2195 | case PCI_DEVICE_ID_LANCER_FC: |
| 2095 | − case PCI_DEVICE_ID_LANCER_FC_VF: | |
| 2096 | 2196 | m = (typeof(m)){"LPe16000", "PCIe", "Fibre Channel Adapter"}; |
| 2097 | 2197 | break; |
| 2198 | + case PCI_DEVICE_ID_LANCER_FC_VF: | |
| 2199 | + m = (typeof(m)){"LPe16000", "PCIe", | |
| 2200 | + "Obsolete, Unsupported Fibre Channel Adapter"}; | |
| 2201 | + break; | |
| 2098 | 2202 | case PCI_DEVICE_ID_LANCER_FCOE: |
| 2099 | − case PCI_DEVICE_ID_LANCER_FCOE_VF: | |
| 2100 | 2203 | oneConnect = 1; |
| 2101 | 2204 | m = (typeof(m)){"OCe15100", "PCIe", "FCoE"}; |
| 2102 | 2205 | break; |
| 2206 | + case PCI_DEVICE_ID_LANCER_FCOE_VF: | |
| 2207 | + oneConnect = 1; | |
| 2208 | + m = (typeof(m)){"OCe15100", "PCIe", | |
| 2209 | + "Obsolete, Unsupported FCoE"}; | |
| 2210 | + break; | |
| 2103 | 2211 | case PCI_DEVICE_ID_SKYHAWK: |
| 2104 | 2212 | case PCI_DEVICE_ID_SKYHAWK_VF: |
| 2105 | 2213 | oneConnect = 1; |
| @@ -4614,7 +4722,10 @@ lpfc_reset_hba(struct lpfc_hba *phba) · 2508 unmodified lines | ||
| 4614 | 4722 | phba->link_state = LPFC_HBA_ERROR; |
| 4615 | 4723 | return; |
| 4616 | 4724 | } |
| 4617 | − lpfc_offline_prep(phba, LPFC_MBX_WAIT); | |
| 4725 | + if (phba->sli.sli_flag & LPFC_SLI_ACTIVE) | |
| 4726 | + lpfc_offline_prep(phba, LPFC_MBX_WAIT); | |
| 4727 | + else | |
| 4728 | + lpfc_offline_prep(phba, LPFC_MBX_NO_WAIT); | |
| 4618 | 4729 | lpfc_offline(phba); |
| 4619 | 4730 | lpfc_sli_brdrestart(phba); |
| 4620 | 4731 | lpfc_online(phba); |
| @@ -9663,9 +9774,6 @@ lpfc_pci_resume_one_s3(struct pci_dev *pdev) · 5042 unmodified lines | ||
| 9663 | 9774 | static void |
| 9664 | 9775 | lpfc_sli_prep_dev_for_recover(struct lpfc_hba *phba) |
| 9665 | 9776 | { |
| 9666 | − struct lpfc_sli *psli = &phba->sli; | |
| 9667 | − struct lpfc_sli_ring *pring; | |
| 9668 | − | |
| 9669 | 9777 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
| 9670 | 9778 | "2723 PCI channel I/O abort preparing for recovery\n"); |
| 9671 | 9779 | |
| @@ -9673,8 +9781,7 @@ lpfc_sli_prep_dev_for_recover(struct lpfc_hba *phba) · 1 unmodified line | ||
| 9673 | 9781 | * There may be errored I/Os through HBA, abort all I/Os on txcmplq |
| 9674 | 9782 | * and let the SCSI mid-layer to retry them to recover. |
| 9675 | 9783 | */ |
| 9676 | − pring = &psli->ring[psli->fcp_ring]; | |
| 9677 | − lpfc_sli_abort_iocb_ring(phba, pring); | |
| 9784 | + lpfc_sli_abort_fcp_rings(phba); | |
| 9678 | 9785 | } |
| 9679 | 9786 | |
| 9680 | 9787 | /** |
| @@ -10417,17 +10524,13 @@ lpfc_pci_resume_one_s4(struct pci_dev *pdev) · 736 unmodified lines | ||
| 10417 | 10524 | static void |
| 10418 | 10525 | lpfc_sli4_prep_dev_for_recover(struct lpfc_hba *phba) |
| 10419 | 10526 | { |
| 10420 | − struct lpfc_sli *psli = &phba->sli; | |
| 10421 | − struct lpfc_sli_ring *pring; | |
| 10422 | − | |
| 10423 | 10527 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
| 10424 | 10528 | "2828 PCI channel I/O abort preparing for recovery\n"); |
| 10425 | 10529 | /* |
| 10426 | 10530 | * There may be errored I/Os through HBA, abort all I/Os on txcmplq |
| 10427 | 10531 | * and let the SCSI mid-layer to retry them to recover. |
| 10428 | 10532 | */ |
| 10429 | − pring = &psli->ring[psli->fcp_ring]; | |
| 10430 | − lpfc_sli_abort_iocb_ring(phba, pring); | |
| 10533 | + lpfc_sli_abort_fcp_rings(phba); | |
| 10431 | 10534 | } |
| 10432 | 10535 | |
| 10433 | 10536 | /** |
| @@ -10898,7 +11001,7 @@ lpfc_sli4_oas_verify(struct lpfc_hba *phba) · 464 unmodified lines | ||
| 10898 | 11001 | if (phba->sli4_hba.pc_sli4_params.oas_supported) { |
| 10899 | 11002 | phba->cfg_fof = 1; |
| 10900 | 11003 | } else { |
| 10901 | − phba->cfg_EnableXLane = 0; | |
| 11004 | + phba->cfg_fof = 0; | |
| 10902 | 11005 | if (phba->device_data_mem_pool) |
| 10903 | 11006 | mempool_destroy(phba->device_data_mem_pool); |
| 10904 | 11007 | phba->device_data_mem_pool = NULL; |
| @@ -10928,7 +11031,7 @@ lpfc_fof_queue_setup(struct lpfc_hba *phba) · 23 unmodified lines | ||
| 10928 | 11031 | if (rc) |
| 10929 | 11032 | return -ENOMEM; |
| 10930 | 11033 | |
| 10931 | − if (phba->cfg_EnableXLane) { | |
| 11034 | + if (phba->cfg_fof) { | |
| 10932 | 11035 | |
| 10933 | 11036 | rc = lpfc_cq_create(phba, phba->sli4_hba.oas_cq, |
| 10934 | 11037 | phba->sli4_hba.fof_eq, LPFC_WCQ, LPFC_FCP); |
| @@ -10947,8 +11050,7 @@ lpfc_fof_queue_setup(struct lpfc_hba *phba) · 12 unmodified lines | ||
| 10947 | 11050 | return 0; |
| 10948 | 11051 | |
| 10949 | 11052 | 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); | |
| 10952 | 11054 | out_oas_cq: |
| 10953 | 11055 | lpfc_eq_destroy(phba, phba->sli4_hba.fof_eq); |
| 10954 | 11056 | return rc; |
| @@ -10982,7 +11084,7 @@ lpfc_fof_queue_create(struct lpfc_hba *phba) · 27 unmodified lines | ||
| 10982 | 11084 | |
| 10983 | 11085 | phba->sli4_hba.fof_eq = qdesc; |
| 10984 | 11086 | |
| 10985 | − if (phba->cfg_EnableXLane) { | |
| 11087 | + if (phba->cfg_fof) { | |
| 10986 | 11088 | |
| 10987 | 11089 | /* Create OAS CQ */ |
| 10988 | 11090 | qdesc = lpfc_sli4_queue_alloc(phba, phba->sli4_hba.cq_esize, |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2012 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
| @@ -73,7 +73,7 @@ lpfc_rport_data_from_scsi_device(struct scsi_device *sdev) · 65 unmodified lines | ||
| 73 | 73 | { |
| 74 | 74 | struct lpfc_vport *vport = (struct lpfc_vport *)sdev->host->hostdata; |
| 75 | 75 | |
| 76 | − if (vport->phba->cfg_EnableXLane) | |
| 76 | + if (vport->phba->cfg_fof) | |
| 77 | 77 | return ((struct lpfc_device_data *)sdev->hostdata)->rport_data; |
| 78 | 78 | else |
| 79 | 79 | return (struct lpfc_rport_data *)sdev->hostdata; |
| @@ -3462,7 +3462,7 @@ lpfc_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd) · 3382 unmodified lines | ||
| 3462 | 3462 | * If the OAS driver feature is enabled and the lun is enabled for |
| 3463 | 3463 | * OAS, set the oas iocb related flags. |
| 3464 | 3464 | */ |
| 3465 | − if ((phba->cfg_EnableXLane) && ((struct lpfc_device_data *) | |
| 3465 | + if ((phba->cfg_fof) && ((struct lpfc_device_data *) | |
| 3466 | 3466 | scsi_cmnd->device->hostdata)->oas_enabled) |
| 3467 | 3467 | lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_OAS; |
| 3468 | 3468 | return 0; |
| @@ -4314,6 +4314,7 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, · 845 unmodified lines | ||
| 4314 | 4314 | fcp_cmnd->fcpCntl1 = SIMPLE_Q; |
| 4315 | 4315 | |
| 4316 | 4316 | sli4 = (phba->sli_rev == LPFC_SLI_REV4); |
| 4317 | + piocbq->iocb.un.fcpi.fcpi_XRdy = 0; | |
| 4317 | 4318 | |
| 4318 | 4319 | /* |
| 4319 | 4320 | * There are three possibilities here - use scatter-gather segment, use |
| @@ -4782,7 +4783,9 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) · 462 unmodified lines | ||
| 4782 | 4783 | struct lpfc_scsi_buf *lpfc_cmd; |
| 4783 | 4784 | IOCB_t *cmd, *icmd; |
| 4784 | 4785 | int ret = SUCCESS, status = 0; |
| 4785 | − unsigned long flags; | |
| 4786 | + struct lpfc_sli_ring *pring_s4; | |
| 4787 | + int ring_number, ret_val; | |
| 4788 | + unsigned long flags, iflags; | |
| 4786 | 4789 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waitq); |
| 4787 | 4790 | |
| 4788 | 4791 | status = fc_block_scsi_eh(cmnd); |
| @@ -4833,6 +4836,14 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) · 44 unmodified lines | ||
| 4833 | 4836 | |
| 4834 | 4837 | BUG_ON(iocb->context1 != lpfc_cmd); |
| 4835 | 4838 | |
| 4839 | + /* abort issued in recovery is still in progress */ | |
| 4840 | + if (iocb->iocb_flag & LPFC_DRIVER_ABORTED) { | |
| 4841 | + lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP, | |
| 4842 | + "3389 SCSI Layer I/O Abort Request is pending\n"); | |
| 4843 | + spin_unlock_irqrestore(&phba->hbalock, flags); | |
| 4844 | + goto wait_for_cmpl; | |
| 4845 | + } | |
| 4846 | + | |
| 4836 | 4847 | abtsiocb = __lpfc_sli_get_iocbq(phba); |
| 4837 | 4848 | if (abtsiocb == NULL) { |
| 4838 | 4849 | ret = FAILED; |
| @@ -4871,11 +4882,23 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) · 32 unmodified lines | ||
| 4871 | 4882 | |
| 4872 | 4883 | abtsiocb->iocb_cmpl = lpfc_sli_abort_fcp_cmpl; |
| 4873 | 4884 | abtsiocb->vport = vport; |
| 4885 | + if (phba->sli_rev == LPFC_SLI_REV4) { | |
| 4886 | + ring_number = MAX_SLI3_CONFIGURED_RINGS + iocb->fcp_wqidx; | |
| 4887 | + pring_s4 = &phba->sli.ring[ring_number]; | |
| 4888 | + /* Note: both hbalock and ring_lock must be set here */ | |
| 4889 | + spin_lock_irqsave(&pring_s4->ring_lock, iflags); | |
| 4890 | + ret_val = __lpfc_sli_issue_iocb(phba, pring_s4->ringno, | |
| 4891 | + abtsiocb, 0); | |
| 4892 | + spin_unlock_irqrestore(&pring_s4->ring_lock, iflags); | |
| 4893 | + } else { | |
| 4894 | + ret_val = __lpfc_sli_issue_iocb(phba, LPFC_FCP_RING, | |
| 4895 | + abtsiocb, 0); | |
| 4896 | + } | |
| 4874 | 4897 | /* no longer need the lock after this point */ |
| 4875 | 4898 | spin_unlock_irqrestore(&phba->hbalock, flags); |
| 4876 | 4899 | |
| 4877 | − if (lpfc_sli_issue_iocb(phba, LPFC_FCP_RING, abtsiocb, 0) == | |
| 4878 | − IOCB_ERROR) { | |
| 4900 | + | |
| 4901 | + if (ret_val == IOCB_ERROR) { | |
| 4879 | 4902 | lpfc_sli_release_iocbq(phba, abtsiocb); |
| 4880 | 4903 | ret = FAILED; |
| 4881 | 4904 | goto out; |
| @@ -4885,12 +4908,16 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) · 3 unmodified lines | ||
| 4885 | 4908 | lpfc_sli_handle_fast_ring_event(phba, |
| 4886 | 4909 | &phba->sli.ring[LPFC_FCP_RING], HA_R0RE_REQ); |
| 4887 | 4910 | |
| 4911 | +wait_for_cmpl: | |
| 4888 | 4912 | lpfc_cmd->waitq = &waitq; |
| 4889 | 4913 | /* Wait for abort to complete */ |
| 4890 | 4914 | wait_event_timeout(waitq, |
| 4891 | 4915 | (lpfc_cmd->pCmd != cmnd), |
| 4892 | 4916 | msecs_to_jiffies(2*vport->cfg_devloss_tmo*1000)); |
| 4917 | + | |
| 4918 | + spin_lock_irqsave(shost->host_lock, flags); | |
| 4893 | 4919 | lpfc_cmd->waitq = NULL; |
| 4920 | + spin_unlock_irqrestore(shost->host_lock, flags); | |
| 4894 | 4921 | |
| 4895 | 4922 | if (lpfc_cmd->pCmd == cmnd) { |
| 4896 | 4923 | ret = FAILED; |
| @@ -5172,8 +5199,9 @@ lpfc_reset_flush_io_context(struct lpfc_vport *vport, uint16_t tgt_id, · 275 unmodified lines | ||
| 5172 | 5199 | |
| 5173 | 5200 | cnt = lpfc_sli_sum_iocb(vport, tgt_id, lun_id, context); |
| 5174 | 5201 | 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); | |
| 5177 | 5205 | later = msecs_to_jiffies(2 * vport->cfg_devloss_tmo * 1000) + jiffies; |
| 5178 | 5206 | while (time_after(later, jiffies) && cnt) { |
| 5179 | 5207 | schedule_timeout_uninterruptible(msecs_to_jiffies(20)); |
| @@ -5491,7 +5519,7 @@ lpfc_slave_alloc(struct scsi_device *sdev) · 311 unmodified lines | ||
| 5491 | 5519 | if (!rport || fc_remote_port_chkready(rport)) |
| 5492 | 5520 | return -ENXIO; |
| 5493 | 5521 | |
| 5494 | − if (phba->cfg_EnableXLane) { | |
| 5522 | + if (phba->cfg_fof) { | |
| 5495 | 5523 | |
| 5496 | 5524 | /* |
| 5497 | 5525 | * 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 | ||
| 5616 | 5644 | struct lpfc_device_data *device_data = sdev->hostdata; |
| 5617 | 5645 | |
| 5618 | 5646 | atomic_dec(&phba->sdev_cnt); |
| 5619 | − if ((phba->cfg_EnableXLane) && (device_data)) { | |
| 5647 | + if ((phba->cfg_fof) && (device_data)) { | |
| 5620 | 5648 | spin_lock_irqsave(&phba->devicelock, flags); |
| 5621 | 5649 | device_data->available = false; |
| 5622 | 5650 | 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 | ||
| 5655 | 5683 | int memory_flags; |
| 5656 | 5684 | |
| 5657 | 5685 | if (unlikely(!phba) || !vport_wwpn || !target_wwpn || |
| 5658 | − !(phba->cfg_EnableXLane)) | |
| 5686 | + !(phba->cfg_fof)) | |
| 5659 | 5687 | return NULL; |
| 5660 | 5688 | |
| 5661 | 5689 | /* 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 | ||
| 5693 | 5721 | { |
| 5694 | 5722 | |
| 5695 | 5723 | if (unlikely(!phba) || !lun_info || |
| 5696 | − !(phba->cfg_EnableXLane)) | |
| 5724 | + !(phba->cfg_fof)) | |
| 5697 | 5725 | return; |
| 5698 | 5726 | |
| 5699 | 5727 | 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 | ||
| 5727 | 5755 | struct lpfc_device_data *lun_info; |
| 5728 | 5756 | |
| 5729 | 5757 | if (unlikely(!phba) || !list || !vport_wwpn || !target_wwpn || |
| 5730 | − !phba->cfg_EnableXLane) | |
| 5758 | + !phba->cfg_fof) | |
| 5731 | 5759 | return NULL; |
| 5732 | 5760 | |
| 5733 | 5761 | /* Check to see if the lun is already enabled for OAS. */ |
| @@ -5789,7 +5817,7 @@ lpfc_find_next_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn, · 55 unmodified lines | ||
| 5789 | 5817 | !starting_lun || !found_vport_wwpn || |
| 5790 | 5818 | !found_target_wwpn || !found_lun || !found_lun_status || |
| 5791 | 5819 | (*starting_lun == NO_MORE_OAS_LUN) || |
| 5792 | − !phba->cfg_EnableXLane) | |
| 5820 | + !phba->cfg_fof) | |
| 5793 | 5821 | return false; |
| 5794 | 5822 | |
| 5795 | 5823 | lun = *starting_lun; |
| @@ -5873,7 +5901,7 @@ lpfc_enable_oas_lun(struct lpfc_hba *phba, struct lpfc_name *vport_wwpn, · 77 unmodified lines | ||
| 5873 | 5901 | unsigned long flags; |
| 5874 | 5902 | |
| 5875 | 5903 | if (unlikely(!phba) || !vport_wwpn || !target_wwpn || |
| 5876 | − !phba->cfg_EnableXLane) | |
| 5904 | + !phba->cfg_fof) | |
| 5877 | 5905 | return false; |
| 5878 | 5906 | |
| 5879 | 5907 | 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 | ||
| 5930 | 5958 | unsigned long flags; |
| 5931 | 5959 | |
| 5932 | 5960 | if (unlikely(!phba) || !vport_wwpn || !target_wwpn || |
| 5933 | − !phba->cfg_EnableXLane) | |
| 5961 | + !phba->cfg_fof) | |
| 5934 | 5962 | return false; |
| 5935 | 5963 | |
| 5936 | 5964 | spin_lock_irqsave(&phba->devicelock, flags); |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * 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 | ||
| 3532 | 3532 | /* Error everything on txq and txcmplq |
| 3533 | 3533 | * First do the txq. |
| 3534 | 3534 | */ |
| 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); | |
| 3537 | 3540 | |
| 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; | |
| 3541 | 3550 | |
| 3542 | − spin_unlock_irq(&phba->hbalock); | |
| 3551 | + /* Next issue ABTS for everything on the txcmplq */ | |
| 3552 | + list_for_each_entry_safe(iocb, next_iocb, &pring->txcmplq, list) | |
| 3553 | + lpfc_sli_issue_abort_iotag(phba, pring, iocb); | |
| 3554 | + spin_unlock_irq(&phba->hbalock); | |
| 3555 | + } | |
| 3543 | 3556 | |
| 3544 | 3557 | /* Cancel all the IOCBs from the completions list */ |
| 3545 | 3558 | lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT, |
| 3546 | 3559 | IOERR_SLI_ABORTED); |
| 3547 | 3560 | } |
| 3548 | 3561 | |
| 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 | + | |
| 3549 | 3592 | /** |
| 3550 | 3593 | * lpfc_sli_flush_fcp_rings - flush all iocbs in the fcp ring |
| 3551 | 3594 | * @phba: Pointer to HBA context object. |
| @@ -3563,28 +3606,55 @@ lpfc_sli_flush_fcp_rings(struct lpfc_hba *phba) · 11 unmodified lines | ||
| 3563 | 3606 | LIST_HEAD(txcmplq); |
| 3564 | 3607 | struct lpfc_sli *psli = &phba->sli; |
| 3565 | 3608 | struct lpfc_sli_ring *pring; |
| 3566 | − | |
| 3567 | − /* Currently, only one fcp ring */ | |
| 3568 | − pring = &psli->ring[psli->fcp_ring]; | |
| 3609 | + uint32_t i; | |
| 3569 | 3610 | |
| 3570 | 3611 | spin_lock_irq(&phba->hbalock); |
| 3571 | − /* Retrieve everything on txq */ | |
| 3572 | − list_splice_init(&pring->txq, &txq); | |
| 3573 | − | |
| 3574 | − /* Retrieve everything on the txcmplq */ | |
| 3575 | − list_splice_init(&pring->txcmplq, &txcmplq); | |
| 3576 | − | |
| 3577 | 3612 | /* Indicate the I/O queues are flushed */ |
| 3578 | 3613 | phba->hba_flag |= HBA_FCP_IOQ_FLUSH; |
| 3579 | 3614 | spin_unlock_irq(&phba->hbalock); |
| 3580 | 3615 | |
| 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]; | |
| 3584 | 3641 | |
| 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 | + } | |
| 3588 | 3658 | } |
| 3589 | 3659 | |
| 3590 | 3660 | /** |
| @@ -3987,12 +4057,13 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba) · 396 unmodified lines | ||
| 3987 | 4057 | { |
| 3988 | 4058 | struct lpfc_sli *psli = &phba->sli; |
| 3989 | 4059 | uint16_t cfg_value; |
| 3990 | − int rc; | |
| 4060 | + int rc = 0; | |
| 3991 | 4061 | |
| 3992 | 4062 | /* Reset HBA */ |
| 3993 | 4063 | 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); | |
| 3996 | 4067 | |
| 3997 | 4068 | /* perform board reset */ |
| 3998 | 4069 | phba->fc_eventTag = 0; |
| @@ -4005,6 +4076,12 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba) · 6 unmodified lines | ||
| 4005 | 4076 | phba->fcf.fcf_flag = 0; |
| 4006 | 4077 | spin_unlock_irq(&phba->hbalock); |
| 4007 | 4078 | |
| 4079 | + /* SLI4 INTF 2: if FW dump is being taken skip INIT_PORT */ | |
| 4080 | + if (phba->hba_flag & HBA_FW_DUMP_OP) { | |
| 4081 | + phba->hba_flag &= ~HBA_FW_DUMP_OP; | |
| 4082 | + return rc; | |
| 4083 | + } | |
| 4084 | + | |
| 4008 | 4085 | /* Now physically reset the device */ |
| 4009 | 4086 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, |
| 4010 | 4087 | "0389 Performing PCI function reset!\n"); |
| @@ -5002,7 +5079,7 @@ lpfc_sli4_arm_cqeq_intr(struct lpfc_hba *phba) · 991 unmodified lines | ||
| 5002 | 5079 | } while (++fcp_eqidx < phba->cfg_fcp_io_channel); |
| 5003 | 5080 | } |
| 5004 | 5081 | |
| 5005 | − if (phba->cfg_EnableXLane) | |
| 5082 | + if (phba->cfg_fof) | |
| 5006 | 5083 | lpfc_sli4_cq_release(phba->sli4_hba.oas_cq, LPFC_QUEUE_REARM); |
| 5007 | 5084 | |
| 5008 | 5085 | if (phba->sli4_hba.hba_eq) { |
| @@ -6722,7 +6799,6 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) · 1713 unmodified lines | ||
| 6722 | 6799 | LPFC_MBOXQ_t *pmbox = phba->sli.mbox_active; |
| 6723 | 6800 | MAILBOX_t *mb = &pmbox->u.mb; |
| 6724 | 6801 | struct lpfc_sli *psli = &phba->sli; |
| 6725 | − struct lpfc_sli_ring *pring; | |
| 6726 | 6802 | |
| 6727 | 6803 | /* If the mailbox completed, process the completion and return */ |
| 6728 | 6804 | if (lpfc_sli4_process_missed_mbox_completions(phba)) |
| @@ -6764,8 +6840,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) · 35 unmodified lines | ||
| 6764 | 6840 | psli->sli_flag &= ~LPFC_SLI_ACTIVE; |
| 6765 | 6841 | spin_unlock_irq(&phba->hbalock); |
| 6766 | 6842 | |
| 6767 | − pring = &psli->ring[psli->fcp_ring]; | |
| 6768 | − lpfc_sli_abort_iocb_ring(phba, pring); | |
| 6843 | + lpfc_sli_abort_fcp_rings(phba); | |
| 6769 | 6844 | |
| 6770 | 6845 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, |
| 6771 | 6846 | "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 | ||
| 8133 | 8208 | abort_tag = (uint32_t) iocbq->iotag; |
| 8134 | 8209 | xritag = iocbq->sli4_xritag; |
| 8135 | 8210 | wqe->generic.wqe_com.word7 = 0; /* The ct field has moved so reset */ |
| 8211 | + wqe->generic.wqe_com.word10 = 0; | |
| 8136 | 8212 | /* words0-2 bpl convert bde */ |
| 8137 | 8213 | if (iocbq->iocb.un.genreq64.bdl.bdeFlags == BUFF_TYPE_BLP_64) { |
| 8138 | 8214 | numBdes = iocbq->iocb.un.genreq64.bdl.bdeSize / |
| @@ -8639,8 +8715,7 @@ __lpfc_sli_issue_iocb_s4(struct lpfc_hba *phba, uint32_t ring_number, · 500 unmodified lines | ||
| 8639 | 8715 | |
| 8640 | 8716 | if ((piocb->iocb_flag & LPFC_IO_FCP) || |
| 8641 | 8717 | (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))) { | |
| 8644 | 8719 | wq = phba->sli4_hba.fcp_wq[piocb->fcp_wqidx]; |
| 8645 | 8720 | } else { |
| 8646 | 8721 | 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 | ||
| 8735 | 8810 | |
| 8736 | 8811 | if (phba->sli_rev == LPFC_SLI_REV4) { |
| 8737 | 8812 | if (piocb->iocb_flag & LPFC_IO_FCP) { |
| 8738 | − if (!phba->cfg_EnableXLane || (!(piocb->iocb_flag & | |
| 8813 | + if (!phba->cfg_fof || (!(piocb->iocb_flag & | |
| 8739 | 8814 | LPFC_IO_OAS))) { |
| 8740 | 8815 | if (unlikely(!phba->sli4_hba.fcp_wq)) |
| 8741 | 8816 | return IOCB_ERROR; |
| @@ -9170,6 +9245,7 @@ lpfc_sli_queue_setup(struct lpfc_hba *phba) · 428 unmodified lines | ||
| 9170 | 9245 | pring->sli.sli3.next_cmdidx = 0; |
| 9171 | 9246 | pring->sli.sli3.local_getidx = 0; |
| 9172 | 9247 | pring->sli.sli3.cmdidx = 0; |
| 9248 | + pring->flag = 0; | |
| 9173 | 9249 | INIT_LIST_HEAD(&pring->txq); |
| 9174 | 9250 | INIT_LIST_HEAD(&pring->txcmplq); |
| 9175 | 9251 | INIT_LIST_HEAD(&pring->iocb_continueq); |
| @@ -9804,43 +9880,6 @@ abort_iotag_exit: · 628 unmodified lines | ||
| 9804 | 9880 | return retval; |
| 9805 | 9881 | } |
| 9806 | 9882 | |
| 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 | − | |
| 9844 | 9883 | /** |
| 9845 | 9884 | * lpfc_sli_hba_iocb_abort - Abort all iocbs to an hba. |
| 9846 | 9885 | * @phba: pointer to lpfc HBA data structure. |
| @@ -9856,7 +9895,7 @@ lpfc_sli_hba_iocb_abort(struct lpfc_hba *phba) · 9 unmodified lines | ||
| 9856 | 9895 | |
| 9857 | 9896 | for (i = 0; i < psli->num_rings; i++) { |
| 9858 | 9897 | pring = &psli->ring[i]; |
| 9859 | − lpfc_sli_iocb_ring_abort(phba, pring); | |
| 9898 | + lpfc_sli_abort_iocb_ring(phba, pring); | |
| 9860 | 9899 | } |
| 9861 | 9900 | } |
| 9862 | 9901 | |
| @@ -10080,6 +10119,124 @@ lpfc_sli_abort_iocb(struct lpfc_vport *vport, struct lpfc_sli_ring *pring, · 217 unmodified lines | ||
| 10080 | 10119 | return errcnt; |
| 10081 | 10120 | } |
| 10082 | 10121 | |
| 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 | + | |
| 10083 | 10240 | /** |
| 10084 | 10241 | * lpfc_sli_wake_iocb_wait - lpfc_sli_issue_iocb_wait's completion handler |
| 10085 | 10242 | * @phba: Pointer to HBA context object. |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2009-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2009-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /******************************************************************* |
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | − * Copyright (C) 2004-2013 Emulex. All rights reserved. * | |
| 4 | + * Copyright (C) 2004-2014 Emulex. All rights reserved. * | |
| 5 | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | 6 | * www.emulex.com * |
| 7 | 7 | * * |
| @@ -18,7 +18,7 @@ · 10 unmodified lines | ||
| 18 | 18 | * included with this package. * |
| 19 | 19 | *******************************************************************/ |
| 20 | 20 | |
| 21 | −#define LPFC_DRIVER_VERSION "8.3.45" | |
| 21 | +#define LPFC_DRIVER_VERSION "10.2.8001.0." | |
| 22 | 22 | #define LPFC_DRIVER_NAME "lpfc" |
| 23 | 23 | |
| 24 | 24 | /* Used for SLI 2/3 */ |
| @@ -30,4 +30,4 @@ · 5 unmodified lines | ||
| 30 | 30 | |
| 31 | 31 | #define LPFC_MODULE_DESC "Emulex LightPulse Fibre Channel SCSI driver " \ |
| 32 | 32 | LPFC_DRIVER_VERSION |
| 33 | −#define LPFC_COPYRIGHT "Copyright(c) 2004-2013 Emulex. All rights reserved." | |
| 33 | +#define LPFC_COPYRIGHT "Copyright(c) 2004-2014 Emulex. All rights reserved." | |
| @@ -1648,16 +1648,16 @@ typedef struct { · 1647 unmodified lines | ||
| 1648 | 1648 | */ |
| 1649 | 1649 | struct crc_context { |
| 1650 | 1650 | uint32_t handle; /* System handle. */ |
| 1651 | − uint32_t ref_tag; | |
| 1652 | − uint16_t app_tag; | |
| 1651 | + __le32 ref_tag; | |
| 1652 | + __le16 app_tag; | |
| 1653 | 1653 | uint8_t ref_tag_mask[4]; /* Validation/Replacement Mask*/ |
| 1654 | 1654 | 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 */ | |
| 1658 | 1658 | uint16_t runt_blk_guard; /* Guard value for runt block (tape |
| 1659 | 1659 | * only) */ |
| 1660 | − uint32_t byte_count; /* Total byte count/ total data | |
| 1660 | + __le32 byte_count; /* Total byte count/ total data | |
| 1661 | 1661 | * transfer count */ |
| 1662 | 1662 | union { |
| 1663 | 1663 | struct { |
| @@ -1671,10 +1671,10 @@ struct crc_context { · 7 unmodified lines | ||
| 1671 | 1671 | uint32_t reserved_6; |
| 1672 | 1672 | } nobundling; |
| 1673 | 1673 | struct { |
| 1674 | − uint32_t dif_byte_count; /* Total DIF byte | |
| 1674 | + __le32 dif_byte_count; /* Total DIF byte | |
| 1675 | 1675 | * count */ |
| 1676 | 1676 | uint16_t reserved_1; |
| 1677 | − uint16_t dseg_count; /* Data segment count */ | |
| 1677 | + __le16 dseg_count; /* Data segment count */ | |
| 1678 | 1678 | uint32_t reserved_2; |
| 1679 | 1679 | uint32_t data_address[2]; |
| 1680 | 1680 | uint32_t data_length; |
| @@ -1996,7 +1996,7 @@ qlt_set_t10dif_tags(struct se_cmd *se_cmd, struct crc_context *ctx) · 1995 unmodified lines | ||
| 1996 | 1996 | * have been immplemented by TCM, before AppTag is avail. |
| 1997 | 1997 | * Look for modesense_handlers[] |
| 1998 | 1998 | */ |
| 1999 | − ctx->app_tag = __constant_cpu_to_le16(0); | |
| 1999 | + ctx->app_tag = 0; | |
| 2000 | 2000 | ctx->app_tag_mask[0] = 0x0; |
| 2001 | 2001 | ctx->app_tag_mask[1] = 0x0; |
| 2002 | 2002 | |
| @@ -2078,6 +2078,7 @@ qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha) · 75 unmodified lines | ||
| 2078 | 2078 | struct se_cmd *se_cmd = &cmd->se_cmd; |
| 2079 | 2079 | uint32_t h; |
| 2080 | 2080 | struct atio_from_isp *atio = &prm->cmd->atio; |
| 2081 | + uint16_t t16; | |
| 2081 | 2082 | |
| 2082 | 2083 | sgc = 0; |
| 2083 | 2084 | 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 | ||
| 2174 | 2175 | pkt->initiator_id[1] = atio->u.isp24.fcp_hdr.s_id[1]; |
| 2175 | 2176 | pkt->initiator_id[2] = atio->u.isp24.fcp_hdr.s_id[0]; |
| 2176 | 2177 | 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); | |
| 2179 | 2185 | pkt->relative_offset = cpu_to_le32(prm->cmd->offset); |
| 2180 | 2186 | |
| 2181 | 2187 | /* 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 | ||
| 2250 | 2256 | |
| 2251 | 2257 | if (bundling && prm->prot_seg_cnt) { |
| 2252 | 2258 | /* 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; | |
| 2255 | 2260 | |
| 2256 | 2261 | cur_dsd = (uint32_t *) &crc_ctx_pkt->u.bundling.dif_address; |
| 2257 | 2262 | if (qla24xx_walk_and_build_prot_sglist(ha, NULL, cur_dsd, |
| @@ -316,7 +316,7 @@ struct fcp_hdr { · 315 unmodified lines | ||
| 316 | 316 | uint8_t seq_id; |
| 317 | 317 | uint8_t df_ctl; |
| 318 | 318 | uint16_t seq_cnt; |
| 319 | − uint16_t ox_id; | |
| 319 | + __be16 ox_id; | |
| 320 | 320 | uint16_t rx_id; |
| 321 | 321 | uint32_t parameter; |
| 322 | 322 | } __packed; |
| @@ -441,7 +441,7 @@ struct ctio7_to_24xx { · 118 unmodified lines | ||
| 441 | 441 | union { |
| 442 | 442 | struct { |
| 443 | 443 | uint16_t reserved1; |
| 444 | − uint16_t flags; | |
| 444 | + __le16 flags; | |
| 445 | 445 | uint32_t residual; |
| 446 | 446 | uint16_t ox_id; |
| 447 | 447 | uint16_t scsi_status; |
| @@ -527,7 +527,7 @@ struct ctio_crc2_to_fw { · 79 unmodified lines | ||
| 527 | 527 | |
| 528 | 528 | uint32_t handle; /* System handle. */ |
| 529 | 529 | uint16_t nport_handle; /* N_PORT handle. */ |
| 530 | − uint16_t timeout; /* Command timeout. */ | |
| 530 | + __le16 timeout; /* Command timeout. */ | |
| 531 | 531 | |
| 532 | 532 | uint16_t dseg_count; /* Data segment count. */ |
| 533 | 533 | uint8_t vp_index; |
| @@ -538,15 +538,15 @@ struct ctio_crc2_to_fw { · 4 unmodified lines | ||
| 538 | 538 | uint8_t reserved1; |
| 539 | 539 | uint32_t exchange_addr; /* rcv exchange address */ |
| 540 | 540 | uint16_t reserved2; |
| 541 | − uint16_t flags; /* refer to CTIO7 flags values */ | |
| 541 | + __le16 flags; /* refer to CTIO7 flags values */ | |
| 542 | 542 | uint32_t residual; |
| 543 | − uint16_t ox_id; | |
| 543 | + __le16 ox_id; | |
| 544 | 544 | uint16_t scsi_status; |
| 545 | − uint32_t relative_offset; | |
| 545 | + __le32 relative_offset; | |
| 546 | 546 | uint32_t reserved5; |
| 547 | − uint32_t transfer_length; /* total fc transfer length */ | |
| 547 | + __le32 transfer_length; /* total fc transfer length */ | |
| 548 | 548 | uint32_t reserved6; |
| 549 | − uint32_t crc_context_address[2];/* Data segment address. */ | |
| 549 | + __le32 crc_context_address[2];/* Data segment address. */ | |
| 550 | 550 | uint16_t crc_context_len; /* Data segment length. */ |
| 551 | 551 | uint16_t reserved_1; /* MUST be set to 0. */ |
| 552 | 552 | } __packed; |