@@ -869,6 +869,23 @@ static void check_active(struct ioatdma_chan *ioat_chan)
869
869
mod_timer (& ioat_chan -> timer , jiffies + IDLE_TIMEOUT );
870
870
}
871
871
872
+ static void ioat_reboot_chan (struct ioatdma_chan * ioat_chan )
873
+ {
874
+ spin_lock_bh (& ioat_chan -> prep_lock );
875
+ set_bit (IOAT_CHAN_DOWN , & ioat_chan -> state );
876
+ spin_unlock_bh (& ioat_chan -> prep_lock );
877
+
878
+ ioat_abort_descs (ioat_chan );
879
+ dev_warn (to_dev (ioat_chan ), "Reset channel...\n" );
880
+ ioat_reset_hw (ioat_chan );
881
+ dev_warn (to_dev (ioat_chan ), "Restart channel...\n" );
882
+ ioat_restart_channel (ioat_chan );
883
+
884
+ spin_lock_bh (& ioat_chan -> prep_lock );
885
+ clear_bit (IOAT_CHAN_DOWN , & ioat_chan -> state );
886
+ spin_unlock_bh (& ioat_chan -> prep_lock );
887
+ }
888
+
872
889
void ioat_timer_event (struct timer_list * t )
873
890
{
874
891
struct ioatdma_chan * ioat_chan = from_timer (ioat_chan , t , timer );
@@ -891,19 +908,7 @@ void ioat_timer_event(struct timer_list *t)
891
908
892
909
if (test_bit (IOAT_RUN , & ioat_chan -> state )) {
893
910
spin_lock_bh (& ioat_chan -> cleanup_lock );
894
- spin_lock_bh (& ioat_chan -> prep_lock );
895
- set_bit (IOAT_CHAN_DOWN , & ioat_chan -> state );
896
- spin_unlock_bh (& ioat_chan -> prep_lock );
897
-
898
- ioat_abort_descs (ioat_chan );
899
- dev_warn (to_dev (ioat_chan ), "Reset channel...\n" );
900
- ioat_reset_hw (ioat_chan );
901
- dev_warn (to_dev (ioat_chan ), "Restart channel...\n" );
902
- ioat_restart_channel (ioat_chan );
903
-
904
- spin_lock_bh (& ioat_chan -> prep_lock );
905
- clear_bit (IOAT_CHAN_DOWN , & ioat_chan -> state );
906
- spin_unlock_bh (& ioat_chan -> prep_lock );
911
+ ioat_reboot_chan (ioat_chan );
907
912
spin_unlock_bh (& ioat_chan -> cleanup_lock );
908
913
}
909
914
@@ -939,19 +944,7 @@ void ioat_timer_event(struct timer_list *t)
939
944
dev_dbg (to_dev (ioat_chan ), "Active descriptors: %d\n" ,
940
945
ioat_ring_active (ioat_chan ));
941
946
942
- spin_lock_bh (& ioat_chan -> prep_lock );
943
- set_bit (IOAT_CHAN_DOWN , & ioat_chan -> state );
944
- spin_unlock_bh (& ioat_chan -> prep_lock );
945
-
946
- ioat_abort_descs (ioat_chan );
947
- dev_warn (to_dev (ioat_chan ), "Resetting channel...\n" );
948
- ioat_reset_hw (ioat_chan );
949
- dev_warn (to_dev (ioat_chan ), "Restarting channel...\n" );
950
- ioat_restart_channel (ioat_chan );
951
-
952
- spin_lock_bh (& ioat_chan -> prep_lock );
953
- clear_bit (IOAT_CHAN_DOWN , & ioat_chan -> state );
954
- spin_unlock_bh (& ioat_chan -> prep_lock );
947
+ ioat_reboot_chan (ioat_chan );
955
948
spin_unlock_bh (& ioat_chan -> cleanup_lock );
956
949
return ;
957
950
} else
0 commit comments