]> Pileus Git - ~andy/linux/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 Mar 2010 23:54:31 +0000 (16:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 Mar 2010 23:54:31 +0000 (16:54 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (69 commits)
  [SCSI] scsi_transport_fc: Fix synchronization issue while deleting vport
  [SCSI] bfa: Update the driver version to 2.1.2.1.
  [SCSI] bfa: Remove unused header files and did some cleanup.
  [SCSI] bfa: Handle SCSI IO underrun case.
  [SCSI] bfa: FCS and include file changes.
  [SCSI] bfa: Modified the portstats get/clear logic
  [SCSI] bfa: Replace bfa_get_attr() with specific APIs
  [SCSI] bfa: New portlog entries for events (FIP/FLOGI/FDISC/LOGO).
  [SCSI] bfa: Rename pport to fcport in BFA FCS.
  [SCSI] bfa: IOC fixes, check for IOC down condition.
  [SCSI] bfa: In MSIX mode, ignore spurious RME interrupts when FCoE ports are in FW mismatch state.
  [SCSI] bfa: Fix Command Queue (CPE) full condition check and ack CPE interrupt.
  [SCSI] bfa: IOC recovery fix in fcmode.
  [SCSI] bfa: AEN and byte alignment fixes.
  [SCSI] bfa: Introduce a link notification state machine.
  [SCSI] bfa: Added firmware save clear feature for BFA driver.
  [SCSI] bfa: FCS authentication related changes.
  [SCSI] bfa: PCI VPD, FIP and include file changes.
  [SCSI] bfa: Fix to copy fpma MAC when requested by user space application.
  [SCSI] bfa: RPORT state machine: direct attach mode fix.
  ...

1  2 
drivers/infiniband/ulp/iser/iscsi_iser.c
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_scsi.c
drivers/scsi/sd.c

index 71237f8f78f723610144cc730ce81cd9437dad3c,5472b7e9abdc94ceb221582c98ee42e54dbf8cad..e78af36d3a0e7c0601ef06b8cac08d1ffc75dcec
@@@ -128,28 -128,6 +128,28 @@@ static int iscsi_iser_pdu_alloc(struct 
        return 0;
  }
  
 +int iser_initialize_task_headers(struct iscsi_task *task,
 +                                              struct iser_tx_desc *tx_desc)
 +{
 +      struct iscsi_iser_conn *iser_conn = task->conn->dd_data;
 +      struct iser_device     *device    = iser_conn->ib_conn->device;
 +      struct iscsi_iser_task *iser_task = task->dd_data;
 +      u64 dma_addr;
 +
 +      dma_addr = ib_dma_map_single(device->ib_device, (void *)tx_desc,
 +                              ISER_HEADERS_LEN, DMA_TO_DEVICE);
 +      if (ib_dma_mapping_error(device->ib_device, dma_addr))
 +              return -ENOMEM;
 +
 +      tx_desc->dma_addr = dma_addr;
 +      tx_desc->tx_sg[0].addr   = tx_desc->dma_addr;
 +      tx_desc->tx_sg[0].length = ISER_HEADERS_LEN;
 +      tx_desc->tx_sg[0].lkey   = device->mr->lkey;
 +
 +      iser_task->headers_initialized  = 1;
 +      iser_task->iser_conn            = iser_conn;
 +      return 0;
 +}
  /**
   * iscsi_iser_task_init - Initialize task
   * @task: iscsi task
  static int
  iscsi_iser_task_init(struct iscsi_task *task)
  {
 -      struct iscsi_iser_conn *iser_conn  = task->conn->dd_data;
        struct iscsi_iser_task *iser_task = task->dd_data;
  
 +      if (!iser_task->headers_initialized)
 +              if (iser_initialize_task_headers(task, &iser_task->desc))
 +                      return -ENOMEM;
 +
        /* mgmt task */
 -      if (!task->sc) {
 -              iser_task->desc.data = task->data;
 +      if (!task->sc)
                return 0;
 -      }
  
        iser_task->command_sent = 0;
 -      iser_task->iser_conn    = iser_conn;
        iser_task_rdma_init(iser_task);
        return 0;
  }
@@@ -190,7 -168,7 +190,7 @@@ iscsi_iser_mtask_xmit(struct iscsi_con
  {
        int error = 0;
  
 -      iser_dbg("task deq [cid %d itt 0x%x]\n", conn->id, task->itt);
 +      iser_dbg("mtask xmit [cid %d itt 0x%x]\n", conn->id, task->itt);
  
        error = iser_send_control(conn, task);
  
         * - if yes, the task is recycled at iscsi_complete_pdu
         * - if no,  the task is recycled at iser_snd_completion
         */
 -      if (error && error != -ENOBUFS)
 -              iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
 -
        return error;
  }
  
@@@ -251,7 -232,7 +251,7 @@@ iscsi_iser_task_xmit(struct iscsi_task 
                           task->imm_count, task->unsol_r2t.data_length);
        }
  
 -      iser_dbg("task deq [cid %d itt 0x%x]\n",
 +      iser_dbg("ctask xmit [cid %d itt 0x%x]\n",
                   conn->id, task->itt);
  
        /* Send the cmd PDU */
                error = iscsi_iser_task_xmit_unsol_data(conn, task);
  
   iscsi_iser_task_xmit_exit:
 -      if (error && error != -ENOBUFS)
 -              iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
        return error;
  }
  
@@@ -300,7 -283,7 +300,7 @@@ iscsi_iser_conn_create(struct iscsi_cls
         * due to issues with the login code re iser sematics
         * this not set in iscsi_conn_setup - FIXME
         */
 -      conn->max_recv_dlength = 128;
 +      conn->max_recv_dlength = ISER_RECV_DATA_SEG_LEN;
  
        iser_conn = conn->dd_data;
        conn->dd_data = iser_conn;
@@@ -418,7 -401,7 +418,7 @@@ iscsi_iser_session_create(struct iscsi_
        struct Scsi_Host *shost;
        struct iser_conn *ib_conn;
  
 -      shost = iscsi_host_alloc(&iscsi_iser_sht, 0, 1);
 +      shost = iscsi_host_alloc(&iscsi_iser_sht, 0, 0);
        if (!shost)
                return NULL;
        shost->transportt = iscsi_iser_scsi_transport;
@@@ -613,7 -596,7 +613,7 @@@ static struct scsi_host_template iscsi_
        .cmd_per_lun            = ISER_DEF_CMD_PER_LUN,
        .eh_abort_handler       = iscsi_eh_abort,
        .eh_device_reset_handler= iscsi_eh_device_reset,
-       .eh_target_reset_handler= iscsi_eh_target_reset,
+       .eh_target_reset_handler = iscsi_eh_recover_target,
        .target_alloc           = iscsi_target_alloc,
        .use_clustering         = DISABLE_CLUSTERING,
        .proc_name              = "iscsi_iser",
@@@ -692,7 -675,7 +692,7 @@@ static int __init iser_init(void
        memset(&ig, 0, sizeof(struct iser_global));
  
        ig.desc_cache = kmem_cache_create("iser_descriptors",
 -                                        sizeof (struct iser_desc),
 +                                        sizeof(struct iser_tx_desc),
                                          0, SLAB_HWCACHE_ALIGN,
                                          NULL);
        if (ig.desc_cache == NULL)
index 2a40a6eabf4d3a55708d5ceb93494f07a9daaef7,d807f36ba4f9d9e3e48e4b72410d585410441074..ee980bd668691b01467f835e8b28668a2f18a5fa
@@@ -771,6 -771,7 +771,7 @@@ lpfc_cmpl_els_flogi(struct lpfc_hba *ph
        struct lpfc_nodelist *ndlp = cmdiocb->context1;
        struct lpfc_dmabuf *pcmd = cmdiocb->context2, *prsp;
        struct serv_parm *sp;
+       uint16_t fcf_index;
        int rc;
  
        /* Check to see if link went down during discovery */
                vport->port_state);
  
        if (irsp->ulpStatus) {
+               /*
+                * In case of FIP mode, perform round robin FCF failover
+                * due to new FCF discovery
+                */
+               if ((phba->hba_flag & HBA_FIP_SUPPORT) &&
+                   (phba->fcf.fcf_flag & FCF_DISCOVERY)) {
+                       lpfc_printf_log(phba, KERN_WARNING, LOG_FIP | LOG_ELS,
+                                       "2611 FLOGI failed on registered "
+                                       "FCF record fcf_index:%d, trying "
+                                       "to perform round robin failover\n",
+                                       phba->fcf.current_rec.fcf_indx);
+                       fcf_index = lpfc_sli4_fcf_rr_next_index_get(phba);
+                       if (fcf_index == LPFC_FCOE_FCF_NEXT_NONE) {
+                               /*
+                                * Exhausted the eligible FCF record list,
+                                * fail through to retry FLOGI on current
+                                * FCF record.
+                                */
+                               lpfc_printf_log(phba, KERN_WARNING,
+                                               LOG_FIP | LOG_ELS,
+                                               "2760 FLOGI exhausted FCF "
+                                               "round robin failover list, "
+                                               "retry FLOGI on the current "
+                                               "registered FCF index:%d\n",
+                                               phba->fcf.current_rec.fcf_indx);
+                               spin_lock_irq(&phba->hbalock);
+                               phba->fcf.fcf_flag &= ~FCF_DISCOVERY;
+                               spin_unlock_irq(&phba->hbalock);
+                       } else {
+                               rc = lpfc_sli4_fcf_rr_read_fcf_rec(phba,
+                                                                  fcf_index);
+                               if (rc) {
+                                       lpfc_printf_log(phba, KERN_WARNING,
+                                                       LOG_FIP | LOG_ELS,
+                                                       "2761 FLOGI round "
+                                                       "robin FCF failover "
+                                                       "read FCF failed "
+                                                       "rc:x%x, fcf_index:"
+                                                       "%d\n", rc,
+                                               phba->fcf.current_rec.fcf_indx);
+                                       spin_lock_irq(&phba->hbalock);
+                                       phba->fcf.fcf_flag &= ~FCF_DISCOVERY;
+                                       spin_unlock_irq(&phba->hbalock);
+                               } else
+                                       goto out;
+                       }
+               }
                /* Check for retry */
                if (lpfc_els_retry(phba, cmdiocb, rspiocb))
                        goto out;
                }
  
                /* FLOGI failure */
-               lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
-                                "0100 FLOGI failure Data: x%x x%x "
-                                "x%x\n",
+               lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
+                                "0100 FLOGI failure Status:x%x/x%x TMO:x%x\n",
                                 irsp->ulpStatus, irsp->un.ulpWord[4],
                                 irsp->ulpTimeout);
                goto flogifail;
                else
                        rc = lpfc_cmpl_els_flogi_nport(vport, ndlp, sp);
  
-               if (!rc)
+               if (!rc) {
+                       /* Mark the FCF discovery process done */
+                       lpfc_printf_vlog(vport, KERN_INFO, LOG_FIP | LOG_ELS,
+                                        "2769 FLOGI successful on FCF record: "
+                                        "current_fcf_index:x%x, terminate FCF "
+                                        "round robin failover process\n",
+                                        phba->fcf.current_rec.fcf_indx);
+                       spin_lock_irq(&phba->hbalock);
+                       phba->fcf.fcf_flag &= ~FCF_DISCOVERY;
+                       spin_unlock_irq(&phba->hbalock);
                        goto out;
+               }
        }
  
  flogifail:
@@@ -981,7 -1039,7 +1039,7 @@@ lpfc_issue_els_flogi(struct lpfc_vport 
   * function returns, it does not guarantee all the IOCBs are actually aborted.
   *
   * Return code
 - *   0 - Sucessfully issued abort iocb on all outstanding flogis (Always 0)
 + *   0 - Successfully issued abort iocb on all outstanding flogis (Always 0)
   **/
  int
  lpfc_els_abort_flogi(struct lpfc_hba *phba)
@@@ -1409,6 -1467,10 +1467,10 @@@ lpfc_cmpl_els_plogi(struct lpfc_hba *ph
                        goto out;
                }
                /* PLOGI failed */
+               lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
+                                "2753 PLOGI failure DID:%06X Status:x%x/x%x\n",
+                                ndlp->nlp_DID, irsp->ulpStatus,
+                                irsp->un.ulpWord[4]);
                /* Do not call DSM for lpfc_els_abort'ed ELS cmds */
                if (lpfc_error_lost_link(irsp))
                        rc = NLP_STE_FREED_NODE;
@@@ -1577,6 -1639,10 +1639,10 @@@ lpfc_cmpl_els_prli(struct lpfc_hba *phb
                        goto out;
                }
                /* PRLI failed */
+               lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
+                                "2754 PRLI failure DID:%06X Status:x%x/x%x\n",
+                                ndlp->nlp_DID, irsp->ulpStatus,
+                                irsp->un.ulpWord[4]);
                /* Do not call DSM for lpfc_els_abort'ed ELS cmds */
                if (lpfc_error_lost_link(irsp))
                        goto out;
@@@ -1860,6 -1926,10 +1926,10 @@@ lpfc_cmpl_els_adisc(struct lpfc_hba *ph
                        goto out;
                }
                /* ADISC failed */
+               lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
+                                "2755 ADISC failure DID:%06X Status:x%x/x%x\n",
+                                ndlp->nlp_DID, irsp->ulpStatus,
+                                irsp->un.ulpWord[4]);
                /* Do not call DSM for lpfc_els_abort'ed ELS cmds */
                if (!lpfc_error_lost_link(irsp))
                        lpfc_disc_state_machine(vport, ndlp, cmdiocb,
@@@ -2009,6 -2079,10 +2079,10 @@@ lpfc_cmpl_els_logo(struct lpfc_hba *phb
                        /* ELS command is being retried */
                        goto out;
                /* LOGO failed */
+               lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
+                                "2756 LOGO failure DID:%06X Status:x%x/x%x\n",
+                                ndlp->nlp_DID, irsp->ulpStatus,
+                                irsp->un.ulpWord[4]);
                /* Do not call DSM for lpfc_els_abort'ed ELS cmds */
                if (lpfc_error_lost_link(irsp))
                        goto out;
@@@ -3129,7 -3203,7 +3203,7 @@@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba
        if (ndlp && NLP_CHK_NODE_ACT(ndlp) &&
            (*((uint32_t *) (pcmd)) == ELS_CMD_LS_RJT)) {
                /* A LS_RJT associated with Default RPI cleanup has its own
 -               * seperate code path.
 +               * separate code path.
                 */
                if (!(ndlp->nlp_flag & NLP_RM_DFLT_RPI))
                        ls_rjt = 1;
@@@ -5989,7 -6063,12 +6063,12 @@@ lpfc_cmpl_reg_new_vport(struct lpfc_hb
                        if (phba->sli_rev < LPFC_SLI_REV4)
                                lpfc_issue_fabric_reglogin(vport);
                        else {
-                               lpfc_start_fdiscs(phba);
+                               /*
+                                * If the physical port is instantiated using
+                                * FDISC, do not start vport discovery.
+                                */
+                               if (vport->port_state != LPFC_FDISC)
+                                       lpfc_start_fdiscs(phba);
                                lpfc_do_scr_ns_plogi(phba, vport);
                        }
                } else
@@@ -6055,21 -6134,18 +6134,18 @@@ mbox_err_exit
  }
  
  /**
-  * lpfc_retry_pport_discovery - Start timer to retry FLOGI.
+  * lpfc_cancel_all_vport_retry_delay_timer - Cancel all vport retry delay timer
   * @phba: pointer to lpfc hba data structure.
   *
-  * This routine abort all pending discovery commands and
-  * start a timer to retry FLOGI for the physical port
-  * discovery.
+  * This routine cancels the retry delay timers to all the vports.
   **/
  void
- lpfc_retry_pport_discovery(struct lpfc_hba *phba)
+ lpfc_cancel_all_vport_retry_delay_timer(struct lpfc_hba *phba)
  {
        struct lpfc_vport **vports;
        struct lpfc_nodelist *ndlp;
-       struct Scsi_Host  *shost;
-       int i;
        uint32_t link_state;
+       int i;
  
        /* Treat this failure as linkdown for all vports */
        link_state = phba->link_state;
                }
                lpfc_destroy_vport_work_array(phba, vports);
        }
