diff options
-rw-r--r-- | drivers/s390/cio/qdio_main.c | 35 | ||||
-rw-r--r-- | drivers/s390/cio/qdio_thinint.c | 8 |
2 files changed, 28 insertions, 15 deletions
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index fa902703996c..1974ec7bf0ed 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
@@ -778,21 +778,17 @@ static void __qdio_outbound_processing(struct qdio_q *q) | |||
778 | 778 | ||
779 | spin_unlock_irqrestore(&q->lock, flags); | 779 | spin_unlock_irqrestore(&q->lock, flags); |
780 | 780 | ||
781 | if (queue_type(q) == QDIO_ZFCP_QFMT) { | 781 | if (queue_type(q) == QDIO_ZFCP_QFMT) |
782 | if (!pci_out_supported(q) && !qdio_outbound_q_done(q)) | 782 | if (!pci_out_supported(q) && !qdio_outbound_q_done(q)) |
783 | tasklet_schedule(&q->tasklet); | 783 | goto sched; |
784 | return; | ||
785 | } | ||
786 | 784 | ||
787 | /* bail out for HiperSockets unicast queues */ | 785 | /* bail out for HiperSockets unicast queues */ |
788 | if (queue_type(q) == QDIO_IQDIO_QFMT && !multicast_outbound(q)) | 786 | if (queue_type(q) == QDIO_IQDIO_QFMT && !multicast_outbound(q)) |
789 | return; | 787 | return; |
790 | 788 | ||
791 | if ((queue_type(q) == QDIO_IQDIO_QFMT) && | 789 | if ((queue_type(q) == QDIO_IQDIO_QFMT) && |
792 | (atomic_read(&q->nr_buf_used)) > QDIO_IQDIO_POLL_LVL) { | 790 | (atomic_read(&q->nr_buf_used)) > QDIO_IQDIO_POLL_LVL) |
793 | tasklet_schedule(&q->tasklet); | 791 | goto sched; |
794 | return; | ||
795 | } | ||
796 | 792 | ||
797 | if (q->u.out.pci_out_enabled) | 793 | if (q->u.out.pci_out_enabled) |
798 | return; | 794 | return; |
@@ -810,6 +806,12 @@ static void __qdio_outbound_processing(struct qdio_q *q) | |||
810 | qdio_perf_stat_inc(&perf_stats.debug_tl_out_timer); | 806 | qdio_perf_stat_inc(&perf_stats.debug_tl_out_timer); |
811 | } | 807 | } |
812 | } | 808 | } |
809 | return; | ||
810 | |||
811 | sched: | ||
812 | if (unlikely(q->irq_ptr->state == QDIO_IRQ_STATE_STOPPED)) | ||
813 | return; | ||
814 | tasklet_schedule(&q->tasklet); | ||
813 | } | 815 | } |
814 | 816 | ||
815 | /* outbound tasklet */ | 817 | /* outbound tasklet */ |
@@ -822,6 +824,9 @@ void qdio_outbound_processing(unsigned long data) | |||
822 | void qdio_outbound_timer(unsigned long data) | 824 | void qdio_outbound_timer(unsigned long data) |
823 | { | 825 | { |
824 | struct qdio_q *q = (struct qdio_q *)data; | 826 | struct qdio_q *q = (struct qdio_q *)data; |
827 | |||
828 | if (unlikely(q->irq_ptr->state == QDIO_IRQ_STATE_STOPPED)) | ||
829 | return; | ||
825 | tasklet_schedule(&q->tasklet); | 830 | tasklet_schedule(&q->tasklet); |
826 | } | 831 | } |
827 | 832 | ||
@@ -863,6 +868,9 @@ static void qdio_int_handler_pci(struct qdio_irq *irq_ptr) | |||
863 | int i; | 868 | int i; |
864 | struct qdio_q *q; | 869 | struct qdio_q *q; |
865 | 870 | ||
871 | if (unlikely(irq_ptr->state == QDIO_IRQ_STATE_STOPPED)) | ||
872 | return; | ||
873 | |||
866 | qdio_perf_stat_inc(&perf_stats.pci_int); | 874 | qdio_perf_stat_inc(&perf_stats.pci_int); |
867 | 875 | ||
868 | for_each_input_queue(irq_ptr, q, i) | 876 | for_each_input_queue(irq_ptr, q, i) |
@@ -1090,11 +1098,11 @@ static void qdio_shutdown_queues(struct ccw_device *cdev) | |||
1090 | int i; | 1098 | int i; |
1091 | 1099 | ||
1092 | for_each_input_queue(irq_ptr, q, i) | 1100 | for_each_input_queue(irq_ptr, q, i) |
1093 | tasklet_disable(&q->tasklet); | 1101 | tasklet_kill(&q->tasklet); |
1094 | 1102 | ||
1095 | for_each_output_queue(irq_ptr, q, i) { | 1103 | for_each_output_queue(irq_ptr, q, i) { |
1096 | tasklet_disable(&q->tasklet); | ||
1097 | del_timer(&q->u.out.timer); | 1104 | del_timer(&q->u.out.timer); |
1105 | tasklet_kill(&q->tasklet); | ||
1098 | } | 1106 | } |
1099 | } | 1107 | } |
1100 | 1108 | ||
@@ -1125,6 +1133,12 @@ int qdio_shutdown(struct ccw_device *cdev, int how) | |||
1125 | return 0; | 1133 | return 0; |
1126 | } | 1134 | } |
1127 | 1135 | ||
1136 | /* | ||
1137 | * Indicate that the device is going down. Scheduling the queue | ||
1138 | * tasklets is forbidden from here on. | ||
1139 | */ | ||
1140 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_STOPPED); | ||
1141 | |||
1128 | tiqdio_remove_input_queues(irq_ptr); | 1142 | tiqdio_remove_input_queues(irq_ptr); |
1129 | qdio_shutdown_queues(cdev); | 1143 | qdio_shutdown_queues(cdev); |
1130 | qdio_shutdown_debug_entries(irq_ptr, cdev); | 1144 | qdio_shutdown_debug_entries(irq_ptr, cdev); |
@@ -1556,7 +1570,6 @@ static void handle_outbound(struct qdio_q *q, unsigned int callflags, | |||
1556 | qdio_perf_stat_inc(&perf_stats.fast_requeue); | 1570 | qdio_perf_stat_inc(&perf_stats.fast_requeue); |
1557 | } | 1571 | } |
1558 | out: | 1572 | out: |
1559 | /* Fixme: could wait forever if called from process context */ | ||
1560 | tasklet_schedule(&q->tasklet); | 1573 | tasklet_schedule(&q->tasklet); |
1561 | } | 1574 | } |
1562 | 1575 | ||
diff --git a/drivers/s390/cio/qdio_thinint.c b/drivers/s390/cio/qdio_thinint.c index 981044c83864..c7c5512a892e 100644 --- a/drivers/s390/cio/qdio_thinint.c +++ b/drivers/s390/cio/qdio_thinint.c | |||
@@ -101,7 +101,6 @@ void tiqdio_add_input_queues(struct qdio_irq *irq_ptr) | |||
101 | list_add_rcu(&q->entry, &tiq_list); | 101 | list_add_rcu(&q->entry, &tiq_list); |
102 | mutex_unlock(&tiq_list_lock); | 102 | mutex_unlock(&tiq_list_lock); |
103 | xchg(irq_ptr->dsci, 1); | 103 | xchg(irq_ptr->dsci, 1); |
104 | tasklet_schedule(&tiqdio_tasklet); | ||
105 | } | 104 | } |
106 | 105 | ||
107 | /* | 106 | /* |
@@ -159,7 +158,6 @@ static void __tiqdio_inbound_processing(struct qdio_q *q) | |||
159 | */ | 158 | */ |
160 | qdio_check_outbound_after_thinint(q); | 159 | qdio_check_outbound_after_thinint(q); |
161 | 160 | ||
162 | again: | ||
163 | if (!qdio_inbound_q_moved(q)) | 161 | if (!qdio_inbound_q_moved(q)) |
164 | return; | 162 | return; |
165 | 163 | ||
@@ -167,7 +165,8 @@ again: | |||
167 | 165 | ||
168 | if (!tiqdio_inbound_q_done(q)) { | 166 | if (!tiqdio_inbound_q_done(q)) { |
169 | qdio_perf_stat_inc(&perf_stats.thinint_inbound_loop); | 167 | qdio_perf_stat_inc(&perf_stats.thinint_inbound_loop); |
170 | goto again; | 168 | if (likely(q->irq_ptr->state != QDIO_IRQ_STATE_STOPPED)) |
169 | tasklet_schedule(&q->tasklet); | ||
171 | } | 170 | } |
172 | 171 | ||
173 | qdio_stop_polling(q); | 172 | qdio_stop_polling(q); |
@@ -177,7 +176,8 @@ again: | |||
177 | */ | 176 | */ |
178 | if (!tiqdio_inbound_q_done(q)) { | 177 | if (!tiqdio_inbound_q_done(q)) { |
179 | qdio_perf_stat_inc(&perf_stats.thinint_inbound_loop2); | 178 | qdio_perf_stat_inc(&perf_stats.thinint_inbound_loop2); |
180 | goto again; | 179 | if (likely(q->irq_ptr->state != QDIO_IRQ_STATE_STOPPED)) |
180 | tasklet_schedule(&q->tasklet); | ||
181 | } | 181 | } |
182 | } | 182 | } |
183 | 183 | ||