diff options
| -rw-r--r-- | drivers/dma/ioat/dma.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c index 1d5df2ef148b..21539d5c54c3 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c | |||
| @@ -861,32 +861,42 @@ void ioat_timer_event(unsigned long data) | |||
| 861 | return; | 861 | return; |
| 862 | } | 862 | } |
| 863 | 863 | ||
| 864 | spin_lock_bh(&ioat_chan->cleanup_lock); | ||
| 865 | |||
| 866 | /* handle the no-actives case */ | ||
| 867 | if (!ioat_ring_active(ioat_chan)) { | ||
| 868 | spin_lock_bh(&ioat_chan->prep_lock); | ||
| 869 | check_active(ioat_chan); | ||
| 870 | spin_unlock_bh(&ioat_chan->prep_lock); | ||
| 871 | spin_unlock_bh(&ioat_chan->cleanup_lock); | ||
| 872 | return; | ||
| 873 | } | ||
| 874 | |||
| 864 | /* if we haven't made progress and we have already | 875 | /* if we haven't made progress and we have already |
| 865 | * acknowledged a pending completion once, then be more | 876 | * acknowledged a pending completion once, then be more |
| 866 | * forceful with a restart | 877 | * forceful with a restart |
| 867 | */ | 878 | */ |
| 868 | spin_lock_bh(&ioat_chan->cleanup_lock); | ||
| 869 | if (ioat_cleanup_preamble(ioat_chan, &phys_complete)) | 879 | if (ioat_cleanup_preamble(ioat_chan, &phys_complete)) |
| 870 | __cleanup(ioat_chan, phys_complete); | 880 | __cleanup(ioat_chan, phys_complete); |
| 871 | else if (test_bit(IOAT_COMPLETION_ACK, &ioat_chan->state)) { | 881 | else if (test_bit(IOAT_COMPLETION_ACK, &ioat_chan->state)) { |
| 882 | u32 chanerr; | ||
| 883 | |||
| 884 | chanerr = readl(ioat_chan->reg_base + IOAT_CHANERR_OFFSET); | ||
| 885 | dev_warn(to_dev(ioat_chan), "Restarting channel...\n"); | ||
| 886 | dev_warn(to_dev(ioat_chan), "CHANSTS: %#Lx CHANERR: %#x\n", | ||
| 887 | status, chanerr); | ||
| 888 | dev_warn(to_dev(ioat_chan), "Active descriptors: %d\n", | ||
| 889 | ioat_ring_active(ioat_chan)); | ||
| 890 | |||
| 872 | spin_lock_bh(&ioat_chan->prep_lock); | 891 | spin_lock_bh(&ioat_chan->prep_lock); |
| 873 | ioat_restart_channel(ioat_chan); | 892 | ioat_restart_channel(ioat_chan); |
| 874 | spin_unlock_bh(&ioat_chan->prep_lock); | 893 | spin_unlock_bh(&ioat_chan->prep_lock); |
| 875 | spin_unlock_bh(&ioat_chan->cleanup_lock); | 894 | spin_unlock_bh(&ioat_chan->cleanup_lock); |
| 876 | return; | 895 | return; |
| 877 | } else { | 896 | } else |
| 878 | set_bit(IOAT_COMPLETION_ACK, &ioat_chan->state); | 897 | set_bit(IOAT_COMPLETION_ACK, &ioat_chan->state); |
| 879 | mod_timer(&ioat_chan->timer, jiffies + COMPLETION_TIMEOUT); | ||
| 880 | } | ||
| 881 | |||
| 882 | 898 | ||
| 883 | if (ioat_ring_active(ioat_chan)) | 899 | mod_timer(&ioat_chan->timer, jiffies + COMPLETION_TIMEOUT); |
| 884 | mod_timer(&ioat_chan->timer, jiffies + COMPLETION_TIMEOUT); | ||
| 885 | else { | ||
| 886 | spin_lock_bh(&ioat_chan->prep_lock); | ||
| 887 | check_active(ioat_chan); | ||
| 888 | spin_unlock_bh(&ioat_chan->prep_lock); | ||
| 889 | } | ||
| 890 | spin_unlock_bh(&ioat_chan->cleanup_lock); | 900 | spin_unlock_bh(&ioat_chan->cleanup_lock); |
| 891 | } | 901 | } |
| 892 | 902 | ||
