The status bits of register MAC_FPE_CTRL_STS are clear on read. Using 32-bit read for MAC_FPE_CTRL_STS in dwmac5_fpe_configure() and dwmac5_fpe_send_mpacket() clear the status bits. Then the stmmac interrupt handler missing FPE event status and leads to FPE handshaking failure and retries. To avoid clear status bits of MAC_FPE_CTRL_STS in dwmac5_fpe_configure() and dwmac5_fpe_send_mpacket(), add fpe_csr to stmmac_fpe_cfg structure to cache the control bits of MAC_FPE_CTRL_STS and to avoid reading MAC_FPE_CTRL_STS in those methods.
Showing the changes to include/linux (1 of 7 files). Show all
Unified · Split
| @@ -175,6 +175,7 @@ struct stmmac_fpe_cfg { · 174 unmodified lines | |||
| 175 | bool hs_enable; /* FPE handshake enable */ | 175 | bool hs_enable; /* FPE handshake enable */ |
| 176 | enum stmmac_fpe_state lp_fpe_state; /* Link Partner FPE state */ | 176 | enum stmmac_fpe_state lp_fpe_state; /* Link Partner FPE state */ |
| 177 | enum stmmac_fpe_state lo_fpe_state; /* Local station FPE state */ | 177 | enum stmmac_fpe_state lo_fpe_state; /* Local station FPE state */ |
| 178 | u32 fpe_csr; /* MAC_FPE_CTRL_STS reg cache */ | ||
| 178 | }; | 179 | }; |
| 179 | 180 | ||
| 180 | struct stmmac_safety_feature_cfg { | 181 | struct stmmac_safety_feature_cfg { |