]>
Commit | Line | Data |
---|---|---|
161bea4e TL |
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Thomas Lamprecht <t.lamprecht@proxmox.com> | |
3 | Date: Fri, 15 May 2020 14:43:37 +0200 | |
4 | Subject: [PATCH] Revert "scsi: lpfc: Fix broken Credit Recovery after driver | |
5 | load" | |
6 | ||
7 | This reverts commit 77d5805eafdb5c42bdfe78f058ad9c40ee1278b4. | |
8 | We got some reports that this causes some lpfcs to report FLOGI | |
9 | errors[0][1] and while the real fix is naturally something else, it | |
10 | is nonexistent for now, so workaround with this revert. | |
11 | ||
12 | [0]: https://forum.proxmox.com/threads/proxmox-6-2-lpfc-error-port-type-wrong.69680/#post-312491 | |
13 | [1]: https://lore.kernel.org/linux-scsi/20200512212855.36q2ut2io2cdtagn@zeha.at/ | |
14 | --- | |
15 | drivers/scsi/lpfc/lpfc.h | 1 - | |
16 | drivers/scsi/lpfc/lpfc_hbadisc.c | 59 +++++++++++--------------------- | |
17 | 2 files changed, 20 insertions(+), 40 deletions(-) | |
18 | ||
19 | diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h | |
20 | index 357fdec06bae..cd5525f28556 100644 | |
21 | --- a/drivers/scsi/lpfc/lpfc.h | |
22 | +++ b/drivers/scsi/lpfc/lpfc.h | |
23 | @@ -748,7 +748,6 @@ struct lpfc_hba { | |
24 | * capability | |
25 | */ | |
26 | #define HBA_FLOGI_ISSUED 0x100000 /* FLOGI was issued */ | |
27 | -#define HBA_DEFER_FLOGI 0x800000 /* Defer FLOGI till read_sparm cmpl */ | |
28 | ||
29 | uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/ | |
30 | struct lpfc_dmabuf slim2p; | |
31 | diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c | |
32 | index 789eecbf32eb..95566e382b48 100644 | |
33 | --- a/drivers/scsi/lpfc/lpfc_hbadisc.c | |
34 | +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |
35 | @@ -1163,16 +1163,13 @@ lpfc_mbx_cmpl_local_config_link(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |
36 | } | |
37 | ||
38 | /* Start discovery by sending a FLOGI. port_state is identically | |
39 | - * LPFC_FLOGI while waiting for FLOGI cmpl. Check if sending | |
40 | - * the FLOGI is being deferred till after MBX_READ_SPARAM completes. | |
41 | + * LPFC_FLOGI while waiting for FLOGI cmpl | |
42 | */ | |
43 | - if (vport->port_state != LPFC_FLOGI) { | |
44 | - if (!(phba->hba_flag & HBA_DEFER_FLOGI)) | |
45 | - lpfc_initial_flogi(vport); | |
46 | - } else { | |
47 | - if (vport->fc_flag & FC_PT2PT) | |
48 | - lpfc_disc_start(vport); | |
49 | - } | |
50 | + if (vport->port_state != LPFC_FLOGI) | |
51 | + lpfc_initial_flogi(vport); | |
52 | + else if (vport->fc_flag & FC_PT2PT) | |
53 | + lpfc_disc_start(vport); | |
54 | + | |
55 | return; | |
56 | ||
57 | out: | |
58 | @@ -3097,14 +3094,6 @@ lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |
59 | lpfc_mbuf_free(phba, mp->virt, mp->phys); | |
60 | kfree(mp); | |
61 | mempool_free(pmb, phba->mbox_mem_pool); | |
62 | - | |
63 | - /* Check if sending the FLOGI is being deferred to after we get | |
64 | - * up to date CSPs from MBX_READ_SPARAM. | |
65 | - */ | |
66 | - if (phba->hba_flag & HBA_DEFER_FLOGI) { | |
67 | - lpfc_initial_flogi(vport); | |
68 | - phba->hba_flag &= ~HBA_DEFER_FLOGI; | |
69 | - } | |
70 | return; | |
71 | ||
72 | out: | |
73 | @@ -3235,23 +3224,6 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) | |
74 | } | |
75 | ||
76 | lpfc_linkup(phba); | |
77 | - sparam_mbox = NULL; | |
78 | - | |
79 | - if (!(phba->hba_flag & HBA_FCOE_MODE)) { | |
80 | - cfglink_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); | |
81 | - if (!cfglink_mbox) | |
82 | - goto out; | |
83 | - vport->port_state = LPFC_LOCAL_CFG_LINK; | |
84 | - lpfc_config_link(phba, cfglink_mbox); | |
85 | - cfglink_mbox->vport = vport; | |
86 | - cfglink_mbox->mbox_cmpl = lpfc_mbx_cmpl_local_config_link; | |
87 | - rc = lpfc_sli_issue_mbox(phba, cfglink_mbox, MBX_NOWAIT); | |
88 | - if (rc == MBX_NOT_FINISHED) { | |
89 | - mempool_free(cfglink_mbox, phba->mbox_mem_pool); | |
90 | - goto out; | |
91 | - } | |
92 | - } | |
93 | - | |
94 | sparam_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); | |
95 | if (!sparam_mbox) | |
96 | goto out; | |
97 | @@ -3272,7 +3244,20 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) | |
98 | goto out; | |
99 | } | |
100 | ||
101 | - if (phba->hba_flag & HBA_FCOE_MODE) { | |
102 | + if (!(phba->hba_flag & HBA_FCOE_MODE)) { | |
103 | + cfglink_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); | |
104 | + if (!cfglink_mbox) | |
105 | + goto out; | |
106 | + vport->port_state = LPFC_LOCAL_CFG_LINK; | |
107 | + lpfc_config_link(phba, cfglink_mbox); | |
108 | + cfglink_mbox->vport = vport; | |
109 | + cfglink_mbox->mbox_cmpl = lpfc_mbx_cmpl_local_config_link; | |
110 | + rc = lpfc_sli_issue_mbox(phba, cfglink_mbox, MBX_NOWAIT); | |
111 | + if (rc == MBX_NOT_FINISHED) { | |
112 | + mempool_free(cfglink_mbox, phba->mbox_mem_pool); | |
113 | + goto out; | |
114 | + } | |
115 | + } else { | |
116 | vport->port_state = LPFC_VPORT_UNKNOWN; | |
117 | /* | |
118 | * Add the driver's default FCF record at FCF index 0 now. This | |
119 | @@ -3329,10 +3314,6 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) | |
120 | } | |
121 | /* Reset FCF roundrobin bmask for new discovery */ | |
122 | lpfc_sli4_clear_fcf_rr_bmask(phba); | |
123 | - } else { | |
124 | - if (phba->bbcredit_support && phba->cfg_enable_bbcr && | |
125 | - !(phba->link_flag & LS_LOOPBACK_MODE)) | |
126 | - phba->hba_flag |= HBA_DEFER_FLOGI; | |
127 | } | |
128 | ||
129 | /* Prepare for LINK up registrations */ |