aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-12-22 12:57:02 -0500
committerJiri Kosina <jkosina@suse.cz>2010-12-22 12:57:02 -0500
commit4b7bd364700d9ac8372eff48832062b936d0793b (patch)
tree0dbf78c95456a0b02d07fcd473281f04a87e266d /drivers/s390
parentc0d8768af260e2cbb4bf659ae6094a262c86b085 (diff)
parent90a8a73c06cc32b609a880d48449d7083327e11a (diff)
Merge branch 'master' into for-next
Conflicts: MAINTAINERS arch/arm/mach-omap2/pm24xx.c drivers/scsi/bfa/bfa_fcpim.c Needed to update to apply fixes for which the old branch was too outdated.
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/dasd_eer.c1
-rw-r--r--drivers/s390/char/fs3270.c1
-rw-r--r--drivers/s390/char/tape_char.c1
-rw-r--r--drivers/s390/char/tape_core.c68
-rw-r--r--drivers/s390/char/vmlogrdr.c37
-rw-r--r--drivers/s390/char/vmur.c1
-rw-r--r--drivers/s390/cio/css.c2
-rw-r--r--drivers/s390/cio/device.c11
-rw-r--r--drivers/s390/cio/qdio_thinint.c2
-rw-r--r--drivers/s390/crypto/zcrypt_api.c1
-rw-r--r--drivers/s390/net/qeth_core.h9
-rw-r--r--drivers/s390/net/qeth_core_main.c55
-rw-r--r--drivers/s390/scsi/zfcp_erp.c11
-rw-r--r--drivers/s390/scsi/zfcp_fc.h2
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c14
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c5
-rw-r--r--drivers/s390/scsi/zfcp_unit.c4
17 files changed, 123 insertions, 102 deletions
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c
index c71d89dba302..83b4615a3b62 100644
--- a/drivers/s390/block/dasd_eer.c
+++ b/drivers/s390/block/dasd_eer.c
@@ -17,7 +17,6 @@
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/poll.h> 18#include <linux/poll.h>
19#include <linux/mutex.h> 19#include <linux/mutex.h>
20#include <linux/smp_lock.h>
21#include <linux/err.h> 20#include <linux/err.h>
22#include <linux/slab.h> 21#include <linux/slab.h>
23 22
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index eb28fb01a38a..f6489eb7e976 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -14,7 +14,6 @@
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/smp_lock.h>
18 17
19#include <asm/compat.h> 18#include <asm/compat.h>
20#include <asm/ccwdev.h> 19#include <asm/ccwdev.h>
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c
index 883e2db02bd3..e090a307fdee 100644
--- a/drivers/s390/char/tape_char.c
+++ b/drivers/s390/char/tape_char.c
@@ -17,7 +17,6 @@
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/proc_fs.h> 18#include <linux/proc_fs.h>
19#include <linux/mtio.h> 19#include <linux/mtio.h>
20#include <linux/smp_lock.h>
21#include <linux/compat.h> 20#include <linux/compat.h>
22 21
23#include <asm/uaccess.h> 22#include <asm/uaccess.h>
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index 6c408670e08d..b3a3e8e8656e 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -209,29 +209,79 @@ tape_state_set(struct tape_device *device, enum tape_state newstate)
209 wake_up(&device->state_change_wq); 209 wake_up(&device->state_change_wq);
210} 210}
211 211
212struct tape_med_state_work_data {
213 struct tape_device *device;
214 enum tape_medium_state state;
215 struct work_struct work;
216};
217
218static void
219tape_med_state_work_handler(struct work_struct *work)
220{
221 static char env_state_loaded[] = "MEDIUM_STATE=LOADED";
222 static char env_state_unloaded[] = "MEDIUM_STATE=UNLOADED";
223 struct tape_med_state_work_data *p =
224 container_of(work, struct tape_med_state_work_data, work);
225 struct tape_device *device = p->device;
226 char *envp[] = { NULL, NULL };
227
228 switch (p->state) {
229 case MS_UNLOADED:
230 pr_info("%s: The tape cartridge has been successfully "
231 "unloaded\n", dev_name(&device->cdev->dev));
232 envp[0] = env_state_unloaded;
233 kobject_uevent_env(&device->cdev->dev.kobj, KOBJ_CHANGE, envp);
234 break;
235 case MS_LOADED:
236 pr_info("%s: A tape cartridge has been mounted\n",
237 dev_name(&device->cdev->dev));
238 envp[0] = env_state_loaded;
239 kobject_uevent_env(&device->cdev->dev.kobj, KOBJ_CHANGE, envp);
240 break;
241 default:
242 break;
243 }
244 tape_put_device(device);
245 kfree(p);
246}
247
248static void
249tape_med_state_work(struct tape_device *device, enum tape_medium_state state)
250{
251 struct tape_med_state_work_data *p;
252
253 p = kzalloc(sizeof(*p), GFP_ATOMIC);
254 if (p) {
255 INIT_WORK(&p->work, tape_med_state_work_handler);
256 p->device = tape_get_device(device);
257 p->state = state;
258 schedule_work(&p->work);
259 }
260}
261
212void 262void
213tape_med_state_set(struct tape_device *device, enum tape_medium_state newstate) 263tape_med_state_set(struct tape_device *device, enum tape_medium_state newstate)
214{ 264{
215 if (device->medium_state == newstate) 265 enum tape_medium_state oldstate;
266
267 oldstate = device->medium_state;
268 if (oldstate == newstate)
216 return; 269 return;
270 device->medium_state = newstate;
217 switch(newstate){ 271 switch(newstate){
218 case MS_UNLOADED: 272 case MS_UNLOADED:
219 device->tape_generic_status |= GMT_DR_OPEN(~0); 273 device->tape_generic_status |= GMT_DR_OPEN(~0);
220 if (device->medium_state == MS_LOADED) 274 if (oldstate == MS_LOADED)
221 pr_info("%s: The tape cartridge has been successfully " 275 tape_med_state_work(device, MS_UNLOADED);
222 "unloaded\n", dev_name(&device->cdev->dev));
223 break; 276 break;
224 case MS_LOADED: 277 case MS_LOADED:
225 device->tape_generic_status &= ~GMT_DR_OPEN(~0); 278 device->tape_generic_status &= ~GMT_DR_OPEN(~0);
226 if (device->medium_state == MS_UNLOADED) 279 if (oldstate == MS_UNLOADED)
227 pr_info("%s: A tape cartridge has been mounted\n", 280 tape_med_state_work(device, MS_LOADED);
228 dev_name(&device->cdev->dev));
229 break; 281 break;
230 default: 282 default:
231 // print nothing
232 break; 283 break;
233 } 284 }
234 device->medium_state = newstate;
235 wake_up(&device->state_change_wq); 285 wake_up(&device->state_change_wq);
236} 286}
237 287
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index 9f661426e4a1..c837d7419a6a 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -30,7 +30,6 @@
30#include <linux/kmod.h> 30#include <linux/kmod.h>
31#include <linux/cdev.h> 31#include <linux/cdev.h>
32#include <linux/device.h> 32#include <linux/device.h>
33#include <linux/smp_lock.h>
34#include <linux/string.h> 33#include <linux/string.h>
35 34
36MODULE_AUTHOR 35MODULE_AUTHOR
@@ -249,27 +248,25 @@ static int vmlogrdr_recording(struct vmlogrdr_priv_t * logptr,
249 char cp_command[80]; 248 char cp_command[80];
250 char cp_response[160]; 249 char cp_response[160];
251 char *onoff, *qid_string; 250 char *onoff, *qid_string;
251 int rc;
252 252
253 memset(cp_command, 0x00, sizeof(cp_command)); 253 onoff = ((action == 1) ? "ON" : "OFF");
254 memset(cp_response, 0x00, sizeof(cp_response));
255
256 onoff = ((action == 1) ? "ON" : "OFF");
257 qid_string = ((recording_class_AB == 1) ? " QID * " : ""); 254 qid_string = ((recording_class_AB == 1) ? " QID * " : "");
258 255
259 /* 256 /*
260 * The recording commands needs to be called with option QID 257 * The recording commands needs to be called with option QID
261 * for guests that have previlege classes A or B. 258 * for guests that have previlege classes A or B.
262 * Purging has to be done as separate step, because recording 259 * Purging has to be done as separate step, because recording
263 * can't be switched on as long as records are on the queue. 260 * can't be switched on as long as records are on the queue.
264 * Doing both at the same time doesn't work. 261 * Doing both at the same time doesn't work.
265 */ 262 */
266 263 if (purge && (action == 1)) {
267 if (purge) { 264 memset(cp_command, 0x00, sizeof(cp_command));
265 memset(cp_response, 0x00, sizeof(cp_response));
268 snprintf(cp_command, sizeof(cp_command), 266 snprintf(cp_command, sizeof(cp_command),
269 "RECORDING %s PURGE %s", 267 "RECORDING %s PURGE %s",
270 logptr->recording_name, 268 logptr->recording_name,
271 qid_string); 269 qid_string);
272
273 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); 270 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL);
274 } 271 }
275 272
@@ -279,19 +276,33 @@ static int vmlogrdr_recording(struct vmlogrdr_priv_t * logptr,
279 logptr->recording_name, 276 logptr->recording_name,
280 onoff, 277 onoff,
281 qid_string); 278 qid_string);
282
283 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); 279 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL);
284 /* The recording command will usually answer with 'Command complete' 280 /* The recording command will usually answer with 'Command complete'
285 * on success, but when the specific service was never connected 281 * on success, but when the specific service was never connected
286 * before then there might be an additional informational message 282 * before then there might be an additional informational message
287 * 'HCPCRC8072I Recording entry not found' before the 283 * 'HCPCRC8072I Recording entry not found' before the
288 * 'Command complete'. So I use strstr rather then the strncmp. 284 * 'Command complete'. So I use strstr rather then the strncmp.
289 */ 285 */
290 if (strstr(cp_response,"Command complete")) 286 if (strstr(cp_response,"Command complete"))
291 return 0; 287 rc = 0;
292 else 288 else
293 return -EIO; 289 rc = -EIO;
290 /*
291 * If we turn recording off, we have to purge any remaining records
292 * afterwards, as a large number of queued records may impact z/VM
293 * performance.
294 */
295 if (purge && (action == 0)) {
296 memset(cp_command, 0x00, sizeof(cp_command));
297 memset(cp_response, 0x00, sizeof(cp_response));
298 snprintf(cp_command, sizeof(cp_command),
299 "RECORDING %s PURGE %s",
300 logptr->recording_name,
301 qid_string);
302 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL);
303 }
294 304
305 return rc;
295} 306}
296 307
297 308
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 1de672f21037..f7e4ae6bf15a 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -13,7 +13,6 @@
13 13
14#include <linux/cdev.h> 14#include <linux/cdev.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/smp_lock.h>
17 16
18#include <asm/uaccess.h> 17#include <asm/uaccess.h>
19#include <asm/cio.h> 18#include <asm/cio.h>
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index a5050e217150..825951b6b83f 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -635,7 +635,7 @@ static void css_process_crw(struct crw *crw0, struct crw *crw1, int overflow)
635 init_subchannel_id(&mchk_schid); 635 init_subchannel_id(&mchk_schid);
636 mchk_schid.sch_no = crw0->rsid; 636 mchk_schid.sch_no = crw0->rsid;
637 if (crw1) 637 if (crw1)
638 mchk_schid.ssid = (crw1->rsid >> 8) & 3; 638 mchk_schid.ssid = (crw1->rsid >> 4) & 3;
639 639
640 /* 640 /*
641 * Since we are always presented with IPI in the CRW, we have to 641 * Since we are always presented with IPI in the CRW, we have to
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 2ff8a22d4257..e8391b89eff4 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -1455,7 +1455,16 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
1455 break; 1455 break;
1456 case IO_SCH_UNREG_ATTACH: 1456 case IO_SCH_UNREG_ATTACH:
1457 case IO_SCH_UNREG: 1457 case IO_SCH_UNREG:
1458 if (cdev) 1458 if (!cdev)
1459 break;
1460 if (cdev->private->state == DEV_STATE_SENSE_ID) {
1461 /*
1462 * Note: delayed work triggered by this event
1463 * and repeated calls to sch_event are synchronized
1464 * by the above check for work_pending(cdev).
1465 */
1466 dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
1467 } else
1459 ccw_device_set_notoper(cdev); 1468 ccw_device_set_notoper(cdev);
1460 break; 1469 break;
1461 case IO_SCH_NOP: 1470 case IO_SCH_NOP:
diff --git a/drivers/s390/cio/qdio_thinint.c b/drivers/s390/cio/qdio_thinint.c
index 752dbee06af5..5d9c66627b6e 100644
--- a/drivers/s390/cio/qdio_thinint.c
+++ b/drivers/s390/cio/qdio_thinint.c
@@ -292,8 +292,8 @@ void qdio_shutdown_thinint(struct qdio_irq *irq_ptr)
292 return; 292 return;
293 293
294 /* reset adapter interrupt indicators */ 294 /* reset adapter interrupt indicators */
295 put_indicator(irq_ptr->dsci);
296 set_subchannel_ind(irq_ptr, 1); 295 set_subchannel_ind(irq_ptr, 1);
296 put_indicator(irq_ptr->dsci);
297} 297}
298 298
299void __exit tiqdio_unregister_thinints(void) 299void __exit tiqdio_unregister_thinints(void)
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c
index f5221749d180..7fca9c10ffcf 100644
--- a/drivers/s390/crypto/zcrypt_api.c
+++ b/drivers/s390/crypto/zcrypt_api.c
@@ -35,7 +35,6 @@
35#include <linux/proc_fs.h> 35#include <linux/proc_fs.h>
36#include <linux/seq_file.h> 36#include <linux/seq_file.h>
37#include <linux/compat.h> 37#include <linux/compat.h>
38#include <linux/smp_lock.h>
39#include <linux/slab.h> 38#include <linux/slab.h>
40#include <asm/atomic.h> 39#include <asm/atomic.h>
41#include <asm/uaccess.h> 40#include <asm/uaccess.h>
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 6be43eb126b4..f47a714538db 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -440,7 +440,6 @@ struct qeth_qdio_out_q {
440 * index of buffer to be filled by driver; state EMPTY or PACKING 440 * index of buffer to be filled by driver; state EMPTY or PACKING
441 */ 441 */
442 int next_buf_to_fill; 442 int next_buf_to_fill;
443 int sync_iqdio_error;
444 /* 443 /*
445 * number of buffers that are currently filled (PRIMED) 444 * number of buffers that are currently filled (PRIMED)
446 * -> these buffers are hardware-owned 445 * -> these buffers are hardware-owned
@@ -695,14 +694,6 @@ struct qeth_mc_mac {
695 int is_vmac; 694 int is_vmac;
696}; 695};
697 696
698struct qeth_skb_data {
699 __u32 magic;
700 int count;
701};
702
703#define QETH_SKB_MAGIC 0x71657468
704#define QETH_SIGA_CC2_RETRIES 3
705
706struct qeth_rx { 697struct qeth_rx {
707 int b_count; 698 int b_count;
708 int b_index; 699 int b_index;
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 764267062601..e6b2df0e73f5 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -877,8 +877,8 @@ out:
877 return; 877 return;
878} 878}
879 879
880static void __qeth_clear_output_buffer(struct qeth_qdio_out_q *queue, 880static void qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
881 struct qeth_qdio_out_buffer *buf, unsigned int qeth_skip_skb) 881 struct qeth_qdio_out_buffer *buf)
882{ 882{
883 int i; 883 int i;
884 struct sk_buff *skb; 884 struct sk_buff *skb;
@@ -887,13 +887,11 @@ static void __qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
887 if (buf->buffer->element[0].flags & 0x40) 887 if (buf->buffer->element[0].flags & 0x40)
888 atomic_dec(&queue->set_pci_flags_count); 888 atomic_dec(&queue->set_pci_flags_count);
889 889
890 if (!qeth_skip_skb) { 890 skb = skb_dequeue(&buf->skb_list);
891 while (skb) {
892 atomic_dec(&skb->users);
893 dev_kfree_skb_any(skb);
891 skb = skb_dequeue(&buf->skb_list); 894 skb = skb_dequeue(&buf->skb_list);
892 while (skb) {
893 atomic_dec(&skb->users);
894 dev_kfree_skb_any(skb);
895 skb = skb_dequeue(&buf->skb_list);
896 }
897 } 895 }
898 for (i = 0; i < QETH_MAX_BUFFER_ELEMENTS(queue->card); ++i) { 896 for (i = 0; i < QETH_MAX_BUFFER_ELEMENTS(queue->card); ++i) {
899 if (buf->buffer->element[i].addr && buf->is_header[i]) 897 if (buf->buffer->element[i].addr && buf->is_header[i])
@@ -909,12 +907,6 @@ static void __qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
909 atomic_set(&buf->state, QETH_QDIO_BUF_EMPTY); 907 atomic_set(&buf->state, QETH_QDIO_BUF_EMPTY);
910} 908}
911 909
912static void qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
913 struct qeth_qdio_out_buffer *buf)
914{
915 __qeth_clear_output_buffer(queue, buf, 0);
916}
917
918void qeth_clear_qdio_buffers(struct qeth_card *card) 910void qeth_clear_qdio_buffers(struct qeth_card *card)
919{ 911{
920 int i, j; 912 int i, j;
@@ -2833,7 +2825,6 @@ static void qeth_flush_buffers(struct qeth_qdio_out_q *queue, int index,
2833 } 2825 }
2834 } 2826 }
2835 2827
2836 queue->sync_iqdio_error = 0;
2837 queue->card->dev->trans_start = jiffies; 2828 queue->card->dev->trans_start = jiffies;
2838 if (queue->card->options.performance_stats) { 2829 if (queue->card->options.performance_stats) {
2839 queue->card->perf_stats.outbound_do_qdio_cnt++; 2830 queue->card->perf_stats.outbound_do_qdio_cnt++;
@@ -2849,10 +2840,6 @@ static void qeth_flush_buffers(struct qeth_qdio_out_q *queue, int index,
2849 queue->card->perf_stats.outbound_do_qdio_time += 2840 queue->card->perf_stats.outbound_do_qdio_time +=
2850 qeth_get_micros() - 2841 qeth_get_micros() -
2851 queue->card->perf_stats.outbound_do_qdio_start_time; 2842 queue->card->perf_stats.outbound_do_qdio_start_time;
2852 if (rc > 0) {
2853 if (!(rc & QDIO_ERROR_SIGA_BUSY))
2854 queue->sync_iqdio_error = rc & 3;
2855 }
2856 if (rc) { 2843 if (rc) {
2857 queue->card->stats.tx_errors += count; 2844 queue->card->stats.tx_errors += count;
2858 /* ignore temporary SIGA errors without busy condition */ 2845 /* ignore temporary SIGA errors without busy condition */
@@ -2916,7 +2903,7 @@ void qeth_qdio_start_poll(struct ccw_device *ccwdev, int queue,
2916{ 2903{
2917 struct qeth_card *card = (struct qeth_card *)card_ptr; 2904 struct qeth_card *card = (struct qeth_card *)card_ptr;
2918 2905
2919 if (card->dev) 2906 if (card->dev && (card->dev->flags & IFF_UP))
2920 napi_schedule(&card->napi); 2907 napi_schedule(&card->napi);
2921} 2908}
2922EXPORT_SYMBOL_GPL(qeth_qdio_start_poll); 2909EXPORT_SYMBOL_GPL(qeth_qdio_start_poll);
@@ -2940,7 +2927,6 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,
2940 struct qeth_qdio_out_q *queue = card->qdio.out_qs[__queue]; 2927 struct qeth_qdio_out_q *queue = card->qdio.out_qs[__queue];
2941 struct qeth_qdio_out_buffer *buffer; 2928 struct qeth_qdio_out_buffer *buffer;
2942 int i; 2929 int i;
2943 unsigned qeth_send_err;
2944 2930
2945 QETH_CARD_TEXT(card, 6, "qdouhdl"); 2931 QETH_CARD_TEXT(card, 6, "qdouhdl");
2946 if (qdio_error & QDIO_ERROR_ACTIVATE_CHECK_CONDITION) { 2932 if (qdio_error & QDIO_ERROR_ACTIVATE_CHECK_CONDITION) {
@@ -2956,9 +2942,8 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,
2956 } 2942 }
2957 for (i = first_element; i < (first_element + count); ++i) { 2943 for (i = first_element; i < (first_element + count); ++i) {
2958 buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q]; 2944 buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q];
2959 qeth_send_err = qeth_handle_send_error(card, buffer, qdio_error); 2945 qeth_handle_send_error(card, buffer, qdio_error);
2960 __qeth_clear_output_buffer(queue, buffer, 2946 qeth_clear_output_buffer(queue, buffer);
2961 (qeth_send_err == QETH_SEND_ERROR_RETRY) ? 1 : 0);
2962 } 2947 }
2963 atomic_sub(count, &queue->used_buffers); 2948 atomic_sub(count, &queue->used_buffers);
2964 /* check if we need to do something on this outbound queue */ 2949 /* check if we need to do something on this outbound queue */
@@ -3183,10 +3168,7 @@ int qeth_do_send_packet_fast(struct qeth_card *card,
3183 int offset, int hd_len) 3168 int offset, int hd_len)
3184{ 3169{
3185 struct qeth_qdio_out_buffer *buffer; 3170 struct qeth_qdio_out_buffer *buffer;
3186 struct sk_buff *skb1;
3187 struct qeth_skb_data *retry_ctrl;
3188 int index; 3171 int index;
3189 int rc;
3190 3172
3191 /* spin until we get the queue ... */ 3173 /* spin until we get the queue ... */
3192 while (atomic_cmpxchg(&queue->state, QETH_OUT_Q_UNLOCKED, 3174 while (atomic_cmpxchg(&queue->state, QETH_OUT_Q_UNLOCKED,
@@ -3205,25 +3187,6 @@ int qeth_do_send_packet_fast(struct qeth_card *card,
3205 atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED); 3187 atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED);
3206 qeth_fill_buffer(queue, buffer, skb, hdr, offset, hd_len); 3188 qeth_fill_buffer(queue, buffer, skb, hdr, offset, hd_len);
3207 qeth_flush_buffers(queue, index, 1); 3189 qeth_flush_buffers(queue, index, 1);
3208 if (queue->sync_iqdio_error == 2) {
3209 skb1 = skb_dequeue(&buffer->skb_list);
3210 while (skb1) {
3211 atomic_dec(&skb1->users);
3212 skb1 = skb_dequeue(&buffer->skb_list);
3213 }
3214 retry_ctrl = (struct qeth_skb_data *) &skb->cb[16];
3215 if (retry_ctrl->magic != QETH_SKB_MAGIC) {
3216 retry_ctrl->magic = QETH_SKB_MAGIC;
3217 retry_ctrl->count = 0;
3218 }
3219 if (retry_ctrl->count < QETH_SIGA_CC2_RETRIES) {
3220 retry_ctrl->count++;
3221 rc = dev_queue_xmit(skb);
3222 } else {
3223 dev_kfree_skb_any(skb);
3224 QETH_CARD_TEXT(card, 2, "qrdrop");
3225 }
3226 }
3227 return 0; 3190 return 0;
3228out: 3191out:
3229 atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED); 3192 atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED);
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index d37c7331f244..0bcd5806bd9a 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -156,6 +156,8 @@ static int zfcp_erp_required_act(int want, struct zfcp_adapter *adapter,
156 if (!(a_status & ZFCP_STATUS_COMMON_RUNNING) || 156 if (!(a_status & ZFCP_STATUS_COMMON_RUNNING) ||
157 a_status & ZFCP_STATUS_COMMON_ERP_FAILED) 157 a_status & ZFCP_STATUS_COMMON_ERP_FAILED)
158 return 0; 158 return 0;
159 if (p_status & ZFCP_STATUS_COMMON_NOESC)
160 return need;
159 if (!(a_status & ZFCP_STATUS_COMMON_UNBLOCKED)) 161 if (!(a_status & ZFCP_STATUS_COMMON_UNBLOCKED))
160 need = ZFCP_ERP_ACTION_REOPEN_ADAPTER; 162 need = ZFCP_ERP_ACTION_REOPEN_ADAPTER;
161 /* fall through */ 163 /* fall through */
@@ -188,6 +190,9 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
188 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, 190 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE,
189 &zfcp_sdev->status); 191 &zfcp_sdev->status);
190 erp_action = &zfcp_sdev->erp_action; 192 erp_action = &zfcp_sdev->erp_action;
193 memset(erp_action, 0, sizeof(struct zfcp_erp_action));
194 erp_action->port = port;
195 erp_action->sdev = sdev;
191 if (!(atomic_read(&zfcp_sdev->status) & 196 if (!(atomic_read(&zfcp_sdev->status) &
192 ZFCP_STATUS_COMMON_RUNNING)) 197 ZFCP_STATUS_COMMON_RUNNING))
193 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; 198 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY;
@@ -200,6 +205,8 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
200 zfcp_erp_action_dismiss_port(port); 205 zfcp_erp_action_dismiss_port(port);
201 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status); 206 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status);
202 erp_action = &port->erp_action; 207 erp_action = &port->erp_action;
208 memset(erp_action, 0, sizeof(struct zfcp_erp_action));
209 erp_action->port = port;
203 if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_RUNNING)) 210 if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_RUNNING))
204 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; 211 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY;
205 break; 212 break;
@@ -209,6 +216,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
209 zfcp_erp_action_dismiss_adapter(adapter); 216 zfcp_erp_action_dismiss_adapter(adapter);
210 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status); 217 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status);
211 erp_action = &adapter->erp_action; 218 erp_action = &adapter->erp_action;
219 memset(erp_action, 0, sizeof(struct zfcp_erp_action));
212 if (!(atomic_read(&adapter->status) & 220 if (!(atomic_read(&adapter->status) &
213 ZFCP_STATUS_COMMON_RUNNING)) 221 ZFCP_STATUS_COMMON_RUNNING))
214 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; 222 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY;
@@ -218,10 +226,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
218 return NULL; 226 return NULL;
219 } 227 }
220 228
221 memset(erp_action, 0, sizeof(struct zfcp_erp_action));
222 erp_action->adapter = adapter; 229 erp_action->adapter = adapter;
223 erp_action->port = port;
224 erp_action->sdev = sdev;
225 erp_action->action = need; 230 erp_action->action = need;
226 erp_action->status = act_status; 231 erp_action->status = act_status;
227 232
diff --git a/drivers/s390/scsi/zfcp_fc.h b/drivers/s390/scsi/zfcp_fc.h
index 938d50360166..b464ae01086c 100644
--- a/drivers/s390/scsi/zfcp_fc.h
+++ b/drivers/s390/scsi/zfcp_fc.h
@@ -270,7 +270,7 @@ void zfcp_fc_eval_fcp_rsp(struct fcp_resp_with_ext *fcp_rsp,
270 if (unlikely(rsp_flags & FCP_SNS_LEN_VAL)) { 270 if (unlikely(rsp_flags & FCP_SNS_LEN_VAL)) {
271 sense = (char *) &fcp_rsp[1]; 271 sense = (char *) &fcp_rsp[1];
272 if (rsp_flags & FCP_RSP_LEN_VAL) 272 if (rsp_flags & FCP_RSP_LEN_VAL)
273 sense += fcp_rsp->ext.fr_sns_len; 273 sense += fcp_rsp->ext.fr_rsp_len;
274 sense_len = min(fcp_rsp->ext.fr_sns_len, 274 sense_len = min(fcp_rsp->ext.fr_sns_len,
275 (u32) SCSI_SENSE_BUFFERSIZE); 275 (u32) SCSI_SENSE_BUFFERSIZE);
276 memcpy(scsi->sense_buffer, sense, sense_len); 276 memcpy(scsi->sense_buffer, sense, sense_len);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index beaf0916ceab..2eb7dd56ab80 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -532,9 +532,6 @@ static void zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *req)
532 fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN; 532 fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN;
533 adapter->hydra_version = 0; 533 adapter->hydra_version = 0;
534 534
535 atomic_set_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK,
536 &adapter->status);
537
538 zfcp_fsf_link_down_info_eval(req, 535 zfcp_fsf_link_down_info_eval(req,
539 &qtcb->header.fsf_status_qual.link_down_info); 536 &qtcb->header.fsf_status_qual.link_down_info);
540 break; 537 break;
@@ -854,7 +851,7 @@ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_cmnd(struct scsi_cmnd *scmnd)
854 851
855 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); 852 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req);
856 853
857 req->data = zfcp_sdev; 854 req->data = sdev;
858 req->handler = zfcp_fsf_abort_fcp_command_handler; 855 req->handler = zfcp_fsf_abort_fcp_command_handler;
859 req->qtcb->header.lun_handle = zfcp_sdev->lun_handle; 856 req->qtcb->header.lun_handle = zfcp_sdev->lun_handle;
860 req->qtcb->header.port_handle = zfcp_sdev->port->handle; 857 req->qtcb->header.port_handle = zfcp_sdev->port->handle;
@@ -2072,8 +2069,6 @@ static void zfcp_fsf_fcp_cmnd_handler(struct zfcp_fsf_req *req)
2072 struct fcp_resp_with_ext *fcp_rsp; 2069 struct fcp_resp_with_ext *fcp_rsp;
2073 unsigned long flags; 2070 unsigned long flags;
2074 2071
2075 zfcp_fsf_fcp_handler_common(req);
2076
2077 read_lock_irqsave(&req->adapter->abort_lock, flags); 2072 read_lock_irqsave(&req->adapter->abort_lock, flags);
2078 2073
2079 scpnt = req->data; 2074 scpnt = req->data;
@@ -2082,6 +2077,8 @@ static void zfcp_fsf_fcp_cmnd_handler(struct zfcp_fsf_req *req)
2082 return; 2077 return;
2083 } 2078 }
2084 2079
2080 zfcp_fsf_fcp_handler_common(req);
2081
2085 if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) { 2082 if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) {
2086 set_host_byte(scpnt, DID_TRANSPORT_DISRUPTED); 2083 set_host_byte(scpnt, DID_TRANSPORT_DISRUPTED);
2087 goto skip_fsfstatus; 2084 goto skip_fsfstatus;
@@ -2173,12 +2170,13 @@ int zfcp_fsf_fcp_cmnd(struct scsi_cmnd *scsi_cmnd)
2173 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; 2170 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter;
2174 struct zfcp_qdio *qdio = adapter->qdio; 2171 struct zfcp_qdio *qdio = adapter->qdio;
2175 struct fsf_qtcb_bottom_io *io; 2172 struct fsf_qtcb_bottom_io *io;
2173 unsigned long flags;
2176 2174
2177 if (unlikely(!(atomic_read(&zfcp_sdev->status) & 2175 if (unlikely(!(atomic_read(&zfcp_sdev->status) &
2178 ZFCP_STATUS_COMMON_UNBLOCKED))) 2176 ZFCP_STATUS_COMMON_UNBLOCKED)))
2179 return -EBUSY; 2177 return -EBUSY;
2180 2178
2181 spin_lock(&qdio->req_q_lock); 2179 spin_lock_irqsave(&qdio->req_q_lock, flags);
2182 if (atomic_read(&qdio->req_q_free) <= 0) { 2180 if (atomic_read(&qdio->req_q_free) <= 0) {
2183 atomic_inc(&qdio->req_q_full); 2181 atomic_inc(&qdio->req_q_full);
2184 goto out; 2182 goto out;
@@ -2242,7 +2240,7 @@ failed_scsi_cmnd:
2242 zfcp_fsf_req_free(req); 2240 zfcp_fsf_req_free(req);
2243 scsi_cmnd->host_scribble = NULL; 2241 scsi_cmnd->host_scribble = NULL;
2244out: 2242out:
2245 spin_unlock(&qdio->req_q_lock); 2243 spin_unlock_irqrestore(&qdio->req_q_lock, flags);
2246 return retval; 2244 return retval;
2247} 2245}
2248 2246
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 50286d8707f3..63529ed801eb 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -76,8 +76,8 @@ static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result)
76 scpnt->scsi_done(scpnt); 76 scpnt->scsi_done(scpnt);
77} 77}
78 78
79static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt, 79static
80 void (*done) (struct scsi_cmnd *)) 80int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt)
81{ 81{
82 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); 82 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device);
83 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; 83 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter;
@@ -87,7 +87,6 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt,
87 /* reset the status for this request */ 87 /* reset the status for this request */
88 scpnt->result = 0; 88 scpnt->result = 0;
89 scpnt->host_scribble = NULL; 89 scpnt->host_scribble = NULL;
90 scpnt->scsi_done = done;
91 90
92 scsi_result = fc_remote_port_chkready(rport); 91 scsi_result = fc_remote_port_chkready(rport);
93 if (unlikely(scsi_result)) { 92 if (unlikely(scsi_result)) {
diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
index 1119c535a667..20796ebc33ce 100644
--- a/drivers/s390/scsi/zfcp_unit.c
+++ b/drivers/s390/scsi/zfcp_unit.c
@@ -142,6 +142,8 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun)
142 return -ENOMEM; 142 return -ENOMEM;
143 } 143 }
144 144
145 get_device(&port->dev);
146
145 if (device_register(&unit->dev)) { 147 if (device_register(&unit->dev)) {
146 put_device(&unit->dev); 148 put_device(&unit->dev);
147 return -ENOMEM; 149 return -ENOMEM;
@@ -152,8 +154,6 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun)
152 return -EINVAL; 154 return -EINVAL;
153 } 155 }
154 156
155 get_device(&port->dev);
156
157 write_lock_irq(&port->unit_list_lock); 157 write_lock_irq(&port->unit_list_lock);
158 list_add_tail(&unit->list, &port->unit_list); 158 list_add_tail(&unit->list, &port->unit_list);
159 write_unlock_irq(&port->unit_list_lock); 159 write_unlock_irq(&port->unit_list_lock);