@@ -2061,6 +2061,22 @@ static void bnxt_event_error_report(struct bnxt *bp, u32 data1, u32 data2)
2061
2061
case ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD :
2062
2062
netdev_warn (bp -> dev , "One or more MMIO doorbells dropped by the device!\n" );
2063
2063
break ;
2064
+ case ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_NVM : {
2065
+ struct bnxt_hw_health * hw_health = & bp -> hw_health ;
2066
+
2067
+ hw_health -> nvm_err_address = EVENT_DATA2_NVM_ERR_ADDR (data2 );
2068
+ if (EVENT_DATA1_NVM_ERR_TYPE_WRITE (data1 )) {
2069
+ hw_health -> synd = BNXT_HW_STATUS_NVM_WRITE_ERR ;
2070
+ hw_health -> nvm_write_errors ++ ;
2071
+ } else if (EVENT_DATA1_NVM_ERR_TYPE_ERASE (data1 )) {
2072
+ hw_health -> synd = BNXT_HW_STATUS_NVM_ERASE_ERR ;
2073
+ hw_health -> nvm_erase_errors ++ ;
2074
+ } else {
2075
+ hw_health -> synd = BNXT_HW_STATUS_NVM_UNKNOWN_ERR ;
2076
+ }
2077
+ set_bit (BNXT_FW_NVM_ERR_SP_EVENT , & bp -> sp_event );
2078
+ break ;
2079
+ }
2064
2080
default :
2065
2081
netdev_err (bp -> dev , "FW reported unknown error type %u\n" ,
2066
2082
err_type );
@@ -9300,7 +9316,7 @@ void bnxt_tx_enable(struct bnxt *bp)
9300
9316
/* Make sure napi polls see @dev_state change */
9301
9317
synchronize_net ();
9302
9318
netif_tx_wake_all_queues (bp -> dev );
9303
- if (bp -> link_info . link_up )
9319
+ if (BNXT_LINK_IS_UP ( bp ) )
9304
9320
netif_carrier_on (bp -> dev );
9305
9321
}
9306
9322
@@ -9330,7 +9346,7 @@ static char *bnxt_report_fec(struct bnxt_link_info *link_info)
9330
9346
9331
9347
void bnxt_report_link (struct bnxt * bp )
9332
9348
{
9333
- if (bp -> link_info . link_up ) {
9349
+ if (BNXT_LINK_IS_UP ( bp ) ) {
9334
9350
const char * signal = "" ;
9335
9351
const char * flow_ctrl ;
9336
9352
const char * duplex ;
@@ -9416,7 +9432,7 @@ static int bnxt_hwrm_phy_qcaps(struct bnxt *bp)
9416
9432
if (rc )
9417
9433
goto hwrm_phy_qcaps_exit ;
9418
9434
9419
- bp -> phy_flags = resp -> flags ;
9435
+ bp -> phy_flags = resp -> flags | ( le16_to_cpu ( resp -> flags2 ) << 8 ) ;
9420
9436
if (resp -> flags & PORT_PHY_QCAPS_RESP_FLAGS_EEE_SUPPORTED ) {
9421
9437
struct ethtool_eee * eee = & bp -> eee ;
9422
9438
u16 fw_speeds = le16_to_cpu (resp -> supported_speeds_eee_mode );
@@ -9466,7 +9482,7 @@ int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
9466
9482
struct bnxt_link_info * link_info = & bp -> link_info ;
9467
9483
struct hwrm_port_phy_qcfg_output * resp ;
9468
9484
struct hwrm_port_phy_qcfg_input * req ;
9469
- u8 link_up = link_info -> link_up ;
9485
+ u8 link_state = link_info -> link_state ;
9470
9486
bool support_changed = false;
9471
9487
int rc ;
9472
9488
@@ -9567,14 +9583,14 @@ int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
9567
9583
/* TODO: need to add more logic to report VF link */
9568
9584
if (chng_link_state ) {
9569
9585
if (link_info -> phy_link_status == BNXT_LINK_LINK )
9570
- link_info -> link_up = 1 ;
9586
+ link_info -> link_state = BNXT_LINK_STATE_UP ;
9571
9587
else
9572
- link_info -> link_up = 0 ;
9573
- if (link_up != link_info -> link_up )
9588
+ link_info -> link_state = BNXT_LINK_STATE_DOWN ;
9589
+ if (link_state != link_info -> link_state )
9574
9590
bnxt_report_link (bp );
9575
9591
} else {
9576
- /* alwasy link down if not require to update link state */
9577
- link_info -> link_up = 0 ;
9592
+ /* always link down if not require to update link state */
9593
+ link_info -> link_state = BNXT_LINK_STATE_DOWN ;
9578
9594
}
9579
9595
hwrm_req_drop (bp , req );
9580
9596
@@ -9774,7 +9790,18 @@ static int bnxt_hwrm_shutdown_link(struct bnxt *bp)
9774
9790
return rc ;
9775
9791
9776
9792
req -> flags = cpu_to_le32 (PORT_PHY_CFG_REQ_FLAGS_FORCE_LINK_DWN );
9777
- return hwrm_req_send (bp , req );
9793
+ rc = hwrm_req_send (bp , req );
9794
+ if (!rc ) {
9795
+ mutex_lock (& bp -> link_lock );
9796
+ /* Device is not obliged link down in certain scenarios, even
9797
+ * when forced. Setting the state unknown is consistent with
9798
+ * driver startup and will force link state to be reported
9799
+ * during subsequent open based on PORT_PHY_QCFG.
9800
+ */
9801
+ bp -> link_info .link_state = BNXT_LINK_STATE_UNKNOWN ;
9802
+ mutex_unlock (& bp -> link_lock );
9803
+ }
9804
+ return rc ;
9778
9805
}
9779
9806
9780
9807
static int bnxt_fw_reset_via_optee (struct bnxt * bp )
@@ -10205,7 +10232,7 @@ static int bnxt_update_phy_setting(struct bnxt *bp)
10205
10232
/* The last close may have shutdown the link, so need to call
10206
10233
* PHY_CFG to bring it back up.
10207
10234
*/
10208
- if (!bp -> link_info . link_up )
10235
+ if (!BNXT_LINK_IS_UP ( bp ) )
10209
10236
update_link = true;
10210
10237
10211
10238
if (!bnxt_eee_config_ok (bp ))
@@ -11437,7 +11464,7 @@ static void bnxt_timer(struct timer_list *t)
11437
11464
if (bp -> fw_cap & BNXT_FW_CAP_ERROR_RECOVERY )
11438
11465
bnxt_fw_health_check (bp );
11439
11466
11440
- if (bp -> link_info . link_up && bp -> stats_coal_ticks ) {
11467
+ if (BNXT_LINK_IS_UP ( bp ) && bp -> stats_coal_ticks ) {
11441
11468
set_bit (BNXT_PERIODIC_STATS_SP_EVENT , & bp -> sp_event );
11442
11469
bnxt_queue_sp_work (bp );
11443
11470
}
@@ -11876,6 +11903,9 @@ static void bnxt_sp_task(struct work_struct *work)
11876
11903
if (test_and_clear_bit (BNXT_FW_ECHO_REQUEST_SP_EVENT , & bp -> sp_event ))
11877
11904
bnxt_fw_echo_reply (bp );
11878
11905
11906
+ if (test_and_clear_bit (BNXT_FW_NVM_ERR_SP_EVENT , & bp -> sp_event ))
11907
+ bnxt_devlink_health_hw_report (bp );
11908
+
11879
11909
/* These functions below will clear BNXT_STATE_IN_SP_TASK. They
11880
11910
* must be the last functions to be called before exiting.
11881
11911
*/
@@ -12138,11 +12168,6 @@ int bnxt_fw_init_one(struct bnxt *bp)
12138
12168
if (rc )
12139
12169
return rc ;
12140
12170
12141
- /* In case fw capabilities have changed, destroy the unneeded
12142
- * reporters and create newly capable ones.
12143
- */
12144
- bnxt_dl_fw_reporters_destroy (bp , false);
12145
- bnxt_dl_fw_reporters_create (bp );
12146
12171
bnxt_fw_init_one_p3 (bp );
12147
12172
return 0 ;
12148
12173
}
@@ -12971,7 +12996,7 @@ static void bnxt_remove_one(struct pci_dev *pdev)
12971
12996
cancel_delayed_work_sync (& bp -> fw_reset_task );
12972
12997
bp -> sp_event = 0 ;
12973
12998
12974
- bnxt_dl_fw_reporters_destroy (bp , true );
12999
+ bnxt_dl_fw_reporters_destroy (bp );
12975
13000
bnxt_dl_unregister (bp );
12976
13001
bnxt_shutdown_tc (bp );
12977
13002
0 commit comments