Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Aug 2018 05:06:26 +0000 (22:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Aug 2018 05:06:26 +0000 (22:06 -0700)
Pull SCSI updates from James Bottomley:
 "This is mostly updates to the usual drivers: mpt3sas, lpfc, qla2xxx,
  hisi_sas, smartpqi, megaraid_sas, arcmsr.

  In addition, with the continuing absence of Nic we have target updates
  for tcmu and target core (all with reviews and acks).

  The biggest observable change is going to be that we're (again) trying
  to switch to mulitqueue as the default (a user can still override the
  setting on the kernel command line).

  Other major core stuff is the removal of the remaining Microchannel
  drivers, an update of the internal timers and some reworks of
  completion and result handling"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (203 commits)
  scsi: core: use blk_mq_run_hw_queues in scsi_kick_queue
  scsi: ufs: remove unnecessary query(DM) UPIU trace
  scsi: qla2xxx: Fix issue reported by static checker for qla2x00_els_dcmd2_sp_done()
  scsi: aacraid: Spelling fix in comment
  scsi: mpt3sas: Fix calltrace observed while running IO & reset
  scsi: aic94xx: fix an error code in aic94xx_init()
  scsi: st: remove redundant pointer STbuffer
  scsi: qla2xxx: Update driver version to 10.00.00.08-k
  scsi: qla2xxx: Migrate NVME N2N handling into state machine
  scsi: qla2xxx: Save frame payload size from ICB
  scsi: qla2xxx: Fix stalled relogin
  scsi: qla2xxx: Fix race between switch cmd completion and timeout
  scsi: qla2xxx: Fix Management Server NPort handle reservation logic
  scsi: qla2xxx: Flush mailbox commands on chip reset
  scsi: qla2xxx: Fix unintended Logout
  scsi: qla2xxx: Fix session state stuck in Get Port DB
  scsi: qla2xxx: Fix redundant fc_rport registration
  scsi: qla2xxx: Silent erroneous message
  scsi: qla2xxx: Prevent sysfs access when chip is down
  scsi: qla2xxx: Add longer window for chip reset
  ...

38 files changed:
1  2 
MAINTAINERS
arch/arm64/configs/defconfig
drivers/ata/libata-core.c
drivers/scsi/Makefile
drivers/scsi/aacraid/aachba.c
drivers/scsi/cxlflash/ocxl_hw.c
drivers/scsi/cxlflash/superpipe.c
drivers/scsi/fcoe/fcoe_ctlr.c
drivers/scsi/ipr.c
drivers/scsi/libfc/fc_rport.c
drivers/scsi/libiscsi.c
drivers/scsi/mpt3sas/mpt3sas_base.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/scsi/qedi/qedi_main.c
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_gs.c
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_inline.h
drivers/scsi/qla2xxx/qla_iocb.c
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_mid.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_target.c
drivers/scsi/scsi_debug.c
drivers/scsi/scsi_error.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_transport_fc.c
drivers/scsi/sd.c
drivers/scsi/sd_zbc.c
drivers/scsi/sg.c
drivers/target/target_core_user.c
drivers/xen/xen-scsiback.c
fs/sysfs/file.c
include/linux/libata.h
lib/Makefile

diff --cc MAINTAINERS
@@@ -9847,17 -9750,6 +9847,11 @@@ F:    drivers/scsi/mac_scsi.
  F:    drivers/scsi/sun3_scsi.*
  F:    drivers/scsi/sun3_scsi_vme.c
  
- NCR DUAL 700 SCSI DRIVER (MICROCHANNEL)
- M:    "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
- L:    linux-scsi@vger.kernel.org
- S:    Maintained
- F:    drivers/scsi/NCR_D700.*
 +NCSI LIBRARY:
 +M:    Samuel Mendoza-Jonas <sam@mendozajonas.com>
 +S:    Maintained
 +F:    net/ncsi/
 +
  NCT6775 HARDWARE MONITOR DRIVER
  M:    Guenter Roeck <linux@roeck-us.net>
  L:    linux-hwmon@vger.kernel.org
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -212,9 -212,8 +212,9 @@@ extern int qla24xx_post_upd_fcport_work
  void qla2x00_handle_login_done_event(struct scsi_qla_host *, fc_port_t *,
        uint16_t *);
  int qla24xx_post_gnl_work(struct scsi_qla_host *, fc_port_t *);
- int qla24xx_async_abort_cmd(srb_t *);
+ int qla24xx_async_abort_cmd(srb_t *, bool);
  int qla24xx_post_relogin_work(struct scsi_qla_host *vha);
 +void qla2x00_wait_for_sess_deletion(scsi_qla_host_t *);
  
  /*
   * Global Functions in qla_mid.c source file.
@@@ -3394,19 -3383,40 +3391,40 @@@ int qla24xx_post_gpnid_work(struct scsi
  
  void qla24xx_sp_unmap(scsi_qla_host_t *vha, srb_t *sp)
  {
-       if (sp->u.iocb_cmd.u.ctarg.req) {
-               dma_free_coherent(&vha->hw->pdev->dev,
-                       sp->u.iocb_cmd.u.ctarg.req_allocated_size,
-                       sp->u.iocb_cmd.u.ctarg.req,
-                       sp->u.iocb_cmd.u.ctarg.req_dma);
-               sp->u.iocb_cmd.u.ctarg.req = NULL;
-       }
-       if (sp->u.iocb_cmd.u.ctarg.rsp) {
-               dma_free_coherent(&vha->hw->pdev->dev,
-                       sp->u.iocb_cmd.u.ctarg.rsp_allocated_size,
-                       sp->u.iocb_cmd.u.ctarg.rsp,
-                       sp->u.iocb_cmd.u.ctarg.rsp_dma);
-               sp->u.iocb_cmd.u.ctarg.rsp = NULL;
+       struct srb_iocb *c = &sp->u.iocb_cmd;
+       switch (sp->type) {
+       case SRB_ELS_DCMD:
+               if (c->u.els_plogi.els_plogi_pyld)
+                       dma_free_coherent(&vha->hw->pdev->dev,
+                           c->u.els_plogi.tx_size,
+                           c->u.els_plogi.els_plogi_pyld,
+                           c->u.els_plogi.els_plogi_pyld_dma);
+               if (c->u.els_plogi.els_resp_pyld)
+                       dma_free_coherent(&vha->hw->pdev->dev,
+                           c->u.els_plogi.rx_size,
+                           c->u.els_plogi.els_resp_pyld,
+                           c->u.els_plogi.els_resp_pyld_dma);
+               break;
+       case SRB_CT_PTHRU_CMD:
+       default:
+               if (sp->u.iocb_cmd.u.ctarg.req) {
+                       dma_free_coherent(&vha->hw->pdev->dev,
 -                          sizeof(struct ct_sns_pkt),
++                          sp->u.iocb_cmd.u.ctarg.req_allocated_size,
+                           sp->u.iocb_cmd.u.ctarg.req,
+                           sp->u.iocb_cmd.u.ctarg.req_dma);
+                       sp->u.iocb_cmd.u.ctarg.req = NULL;
+               }
+               if (sp->u.iocb_cmd.u.ctarg.rsp) {
+                       dma_free_coherent(&vha->hw->pdev->dev,
 -                          sizeof(struct ct_sns_pkt),
++                          sp->u.iocb_cmd.u.ctarg.rsp_allocated_size,
+                           sp->u.iocb_cmd.u.ctarg.rsp,
+                           sp->u.iocb_cmd.u.ctarg.rsp_dma);
+                       sp->u.iocb_cmd.u.ctarg.rsp = NULL;
+               }
+               break;
        }
  
        sp->free(sp);
@@@ -578,34 -693,76 +693,78 @@@ static void qla24xx_handle_gnl_done_eve
        }
  
        if (!found) {
-               /* fw has no record of this port */
-               for (i = 0; i < n; i++) {
-                       e = &vha->gnl.l[i];
-                       id.b.domain = e->port_id[0];
-                       id.b.area = e->port_id[1];
-                       id.b.al_pa = e->port_id[2];
-                       id.b.rsvd_1 = 0;
-                       loop_id = le16_to_cpu(e->nport_handle);
-                       if (fcport->d_id.b24 == id.b24) {
-                               conflict_fcport =
-                                       qla2x00_find_fcport_by_wwpn(vha,
-                                           e->port_name, 0);
-                               if (conflict_fcport) {
-                                       qlt_schedule_sess_for_deletion
-                                               (conflict_fcport);
-                                       ql_dbg(ql_dbg_disc, vha, 0x20e6,
-                                           "%s %d %8phC post del sess\n",
-                                           __func__, __LINE__,
-                                           conflict_fcport->port_name);
+               switch (vha->hw->current_topology) {
+               case ISP_CFG_F:
+               case ISP_CFG_FL:
+                       for (i = 0; i < n; i++) {
+                               e = &vha->gnl.l[i];
+                               id.b.domain = e->port_id[0];
+                               id.b.area = e->port_id[1];
+                               id.b.al_pa = e->port_id[2];
+                               id.b.rsvd_1 = 0;
+                               loop_id = le16_to_cpu(e->nport_handle);
+                               if (fcport->d_id.b24 == id.b24) {
+                                       conflict_fcport =
+                                           qla2x00_find_fcport_by_wwpn(vha,
+                                               e->port_name, 0);
 -                                      ql_dbg(ql_dbg_disc + ql_dbg_verbose,
 -                                          vha, 0x20e5,
 -                                          "%s %d %8phC post del sess\n",
 -                                          __func__, __LINE__,
 -                                          conflict_fcport->port_name);
 -                                      qlt_schedule_sess_for_deletion
 -                                              (conflict_fcport);
++                                      if (conflict_fcport) {
++                                              ql_dbg(ql_dbg_disc + ql_dbg_verbose,
++                                                  vha, 0x20e5,
++                                                  "%s %d %8phC post del sess\n",
++                                                  __func__, __LINE__,
++                                                  conflict_fcport->port_name);
++                                              qlt_schedule_sess_for_deletion
++                                                      (conflict_fcport);
++                                      }
                                }
+                               /*
+                                * FW already picked this loop id for
+                                * another fcport
+                                */
+                               if (fcport->loop_id == loop_id)
+                                       fcport->loop_id = FC_NO_LOOP_ID;
                        }
-                       /* FW already picked this loop id for another fcport */
-                       if (fcport->loop_id == loop_id)
-                               fcport->loop_id = FC_NO_LOOP_ID;
+                       qla24xx_fcport_handle_login(vha, fcport);
+                       break;
+               case ISP_CFG_N:
+                       fcport->disc_state = DSC_DELETED;
+                       if (time_after_eq(jiffies, fcport->dm_login_expire)) {
+                               if (fcport->n2n_link_reset_cnt < 2) {
+                                       fcport->n2n_link_reset_cnt++;
+                                       /*
+                                        * remote port is not sending PLOGI.
+                                        * Reset link to kick start his state
+                                        * machine
+                                        */
+                                       set_bit(N2N_LINK_RESET,
+                                           &vha->dpc_flags);
+                               } else {
+                                       if (fcport->n2n_chip_reset < 1) {
+                                               ql_log(ql_log_info, vha, 0x705d,
+                                                   "Chip reset to bring laser down");
+                                               set_bit(ISP_ABORT_NEEDED,
+                                                   &vha->dpc_flags);
+                                               fcport->n2n_chip_reset++;
+                                       } else {
+                                               ql_log(ql_log_info, vha, 0x705d,
+                                                   "Remote port %8ph is not coming back\n",
+                                                   fcport->port_name);
+                                               fcport->scan_state = 0;
+                                       }
+                               }
+                               qla2xxx_wake_dpc(vha);
+                       } else {
+                               /*
+                                * report port suppose to do PLOGI. Give him
+                                * more time. FW will catch it.
+                                */
+                               set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
+                       }
+                       break;
+               default:
+                       break;
                }
-               qla24xx_fcport_handle_login(vha, fcport);
        }
  } /* gnl_event */
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/sysfs/file.c
Simple merge
Simple merge
diff --cc lib/Makefile
Simple merge