+ }
+ /**
+  * lpfc_retry_pport_discovery - Start timer to retry FLOGI.
+  * @phba: pointer to lpfc hba data structure.
+  *
+  * This routine abort all pending discovery commands and
+  * start a timer to retry FLOGI for the physical port
+  * discovery.
+  **/
+ void
+ lpfc_retry_pport_discovery(struct lpfc_hba *phba)
+ {
+       struct lpfc_nodelist *ndlp;
+       struct Scsi_Host  *shost;
+       /* Cancel the all vports retry delay retry timers */
+       lpfc_cancel_all_vport_retry_delay_timer(phba);
  
        /* If fabric require FLOGI, then re-instantiate physical login */
        ndlp = lpfc_findnode_did(phba->pport, Fabric_DID);
        if (!ndlp)
                return;
  
        shost = lpfc_shost_from_vport(phba->pport);
        mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ);
        spin_lock_irq(shost->host_lock);
@@@ -6219,7 -6312,8 +6312,8 @@@ lpfc_cmpl_els_fdisc(struct lpfc_hba *ph
                lpfc_mbx_unreg_vpi(vport);
                spin_lock_irq(shost->host_lock);
                vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
-               vport->fc_flag |= FC_VPORT_NEEDS_INIT_VPI;
+               if (phba->sli_rev == LPFC_SLI_REV4)
+                       vport->fc_flag |= FC_VPORT_NEEDS_INIT_VPI;
                spin_unlock_irq(shost->host_lock);
        }
  
