diff options
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index a8b02542ac2d..0eb31e162b15 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -156,44 +156,30 @@ zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req) | |||
156 | kfree(fsf_req); | 156 | kfree(fsf_req); |
157 | } | 157 | } |
158 | 158 | ||
159 | /** | 159 | /* |
160 | * zfcp_fsf_req_dismiss - dismiss a single fsf request | 160 | * Never ever call this without shutting down the adapter first. |
161 | */ | 161 | * Otherwise the adapter would continue using and corrupting s390 storage. |
162 | static void zfcp_fsf_req_dismiss(struct zfcp_adapter *adapter, | 162 | * Included BUG_ON() call to ensure this is done. |
163 | struct zfcp_fsf_req *fsf_req, | 163 | * ERP is supposed to be the only user of this function. |
164 | unsigned int counter) | ||
165 | { | ||
166 | u64 dbg_tmp[2]; | ||
167 | |||
168 | dbg_tmp[0] = (u64) atomic_read(&adapter->reqs_active); | ||
169 | dbg_tmp[1] = (u64) counter; | ||
170 | debug_event(adapter->erp_dbf, 4, (void *) dbg_tmp, 16); | ||
171 | list_del(&fsf_req->list); | ||
172 | fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; | ||
173 | zfcp_fsf_req_complete(fsf_req); | ||
174 | } | ||
175 | |||
176 | /** | ||
177 | * zfcp_fsf_req_dismiss_all - dismiss all remaining fsf requests | ||
178 | */ | 164 | */ |
179 | void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) | 165 | void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) |
180 | { | 166 | { |
181 | struct zfcp_fsf_req *request, *tmp; | 167 | struct zfcp_fsf_req *fsf_req, *tmp; |
182 | unsigned long flags; | 168 | unsigned long flags; |
183 | LIST_HEAD(remove_queue); | 169 | LIST_HEAD(remove_queue); |
184 | unsigned int i, counter; | 170 | unsigned int i; |
185 | 171 | ||
172 | BUG_ON(atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)); | ||
186 | spin_lock_irqsave(&adapter->req_list_lock, flags); | 173 | spin_lock_irqsave(&adapter->req_list_lock, flags); |
187 | atomic_set(&adapter->reqs_active, 0); | 174 | atomic_set(&adapter->reqs_active, 0); |
188 | for (i=0; i<REQUEST_LIST_SIZE; i++) | 175 | for (i = 0; i < REQUEST_LIST_SIZE; i++) |
189 | list_splice_init(&adapter->req_list[i], &remove_queue); | 176 | list_splice_init(&adapter->req_list[i], &remove_queue); |
190 | |||
191 | spin_unlock_irqrestore(&adapter->req_list_lock, flags); | 177 | spin_unlock_irqrestore(&adapter->req_list_lock, flags); |
192 | 178 | ||
193 | counter = 0; | 179 | list_for_each_entry_safe(fsf_req, tmp, &remove_queue, list) { |
194 | list_for_each_entry_safe(request, tmp, &remove_queue, list) { | 180 | list_del(&fsf_req->list); |
195 | zfcp_fsf_req_dismiss(adapter, request, counter); | 181 | fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; |
196 | counter++; | 182 | zfcp_fsf_req_complete(fsf_req); |
197 | } | 183 | } |
198 | } | 184 | } |
199 | 185 | ||