@@ -922,17 +922,23 @@ void ioat_timer_event(struct timer_list *t)
922
922
spin_lock_bh (& ioat_chan -> prep_lock );
923
923
check_active (ioat_chan );
924
924
spin_unlock_bh (& ioat_chan -> prep_lock );
925
- spin_unlock_bh (& ioat_chan -> cleanup_lock );
926
- return ;
925
+ goto unlock_out ;
926
+ }
927
+
928
+ /* handle the missed cleanup case */
929
+ if (ioat_cleanup_preamble (ioat_chan , & phys_complete )) {
930
+ /* timer restarted in ioat_cleanup_preamble
931
+ * and IOAT_COMPLETION_ACK cleared
932
+ */
933
+ __cleanup (ioat_chan , phys_complete );
934
+ goto unlock_out ;
927
935
}
928
936
929
937
/* if we haven't made progress and we have already
930
938
* acknowledged a pending completion once, then be more
931
939
* forceful with a restart
932
940
*/
933
- if (ioat_cleanup_preamble (ioat_chan , & phys_complete ))
934
- __cleanup (ioat_chan , phys_complete );
935
- else if (test_bit (IOAT_COMPLETION_ACK , & ioat_chan -> state )) {
941
+ if (test_bit (IOAT_COMPLETION_ACK , & ioat_chan -> state )) {
936
942
u32 chanerr ;
937
943
938
944
chanerr = readl (ioat_chan -> reg_base + IOAT_CHANERR_OFFSET );
@@ -945,12 +951,13 @@ void ioat_timer_event(struct timer_list *t)
945
951
ioat_ring_active (ioat_chan ));
946
952
947
953
ioat_reboot_chan (ioat_chan );
948
- spin_unlock_bh (& ioat_chan -> cleanup_lock );
949
- return ;
950
- } else
951
- set_bit (IOAT_COMPLETION_ACK , & ioat_chan -> state );
952
954
955
+ goto unlock_out ;
956
+ }
957
+
958
+ set_bit (IOAT_COMPLETION_ACK , & ioat_chan -> state );
953
959
mod_timer (& ioat_chan -> timer , jiffies + COMPLETION_TIMEOUT );
960
+ unlock_out :
954
961
spin_unlock_bh (& ioat_chan -> cleanup_lock );
955
962
}
956
963
0 commit comments