@@@ -6797,21 -6891,27 +6891,27 @@@ lpfc_sli4_els_xri_aborted(struct lpfc_h
        struct lpfc_sglq *sglq_entry = NULL, *sglq_next = NULL;
        unsigned long iflag = 0;
  
-       spin_lock_irqsave(&phba->sli4_hba.abts_sgl_list_lock, iflag);
+       spin_lock_irqsave(&phba->hbalock, iflag);
+       spin_lock(&phba->sli4_hba.abts_sgl_list_lock);
        list_for_each_entry_safe(sglq_entry, sglq_next,
                        &phba->sli4_hba.lpfc_abts_els_sgl_list, list) {
                if (sglq_entry->sli4_xritag == xri) {
                        list_del(&sglq_entry->list);
-                       spin_unlock_irqrestore(
-                                       &phba->sli4_hba.abts_sgl_list_lock,
-                                        iflag);
-                       spin_lock_irqsave(&phba->hbalock, iflag);
                        list_add_tail(&sglq_entry->list,
                                &phba->sli4_hba.lpfc_sgl_list);
+                       sglq_entry->state = SGL_FREED;
+                       spin_unlock(&phba->sli4_hba.abts_sgl_list_lock);
                        spin_unlock_irqrestore(&phba->hbalock, iflag);
                        return;
                }
        }
-       spin_unlock_irqrestore(&phba->sli4_hba.abts_sgl_list_lock, iflag);
+       spin_unlock(&phba->sli4_hba.abts_sgl_list_lock);
+       sglq_entry = __lpfc_get_active_sglq(phba, xri);
+       if (!sglq_entry || (sglq_entry->sli4_xritag != xri)) {
+               spin_unlock_irqrestore(&phba->hbalock, iflag);
+               return;
+       }
+       sglq_entry->state = SGL_XRI_ABORTED;
+       spin_unlock_irqrestore(&phba->hbalock, iflag);
+       return;
  }
