Skip to content

Commit 40ae6a1

Browse files
Merge patch series "Update lpfc to revision 14.4.0.2"
Justin Tee <[email protected]> says: Update lpfc to revision 14.4.0.2 This patch set contains updates to log messaging, a bug fix related to unloading of the driver, clean up patches regarding the abuse of a global spinlock, and support for 32 byte CDBs. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
2 parents 0f7b063 + 3f1d179 commit 40ae6a1

File tree

15 files changed

+432
-413
lines changed

15 files changed

+432
-413
lines changed

drivers/scsi/lpfc/lpfc.h

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,37 @@ enum hba_state {
393393
LPFC_HBA_ERROR = -1
394394
};
395395

396+
enum lpfc_hba_flag { /* hba generic flags */
397+
HBA_ERATT_HANDLED = 0, /* This flag is set when eratt handled */
398+
DEFER_ERATT = 1, /* Deferred error attn in progress */
399+
HBA_FCOE_MODE = 2, /* HBA function in FCoE Mode */
400+
HBA_SP_QUEUE_EVT = 3, /* Slow-path qevt posted to worker thread*/
401+
HBA_POST_RECEIVE_BUFFER = 4, /* Rcv buffers need to be posted */
402+
HBA_PERSISTENT_TOPO = 5, /* Persistent topology support in hba */
403+
ELS_XRI_ABORT_EVENT = 6, /* ELS_XRI abort event was queued */
404+
ASYNC_EVENT = 7,
405+
LINK_DISABLED = 8, /* Link disabled by user */
406+
FCF_TS_INPROG = 9, /* FCF table scan in progress */
407+
FCF_RR_INPROG = 10, /* FCF roundrobin flogi in progress */
408+
HBA_FIP_SUPPORT = 11, /* FIP support in HBA */
409+
HBA_DEVLOSS_TMO = 13, /* HBA in devloss timeout */
410+
HBA_RRQ_ACTIVE = 14, /* process the rrq active list */
411+
HBA_IOQ_FLUSH = 15, /* I/O queues being flushed */
412+
HBA_RECOVERABLE_UE = 17, /* FW supports recoverable UE */
413+
HBA_FORCED_LINK_SPEED = 18, /*
414+
* Firmware supports Forced Link
415+
* Speed capability
416+
*/
417+
HBA_FLOGI_ISSUED = 20, /* FLOGI was issued */
418+
HBA_DEFER_FLOGI = 23, /* Defer FLOGI till read_sparm cmpl */
419+
HBA_SETUP = 24, /* HBA setup completed */
420+
HBA_NEEDS_CFG_PORT = 25, /* SLI3: CONFIG_PORT mbox needed */
421+
HBA_HBEAT_INP = 26, /* mbox HBEAT is in progress */
422+
HBA_HBEAT_TMO = 27, /* HBEAT initiated after timeout */
423+
HBA_FLOGI_OUTSTANDING = 28, /* FLOGI is outstanding */
424+
HBA_RHBA_CMPL = 29, /* RHBA FDMI cmd is successful */
425+
};
426+
396427
struct lpfc_trunk_link_state {
397428
enum hba_state state;
398429
uint8_t fault;
@@ -1007,35 +1038,7 @@ struct lpfc_hba {
10071038
#define LS_CT_VEN_RPA 0x20 /* Vendor RPA sent to switch */
10081039
#define LS_EXTERNAL_LOOPBACK 0x40 /* External loopback plug inserted */
10091040

1010-
uint32_t hba_flag; /* hba generic flags */
1011-
#define HBA_ERATT_HANDLED 0x1 /* This flag is set when eratt handled */
1012-
#define DEFER_ERATT 0x2 /* Deferred error attention in progress */
1013-
#define HBA_FCOE_MODE 0x4 /* HBA function in FCoE Mode */
1014-
#define HBA_SP_QUEUE_EVT 0x8 /* Slow-path qevt posted to worker thread*/
1015-
#define HBA_POST_RECEIVE_BUFFER 0x10 /* Rcv buffers need to be posted */
1016-
#define HBA_PERSISTENT_TOPO 0x20 /* Persistent topology support in hba */
1017-
#define ELS_XRI_ABORT_EVENT 0x40 /* ELS_XRI abort event was queued */
1018-
#define ASYNC_EVENT 0x80
1019-
#define LINK_DISABLED 0x100 /* Link disabled by user */
1020-
#define FCF_TS_INPROG 0x200 /* FCF table scan in progress */
1021-
#define FCF_RR_INPROG 0x400 /* FCF roundrobin flogi in progress */
1022-
#define HBA_FIP_SUPPORT 0x800 /* FIP support in HBA */
1023-
#define HBA_DEVLOSS_TMO 0x2000 /* HBA in devloss timeout */
1024-
#define HBA_RRQ_ACTIVE 0x4000 /* process the rrq active list */
1025-
#define HBA_IOQ_FLUSH 0x8000 /* FCP/NVME I/O queues being flushed */
1026-
#define HBA_RECOVERABLE_UE 0x20000 /* Firmware supports recoverable UE */
1027-
#define HBA_FORCED_LINK_SPEED 0x40000 /*
1028-
* Firmware supports Forced Link Speed
1029-
* capability
1030-
*/
1031-
#define HBA_FLOGI_ISSUED 0x100000 /* FLOGI was issued */
1032-
#define HBA_DEFER_FLOGI 0x800000 /* Defer FLOGI till read_sparm cmpl */
1033-
#define HBA_SETUP 0x1000000 /* Signifies HBA setup is completed */
1034-
#define HBA_NEEDS_CFG_PORT 0x2000000 /* SLI3 - needs a CONFIG_PORT mbox */
1035-
#define HBA_HBEAT_INP 0x4000000 /* mbox HBEAT is in progress */
1036-
#define HBA_HBEAT_TMO 0x8000000 /* HBEAT initiated after timeout */
1037-
#define HBA_FLOGI_OUTSTANDING 0x10000000 /* FLOGI is outstanding */
1038-
#define HBA_RHBA_CMPL 0x20000000 /* RHBA FDMI command is successful */
1041+
unsigned long hba_flag; /* hba generic flags */
10391042

10401043
struct completion *fw_dump_cmpl; /* cmpl event tracker for fw_dump */
10411044
uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/
@@ -1284,6 +1287,7 @@ struct lpfc_hba {
12841287
uint32_t total_scsi_bufs;
12851288
struct list_head lpfc_iocb_list;
12861289
uint32_t total_iocbq_bufs;
1290+
spinlock_t rrq_list_lock; /* lock for active_rrq_list */
12871291
struct list_head active_rrq_list;
12881292
spinlock_t hbalock;
12891293
struct work_struct unblock_request_work; /* SCSI layer unblock IOs */

drivers/scsi/lpfc/lpfc_attr.c

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ lpfc_enable_fip_show(struct device *dev, struct device_attribute *attr,
322322
struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
323323
struct lpfc_hba *phba = vport->phba;
324324

325-
if (phba->hba_flag & HBA_FIP_SUPPORT)
325+
if (test_bit(HBA_FIP_SUPPORT, &phba->hba_flag))
326326
return scnprintf(buf, PAGE_SIZE, "1\n");
327327
else
328328
return scnprintf(buf, PAGE_SIZE, "0\n");
@@ -1049,7 +1049,7 @@ lpfc_link_state_show(struct device *dev, struct device_attribute *attr,
10491049
case LPFC_INIT_MBX_CMDS:
10501050
case LPFC_LINK_DOWN:
10511051
case LPFC_HBA_ERROR:
1052-
if (phba->hba_flag & LINK_DISABLED)
1052+
if (test_bit(LINK_DISABLED, &phba->hba_flag))
10531053
len += scnprintf(buf + len, PAGE_SIZE-len,
10541054
"Link Down - User disabled\n");
10551055
else
@@ -1292,7 +1292,7 @@ lpfc_issue_lip(struct Scsi_Host *shost)
12921292
* it doesn't make any sense to allow issue_lip
12931293
*/
12941294
if (test_bit(FC_OFFLINE_MODE, &vport->fc_flag) ||
1295-
(phba->hba_flag & LINK_DISABLED) ||
1295+
test_bit(LINK_DISABLED, &phba->hba_flag) ||
12961296
(phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO))
12971297
return -EPERM;
12981298

@@ -3635,7 +3635,8 @@ lpfc_pt_show(struct device *dev, struct device_attribute *attr, char *buf)
36353635
struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
36363636

36373637
return scnprintf(buf, PAGE_SIZE, "%d\n",
3638-
(phba->hba_flag & HBA_PERSISTENT_TOPO) ? 1 : 0);
3638+
test_bit(HBA_PERSISTENT_TOPO,
3639+
&phba->hba_flag) ? 1 : 0);
36393640
}
36403641
static DEVICE_ATTR(pt, 0444,
36413642
lpfc_pt_show, NULL);
@@ -4205,8 +4206,8 @@ lpfc_topology_store(struct device *dev, struct device_attribute *attr,
42054206
&phba->sli4_hba.sli_intf);
42064207
if_type = bf_get(lpfc_sli_intf_if_type,
42074208
&phba->sli4_hba.sli_intf);
4208-
if ((phba->hba_flag & HBA_PERSISTENT_TOPO ||
4209-
(!phba->sli4_hba.pc_sli4_params.pls &&
4209+
if ((test_bit(HBA_PERSISTENT_TOPO, &phba->hba_flag) ||
4210+
(!phba->sli4_hba.pc_sli4_params.pls &&
42104211
(sli_family == LPFC_SLI_INTF_FAMILY_G6 ||
42114212
if_type == LPFC_SLI_INTF_IF_TYPE_6))) &&
42124213
val == 4) {
@@ -4309,7 +4310,7 @@ lpfc_link_speed_store(struct device *dev, struct device_attribute *attr,
43094310

43104311
if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf);
43114312
if (if_type >= LPFC_SLI_INTF_IF_TYPE_2 &&
4312-
phba->hba_flag & HBA_FORCED_LINK_SPEED)
4313+
test_bit(HBA_FORCED_LINK_SPEED, &phba->hba_flag))
43134314
return -EPERM;
43144315

43154316
if (!strncmp(buf, "nolip ", strlen("nolip "))) {
@@ -6497,7 +6498,8 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
64976498
struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
64986499
struct lpfc_hba *phba = vport->phba;
64996500

6500-
if ((lpfc_is_link_up(phba)) && (!(phba->hba_flag & HBA_FCOE_MODE))) {
6501+
if ((lpfc_is_link_up(phba)) &&
6502+
!test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
65016503
switch(phba->fc_linkspeed) {
65026504
case LPFC_LINK_SPEED_1GHZ:
65036505
fc_host_speed(shost) = FC_PORTSPEED_1GBIT;
@@ -6533,7 +6535,8 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
65336535
fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
65346536
break;
65356537
}
6536-
} else if (lpfc_is_link_up(phba) && (phba->hba_flag & HBA_FCOE_MODE)) {
6538+
} else if (lpfc_is_link_up(phba) &&
6539+
test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
65376540
switch (phba->fc_linkspeed) {
65386541
case LPFC_ASYNC_LINK_SPEED_1GBPS:
65396542
fc_host_speed(shost) = FC_PORTSPEED_1GBIT;
@@ -6718,7 +6721,7 @@ lpfc_get_stats(struct Scsi_Host *shost)
67186721
hs->invalid_crc_count -= lso->invalid_crc_count;
67196722
hs->error_frames -= lso->error_frames;
67206723

6721-
if (phba->hba_flag & HBA_FCOE_MODE) {
6724+
if (test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
67226725
hs->lip_count = -1;
67236726
hs->nos_count = (phba->link_events >> 1);
67246727
hs->nos_count -= lso->link_events;
@@ -6816,7 +6819,7 @@ lpfc_reset_stats(struct Scsi_Host *shost)
68166819
lso->invalid_tx_word_count = pmb->un.varRdLnk.invalidXmitWord;
68176820
lso->invalid_crc_count = pmb->un.varRdLnk.crcCnt;
68186821
lso->error_frames = pmb->un.varRdLnk.crcCnt;
6819-
if (phba->hba_flag & HBA_FCOE_MODE)
6822+
if (test_bit(HBA_FCOE_MODE, &phba->hba_flag))
68206823
lso->link_events = (phba->link_events >> 1);
68216824
else
68226825
lso->link_events = (phba->fc_eventTag >> 1);
@@ -7161,11 +7164,11 @@ lpfc_get_hba_function_mode(struct lpfc_hba *phba)
71617164
case PCI_DEVICE_ID_ZEPHYR_DCSP:
71627165
case PCI_DEVICE_ID_TIGERSHARK:
71637166
case PCI_DEVICE_ID_TOMCAT:
7164-
phba->hba_flag |= HBA_FCOE_MODE;
7167+
set_bit(HBA_FCOE_MODE, &phba->hba_flag);
71657168
break;
71667169
default:
71677170
/* for others, clear the flag */
7168-
phba->hba_flag &= ~HBA_FCOE_MODE;
7171+
clear_bit(HBA_FCOE_MODE, &phba->hba_flag);
71697172
}
71707173
}
71717174

@@ -7236,7 +7239,7 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
72367239
lpfc_get_hba_function_mode(phba);
72377240

72387241
/* BlockGuard allowed for FC only. */
7239-
if (phba->cfg_enable_bg && phba->hba_flag & HBA_FCOE_MODE) {
7242+
if (phba->cfg_enable_bg && test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
72407243
lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
72417244
"0581 BlockGuard feature not supported\n");
72427245
/* If set, clear the BlockGuard support param */

drivers/scsi/lpfc/lpfc_bsg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5002,7 +5002,8 @@ lpfc_forced_link_speed(struct bsg_job *job)
50025002
goto job_error;
50035003
}
50045004

5005-
forced_reply->supported = (phba->hba_flag & HBA_FORCED_LINK_SPEED)
5005+
forced_reply->supported = test_bit(HBA_FORCED_LINK_SPEED,
5006+
&phba->hba_flag)
50065007
? LPFC_FORCED_LINK_SPEED_SUPPORTED
50075008
: LPFC_FORCED_LINK_SPEED_NOT_SUPPORTED;
50085009
job_error:

drivers/scsi/lpfc/lpfc_ct.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ lpfc_ct_handle_mibreq(struct lpfc_hba *phba, struct lpfc_iocbq *ctiocbq)
291291

292292
did = bf_get(els_rsp64_sid, &ctiocbq->wqe.xmit_els_rsp);
293293
if (ulp_status) {
294-
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
295-
"6438 Unsol CT: status:x%x/x%x did : x%x\n",
296-
ulp_status, ulp_word4, did);
294+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
295+
"6438 Unsol CT: status:x%x/x%x did : x%x\n",
296+
ulp_status, ulp_word4, did);
297297
return;
298298
}
299299

@@ -303,17 +303,17 @@ lpfc_ct_handle_mibreq(struct lpfc_hba *phba, struct lpfc_iocbq *ctiocbq)
303303

304304
ndlp = lpfc_findnode_did(vport, did);
305305
if (!ndlp) {
306-
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
307-
"6439 Unsol CT: NDLP Not Found for DID : x%x",
308-
did);
306+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
307+
"6439 Unsol CT: NDLP Not Found for DID : x%x",
308+
did);
309309
return;
310310
}
311311

312312
ct_req = (struct lpfc_sli_ct_request *)ctiocbq->cmd_dmabuf->virt;
313313

314314
mi_cmd = be16_to_cpu(ct_req->CommandResponse.bits.CmdRsp);
315-
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
316-
"6442 : MI Cmd : x%x Not Supported\n", mi_cmd);
315+
lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS,
316+
"6442 MI Cmd : x%x Not Supported\n", mi_cmd);
317317
lpfc_ct_reject_event(ndlp, ct_req,
318318
bf_get(wqe_ctxt_tag,
319319
&ctiocbq->wqe.xmit_els_rsp.wqe_com),
@@ -2173,7 +2173,7 @@ lpfc_fdmi_rprt_defer(struct lpfc_hba *phba, uint32_t mask)
21732173
struct lpfc_nodelist *ndlp;
21742174
int i;
21752175

2176-
phba->hba_flag |= HBA_RHBA_CMPL;
2176+
set_bit(HBA_RHBA_CMPL, &phba->hba_flag);
21772177
vports = lpfc_create_vport_work_array(phba);
21782178
if (vports) {
21792179
for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
@@ -2368,7 +2368,7 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
23682368
* for the physical port completes successfully.
23692369
* We may have to defer the RPRT accordingly.
23702370
*/
2371-
if (phba->hba_flag & HBA_RHBA_CMPL) {
2371+
if (test_bit(HBA_RHBA_CMPL, &phba->hba_flag)) {
23722372
lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_RPRT, 0);
23732373
} else {
23742374
lpfc_printf_vlog(vport, KERN_INFO,
@@ -2785,7 +2785,7 @@ lpfc_fdmi_port_attr_support_speed(struct lpfc_vport *vport, void *attr)
27852785
u32 tcfg;
27862786
u8 i, cnt;
27872787

2788-
if (!(phba->hba_flag & HBA_FCOE_MODE)) {
2788+
if (!test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
27892789
cnt = 0;
27902790
if (phba->sli_rev == LPFC_SLI_REV4) {
27912791
tcfg = phba->sli4_hba.conf_trunk;
@@ -2859,7 +2859,7 @@ lpfc_fdmi_port_attr_speed(struct lpfc_vport *vport, void *attr)
28592859
struct lpfc_hba *phba = vport->phba;
28602860
u32 speeds = 0;
28612861

2862-
if (!(phba->hba_flag & HBA_FCOE_MODE)) {
2862+
if (!test_bit(HBA_FCOE_MODE, &phba->hba_flag)) {
28632863
switch (phba->fc_linkspeed) {
28642864
case LPFC_LINK_SPEED_1GHZ:
28652865
speeds = HBA_PORTSPEED_1GFC;

0 commit comments

Comments
 (0)