Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"Twelve patches mostly small but obvious fixes or cosmetic but small
updates"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: qla2xxx: Fix Nport ID display value
scsi: qla2xxx: Fix N2N link up fail
scsi: qla2xxx: Fix N2N link reset
scsi: qla2xxx: Optimize NPIV tear down process
scsi: qla2xxx: Fix stale mem access on driver unload
scsi: qla2xxx: Fix unbound sleep in fcport delete path.
scsi: qla2xxx: Silence fwdump template message
scsi: hisi_sas: Make three functions static
scsi: megaraid: disable device when probe failed after enabled device
scsi: storvsc: setup 1:1 mapping between hardware queue and CPU queue
scsi: qedf: Remove always false 'tmp_prio < 0' statement
scsi: ufs: skip shutdown if hba is not powered
scsi: bnx2fc: Handle scope bits when array returns BUSY or TSF

+192 -79
+24 -5
drivers/scsi/bnx2fc/bnx2fc_io.c
··· 1923 1923 struct fcoe_fcp_rsp_payload *fcp_rsp; 1924 1924 struct bnx2fc_rport *tgt = io_req->tgt; 1925 1925 struct scsi_cmnd *sc_cmd; 1926 + u16 scope = 0, qualifier = 0; 1926 1927 1927 1928 /* scsi_cmd_cmpl is called with tgt lock held */ 1928 1929 ··· 1991 1990 1992 1991 if (io_req->cdb_status == SAM_STAT_TASK_SET_FULL || 1993 1992 io_req->cdb_status == SAM_STAT_BUSY) { 1994 - /* Set the jiffies + retry_delay_timer * 100ms 1995 - for the rport/tgt */ 1996 - tgt->retry_delay_timestamp = jiffies + 1997 - fcp_rsp->retry_delay_timer * HZ / 10; 1993 + /* Newer array firmware with BUSY or 1994 + * TASK_SET_FULL may return a status that needs 1995 + * the scope bits masked. 1996 + * Or a huge delay timestamp up to 27 minutes 1997 + * can result. 1998 + */ 1999 + if (fcp_rsp->retry_delay_timer) { 2000 + /* Upper 2 bits */ 2001 + scope = fcp_rsp->retry_delay_timer 2002 + & 0xC000; 2003 + /* Lower 14 bits */ 2004 + qualifier = fcp_rsp->retry_delay_timer 2005 + & 0x3FFF; 2006 + } 2007 + if (scope > 0 && qualifier > 0 && 2008 + qualifier <= 0x3FEF) { 2009 + /* Set the jiffies + 2010 + * retry_delay_timer * 100ms 2011 + * for the rport/tgt 2012 + */ 2013 + tgt->retry_delay_timestamp = jiffies + 2014 + (qualifier * HZ / 10); 2015 + } 1998 2016 } 1999 - 2000 2017 } 2001 2018 if (io_req->fcp_resid) 2002 2019 scsi_set_resid(sc_cmd, io_req->fcp_resid);
+3 -3
drivers/scsi/hisi_sas/hisi_sas_main.c
··· 3683 3683 } 3684 3684 EXPORT_SYMBOL_GPL(hisi_sas_debugfs_work_handler); 3685 3685 3686 - void hisi_sas_debugfs_release(struct hisi_hba *hisi_hba) 3686 + static void hisi_sas_debugfs_release(struct hisi_hba *hisi_hba) 3687 3687 { 3688 3688 struct device *dev = hisi_hba->dev; 3689 3689 int i; ··· 3705 3705 devm_kfree(dev, hisi_hba->debugfs_port_reg[i]); 3706 3706 } 3707 3707 3708 - int hisi_sas_debugfs_alloc(struct hisi_hba *hisi_hba) 3708 + static int hisi_sas_debugfs_alloc(struct hisi_hba *hisi_hba) 3709 3709 { 3710 3710 const struct hisi_sas_hw *hw = hisi_hba->hw; 3711 3711 struct device *dev = hisi_hba->dev; ··· 3796 3796 return -ENOMEM; 3797 3797 } 3798 3798 3799 - void hisi_sas_debugfs_bist_init(struct hisi_hba *hisi_hba) 3799 + static void hisi_sas_debugfs_bist_init(struct hisi_hba *hisi_hba) 3800 3800 { 3801 3801 hisi_hba->debugfs_bist_dentry = 3802 3802 debugfs_create_dir("bist", hisi_hba->debugfs_dir);
+2 -2
drivers/scsi/megaraid.c
··· 4183 4183 */ 4184 4184 if (pdev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ && 4185 4185 pdev->subsystem_device == 0xC000) 4186 - return -ENODEV; 4186 + goto out_disable_device; 4187 4187 /* Now check the magic signature byte */ 4188 4188 pci_read_config_word(pdev, PCI_CONF_AMISIG, &magic); 4189 4189 if (magic != HBA_SIGNATURE_471 && magic != HBA_SIGNATURE) 4190 - return -ENODEV; 4190 + goto out_disable_device; 4191 4191 /* Ok it is probably a megaraid */ 4192 4192 } 4193 4193
+1 -1
drivers/scsi/qedf/qedf_main.c
··· 596 596 tmp_prio = get->operational.app_prio.fcoe; 597 597 if (qedf_default_prio > -1) 598 598 qedf->prio = qedf_default_prio; 599 - else if (tmp_prio < 0 || tmp_prio > 7) { 599 + else if (tmp_prio > 7) { 600 600 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC, 601 601 "FIP/FCoE prio %d out of range, setting to %d.\n", 602 602 tmp_prio, QEDF_DEFAULT_PRIO);
+2
drivers/scsi/qla2xxx/qla_attr.c
··· 2920 2920 struct qla_hw_data *ha = vha->hw; 2921 2921 uint16_t id = vha->vp_idx; 2922 2922 2923 + set_bit(VPORT_DELETE, &vha->dpc_flags); 2924 + 2923 2925 while (test_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags) || 2924 2926 test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags)) 2925 2927 msleep(1000);
+3 -1
drivers/scsi/qla2xxx/qla_def.h
··· 2396 2396 unsigned int query:1; 2397 2397 unsigned int id_changed:1; 2398 2398 unsigned int scan_needed:1; 2399 + unsigned int n2n_flag:1; 2399 2400 2400 2401 struct completion nvme_del_done; 2401 2402 uint32_t nvme_prli_service_param; ··· 2447 2446 uint8_t fc4_type; 2448 2447 uint8_t fc4f_nvme; 2449 2448 uint8_t scan_state; 2450 - uint8_t n2n_flag; 2451 2449 2452 2450 unsigned long last_queue_full; 2453 2451 unsigned long last_ramp_up; ··· 3036 3036 enum fc4type_t { 3037 3037 FS_FC4TYPE_FCP = BIT_0, 3038 3038 FS_FC4TYPE_NVME = BIT_1, 3039 + FS_FCP_IS_N2N = BIT_7, 3039 3040 }; 3040 3041 3041 3042 struct fab_scan_rp { ··· 4395 4394 #define IOCB_WORK_ACTIVE 31 4396 4395 #define SET_ZIO_THRESHOLD_NEEDED 32 4397 4396 #define ISP_ABORT_TO_ROM 33 4397 + #define VPORT_DELETE 34 4398 4398 4399 4399 unsigned long pci_flags; 4400 4400 #define PFLG_DISCONNECTED 0 /* PCI device removed */
+2 -1
drivers/scsi/qla2xxx/qla_gs.c
··· 3102 3102 { 3103 3103 struct qla_work_evt *e; 3104 3104 3105 - if (test_bit(UNLOADING, &vha->dpc_flags)) 3105 + if (test_bit(UNLOADING, &vha->dpc_flags) || 3106 + (vha->vp_idx && test_bit(VPORT_DELETE, &vha->dpc_flags))) 3106 3107 return 0; 3107 3108 3108 3109 e = qla2x00_alloc_work(vha, QLA_EVT_GPNID);
+77 -30
drivers/scsi/qla2xxx/qla_init.c
··· 746 746 break; 747 747 default: 748 748 if ((id.b24 != fcport->d_id.b24 && 749 - fcport->d_id.b24) || 749 + fcport->d_id.b24 && 750 + fcport->loop_id != FC_NO_LOOP_ID) || 750 751 (fcport->loop_id != FC_NO_LOOP_ID && 751 752 fcport->loop_id != loop_id)) { 752 753 ql_dbg(ql_dbg_disc, vha, 0x20e3, 753 754 "%s %d %8phC post del sess\n", 754 755 __func__, __LINE__, fcport->port_name); 756 + if (fcport->n2n_flag) 757 + fcport->d_id.b24 = 0; 755 758 qlt_schedule_sess_for_deletion(fcport); 756 759 return; 757 760 } ··· 762 759 } 763 760 764 761 fcport->loop_id = loop_id; 762 + if (fcport->n2n_flag) 763 + fcport->d_id.b24 = id.b24; 765 764 766 765 wwn = wwn_to_u64(fcport->port_name); 767 766 qlt_find_sess_invalidate_other(vha, wwn, ··· 977 972 wwn = wwn_to_u64(e->port_name); 978 973 979 974 ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x20e8, 980 - "%s %8phC %02x:%02x:%02x state %d/%d lid %x \n", 975 + "%s %8phC %02x:%02x:%02x CLS %x/%x lid %x \n", 981 976 __func__, (void *)&wwn, e->port_id[2], e->port_id[1], 982 977 e->port_id[0], e->current_login_state, e->last_login_state, 983 978 (loop_id & 0x7fff)); ··· 1504 1499 (fcport->fw_login_state == DSC_LS_PRLI_PEND))) 1505 1500 return 0; 1506 1501 1507 - if (fcport->fw_login_state == DSC_LS_PLOGI_COMP) { 1502 + if (fcport->fw_login_state == DSC_LS_PLOGI_COMP && 1503 + !N2N_TOPO(vha->hw)) { 1508 1504 if (time_before_eq(jiffies, fcport->plogi_nack_done_deadline)) { 1509 1505 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); 1510 1506 return 0; ··· 1576 1570 qla24xx_post_gpdb_work(vha, fcport, 0); 1577 1571 } else { 1578 1572 ql_dbg(ql_dbg_disc, vha, 0x2118, 1579 - "%s %d %8phC post NVMe PRLI\n", 1580 - __func__, __LINE__, fcport->port_name); 1573 + "%s %d %8phC post %s PRLI\n", 1574 + __func__, __LINE__, fcport->port_name, 1575 + fcport->fc4f_nvme ? "NVME" : "FC"); 1581 1576 qla24xx_post_prli_work(vha, fcport); 1582 1577 } 1583 1578 break; ··· 1860 1853 break; 1861 1854 } 1862 1855 1863 - if (ea->fcport->n2n_flag) { 1856 + if (ea->fcport->fc4f_nvme) { 1864 1857 ql_dbg(ql_dbg_disc, vha, 0x2118, 1865 1858 "%s %d %8phC post fc4 prli\n", 1866 1859 __func__, __LINE__, ea->fcport->port_name); 1867 1860 ea->fcport->fc4f_nvme = 0; 1868 - ea->fcport->n2n_flag = 0; 1869 1861 qla24xx_post_prli_work(vha, ea->fcport); 1862 + return; 1870 1863 } 1871 - ql_dbg(ql_dbg_disc, vha, 0x2119, 1872 - "%s %d %8phC unhandle event of %x\n", 1873 - __func__, __LINE__, ea->fcport->port_name, ea->data[0]); 1864 + 1865 + /* at this point both PRLI NVME & PRLI FCP failed */ 1866 + if (N2N_TOPO(vha->hw)) { 1867 + if (ea->fcport->n2n_link_reset_cnt < 3) { 1868 + ea->fcport->n2n_link_reset_cnt++; 1869 + /* 1870 + * remote port is not sending Plogi. Reset 1871 + * link to kick start his state machine 1872 + */ 1873 + set_bit(N2N_LINK_RESET, &vha->dpc_flags); 1874 + } else { 1875 + ql_log(ql_log_warn, vha, 0x2119, 1876 + "%s %d %8phC Unable to reconnect\n", 1877 + __func__, __LINE__, ea->fcport->port_name); 1878 + } 1879 + } else { 1880 + /* 1881 + * switch connect. login failed. Take connection 1882 + * down and allow relogin to retrigger 1883 + */ 1884 + ea->fcport->flags &= ~FCF_ASYNC_SENT; 1885 + ea->fcport->keep_nport_handle = 0; 1886 + qlt_schedule_sess_for_deletion(ea->fcport); 1887 + } 1874 1888 break; 1875 1889 } 1876 1890 } ··· 3218 3190 3219 3191 for (j = 0; j < 2; j++, fwdt++) { 3220 3192 if (!fwdt->template) { 3221 - ql_log(ql_log_warn, vha, 0x00ba, 3193 + ql_dbg(ql_dbg_init, vha, 0x00ba, 3222 3194 "-> fwdt%u no template\n", j); 3223 3195 continue; 3224 3196 } ··· 5014 4986 unsigned long flags; 5015 4987 5016 4988 /* Inititae N2N login. */ 5017 - if (test_and_clear_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags)) { 5018 - /* borrowing */ 5019 - u32 *bp, i, sz; 4989 + if (N2N_TOPO(ha)) { 4990 + if (test_and_clear_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags)) { 4991 + /* borrowing */ 4992 + u32 *bp, i, sz; 5020 4993 5021 - memset(ha->init_cb, 0, ha->init_cb_size); 5022 - sz = min_t(int, sizeof(struct els_plogi_payload), 5023 - ha->init_cb_size); 5024 - rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma, 5025 - (void *)ha->init_cb, sz); 5026 - if (rval == QLA_SUCCESS) { 5027 - bp = (uint32_t *)ha->init_cb; 5028 - for (i = 0; i < sz/4 ; i++, bp++) 5029 - *bp = cpu_to_be32(*bp); 4994 + memset(ha->init_cb, 0, ha->init_cb_size); 4995 + sz = min_t(int, sizeof(struct els_plogi_payload), 4996 + ha->init_cb_size); 4997 + rval = qla24xx_get_port_login_templ(vha, 4998 + ha->init_cb_dma, (void *)ha->init_cb, sz); 4999 + if (rval == QLA_SUCCESS) { 5000 + bp = (uint32_t *)ha->init_cb; 5001 + for (i = 0; i < sz/4 ; i++, bp++) 5002 + *bp = cpu_to_be32(*bp); 5030 5003 5031 - memcpy(&ha->plogi_els_payld.data, (void *)ha->init_cb, 5032 - sizeof(ha->plogi_els_payld.data)); 5033 - set_bit(RELOGIN_NEEDED, &vha->dpc_flags); 5034 - } else { 5035 - ql_dbg(ql_dbg_init, vha, 0x00d1, 5036 - "PLOGI ELS param read fail.\n"); 5004 + memcpy(&ha->plogi_els_payld.data, 5005 + (void *)ha->init_cb, 5006 + sizeof(ha->plogi_els_payld.data)); 5007 + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); 5008 + } else { 5009 + ql_dbg(ql_dbg_init, vha, 0x00d1, 5010 + "PLOGI ELS param read fail.\n"); 5011 + goto skip_login; 5012 + } 5037 5013 } 5038 - return QLA_SUCCESS; 5014 + 5015 + list_for_each_entry(fcport, &vha->vp_fcports, list) { 5016 + if (fcport->n2n_flag) { 5017 + qla24xx_fcport_handle_login(vha, fcport); 5018 + return QLA_SUCCESS; 5019 + } 5020 + } 5021 + skip_login: 5022 + spin_lock_irqsave(&vha->work_lock, flags); 5023 + vha->scan.scan_retry++; 5024 + spin_unlock_irqrestore(&vha->work_lock, flags); 5025 + 5026 + if (vha->scan.scan_retry < MAX_SCAN_RETRIES) { 5027 + set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); 5028 + set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); 5029 + } 5039 5030 } 5040 5031 5041 5032 found_devs = 0;
+4 -3
drivers/scsi/qla2xxx/qla_iocb.c
··· 2656 2656 els_iocb->port_id[0] = sp->fcport->d_id.b.al_pa; 2657 2657 els_iocb->port_id[1] = sp->fcport->d_id.b.area; 2658 2658 els_iocb->port_id[2] = sp->fcport->d_id.b.domain; 2659 - els_iocb->s_id[0] = vha->d_id.b.al_pa; 2660 - els_iocb->s_id[1] = vha->d_id.b.area; 2661 - els_iocb->s_id[2] = vha->d_id.b.domain; 2659 + /* For SID the byte order is different than DID */ 2660 + els_iocb->s_id[1] = vha->d_id.b.al_pa; 2661 + els_iocb->s_id[2] = vha->d_id.b.area; 2662 + els_iocb->s_id[0] = vha->d_id.b.domain; 2662 2663 2663 2664 if (elsio->u.els_logo.els_cmd == ELS_DCMD_PLOGI) { 2664 2665 els_iocb->control_flags = 0;
+22 -3
drivers/scsi/qla2xxx/qla_mbx.c
··· 2249 2249 mbx_cmd_t mc; 2250 2250 mbx_cmd_t *mcp = &mc; 2251 2251 2252 - ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x105a, 2252 + ql_dbg(ql_dbg_disc, vha, 0x105a, 2253 2253 "Entered %s.\n", __func__); 2254 2254 2255 2255 if (IS_CNA_CAPABLE(vha->hw)) { ··· 3883 3883 case TOPO_N2N: 3884 3884 ha->current_topology = ISP_CFG_N; 3885 3885 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); 3886 + list_for_each_entry(fcport, &vha->vp_fcports, list) { 3887 + fcport->scan_state = QLA_FCPORT_SCAN; 3888 + fcport->n2n_flag = 0; 3889 + } 3890 + 3886 3891 fcport = qla2x00_find_fcport_by_wwpn(vha, 3887 3892 rptid_entry->u.f1.port_name, 1); 3888 3893 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); 3889 3894 3890 3895 if (fcport) { 3891 3896 fcport->plogi_nack_done_deadline = jiffies + HZ; 3892 - fcport->dm_login_expire = jiffies + 3*HZ; 3897 + fcport->dm_login_expire = jiffies + 2*HZ; 3893 3898 fcport->scan_state = QLA_FCPORT_FOUND; 3899 + fcport->n2n_flag = 1; 3900 + fcport->keep_nport_handle = 1; 3901 + if (vha->flags.nvme_enabled) 3902 + fcport->fc4f_nvme = 1; 3903 + 3894 3904 switch (fcport->disc_state) { 3895 3905 case DSC_DELETED: 3896 3906 set_bit(RELOGIN_NEEDED, ··· 3934 3924 rptid_entry->u.f1.port_name, 3935 3925 rptid_entry->u.f1.node_name, 3936 3926 NULL, 3937 - FC4_TYPE_UNKNOWN); 3927 + FS_FCP_IS_N2N); 3938 3928 } 3939 3929 3940 3930 /* if our portname is higher then initiate N2N login */ ··· 4033 4023 4034 4024 list_for_each_entry(fcport, &vha->vp_fcports, list) { 4035 4025 fcport->scan_state = QLA_FCPORT_SCAN; 4026 + fcport->n2n_flag = 0; 4036 4027 } 4037 4028 4038 4029 fcport = qla2x00_find_fcport_by_wwpn(vha, ··· 4043 4032 fcport->login_retry = vha->hw->login_retry_count; 4044 4033 fcport->plogi_nack_done_deadline = jiffies + HZ; 4045 4034 fcport->scan_state = QLA_FCPORT_FOUND; 4035 + fcport->keep_nport_handle = 1; 4036 + fcport->n2n_flag = 1; 4037 + fcport->d_id.b.domain = 4038 + rptid_entry->u.f2.remote_nport_id[2]; 4039 + fcport->d_id.b.area = 4040 + rptid_entry->u.f2.remote_nport_id[1]; 4041 + fcport->d_id.b.al_pa = 4042 + rptid_entry->u.f2.remote_nport_id[0]; 4046 4043 } 4047 4044 } 4048 4045 }
+22 -10
drivers/scsi/qla2xxx/qla_mid.c
··· 66 66 uint16_t vp_id; 67 67 struct qla_hw_data *ha = vha->hw; 68 68 unsigned long flags = 0; 69 + u8 i; 69 70 70 71 mutex_lock(&ha->vport_lock); 71 72 /* ··· 76 75 * ensures no active vp_list traversal while the vport is removed 77 76 * from the queue) 78 77 */ 79 - wait_event_timeout(vha->vref_waitq, !atomic_read(&vha->vref_count), 80 - 10*HZ); 78 + for (i = 0; i < 10 && atomic_read(&vha->vref_count); i++) 79 + wait_event_timeout(vha->vref_waitq, 80 + atomic_read(&vha->vref_count), HZ); 81 81 82 82 spin_lock_irqsave(&ha->vport_slock, flags); 83 83 if (atomic_read(&vha->vref_count)) { ··· 264 262 spin_lock_irqsave(&ha->vport_slock, flags); 265 263 list_for_each_entry(vha, &ha->vp_list, list) { 266 264 if (vha->vp_idx) { 265 + if (test_bit(VPORT_DELETE, &vha->dpc_flags)) 266 + continue; 267 + 267 268 atomic_inc(&vha->vref_count); 268 269 spin_unlock_irqrestore(&ha->vport_slock, flags); 269 270 ··· 305 300 int 306 301 qla2x00_vp_abort_isp(scsi_qla_host_t *vha) 307 302 { 303 + fc_port_t *fcport; 304 + 305 + /* 306 + * To exclusively reset vport, we need to log it out first. 307 + * Note: This control_vp can fail if ISP reset is already 308 + * issued, this is expected, as the vp would be already 309 + * logged out due to ISP reset. 310 + */ 311 + if (!test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) { 312 + qla24xx_control_vp(vha, VCE_COMMAND_DISABLE_VPS_LOGO_ALL); 313 + list_for_each_entry(fcport, &vha->vp_fcports, list) 314 + fcport->logout_on_delete = 0; 315 + } 316 + 308 317 /* 309 318 * Physical port will do most of the abort and recovery work. We can 310 319 * just treat it as a loop down ··· 331 312 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); 332 313 } 333 314 334 - /* 335 - * To exclusively reset vport, we need to log it out first. Note: this 336 - * control_vp can fail if ISP reset is already issued, this is 337 - * expected, as the vp would be already logged out due to ISP reset. 338 - */ 339 - if (!test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) 340 - qla24xx_control_vp(vha, VCE_COMMAND_DISABLE_VPS_LOGO_ALL); 341 - 342 315 ql_dbg(ql_dbg_taskm, vha, 0x801d, 343 316 "Scheduling enable of Vport %d.\n", vha->vp_idx); 317 + 344 318 return qla24xx_enable_vp(vha); 345 319 } 346 320
+13 -5
drivers/scsi/qla2xxx/qla_os.c
··· 1115 1115 void 1116 1116 qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha) 1117 1117 { 1118 + u8 i; 1119 + 1118 1120 qla2x00_mark_all_devices_lost(vha, 0); 1119 1121 1120 - wait_event_timeout(vha->fcport_waitQ, test_fcport_count(vha), 10*HZ); 1122 + for (i = 0; i < 10; i++) 1123 + wait_event_timeout(vha->fcport_waitQ, test_fcport_count(vha), 1124 + HZ); 1125 + 1126 + flush_workqueue(vha->hw->wq); 1121 1127 } 1122 1128 1123 1129 /* ··· 5042 5036 5043 5037 memcpy(fcport->port_name, e->u.new_sess.port_name, 5044 5038 WWN_SIZE); 5039 + 5040 + if (e->u.new_sess.fc4_type & FS_FCP_IS_N2N) 5041 + fcport->n2n_flag = 1; 5042 + 5045 5043 } else { 5046 5044 ql_dbg(ql_dbg_disc, vha, 0xffff, 5047 5045 "%s %8phC mem alloc fail.\n", ··· 5144 5134 if (dfcp) 5145 5135 qlt_schedule_sess_for_deletion(tfcp); 5146 5136 5147 - 5148 - if (N2N_TOPO(vha->hw)) 5149 - fcport->flags &= ~FCF_FABRIC_DEVICE; 5150 - 5151 5137 if (N2N_TOPO(vha->hw)) { 5138 + fcport->flags &= ~FCF_FABRIC_DEVICE; 5139 + fcport->keep_nport_handle = 1; 5152 5140 if (vha->flags.nvme_enabled) { 5153 5141 fcport->fc4f_nvme = 1; 5154 5142 fcport->n2n_flag = 1;
+13 -13
drivers/scsi/qla2xxx/qla_target.c
··· 953 953 struct qla_hw_data *ha = vha->hw; 954 954 unsigned long flags; 955 955 bool logout_started = false; 956 - scsi_qla_host_t *base_vha; 956 + scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev); 957 957 struct qlt_plogi_ack_t *own = 958 958 sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN]; 959 959 ··· 1020 1020 1021 1021 if (logout_started) { 1022 1022 bool traced = false; 1023 + u16 cnt = 0; 1023 1024 1024 1025 while (!READ_ONCE(sess->logout_completed)) { 1025 1026 if (!traced) { ··· 1030 1029 traced = true; 1031 1030 } 1032 1031 msleep(100); 1032 + cnt++; 1033 + if (cnt > 200) 1034 + break; 1033 1035 } 1034 1036 1035 1037 ql_dbg(ql_dbg_disc, vha, 0xf087, ··· 1105 1101 } 1106 1102 1107 1103 spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); 1104 + sess->free_pending = 0; 1108 1105 1109 1106 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf001, 1110 1107 "Unregistration of sess %p %8phC finished fcp_cnt %d\n", ··· 1114 1109 if (tgt && (tgt->sess_count == 0)) 1115 1110 wake_up_all(&tgt->waitQ); 1116 1111 1117 - if (vha->fcport_count == 0) 1118 - wake_up_all(&vha->fcport_waitQ); 1119 - 1120 - base_vha = pci_get_drvdata(ha->pdev); 1121 - 1122 - sess->free_pending = 0; 1123 - 1124 - if (test_bit(PFLG_DRIVER_REMOVING, &base_vha->pci_flags)) 1125 - return; 1126 - 1127 - if ((!tgt || !tgt->tgt_stop) && !LOOP_TRANSITION(vha)) { 1112 + if (!test_bit(PFLG_DRIVER_REMOVING, &base_vha->pci_flags) && 1113 + !(vha->vp_idx && test_bit(VPORT_DELETE, &vha->dpc_flags)) && 1114 + (!tgt || !tgt->tgt_stop) && !LOOP_TRANSITION(vha)) { 1128 1115 switch (vha->host->active_mode) { 1129 1116 case MODE_INITIATOR: 1130 1117 case MODE_DUAL: ··· 1129 1132 break; 1130 1133 } 1131 1134 } 1135 + 1136 + if (vha->fcport_count == 0) 1137 + wake_up_all(&vha->fcport_waitQ); 1132 1138 } 1133 1139 1134 1140 /* ha->tgt.sess_lock supposed to be held on entry */ ··· 1161 1161 sess->last_login_gen = sess->login_gen; 1162 1162 1163 1163 INIT_WORK(&sess->free_work, qlt_free_session_done); 1164 - schedule_work(&sess->free_work); 1164 + queue_work(sess->vha->hw->wq, &sess->free_work); 1165 1165 } 1166 1166 EXPORT_SYMBOL(qlt_unreg_sess); 1167 1167
+1 -2
drivers/scsi/storvsc_drv.c
··· 1837 1837 /* 1838 1838 * Set the number of HW queues we are supporting. 1839 1839 */ 1840 - if (stor_device->num_sc != 0) 1841 - host->nr_hw_queues = stor_device->num_sc + 1; 1840 + host->nr_hw_queues = num_present_cpus(); 1842 1841 1843 1842 /* 1844 1843 * Set the error handler work queue.
+3
drivers/scsi/ufs/ufshcd.c
··· 8143 8143 { 8144 8144 int ret = 0; 8145 8145 8146 + if (!hba->is_powered) 8147 + goto out; 8148 + 8146 8149 if (ufshcd_is_ufs_dev_poweroff(hba) && ufshcd_is_link_off(hba)) 8147 8150 goto out; 8148 8151