index 483fb74bc5922697f4077635f04121bbaa38d293,a4881f26ab1bc0cbedcc5da0d439f94069dded43..b16bb2c9978bce87d1f819a6aa251b39741c7edb
@@@ -620,23 -620,40 +620,40 @@@ lpfc_sli4_fcp_xri_aborted(struct lpfc_h
        uint16_t xri = bf_get(lpfc_wcqe_xa_xri, axri);
        struct lpfc_scsi_buf *psb, *next_psb;
        unsigned long iflag = 0;
+       struct lpfc_iocbq *iocbq;
+       int i;
  
-       spin_lock_irqsave(&phba->sli4_hba.abts_scsi_buf_list_lock, iflag);
+       spin_lock_irqsave(&phba->hbalock, iflag);
+       spin_lock(&phba->sli4_hba.abts_scsi_buf_list_lock);
        list_for_each_entry_safe(psb, next_psb,
                &phba->sli4_hba.lpfc_abts_scsi_buf_list, list) {
                if (psb->cur_iocbq.sli4_xritag == xri) {
                        list_del(&psb->list);
                        psb->exch_busy = 0;
                        psb->status = IOSTAT_SUCCESS;
-                       spin_unlock_irqrestore(
-                               &phba->sli4_hba.abts_scsi_buf_list_lock,
-                               iflag);
+                       spin_unlock(
+                               &phba->sli4_hba.abts_scsi_buf_list_lock);
+                       spin_unlock_irqrestore(&phba->hbalock, iflag);
                        lpfc_release_scsi_buf_s4(phba, psb);
                        return;
                }
        }
-       spin_unlock_irqrestore(&phba->sli4_hba.abts_scsi_buf_list_lock,
-                               iflag);
+       spin_unlock(&phba->sli4_hba.abts_scsi_buf_list_lock);
+       for (i = 1; i <= phba->sli.last_iotag; i++) {
+               iocbq = phba->sli.iocbq_lookup[i];
+               if (!(iocbq->iocb_flag &  LPFC_IO_FCP) ||
+                       (iocbq->iocb_flag & LPFC_IO_LIBDFC))
+                       continue;
+               if (iocbq->sli4_xritag != xri)
+                       continue;
+               psb = container_of(iocbq, struct lpfc_scsi_buf, cur_iocbq);
+               psb->exch_busy = 0;
+               spin_unlock_irqrestore(&phba->hbalock, iflag);
+               return;
+       }
+       spin_unlock_irqrestore(&phba->hbalock, iflag);
  }
  
  /**
@@@ -1006,6 -1023,7 +1023,7 @@@ lpfc_scsi_prep_dma_buf_s3(struct lpfc_h
        struct scatterlist *sgel = NULL;
        struct fcp_cmnd *fcp_cmnd = lpfc_cmd->fcp_cmnd;
        struct ulp_bde64 *bpl = lpfc_cmd->fcp_bpl;
+       struct lpfc_iocbq *iocbq = &lpfc_cmd->cur_iocbq;
        IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb;
        struct ulp_bde64 *data_bde = iocb_cmd->unsli3.fcp_ext.dbde;
        dma_addr_t physaddr;
                        physaddr = sg_dma_address(sgel);
                        if (phba->sli_rev == 3 &&
                            !(phba->sli3_options & LPFC_SLI3_BG_ENABLED) &&
+                           !(iocbq->iocb_flag & DSS_SECURITY_OP) &&
                            nseg <= LPFC_EXT_DATA_BDE_COUNT) {
                                data_bde->tus.f.bdeFlags = BUFF_TYPE_BDE_64;
                                data_bde->tus.f.bdeSize = sg_dma_len(sgel);
         * explicitly reinitialized since all iocb memory resources are reused.
         */
        if (phba->sli_rev == 3 &&
-           !(phba->sli3_options & LPFC_SLI3_BG_ENABLED)) {
+           !(phba->sli3_options & LPFC_SLI3_BG_ENABLED) &&
+           !(iocbq->iocb_flag & DSS_SECURITY_OP)) {
                if (num_bde > LPFC_EXT_DATA_BDE_COUNT) {
                        /*
                         * The extended IOCB format can only fit 3 BDE or a BPL.
        } else {
                iocb_cmd->un.fcpi64.bdl.bdeSize =
                        ((num_bde + 2) * sizeof(struct ulp_bde64));
+               iocb_cmd->unsli3.fcp_ext.ebde_count = (num_bde + 1);
        }
        fcp_cmnd->fcpDl = cpu_to_be32(scsi_bufflen(scsi_cmnd));
  
@@@ -1575,7 -1596,7 +1596,7 @@@ lpfc_bg_scsi_prep_dma_buf(struct lpfc_h
                case LPFC_PG_TYPE_NO_DIF:
                        num_bde = lpfc_bg_setup_bpl(phba, scsi_cmnd, bpl,
                                        datasegcnt);
 -                      /* we shoud have 2 or more entries in buffer list */
 +                      /* we should have 2 or more entries in buffer list */
                        if (num_bde < 2)
                                goto err;
                        break;
  
                        num_bde = lpfc_bg_setup_bpl_prot(phba, scsi_cmnd, bpl,
                                        datasegcnt, protsegcnt);
 -                      /* we shoud have 3 or more entries in buffer list */
 +                      /* we should have 3 or more entries in buffer list */
                        if (num_bde < 3)
                                goto err;
                        break;
@@@ -2079,8 -2100,7 +2100,7 @@@ lpfc_handle_fcp_err(struct lpfc_vport *
  
        if (resp_info & RSP_LEN_VALID) {
                rsplen = be32_to_cpu(fcprsp->rspRspLen);
-               if ((rsplen != 0 && rsplen != 4 && rsplen != 8) ||
-                   (fcprsp->rspInfo3 != RSP_NO_FAILURE)) {
+               if (rsplen != 0 && rsplen != 4 && rsplen != 8) {
                        lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
                                 "2719 Invalid response length: "
                                 "tgt x%x lun x%x cmnd x%x rsplen x%x\n",
                        host_status = DID_ERROR;
                        goto out;
                }
+               if (fcprsp->rspInfo3 != RSP_NO_FAILURE) {
+                       lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
+                                "2757 Protocol failure detected during "
+                                "processing of FCP I/O op: "
+                                "tgt x%x lun x%x cmnd x%x rspInfo3 x%x\n",
+                                cmnd->device->id,
+                                cmnd->device->lun, cmnd->cmnd[0],
+                                fcprsp->rspInfo3);
+                       host_status = DID_ERROR;
+                       goto out;
+               }
        }
  
        if ((resp_info & SNS_LEN_VALID) && fcprsp->rspSnsLen) {
diff --combined drivers/scsi/sd.c
index 83881dfb33c055646b42cc1341f21caebee9f42f,f9995388a57491beac8dd522536dfc6eb11dd171..7b75c8a2a49dbdd9e607f67722c92136d8178f4c
@@@ -1948,7 -1948,7 +1948,7 @@@ static void sd_read_block_limits(struc
  {
        struct request_queue *q = sdkp->disk->queue;
        unsigned int sector_sz = sdkp->device->sector_size;
-       const int vpd_len = 32;
+       const int vpd_len = 64;
        unsigned char *buffer = kmalloc(vpd_len, GFP_KERNEL);
  
        if (!buffer ||
@@@ -1998,7 -1998,7 +1998,7 @@@ static void sd_read_block_characteristi
  {
        unsigned char *buffer;
        u16 rot;
-       const int vpd_len = 32;
+       const int vpd_len = 64;
  
        buffer = kmalloc(vpd_len, GFP_KERNEL);
  
@@@ -2111,7 -2111,7 +2111,7 @@@ static int sd_revalidate_disk(struct ge
   *    which is followed by sdaaa.
   *
   *    This is basically 26 base counting with one extra 'nil' entry
 - *    at the beggining from the second digit on and can be
 + *    at the beginning from the second digit on and can be
   *    determined using similar method as 26 base conversion with the
   *    index shifted -1 after each digit is computed.
   *