@@ -276,50 +276,48 @@ impl ServerImpl {
276276 }
277277
278278 fn actually_reset_front_io_phy ( & mut self ) -> Result < ( ) , SeqError > {
279- if let Some ( front_io_board) = self . front_io_board . as_mut ( ) {
280- if front_io_board. initialized ( ) {
281- // The board was initialized prior and this function is called
282- // by the monorail task because it is initializing the front IO
283- // PHY. Unfortunately some front IO boards have PHY oscillators
284- // which do not start reliably when their enable pin is used and
285- // the only way to resolve this is by power cycling the front IO
286- // board. But power cycling the board also bounces any QSFP
287- // transceivers which may be running, so this function attempts
288- // to determine what the monorail task wants to do.
289- //
290- // Whether or not the PHY oscillator was found to be operating
291- // nominally is recorded in the front IO board controller. Look
292- // up what this value is to determine if a power reset of the
293- // front IO board is needed.
294- match front_io_board. phy ( ) . osc_state ( ) ? {
295- PhyOscState :: Bad => {
296- // The PHY was attempted to be initialized but its
297- // oscillator was deemed not functional. Unfortunately
298- // the only course of action is to power cycle the
299- // entire front IO board, so do so now.
300- self . front_io_hsc . set_enable ( false ) ?;
301- ringbuf_entry ! ( Trace :: FrontIOBoardPowerEnable ( false ) ) ;
302-
303- // Wait some cool down period to allow caps to bleed off
304- // etc.
305- userlib:: hl:: sleep_for ( 1000 ) ;
306- }
307- PhyOscState :: Good => {
308- // The PHY was initialized properly before and its
309- // oscillator declared operating nominally. Assume this
310- // has not changed and only a reset the PHY itself is
311- // desired.
312- front_io_board. phy ( ) . set_phy_power_enabled ( false ) ?;
313- ringbuf_entry ! ( Trace :: FrontIOBoardPhyPowerEnable (
314- false
315- ) ) ;
316-
317- userlib:: hl:: sleep_for ( 10 ) ;
318- }
319- PhyOscState :: Unknown => {
320- // Do nothing (yet) since the oscillator state is
321- // unknown.
322- }
279+ if let Some ( front_io_board) = self . front_io_board . as_mut ( )
280+ && front_io_board. initialized ( )
281+ {
282+ // The board was initialized prior and this function is called
283+ // by the monorail task because it is initializing the front IO
284+ // PHY. Unfortunately some front IO boards have PHY oscillators
285+ // which do not start reliably when their enable pin is used and
286+ // the only way to resolve this is by power cycling the front IO
287+ // board. But power cycling the board also bounces any QSFP
288+ // transceivers which may be running, so this function attempts
289+ // to determine what the monorail task wants to do.
290+ //
291+ // Whether or not the PHY oscillator was found to be operating
292+ // nominally is recorded in the front IO board controller. Look
293+ // up what this value is to determine if a power reset of the
294+ // front IO board is needed.
295+ match front_io_board. phy ( ) . osc_state ( ) ? {
296+ PhyOscState :: Bad => {
297+ // The PHY was attempted to be initialized but its
298+ // oscillator was deemed not functional. Unfortunately
299+ // the only course of action is to power cycle the
300+ // entire front IO board, so do so now.
301+ self . front_io_hsc . set_enable ( false ) ?;
302+ ringbuf_entry ! ( Trace :: FrontIOBoardPowerEnable ( false ) ) ;
303+
304+ // Wait some cool down period to allow caps to bleed off
305+ // etc.
306+ userlib:: hl:: sleep_for ( 1000 ) ;
307+ }
308+ PhyOscState :: Good => {
309+ // The PHY was initialized properly before and its
310+ // oscillator declared operating nominally. Assume this
311+ // has not changed and only a reset the PHY itself is
312+ // desired.
313+ front_io_board. phy ( ) . set_phy_power_enabled ( false ) ?;
314+ ringbuf_entry ! ( Trace :: FrontIOBoardPhyPowerEnable ( false ) ) ;
315+
316+ userlib:: hl:: sleep_for ( 10 ) ;
317+ }
318+ PhyOscState :: Unknown => {
319+ // Do nothing (yet) since the oscillator state is
320+ // unknown.
323321 }
324322 }
325323 }
@@ -853,10 +851,10 @@ impl NotificationHandler for ServerImpl {
853851 // Currently, we will only resequence a single time to resolve the problem.
854852 match self . tofino . sequencer . state ( ) . unwrap_or ( TofinoSeqState :: A2 ) {
855853 TofinoSeqState :: A0 => {
856- if !self . resequenced {
857- if let Err ( e) = self . monitor_tofino_pcie_link ( ) {
858- ringbuf_entry ! ( Trace :: TofinoSequencerError ( e ) ) ;
859- }
854+ if !self . resequenced
855+ && let Err ( e) = self . monitor_tofino_pcie_link ( )
856+ {
857+ ringbuf_entry ! ( Trace :: TofinoSequencerError ( e ) ) ;
860858 }
861859 }
862860 // If we're not in A0, make sure next time we go into A0 we will attempt to
0 commit comments