1
diff -ruN linux-2.4.19/drivers/s390/block/dasd.c linux-2.3/drivers/s390/block/dasd.c
2
--- linux-2.4.19/drivers/s390/block/dasd.c Wed Jan 29 20:13:56 2003
3
+++ linux-2.3/drivers/s390/block/dasd.c Wed Jan 22 13:23:31 2003
5
* Bugreports.to..: <Linux390@de.ibm.com>
6
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
8
- * $Revision: 1.234.2.32 $
9
+ * $Revision: 1.234.2.35 $
11
* History of changes (starts July 2000)
12
* 11/09/00 complete redesign after code review
14
EXPORT_SYMBOL (dasd_start_IO);
15
EXPORT_SYMBOL (dasd_term_IO);
16
EXPORT_SYMBOL (dasd_schedule_bh);
17
+EXPORT_SYMBOL (dasd_schedule_bh_timed);
18
EXPORT_SYMBOL (dasd_int_handler);
19
EXPORT_SYMBOL (dasd_oper_handler);
20
EXPORT_SYMBOL (dasd_alloc_request);
22
#undef DASD_PROFILE /* without procfs */
23
#endif /* not CONFIG_PROC_FS */
25
-#define DASD_MIN_SIZE_FOR_QUEUE 32
26
-#undef CONFIG_DYNAMIC_QUEUE_MIN_SIZE
27
#define DASD_CHANQ_MAX_SIZE 6
29
/********************************************************************************
30
@@ -1230,7 +1228,15 @@
31
cplength * sizeof (ccw1_t) + datasize) > PAGE_SIZE) {
34
- if (device->lowmem_cqr==NULL) {
36
+ /* use emergency request only for ERP or if it is the only request on queue */
37
+ if ((device->lowmem_cqr==NULL) &&
38
+ (device->queue.head == NULL ||
39
+ device->queue.head->status == CQR_STATUS_ERROR)) {
41
+ DEV_MESSAGE (KERN_DEBUG, device,
42
+ "Low memory! Using emergency request %p.",
43
+ device->lowmem_ccws);
46
"(%04x) Low memory! Using emergency request %p.",
47
@@ -1248,6 +1254,11 @@
48
rv->cpaddr = (ccw1_t *) ((long) rv + sizeof (ccw_req_t));
51
+ DEV_MESSAGE (KERN_DEBUG, device,
52
+ "Refusing emergency mem for request "
53
+ "(already in use at %p)?",
54
+ device->lowmem_ccws);
57
"(%04x) Refusing emergency mem for request "
58
"NULL, already in use at %p.",
59
@@ -1323,6 +1334,18 @@
64
+ if ((device->queue.head != NULL) &&
65
+ (device->queue.head->status != CQR_STATUS_ERROR) &&
66
+ (device->lowmem_cqr!=request)) {
67
+ DBF_DEV_EVENT (DBF_WARNING, device,
68
+ "Refusing emergency idals for request %p "
69
+ "because other requests are running & no ERP "
75
device->lowmem_cqr=request;
76
if (device->lowmem_idal_ptr == device->lowmem_idals) {
79
dasd_chanq_t *qp = &device->queue;
80
int irq = device->devinfo.irq;
81
ccw_req_t *final_requests = NULL;
82
- static int chanq_min_size = DASD_MIN_SIZE_FOR_QUEUE;
83
int chanq_max_size = DASD_CHANQ_MAX_SIZE;
84
ccw_req_t *cqr = NULL, *temp;
85
dasd_erp_postaction_fn_t erp_postaction;
88
qp->head->stopclk = get_clock ();
90
- } else if ((device->discipline->erp_action == NULL ) ||
91
+ } else if (((qp->head->dstat->flag & DEVSTAT_FLAG_SENSE_AVAIL) == 0 ) ||
92
+ (device->discipline->erp_action == NULL ) ||
93
((erp_action = device->discipline->erp_action (qp->head)) == NULL) ) {
95
erp_cqr = dasd_default_erp_action (qp->head);
100
- DEV_MESSAGE (KERN_ERR, device, "%s",
101
+ DEV_MESSAGE (KERN_WARNING, device, "%s",
105
@@ -1992,52 +2015,42 @@
108
(!list_empty (&queue->queue_head)) &&
109
- (req = dasd_next_request (queue)) != NULL) {
110
+ (req = dasd_next_request (queue)) &&
111
+ (qp->head == NULL || chanq_max_size > 0)) {
112
/* queue empty or certain critera fulfilled -> transfer */
113
- if (qp->head == NULL ||
114
- chanq_max_size > 0 || (req->nr_sectors >= chanq_min_size)) {
115
- ccw_req_t *cqr = NULL;
116
- if (is_read_only(device->kdev) && req->cmd == WRITE) {
118
- DBF_EVENT (DBF_ERR,
119
- "(%04x) Rejecting write request %p",
120
- device->devinfo.devno,
122
+ ccw_req_t *cqr = NULL;
123
+ if (is_read_only(device->kdev) && req->cmd == WRITE) {
125
- dasd_end_request (req, 0);
126
- dasd_dequeue_request (queue,req);
128
- /* relocate request according to partition table */
130
- device->major_info->gendisk.
131
- part[MINOR (req->rq_dev)].start_sect;
132
- cqr = device->discipline->build_cp_from_req (device, req);
135
- DBF_EVENT (DBF_ERR,
136
- "(%04x) CCW creation failed "
138
- device->devinfo.devno,
141
- /* revert relocation of request */
143
- device->major_info->gendisk.
144
- part[MINOR (req->rq_dev)].start_sect;
145
- break; /* terminate request queue loop */
148
-#ifdef CONFIG_DYNAMIC_QUEUE_MIN_SIZE
150
- (chanq_min_size + req->nr_sectors) >> 1;
151
-#endif /* CONFIG_DYNAMIC_QUEUE_MIN_SIZE */
152
- dasd_dequeue_request (queue, req);
153
- dasd_chanq_enq (qp, cqr);
155
+ DBF_EVENT (DBF_ERR,
156
+ "(%04x) Rejecting write request %p",
157
+ device->devinfo.devno,
159
+ dasd_dequeue_request (queue,req);
160
+ dasd_end_request (req, 0);
163
+ cqr = device->discipline->build_cp_from_req (device, req);
165
+ if (cqr == NULL || IS_ERR(cqr)) {
166
+ if (cqr == ERR_PTR(-ENOMEM)) {
169
- } else { /* queue not empty OR criteria not met */
170
- break; /* terminate request queue loop */
173
+ MESSAGE (KERN_EMERG,
174
+ "(%04x) CCW creation failed "
176
+ device->devinfo.devno, req);
177
+ dasd_dequeue_request (queue,req);
178
+ dasd_end_request (req, 0);
182
+ dasd_dequeue_request (queue, req);
183
+ dasd_chanq_enq (qp, cqr);
187
/* we process the requests with non-final status */
189
switch (qp->head->status) {
190
@@ -2164,9 +2177,9 @@
194
- "got state change pending interrupt on"
195
- "an idle device: devno%04x",
197
+ "got state change pending interrupt on"
198
+ " idle device: devno%04x",
203
@@ -2180,11 +2193,16 @@
205
check_then_set (&cqr->status,
206
CQR_STATUS_PENDING, CQR_STATUS_QUEUED);
208
- dasd_schedule_bh (*device_addr);
211
+ if (cqr->status == CQR_STATUS_IN_IO) {
212
+ cqr->status = CQR_STATUS_QUEUED;
213
+ DEV_MESSAGE (KERN_WARNING, (*device_addr), "%s",
214
+ "redriving state change pending condition w"
218
+ dasd_schedule_bh (*device_addr);
220
} /* end dasd_handle_state_change_pending */
223
@@ -2274,20 +2292,43 @@
224
((stat->cstat<<8)|stat->dstat));
226
/* first of all lets try to find out the appropriate era_action */
227
- if (stat->flag & DEVSTAT_FLAG_SENSE_AVAIL ||
228
- stat->dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) {
229
- /* anything abnormal ? */
230
- if (device->discipline->examine_error == NULL ||
231
- stat->flag & DEVSTAT_HALT_FUNCTION) {
232
- era = dasd_era_fatal;
233
+ if (stat->flag & DEVSTAT_HALT_FUNCTION) {
234
+ era = dasd_era_fatal;
235
+ } else if ( stat->flag & DEVSTAT_FLAG_SENSE_AVAIL ) {
236
+ if (cqr->dstat == NULL)
237
+ cqr->dstat = kmalloc (sizeof (devstat_t), GFP_ATOMIC);
239
+ memcpy (cqr->dstat, stat, sizeof (devstat_t));
241
- era = device->discipline->examine_error (cqr, stat);
242
+ MESSAGE (KERN_DEBUG, "%s",
243
+ "no memory for dstat...ignoring");
246
- DBF_EVENT (DBF_NOTICE,
251
+ if (device->discipline &&
252
+ device->discipline->dump_sense ) {
254
+ device->discipline->dump_sense (device,
258
+ if (device->discipline->examine_error == NULL) {
259
+ era = dasd_era_recover;
261
+ era = device->discipline->examine_error (cqr, stat);
263
+ } else if (stat->dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END) ||
264
+ stat->cstat & ~(SCHN_STAT_PCI | SCHN_STAT_INCORR_LEN) ) {
265
+ /* received IFCC or DATA_CHECK or ..... */
266
+ DEV_MESSAGE (KERN_DEBUG, device,
267
+ "Status without sense (IFCC,...) CS/DS %04x flag %08x",
268
+ ((stat->cstat<<8)|stat->dstat),
270
+ era = dasd_era_recover;
272
+ era = dasd_era_none;
275
if ( era == dasd_era_none ) {
276
check_then_set(&cqr->status,
278
@@ -2304,25 +2345,6 @@
282
- if (cqr->dstat == NULL)
283
- cqr->dstat = kmalloc (sizeof (devstat_t), GFP_ATOMIC);
285
- memcpy (cqr->dstat, stat, sizeof (devstat_t));
288
- MESSAGE (KERN_ERR, "%s",
289
- "no memory for dstat...ignoring");
293
- /* dump sense data */
294
- if (device->discipline &&
295
- device->discipline->dump_sense ) {
297
- device->discipline->dump_sense (device,
304
@@ -2360,53 +2382,40 @@
308
- * sets up the default-ERP ccw_req_t, namely one, which performs a TIC
309
- * to the original channel program with a retry counter of 16
310
+ * just retries the current cqr
316
- * erp CQR performing the ERP
320
dasd_default_erp_action (ccw_req_t * cqr)
323
dasd_device_t *device = cqr->device;
324
- ccw_req_t *erp = dasd_alloc_request ((char *) &cqr->magic, 1, 0, cqr->device);
326
- MESSAGE (KERN_DEBUG, "%s",
327
- "Default ERP called... ");
331
- DEV_MESSAGE (KERN_ERR, device, "%s",
332
- "Unable to allocate request for default ERP");
334
+ // just retry - there is nothing to save ... I got no sense data....
335
+ if (cqr->retries > 0) {
336
+ DEV_MESSAGE (KERN_DEBUG, device,
337
+ "default ERP called (%i retries left)",
340
check_then_set (&cqr->status,
342
- CQR_STATUS_FAILED);
344
- cqr->stopclk = get_clock ();
349
- erp->cpaddr->cmd_code = CCW_CMD_TIC;
350
- erp->cpaddr->cda = (__u32) (addr_t) cqr->cpaddr;
351
- erp->function = dasd_default_erp_action;
353
- erp->device = cqr->device;
354
- erp->magic = cqr->magic;
357
- erp->status = CQR_STATUS_FILLED;
359
- dasd_chanq_enq_head (&device->queue,
363
+ CQR_STATUS_QUEUED);
365
+ DEV_MESSAGE (KERN_WARNING, device, "%s",
366
+ "default ERP called (NO retry left)");
368
+ check_then_set (&cqr->status,
370
+ CQR_STATUS_FAILED);
372
+ cqr->stopclk = get_clock ();
376
} /* end dasd_default_erp_action */
378
@@ -2520,7 +2529,8 @@
380
if ((rc = dasd_sleep_on_req (req)) != 0) {
382
- DEV_MESSAGE (KERN_ERR, device,
384
+ DEV_MESSAGE (KERN_WARNING, device,
385
" Formatting of unit %d failed "
387
fdata->start_unit, rc);
388
@@ -3031,6 +3041,7 @@
389
set_device_ro(MKDEV(major,minor), intval);
396
@@ -3879,7 +3890,7 @@
397
&device->dev_status);
400
- MESSAGE (KERN_ERR, "%s",
401
+ MESSAGE (KERN_DEBUG, "%s",
405
@@ -4532,7 +4543,8 @@
408
/* Negative numbers in str/from/to indicate errors */
410
+ if (IS_ERR (str) || (range.from < 0) || (range.to < 0)
411
+ || (range.from > 65535) || (range.to > 65535))
414
if (strncmp (str, "on", 2) == 0) {
415
@@ -4567,7 +4579,8 @@
418
/* Negative numbers in str/from/to indicate errors */
420
+ if (IS_ERR (str) || (range.from < 0) || (range.to < 0)
421
+ || (range.from > 65535) || (range.to > 65535))
424
dasd_add_range (range.from, range.to, range.features);
425
@@ -4591,7 +4604,7 @@
427
/* check devixe status */
428
if (device->level != DASD_STATE_BOXED) {
430
+ MESSAGE (KERN_WARNING,
431
"/proc/dasd/devices: the given device (%04X) "
433
device->devinfo.devno);
434
@@ -4617,7 +4630,7 @@
435
device->discipline = discipline;
437
if (device->discipline == NULL) {
438
- MESSAGE (KERN_ERR, "%s",
439
+ MESSAGE (KERN_WARNING, "%s",
440
"/proc/dasd/devices: discipline not found "
441
"in discipline list");
443
@@ -4666,7 +4679,7 @@
446
if (range.from != range.to) {
447
- MESSAGE (KERN_ERR, "%s",
448
+ MESSAGE (KERN_WARNING, "%s",
449
"/proc/dasd/devices: 'brk <devno> <discipline> "
450
"is only allowed for a single device (no ranges)");
452
@@ -4674,7 +4687,7 @@
454
/* check for discipline = 'eckd' */
455
if (strncmp(str, "eckd", 4) != 0) {
457
+ MESSAGE (KERN_WARNING,
458
"/proc/dasd/devices: 'brk <devno> <discipline> "
459
"is only allowed for 'eckd' (%s)",
461
@@ -4685,7 +4698,7 @@
463
device = *(dasd_device_from_devno (range.from));
464
if (device == NULL) {
466
+ MESSAGE (KERN_WARNING,
467
"/proc/dasd/devices: no device found for devno (%04X)",
470
diff -ruN linux-2.4.19/drivers/s390/block/dasd_3990_erp.c linux-2.3/drivers/s390/block/dasd_3990_erp.c
471
--- linux-2.4.19/drivers/s390/block/dasd_3990_erp.c Wed Jan 29 20:13:56 2003
472
+++ linux-2.3/drivers/s390/block/dasd_3990_erp.c Wed Jan 22 13:23:31 2003
477
+ DEV_MESSAGE (KERN_ERR, device,
478
+ "DATA area is at: %p",
481
+ nl = (char *) loop_cqr->data;
482
+ end_cqr = nl + loop_cqr->datasize;
484
+ while (nl < end_cqr) {
487
+ "%p: %02x%02x%02x%02x"
488
+ " %02x%02x%02x%02x"
489
+ " %02x%02x%02x%02x"
490
+ " %02x%02x%02x%02x",
492
+ nl[0], nl[1], nl[2], nl[3],
493
+ nl[4], nl[5], nl[6], nl[7],
494
+ nl[8], nl[9], nl[10], nl[11],
495
+ nl[12], nl[13], nl[14], nl[15]);
497
+ DEV_MESSAGE (KERN_ERR, device, "%s",
503
nl = (char *) loop_cqr->cpaddr;
505
if (loop_cqr->cplength > 40) { /* log only parts of the CP */
510
- if (sense[25] & 0x1D) { /* state change pending */
511
+ if (sense[25] == 0x1D) { /* state change pending */
513
DEV_MESSAGE (KERN_INFO, device, "%s",
514
"waiting for state change pending "
515
@@ -753,14 +779,19 @@
518
/* no state change pending - retry */
519
+ DEV_MESSAGE (KERN_INFO, device,
520
+ "redriving request immediately, "
524
check_then_set (&erp->status,
534
} /* end dasd_3990_erp_action_4 */
537
@@ -2681,25 +2712,49 @@
540
dasd_device_t *device = cqr->device;
543
/* allocate additional request block */
544
- ccw_req_t *erp = dasd_alloc_request ((char *) &cqr->magic, 1, 0, cqr->device);
545
+ ccw_req_t *erp = dasd_alloc_request ((char *) &cqr->magic, 2, 0, cqr->device);
549
- DEV_MESSAGE (KERN_ERR, device, "%s",
550
- "Unable to allocate ERP request");
551
+ if (cqr->retries <= 0) {
552
+ DEV_MESSAGE (KERN_ERR, device, "%s",
553
+ "Unable to allocate ERP request "
554
+ "(NO retries left)");
556
- check_then_set (&cqr->status,
558
- CQR_STATUS_FAILED);
559
+ check_then_set (&cqr->status,
561
+ CQR_STATUS_FAILED);
563
+ cqr->stopclk = get_clock ();
566
+ DEV_MESSAGE (KERN_ERR, device,
567
+ "Unable to allocate ERP request "
568
+ "(%i retries left)",
571
+ if (!timer_pending(&device->timer)) {
572
+ init_timer (&device->timer);
573
+ device->timer.function = dasd_schedule_bh_timed;
574
+ device->timer.data = (unsigned long) device;
575
+ device->timer.expires = jiffies + (HZ << 3);
576
+ add_timer (&device->timer);
578
+ mod_timer(&device->timer, jiffies + (HZ << 3));
584
/* initialize request with default TIC to current ERP/CQR */
585
- erp->cpaddr->cmd_code = CCW_CMD_TIC;
586
- erp->cpaddr->cda = (long)(cqr->cpaddr);
588
+ ccw->cmd_code = CCW_CMD_NOOP;
589
+ ccw->flags = CCW_FLAG_CC;
591
+ ccw->cmd_code = CCW_CMD_TIC;
592
+ ccw->cda = (long)(cqr->cpaddr);
593
erp->function = dasd_3990_erp_add_erp;
595
erp->device = cqr->device;
596
@@ -2777,9 +2832,9 @@
599
/* check sense data; byte 0-2,25,27 */
600
- if (!((strncmp (cqr1->dstat->ii.sense.data,
601
- cqr2->dstat->ii.sense.data,
603
+ if (!((memcmp (cqr1->dstat->ii.sense.data,
604
+ cqr2->dstat->ii.sense.data,
606
(cqr1->dstat->ii.sense.data[27] ==
607
cqr2->dstat->ii.sense.data[27] ) &&
608
(cqr1->dstat->ii.sense.data[25] ==
609
@@ -2979,7 +3034,7 @@
611
if (erp->retries > 0) {
613
- char *sense = erp->dstat->ii.sense.data;
614
+ char *sense = erp->refers->dstat->ii.sense.data;
616
/* check for special retries */
617
if (erp->function == dasd_3990_erp_action_4) {
618
@@ -3131,18 +3186,15 @@
621
/* enqueue added ERP request */
622
- if ((erp != cqr ) &&
623
+ if ((erp != device->queue.head ) &&
624
(erp->status == CQR_STATUS_FILLED) ){
626
dasd_chanq_enq_head (&device->queue,
629
- if ((erp->status == CQR_STATUS_FILLED )||
631
- /* something strange happened - log the error and throw a BUG() */
632
- DEV_MESSAGE (KERN_ERR, device, "%s",
633
- "Problems with ERP chain!!! BUG");
635
+ if ((erp->status == CQR_STATUS_FILLED) ||
636
+ (erp != device->queue.head ) ) {
637
+ /* something strange happened - log the error and panic */
638
/* print current erp_chain */
639
DEV_MESSAGE (KERN_DEBUG, device, "%s",
640
"ERP chain at END of ERP-ACTION");
641
@@ -3160,7 +3212,8 @@
646
+ panic ("Problems with ERP chain!!! "
647
+ "Please report to linux390@de.ibm.com");
651
diff -ruN linux-2.4.19/drivers/s390/block/dasd_diag.c linux-2.3/drivers/s390/block/dasd_diag.c
652
--- linux-2.4.19/drivers/s390/block/dasd_diag.c Wed Jan 29 20:13:56 2003
653
+++ linux-2.3/drivers/s390/block/dasd_diag.c Wed Jan 22 13:23:31 2003
655
* Bugreports.to..: <Linux390@de.ibm.com>
656
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
658
- * $Revision: 1.37.2.6 $
659
+ * $Revision: 1.37.2.8 $
662
* 07/13/00 Added fixup sections for diagnoses ans saved some registers
663
@@ -472,13 +472,15 @@
667
+ unsigned long reloc_sector = req->sector +
668
+ device->major_info->gendisk.part[MINOR (req->rq_dev)].start_sect;
672
MESSAGE (KERN_ERR, "%s",
673
"No blocks to read/write...returning");
676
+ return ERR_PTR(-EINVAL);
678
if (req->cmd == READ) {
679
rw_cmd = MDSK_READ_REQ;
680
@@ -494,11 +496,11 @@
681
/* Build the request */
682
rw_cp = dasd_alloc_request (dasd_diag_discipline.name, bhct << 1, 0, device);
685
+ return ERR_PTR(-ENOMEM);
687
bio = (diag_bio_t *) (rw_cp->cpaddr);
689
- block = req->sector >> device->sizes.s2b_shift;
690
+ block = reloc_sector >> device->sizes.s2b_shift;
691
for (bh = req->bh; bh; bh = bh->b_reqnext) {
692
memset (bio, 0, sizeof (diag_bio_t));
693
for (size = 0; size < bh->b_size; size += byt_per_blk) {
694
diff -ruN linux-2.4.19/drivers/s390/block/dasd_eckd.c linux-2.3/drivers/s390/block/dasd_eckd.c
695
--- linux-2.4.19/drivers/s390/block/dasd_eckd.c Wed Jan 29 20:13:56 2003
696
+++ linux-2.3/drivers/s390/block/dasd_eckd.c Wed Jan 22 13:23:31 2003
698
* Bugreports.to..: <Linux390@de.ibm.com>
699
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
701
- * $Revision: 1.82.6.6 $
702
+ * $Revision: 1.82.6.8 $
704
* History of changes (starts July 2000)
705
* 07/11/00 Enabled rotational position sensing
708
cqr->device = device;
710
+ cqr->buildclk = get_clock ();
711
cqr->status = CQR_STATUS_FILLED;
712
dasd_chanq_enq (&device->queue, cqr);
714
@@ -1143,6 +1144,7 @@
716
(last_ccw - 1)->flags &= ~(CCW_FLAG_CC | CCW_FLAG_DC);
717
fcp->device = device;
718
+ fcp->buildclk = get_clock ();
719
fcp->status = CQR_STATUS_FILLED;
722
@@ -1247,11 +1249,14 @@
723
int byt_per_blk = device->sizes.bp_block;
724
int shift = device->sizes.s2b_shift;
725
int blk_per_trk = recs_per_track (&(private->rdc_data), 0, byt_per_blk);
726
- int btrk = (req->sector >> shift) / blk_per_trk;
727
- int etrk = ((req->sector + req->nr_sectors - 1) >> shift) / blk_per_trk;
728
- int recid = req->sector >> shift;
729
+ unsigned long reloc_sector = req->sector +
730
+ device->major_info->gendisk.part[MINOR(req->rq_dev)].start_sect;
731
+ int btrk = (reloc_sector >> shift) / blk_per_trk;
732
+ int etrk = ((reloc_sector + req->nr_sectors - 1) >> shift) / blk_per_trk;
733
+ int recid = reloc_sector >> shift;
734
int locate4k_set = 0;
738
if (req->cmd == READ) {
739
rw_cmd = DASD_ECKD_CCW_READ_MT;
740
@@ -1263,14 +1268,17 @@
741
"Unknown command %d",
745
+ return ERR_PTR(-EINVAL);
747
/* Build the request */
748
/* count bhs to prevent errors, when bh smaller than block */
750
for (bh = req->bh; bh; bh = bh->b_reqnext) {
751
- if (bh->b_size < byt_per_blk)
753
+ if (bh->b_size < byt_per_blk) {
754
+ MESSAGE(KERN_ERR, "ignoring bogus sized request: %d<%d",
755
+ bh->b_size, byt_per_blk);
756
+ return ERR_PTR(-EINVAL);
758
bhct+= bh->b_size >> (device->sizes.s2b_shift+9);
760
if (btrk < 2 && private->uses_cdl) {
761
@@ -1286,12 +1294,12 @@
762
sizeof (LO_eckd_data_t),
766
+ return ERR_PTR(-ENOMEM);
768
DE_data = rw_cp->data;
769
LO_data = rw_cp->data + sizeof (DE_eckd_data_t);
771
- if (define_extent (ccw, DE_data, btrk, etrk, rw_cmd, device, rw_cp)) {
772
+ if (errcode=define_extent (ccw, DE_data, btrk, etrk, rw_cmd, device, rw_cp)) {
775
ccw->flags |= CCW_FLAG_CC;
776
@@ -1304,7 +1312,7 @@
777
&& private->uses_cdl) {
778
/* Do a locate record for our special blocks */
779
int cmd = dasd_eckd_cdl_cmd (device,recid, req->cmd);
780
- if (locate_record (ccw,
781
+ if (errcode=locate_record (ccw,
784
recid % blk_per_trk + 1,
785
@@ -1314,11 +1322,11 @@
788
// Do a locate record for standard blocks */
789
- if (locate_record (ccw,
790
+ if (errcode=locate_record (ccw,
793
recid %blk_per_trk + 1,
799
@@ -1341,7 +1349,7 @@
800
0xE5, byt_per_blk - ccw->count);
803
- if (dasd_set_normalized_cda (ccw, __pa (bh->b_data+size), rw_cp, device)) {
804
+ if (errcode=dasd_set_normalized_cda (ccw, __pa (bh->b_data+size), rw_cp, device)) {
808
@@ -1353,7 +1361,7 @@
809
rw_cp->expires = 5 * TOD_MIN; /* 5 minutes */
811
rw_cp->lpm = LPM_ANYPATH;
812
- rw_cp->retries = 2;
813
+ rw_cp->retries = 256;
815
rw_cp->buildclk = get_clock ();
817
@@ -1365,7 +1373,7 @@
819
dasd_free_request (rw_cp,
822
+ rw_cp=ERR_PTR(errcode);
826
@@ -1432,6 +1440,7 @@
827
cqr->device = device;
829
cqr->expires = 10 * TOD_SEC;
830
+ cqr->buildclk = get_clock ();
831
cqr->status = CQR_STATUS_FILLED;
834
@@ -1460,6 +1469,7 @@
835
cqr->device = device;
837
cqr->expires = 10 * TOD_SEC;
838
+ cqr->buildclk = get_clock ();
839
cqr->status = CQR_STATUS_FILLED;
842
@@ -1489,6 +1499,7 @@
843
cqr->device = device;
845
cqr->expires = 10 * TOD_SEC;
846
+ cqr->buildclk = get_clock ();
847
cqr->status = CQR_STATUS_FILLED;
850
@@ -1617,6 +1628,7 @@
854
+ cqr->buildclk = get_clock ();
855
cqr->status = CQR_STATUS_FILLED;
858
diff -ruN linux-2.4.19/drivers/s390/block/dasd_fba.c linux-2.3/drivers/s390/block/dasd_fba.c
859
--- linux-2.4.19/drivers/s390/block/dasd_fba.c Wed Jan 29 20:13:56 2003
860
+++ linux-2.3/drivers/s390/block/dasd_fba.c Wed Jan 22 13:23:31 2003
862
* Bugreports.to..: <Linux390@de.ibm.com>
863
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
865
- * $Revision: 1.44.10.4 $
866
+ * $Revision: 1.44.10.6 $
869
* fixed partition handling and HDIO_GETGEO
871
struct buffer_head *bh;
872
dasd_fba_private_t *private = (dasd_fba_private_t *) device->private;
873
int byt_per_blk = device->sizes.bp_block;
874
+ unsigned long reloc_sector = req->sector +
875
+ device->major_info->gendisk.part[MINOR (req->rq_dev)].start_sect;
877
if (req->cmd == READ) {
878
rw_cmd = DASD_FBA_CCW_READ;
880
"Unknown command %d\n",
884
+ return ERR_PTR(-EINVAL);
886
/* Build the request */
887
/* count hs to prevent errors, when bh smaller than block */
888
@@ -329,14 +331,14 @@
893
+ return ERR_PTR(-ENOMEM);
895
DE_data = rw_cp->data;
896
LO_data = rw_cp->data + sizeof (DE_fba_data_t);
899
if (define_extent (ccw, DE_data, req->cmd, byt_per_blk,
900
- req->sector, req->nr_sectors, rw_cp, device)) {
901
+ reloc_sector, req->nr_sectors, rw_cp, device)) {
904
ccw->flags |= CCW_FLAG_CC;
905
diff -ruN linux-2.4.19/drivers/s390/char/hwc_rw.c linux-2.3/drivers/s390/char/hwc_rw.c
906
--- linux-2.4.19/drivers/s390/char/hwc_rw.c Wed Jan 29 20:13:56 2003
907
+++ linux-2.3/drivers/s390/char/hwc_rw.c Wed Jan 29 20:15:03 2003
908
@@ -1662,7 +1662,7 @@
911
quiesce_psw.mask = _DW_PSW_MASK;
912
- queisce_psw.addr = 0xfff;
913
+ quiesce_psw.addr = 0xfff;
914
__load_psw (quiesce_psw);
917
diff -ruN linux-2.4.19/drivers/s390/char/tapechar.c linux-2.3/drivers/s390/char/tapechar.c
918
--- linux-2.4.19/drivers/s390/char/tapechar.c Wed Jan 29 20:13:56 2003
919
+++ linux-2.3/drivers/s390/char/tapechar.c Wed Dec 11 14:06:18 2002
921
if(op.mt_op == MTBSR ||
924
- op.mt_op == MTBSR ||
925
+ op.mt_op == MTBSF ||
926
op.mt_op == MTFSFM ||
929
diff -ruN linux-2.4.19/drivers/s390/misc/z90main.c linux-2.3/drivers/s390/misc/z90main.c
930
--- linux-2.4.19/drivers/s390/misc/z90main.c Wed Jan 29 20:13:56 2003
931
+++ linux-2.3/drivers/s390/misc/z90main.c Thu Jan 23 22:55:06 2003
932
@@ -1851,12 +1851,22 @@
933
// Request for device reset
935
case ICAZ90HARDRESET:
936
- PRINTK("RESETING device under directions from PID %d.\n", pid);
937
- if(current->euid != 0)
940
- atomic_set(&__this_module.uc.usecount, 1);
942
+#ifdef Z90CRYPT_DEBUG
944
+ PRINTK("RESETING device under directions from PID %d.\n", pid);
945
+ if(current->euid != 0)
948
+ atomic_set(&__this_module.uc.usecount, 1);
957
+#endif // Z90CRYPT_DEBUG
960
// Request for RSA Clear-Key Decrypt
961
diff -ruN linux-2.4.19/drivers/s390/s390io.c linux-2.3/drivers/s390/s390io.c
962
--- linux-2.4.19/drivers/s390/s390io.c Wed Jan 29 20:13:56 2003
963
+++ linux-2.3/drivers/s390/s390io.c Tue Dec 10 18:16:13 2002
966
* drivers/s390/s390io.c
967
* S/390 common I/O routines
968
- * $Revision: 1.171.2.28 $
969
+ * $Revision: 1.171.2.34 $
972
* Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH,
977
- * Switch chpids off after the paths in mask failed
980
-switch_off_chpids(int irq, __u8 mask)
983
- pmcw_t *pmcw = &ioinfo[irq]->schib.pmcw;
986
- if ((0x80>>i) & mask
990
- clear_bit(pmcw->chpid[i], &chpids);
995
* Function: s390_send_nop
997
* sends a nop CCW to the specified subchannel down the given path(s)
998
@@ -1692,6 +1674,16 @@
1000
case 1: /* status pending */
1003
+ * Don't do an inline processing of pending interrupt conditions
1004
+ * while doing async. I/O. The interrupt will pop up when we are
1005
+ * enabled again and the I/O can be retried.
1007
+ if (!ioinfo[irq]->ui.flags.syncio) {
1012
ioinfo[irq]->devstat.flag = DEVSTAT_START_FUNCTION
1013
| DEVSTAT_STATUS_PENDING;
1015
@@ -1732,14 +1724,6 @@
1016
* than the one used (i.e. path available mask is non-zero).
1018
if (ioinfo[irq]->devstat.ii.irb.scsw.cc == 3) {
1019
- if (flag & DOIO_VALID_LPM) {
1020
- ioinfo[irq]->opm &=
1021
- ~(ioinfo[irq]->devstat.ii.irb.esw.esw1.
1024
- ioinfo[irq]->opm = 0;
1028
if (ioinfo[irq]->opm == 0) {
1030
@@ -1848,7 +1832,6 @@
1032
if (flag & DOIO_VALID_LPM) {
1033
ioinfo[irq]->opm &= ~lpm;
1034
- switch_off_chpids(irq, lpm);
1036
ioinfo[irq]->opm = 0;
1038
@@ -2000,7 +1983,6 @@
1042
- s390_process_IRQ (irq);
1046
@@ -2176,6 +2158,16 @@
1048
case 1: /* status pending */
1051
+ * Don't do an inline processing of pending interrupt conditions
1052
+ * while doing async. I/O. The interrupt will pop up when we are
1053
+ * enabled again and the I/O can be retried.
1055
+ if (!ioinfo[irq]->ui.flags.syncio) {
1060
ioinfo[irq]->devstat.flag |= DEVSTAT_STATUS_PENDING;
1063
@@ -2453,8 +2445,6 @@
1065
case 1: /* status pending */
1067
- /* process the pending irq... */
1068
- s390_process_IRQ (irq);
1072
@@ -2924,8 +2914,8 @@
1074
if (ioinfo[irq]->ui.flags.w4sense &&
1075
(dp->ii.irb.scsw.dstat & DEV_STAT_UNIT_CHECK)) {
1076
- CIO_MSG_EVENT(4,"double unit check irq %04x, dstat %02x,
1077
- flags %8x\n", irq, dp->ii.irb.scsw.dstat,
1078
+ CIO_MSG_EVENT(4,"double unit check irq %04x, dstat %02x, "
1079
+ "flags %8x\n", irq, dp->ii.irb.scsw.dstat,
1080
ioinfo[irq]->ui.info, ending_status);
1083
@@ -2982,6 +2972,32 @@
1084
ret_io = s390_start_IO (irq, s_ccw, 0xE2C5D5E2, /* = SENSe */
1092
+ * The device is no longer operational.
1093
+ * We won't get any sense data.
1095
+ ioinfo[irq]->ui.flags.w4sense = 0;
1096
+ ioinfo[irq]->ui.flags.oper = 0;
1097
+ allow4handler = 1; /* to notify the driver */
1101
+ * The channel subsystem is either busy, or we have
1102
+ * a status pending. Retry later.
1104
+ ioinfo[irq]->ui.flags.w4sense = 0;
1105
+ ioinfo[irq]->ui.flags.delsense = 1;
1108
+ printk(KERN_ERR"irq %04X: Unexpected rc %d "
1109
+ "for BASIC SENSE!\n", irq, ret_io);
1110
+ ioinfo[irq]->ui.flags.w4sense = 0;
1111
+ allow4handler = 1;
1115
* we received an Unit Check but we have no final
1116
@@ -3054,10 +3070,12 @@
1117
udp->flag |= DEVSTAT_FLAG_SENSE_AVAIL;
1118
udp->scnt = sense_count;
1120
- if (sense_count >= 0) {
1121
+ if (sense_count > 0) {
1122
memcpy (udp->ii.sense.data,
1123
ioinfo[irq]->sense_data,
1125
+ } else if (sense_count == 0) {
1126
+ udp->flag &= ~DEVSTAT_FLAG_SENSE_AVAIL;
1129
("s390_process_IRQ(%04x) encountered "
1130
@@ -3204,16 +3222,16 @@
1134
- if (ioinfo[irq]->ulpm != ioinfo[irq]->opm) {
1136
- * either it was the only path or it was restricted ...
1138
- ioinfo[irq]->opm &=
1139
- ~(ioinfo[irq]->devstat.ii.irb.esw.esw1.lpum);
1141
- ioinfo[irq]->opm = 0;
1142
+ if ((dp->ii.irb.scsw.fctl != 0) &&
1143
+ ((dp->ii.irb.scsw.stctl & SCSW_STCTL_STATUS_PEND) != 0) &&
1144
+ (((dp->ii.irb.scsw.stctl & SCSW_STCTL_INTER_STATUS) == 0) ||
1145
+ ((dp->ii.irb.scsw.actl & SCSW_ACTL_SUSPENDED) != 0)))
1146
+ if (dp->ii.irb.scsw.pno) {
1149
+ stsch(irq, &ioinfo[irq]->schib);
1150
+ ioinfo[irq]->opm &=
1151
+ ~ioinfo[irq]->schib.pmcw.pnom;
1154
if (ioinfo[irq]->opm == 0) {
1155
ioinfo[irq]->ui.flags.oper = 0;
1156
@@ -3468,7 +3486,6 @@
1157
* we only run the STSCH/MSCH path for the first enablement
1159
else if (sync_isc_cnt == 1) {
1160
- ioinfo[irq]->ui.flags.syncio = 1;
1162
ccode = stsch (irq, &(ioinfo[irq]->schib));
1164
@@ -3493,6 +3510,7 @@
1168
+ ioinfo[irq]->ui.flags.syncio = 1;
1169
__ctl_load (cr6, 6, 6);
1172
@@ -3535,6 +3553,15 @@
1173
if (rc) { /* can only happen if stsch/msch fails */
1175
atomic_set (&sync_isc, -1);
1176
+ } else if (sync_isc_cnt == 1) {
1179
+ ccode = stsch(irq, &ioinfo[irq]->schib);
1180
+ if (!ccode && ioinfo[irq]->schib.pmcw.isc != 5) {
1181
+ ioinfo[irq]->ui.flags.syncio = 0;
1183
+ atomic_set (&sync_isc, -1);
1187
#ifdef CONFIG_SYNC_ISC_PARANOIA
1188
@@ -6263,7 +6290,6 @@
1191
ioinfo[irq]->opm &= ~lpm;
1192
- switch_off_chpids(irq, lpm);
1196
@@ -6493,7 +6519,6 @@
1199
ioinfo[irq]->opm &= ~lpm;
1200
- switch_off_chpids(irq, lpm);
1204
diff -ruN linux-2.4.19/drivers/s390/scsi/zfcp.c linux-2.3/drivers/s390/scsi/zfcp.c
1205
--- linux-2.4.19/drivers/s390/scsi/zfcp.c Wed Jan 29 20:13:56 2003
1206
+++ linux-2.3/drivers/s390/scsi/zfcp.c Wed Jan 29 20:03:47 2003
1210
/* this drivers version (do not edit !!! generated and updated by cvs) */
1211
-#define ZFCP_REVISION "$Revision: 3.60.4.15 $"
1212
+#define ZFCP_REVISION "$Revision: 3.60.4.29 $"
1214
#define ZFCP_QTCB_VERSION FSF_QTCB_CURRENT_VERSION
1218
#define ZFCP_DEBUG_ABORTS /* scsi_cmnd abort tracing */
1220
+#define ZFCP_DEBUG_INCOMING_ELS /* incoming ELS tracing */
1225
@@ -195,22 +197,36 @@
1226
/* maximum number of commands in LUN queue */
1227
#define ZFCP_CMND_PER_LUN 32
1230
-#define ZFCP_ADAPTER_DBF_INDEX 6
1231
-#define ZFCP_ADAPTER_DBF_AREAS 2
1232
-#define ZFCP_ADAPTER_DBF_LENGTH 16
1233
-#define ZFCP_ADAPTER_DBF_LEVEL 6
1234
+/* debug feature entries per adapter */
1235
+#define ZFCP_ERP_DBF_INDEX 1
1236
+#define ZFCP_ERP_DBF_AREAS 2
1237
+#define ZFCP_ERP_DBF_LENGTH 16
1238
+#define ZFCP_ERP_DBF_LEVEL 3
1239
+#define ZFCP_ERP_DBF_NAME "zfcp_erp"
1241
+#define ZFCP_REQ_DBF_INDEX 1
1242
+#define ZFCP_REQ_DBF_AREAS 1
1243
+#define ZFCP_REQ_DBF_LENGTH 8
1244
+#define ZFCP_REQ_DBF_LEVEL 1
1245
+#define ZFCP_REQ_DBF_NAME "zfcp_req"
1247
#define ZFCP_CMD_DBF_INDEX 2
1248
#define ZFCP_CMD_DBF_AREAS 1
1249
#define ZFCP_CMD_DBF_LENGTH 8
1250
#define ZFCP_CMD_DBF_LEVEL 3
1251
+#define ZFCP_CMD_DBF_NAME "zfcp_cmd"
1253
#define ZFCP_ABORT_DBF_INDEX 2
1254
#define ZFCP_ABORT_DBF_AREAS 1
1255
#define ZFCP_ABORT_DBF_LENGTH 8
1256
#define ZFCP_ABORT_DBF_LEVEL 6
1257
-#define ZFCP_ABORT_DBF_RECSIZE ZFCP_ABORT_DBF_LENGTH * 5
1258
+#define ZFCP_ABORT_DBF_NAME "zfcp_abt"
1260
+#define ZFCP_IN_ELS_DBF_INDEX 2
1261
+#define ZFCP_IN_ELS_DBF_AREAS 1
1262
+#define ZFCP_IN_ELS_DBF_LENGTH 8
1263
+#define ZFCP_IN_ELS_DBF_LEVEL 6
1264
+#define ZFCP_IN_ELS_DBF_NAME "zfcp_els"
1267
* paranoia: some extra checks ensuring driver consistency and probably
1268
@@ -1203,6 +1219,8 @@
1269
/* and here for the extra proc_dir */
1270
struct proc_dir_entry *proc_dir;
1271
struct proc_dir_entry *proc_file;
1272
+ /* nameserver avaliable via this adapter */
1273
+ struct _zfcp_port *nameserver_port;
1274
/* error recovery for this adapter and associated devices */
1275
struct list_head erp_ready_head;
1276
struct list_head erp_running_head;
1277
@@ -1214,15 +1232,11 @@
1278
struct _zfcp_erp_action erp_action;
1279
atomic_t erp_counter;
1280
debug_info_t *erp_dbf;
1281
- /* nameserver avaliable via this adapter */
1282
- struct _zfcp_port *nameserver_port;
1283
- debug_info_t *cmd_dbf;
1284
- char cmd_dbf_name[20];
1285
- rwlock_t cmd_dbf_lock;
1286
debug_info_t *abort_dbf;
1287
- char abort_dbf_name[20];
1288
debug_info_t *req_dbf;
1289
- char req_dbf_name[20];
1290
+ debug_info_t *in_els_dbf;
1291
+ debug_info_t *cmd_dbf;
1292
+ rwlock_t cmd_dbf_lock;
1293
zfcp_adapter_mem_pool_t pool;
1294
/* SCSI error recovery watch */
1295
struct timer_list scsi_er_timer;
1296
@@ -1549,7 +1563,7 @@
1297
static int zfcp_fsf_abort_fcp_command_handler (zfcp_fsf_req_t*);
1298
static int zfcp_fsf_send_generic_handler (zfcp_fsf_req_t*);
1299
static int zfcp_fsf_status_read_handler (zfcp_fsf_req_t*);
1300
-inline void zfcp_fsf_els_processing (zfcp_fsf_req_t *);
1301
+void zfcp_fsf_incoming_els (zfcp_fsf_req_t *);
1303
zfcp_fsf_req_create_sbal_check
1304
(unsigned long*, zfcp_qdio_queue_t*, int);
1305
@@ -2356,7 +2370,7 @@
1310
+ (char*)add_data + i,
1311
min(ZFCP_CMD_DBF_LENGTH, add_length - i));
1313
ZFCP_WRITE_UNLOCK_IRQRESTORE(&adapter->cmd_dbf_lock, flags);
1314
@@ -2392,6 +2406,28 @@
1318
+static inline void zfcp_in_els_dbf_event(
1319
+ zfcp_adapter_t *adapter,
1321
+ fsf_status_read_buffer_t *status_buffer,
1324
+#ifdef ZFCP_DEBUG_INCOMING_ELS
1328
+ debug_text_event(adapter->in_els_dbf, level, text);
1329
+ debug_event(adapter->in_els_dbf, level, &status_buffer->d_id, 8);
1330
+ for (i = 0; i < length; i += ZFCP_IN_ELS_DBF_LENGTH)
1332
+ adapter->in_els_dbf,
1334
+ (char*)status_buffer->payload + i,
1335
+ min(ZFCP_IN_ELS_DBF_LENGTH, length - i));
1340
/****************************************************************/
1343
@@ -3309,7 +3345,7 @@
1345
zfcp_adapter_t *adapter;
1346
unsigned long flags;
1347
- char dbf_name[16];
1348
+ char dbf_name[20];
1351
"enter (devno=0x%x ,adapter_p=0x%lx)\n",
1352
@@ -3389,51 +3425,104 @@
1353
adapter->fc_service_class = ZFCP_FC_SERVICE_CLASS_DEFAULT;
1355
#ifdef ZFCP_DEBUG_REQUESTS
1356
- /* debug feature area which records fsf request sequence numbers */
1357
- sprintf(adapter->req_dbf_name, "zfcp_req0x%4.4x",adapter->devno);
1358
- adapter->req_dbf = debug_register(adapter->req_dbf_name, 1, 1, 8);
1359
- if (!adapter->req_dbf) {
1361
- goto failed_req_dbf;
1363
- debug_register_view(adapter->req_dbf, &debug_hex_ascii_view);
1364
- debug_set_level(adapter->req_dbf, 6);
1365
- debug_text_event(adapter->req_dbf, 1, "zzz");
1366
+ /* debug feature area which records fsf request sequence numbers */
1367
+ sprintf(dbf_name, ZFCP_REQ_DBF_NAME"0x%4.4x",adapter->devno);
1368
+ adapter->req_dbf = debug_register(
1370
+ ZFCP_REQ_DBF_INDEX,
1371
+ ZFCP_REQ_DBF_AREAS,
1372
+ ZFCP_REQ_DBF_LENGTH);
1373
+ if (!adapter->req_dbf) {
1375
+ "error: Out of resources. Request debug feature for "
1376
+ "adapter with devno 0x%4.4x could not be generated.\n",
1379
+ goto failed_req_dbf;
1381
+ debug_register_view(adapter->req_dbf, &debug_hex_ascii_view);
1382
+ debug_set_level(adapter->req_dbf, ZFCP_REQ_DBF_LEVEL);
1383
+ debug_text_event(adapter->req_dbf, 1, "zzz");
1384
#endif /* ZFCP_DEBUG_REQUESTS */
1386
#ifdef ZFCP_DEBUG_COMMANDS
1387
- /* debug feature area which records SCSI command failures (hostbyte) */
1388
+ /* debug feature area which records SCSI command failures (hostbyte) */
1389
rwlock_init(&adapter->cmd_dbf_lock);
1390
- sprintf(adapter->cmd_dbf_name, "zfcp_cmd0x%4.4x", adapter->devno);
1391
- adapter->cmd_dbf = debug_register(
1392
- adapter->cmd_dbf_name,
1394
+ sprintf(dbf_name, ZFCP_CMD_DBF_NAME"0x%4.4x", adapter->devno);
1395
+ adapter->cmd_dbf = debug_register(
1397
+ ZFCP_CMD_DBF_INDEX,
1399
ZFCP_CMD_DBF_LENGTH);
1400
- if (!adapter->cmd_dbf) {
1402
- goto failed_cmd_dbf;
1404
- debug_register_view(adapter->cmd_dbf, &debug_hex_ascii_view);
1405
- debug_set_level(adapter->cmd_dbf, ZFCP_CMD_DBF_LEVEL);
1406
+ if (!adapter->cmd_dbf) {
1408
+ "error: Out of resources. Command debug feature for "
1409
+ "adapter with devno 0x%4.4x could not be generated.\n",
1412
+ goto failed_cmd_dbf;
1414
+ debug_register_view(adapter->cmd_dbf, &debug_hex_ascii_view);
1415
+ debug_set_level(adapter->cmd_dbf, ZFCP_CMD_DBF_LEVEL);
1416
#endif /* ZFCP_DEBUG_COMMANDS */
1418
#ifdef ZFCP_DEBUG_ABORTS
1419
- /* debug feature area which records SCSI command aborts */
1420
- sprintf(adapter->abort_dbf_name, "zfcp_abt0x%4.4x", adapter->devno);
1421
- adapter->abort_dbf = debug_register(
1422
- adapter->abort_dbf_name,
1423
+ /* debug feature area which records SCSI command aborts */
1424
+ sprintf(dbf_name, ZFCP_ABORT_DBF_NAME"0x%4.4x", adapter->devno);
1425
+ adapter->abort_dbf = debug_register(
1427
ZFCP_ABORT_DBF_INDEX,
1428
ZFCP_ABORT_DBF_AREAS,
1429
ZFCP_ABORT_DBF_LENGTH);
1430
- if (!adapter->abort_dbf) {
1432
- goto failed_abort_dbf;
1434
- debug_register_view(adapter->abort_dbf, &debug_hex_ascii_view);
1435
- debug_set_level(adapter->abort_dbf, ZFCP_ABORT_DBF_LEVEL);
1436
+ if (!adapter->abort_dbf) {
1438
+ "error: Out of resources. Abort debug feature for "
1439
+ "adapter with devno 0x%4.4x could not be generated.\n",
1442
+ goto failed_abort_dbf;
1444
+ debug_register_view(adapter->abort_dbf, &debug_hex_ascii_view);
1445
+ debug_set_level(adapter->abort_dbf, ZFCP_ABORT_DBF_LEVEL);
1446
#endif /* ZFCP_DEBUG_ABORTS */
1448
+#ifdef ZFCP_DEBUG_INCOMING_ELS
1449
+ /* debug feature area which records SCSI command aborts */
1450
+ sprintf(dbf_name, ZFCP_IN_ELS_DBF_NAME"0x%4.4x", adapter->devno);
1451
+ adapter->in_els_dbf = debug_register(
1453
+ ZFCP_IN_ELS_DBF_INDEX,
1454
+ ZFCP_IN_ELS_DBF_AREAS,
1455
+ ZFCP_IN_ELS_DBF_LENGTH);
1456
+ if (!adapter->in_els_dbf) {
1458
+ "error: Out of resources. ELS debug feature for "
1459
+ "adapter with devno 0x%4.4x could not be generated.\n",
1462
+ goto failed_in_els_dbf;
1464
+ debug_register_view(adapter->in_els_dbf, &debug_hex_ascii_view);
1465
+ debug_set_level(adapter->in_els_dbf, ZFCP_IN_ELS_DBF_LEVEL);
1466
+#endif /* ZFCP_DEBUG_INCOMING_ELS */
1468
+ sprintf(dbf_name, ZFCP_ERP_DBF_NAME"0x%4.4x", adapter->devno);
1469
+ adapter->erp_dbf = debug_register(
1471
+ ZFCP_ERP_DBF_INDEX,
1472
+ ZFCP_ERP_DBF_AREAS,
1473
+ ZFCP_ERP_DBF_LENGTH);
1474
+ if (!adapter->erp_dbf) {
1476
+ "error: Out of resources. ERP debug feature for "
1477
+ "adapter with devno 0x%4.4x could not be generated.\n",
1480
+ goto failed_erp_dbf;
1482
+ debug_register_view(adapter->erp_dbf, &debug_hex_ascii_view);
1483
+ debug_set_level(adapter->erp_dbf, ZFCP_ERP_DBF_LEVEL);
1485
/* Init proc structures */
1486
#ifdef CONFIG_PROC_FS
1487
ZFCP_LOG_TRACE("Generating proc entry....\n");
1488
@@ -3449,24 +3538,6 @@
1489
ZFCP_LOG_TRACE("Proc entry created.\n");
1492
- sprintf(dbf_name, "zfcp_erp0x%4.4x", adapter->devno);
1493
- adapter->erp_dbf = debug_register(
1496
- ZFCP_ADAPTER_DBF_AREAS,
1497
- ZFCP_ADAPTER_DBF_LENGTH);
1498
- if (!adapter->erp_dbf) {
1500
- "error: Out of resources. "
1501
- "Debug feature entries for adapter with "
1502
- "devno 0x%4.4x could not be generated\n",
1507
- debug_register_view(adapter->erp_dbf, &debug_hex_ascii_view);
1508
- debug_set_level(adapter->erp_dbf, ZFCP_ADAPTER_DBF_LEVEL);
1510
retval = zfcp_erp_thread_setup(adapter);
1513
@@ -3501,12 +3572,17 @@
1517
- debug_unregister(adapter->erp_dbf);
1520
- zfcp_delete_adapter_proc(adapter);
1521
+ zfcp_delete_adapter_proc(adapter);
1524
+ debug_unregister(adapter->erp_dbf);
1527
+#ifdef ZFCP_DEBUG_INCOMING_ELS
1528
+ debug_unregister(adapter->in_els_dbf);
1532
#ifdef ZFCP_DEBUG_ABORTS
1533
debug_unregister(adapter->abort_dbf);
1535
@@ -3520,7 +3596,7 @@
1536
#ifdef ZFCP_DEBUG_REQUESTS
1537
debug_unregister(adapter->req_dbf);
1539
-#endif /* ZFCP_DEBUG_REQUESTS */
1542
failed_low_mem_buffers:
1543
zfcp_free_low_mem_buffers(adapter);
1544
@@ -3653,17 +3729,14 @@
1546
retval = zfcp_erp_thread_kill(adapter);
1548
- ZFCP_LOG_TRACE("Deleting dbf entry......\n");
1549
- debug_unregister(adapter->erp_dbf);
1550
- ZFCP_LOG_TRACE("dbf entry removed.\n");
1552
- ZFCP_LOG_TRACE("Deleting proc entry......\n");
1553
zfcp_delete_adapter_proc(adapter);
1554
ZFCP_LOG_TRACE("Proc entry removed.\n");
1556
+ debug_unregister(adapter->erp_dbf);
1558
#ifdef ZFCP_DEBUG_REQUESTS
1559
debug_unregister(adapter->req_dbf);
1560
-#endif /* ZFCP_DEBUG_REQUESTS */
1563
#ifdef ZFCP_DEBUG_COMMANDS
1564
debug_unregister(adapter->cmd_dbf);
1565
@@ -3673,6 +3746,10 @@
1566
debug_unregister(adapter->abort_dbf);
1569
+#ifdef ZFCP_DEBUG_INCOMING_ELS
1570
+ debug_unregister(adapter->in_els_dbf);
1573
zfcp_free_low_mem_buffers(adapter);
1574
/* free memory of adapter data structure and queues */
1575
zfcp_free_qdio_queues(adapter);
1576
@@ -8372,14 +8449,16 @@
1578
#ifdef ZFCP_DEBUG_ABORTS
1579
/* the components of a abort_dbf record (fixed size record) */
1580
- unsigned long dbf_scsi_cmnd = (unsigned long)scpnt;
1581
+ u64 dbf_scsi_cmnd = (unsigned long)scpnt;
1582
char dbf_opcode[ZFCP_ABORT_DBF_LENGTH];
1583
wwn_t dbf_wwn = port->wwpn;
1584
fcp_lun_t dbf_fcp_lun = unit->fcp_lun;
1585
- unsigned long dbf_retries = scpnt->retries;
1586
- unsigned long dbf_allowed = scpnt->allowed;
1587
- unsigned long dbf_timeout = 0;
1588
- unsigned long dbf_fsf_req = 0;
1589
+ u64 dbf_retries = scpnt->retries;
1590
+ u64 dbf_allowed = scpnt->allowed;
1591
+ u64 dbf_timeout = 0;
1592
+ u64 dbf_fsf_req = 0;
1593
+ u64 dbf_fsf_status = 0;
1594
+ u64 dbf_fsf_qual[2] = { 0, 0 };
1595
char dbf_result[ZFCP_ABORT_DBF_LENGTH]
1598
@@ -8536,10 +8615,27 @@
1600
/* wait for completion of abort */
1601
ZFCP_LOG_DEBUG("Waiting for cleanup....\n");
1602
+#ifdef ZFCP_DEBUG_ABORTS
1603
+ /* FIXME: copying zfcp_fsf_req_wait_and_cleanup code is not really nice */
1605
+ new_fsf_req->completion_wq,
1606
+ new_fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
1607
+ status = new_fsf_req->status;
1608
+ dbf_fsf_status = new_fsf_req->qtcb->header.fsf_status;
1610
+ * Ralphs special debug load provides timestamps in the FSF
1611
+ * status qualifier. This might be specified later if being
1612
+ * useful for debugging aborts.
1614
+ dbf_fsf_qual[0] = *(u64*)&new_fsf_req->qtcb->header.fsf_status_qual.word[0];
1615
+ dbf_fsf_qual[1] = *(u64*)&new_fsf_req->qtcb->header.fsf_status_qual.word[2];
1616
+ retval = zfcp_fsf_req_cleanup(new_fsf_req);
1618
retval = zfcp_fsf_req_wait_and_cleanup(
1620
ZFCP_UNINTERRUPTIBLE,
1624
"Waiting for cleanup complete, status=0x%x\n",
1626
@@ -8557,14 +8653,17 @@
1629
#ifdef ZFCP_DEBUG_ABORTS
1630
- debug_event(adapter->abort_dbf, 1, &dbf_scsi_cmnd, sizeof(unsigned long));
1631
+ debug_event(adapter->abort_dbf, 1, &dbf_scsi_cmnd, sizeof(u64));
1632
debug_event(adapter->abort_dbf, 1, &dbf_opcode, ZFCP_ABORT_DBF_LENGTH);
1633
debug_event(adapter->abort_dbf, 1, &dbf_wwn, sizeof(wwn_t));
1634
debug_event(adapter->abort_dbf, 1, &dbf_fcp_lun, sizeof(fcp_lun_t));
1635
- debug_event(adapter->abort_dbf, 1, &dbf_retries, sizeof(unsigned long));
1636
- debug_event(adapter->abort_dbf, 1, &dbf_allowed, sizeof(unsigned long));
1637
- debug_event(adapter->abort_dbf, 1, &dbf_timeout, sizeof(unsigned long));
1638
- debug_event(adapter->abort_dbf, 1, &dbf_fsf_req, sizeof(unsigned long));
1639
+ debug_event(adapter->abort_dbf, 1, &dbf_retries, sizeof(u64));
1640
+ debug_event(adapter->abort_dbf, 1, &dbf_allowed, sizeof(u64));
1641
+ debug_event(adapter->abort_dbf, 1, &dbf_timeout, sizeof(u64));
1642
+ debug_event(adapter->abort_dbf, 1, &dbf_fsf_req, sizeof(u64));
1643
+ debug_event(adapter->abort_dbf, 1, &dbf_fsf_status, sizeof(u64));
1644
+ debug_event(adapter->abort_dbf, 1, &dbf_fsf_qual[0], sizeof(u64));
1645
+ debug_event(adapter->abort_dbf, 1, &dbf_fsf_qual[1], sizeof(u64));
1646
debug_text_event(adapter->abort_dbf, 1, dbf_result);
1649
@@ -9784,50 +9883,47 @@
1651
inline static void zfcp_activate_adapter(int irq)
1653
-#define ZFCP_LOG_AREA ZFCP_LOG_AREA_SCSI
1654
-#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_SCSI
1655
+#define ZFCP_LOG_AREA ZFCP_LOG_AREA_DIO
1656
+#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_DIO
1659
- zfcp_adapter_t *adapter;
1661
+ zfcp_adapter_t *adapter;
1663
- ZFCP_LOG_TRACE("enter (irq=%i\n", irq);
1665
- devno=get_devno_by_irq(irq);
1666
- ZFCP_LOG_TRACE("devno is 0x%4.4x",devno);
1667
- /* Find the new adapter and open it */
1668
- ZFCP_FOR_EACH_ADAPTER(adapter) {
1669
- if (adapter->devno == devno)
1672
- if (adapter->devno != devno) {
1674
- "An unconfigured adapter has become"
1675
+ ZFCP_LOG_TRACE("enter (irq=%i)\n", irq);
1677
+ devno = get_devno_by_irq(irq);
1678
+ ZFCP_LOG_TRACE("devno is 0x%4.4x\n",devno);
1680
+ /* Find the new adapter and open it */
1681
+ ZFCP_FOR_EACH_ADAPTER(adapter) {
1682
+ if (adapter->devno == devno) {
1684
+ "The adapter with devno 0x%4.4x "
1685
+ "will now be activated.\n",
1687
+ debug_text_event(adapter->erp_dbf,1,"activate");
1688
+ zfcp_erp_modify_adapter_status(
1690
+ ZFCP_STATUS_COMMON_RUNNING,
1692
+ zfcp_erp_adapter_reopen(
1694
+ ZFCP_STATUS_COMMON_ERP_FAILED);
1699
+ "An unconfigured adapter has become "
1700
"active, it's devno 0x%4.4x.\n",
1705
- "The adapter with devno 0x%4.4x will now "
1706
- "be activated.\n",
1708
- zfcp_erp_modify_adapter_status(
1710
- ZFCP_STATUS_COMMON_RUNNING,
1712
- debug_text_event(adapter->erp_dbf,1,"activate");
1713
- zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
1716
ZFCP_LOG_TRACE("exit\n");
1720
#undef ZFCP_LOG_AREA
1721
#undef ZFCP_LOG_AREA_PREFIX
1727
* function: zfcp_dio_oper_handler
1729
@@ -9837,8 +9933,8 @@
1731
static int zfcp_dio_oper_handler(int irq, devreg_t *dreg)
1733
-#define ZFCP_LOG_AREA ZFCP_LOG_AREA_SCSI
1734
-#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_SCSI
1735
+#define ZFCP_LOG_AREA ZFCP_LOG_AREA_DIO
1736
+#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_DIO
1740
@@ -9866,8 +9962,8 @@
1742
static void zfcp_dio_not_oper_handler(int irq, int status)
1744
-#define ZFCP_LOG_AREA ZFCP_LOG_AREA_SCSI
1745
-#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_SCSI
1746
+#define ZFCP_LOG_AREA ZFCP_LOG_AREA_DIO
1747
+#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_DIO
1749
zfcp_adapter_t *adapter;
1751
@@ -9953,8 +10049,8 @@
1753
static void zfcp_cio_handler(int irq, void *devstat, struct pt_regs *rgs)
1755
-#define ZFCP_LOG_AREA ZFCP_LOG_AREA_SCSI
1756
-#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_SCSI
1757
+#define ZFCP_LOG_AREA ZFCP_LOG_AREA_DIO
1758
+#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_DIO
1761
"enter (irq=%i, devstat=0%lx, pt_regs=0%lx)\n",
1762
@@ -10812,6 +10908,69 @@
1766
+static int zfcp_fsf_status_read_port_closed(zfcp_fsf_req_t *fsf_req)
1768
+#define ZFCP_LOG_AREA ZFCP_LOG_AREA_FSF
1769
+#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_FSF
1771
+ fsf_status_read_buffer_t *status_buffer = fsf_req->data.status_read.buffer;
1772
+ zfcp_adapter_t *adapter = fsf_req->adapter;
1773
+ unsigned long flags;
1774
+ zfcp_port_t *port;
1776
+ ZFCP_WRITE_LOCK_IRQSAVE(&adapter->port_list_lock, flags);
1777
+ ZFCP_FOR_EACH_PORT (adapter, port)
1778
+ if (port->d_id == (status_buffer->d_id & ZFCP_DID_MASK))
1780
+ ZFCP_WRITE_UNLOCK_IRQRESTORE(&adapter->port_list_lock, flags);
1784
+ "bug: Re-open port indication received for the "
1785
+ "non-existing port with DID 0x%3.3x, on the adapter "
1786
+ "with devno 0x%4.4x. Ignored.\n",
1787
+ status_buffer->d_id & ZFCP_DID_MASK,
1792
+ switch (status_buffer->status_subtype) {
1794
+ case FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT:
1795
+ ZFCP_LOG_FLAGS(2, "FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT\n");
1796
+ debug_text_event(adapter->erp_dbf, 3, "unsol_pc_phys:");
1797
+ zfcp_erp_port_reopen(port, 0);
1800
+ case FSF_STATUS_READ_SUB_ERROR_PORT:
1801
+ ZFCP_LOG_FLAGS(1,"FSF_STATUS_READ_SUB_ERROR_PORT\n");
1802
+ debug_text_event(adapter->erp_dbf, 1, "unsol_pc_err:");
1803
+ zfcp_erp_port_shutdown(port, 0);
1807
+ debug_text_event(adapter->erp_dbf, 0, "unsol_unk_sub:");
1809
+ adapter->erp_dbf, 0,
1810
+ &status_buffer->status_subtype, sizeof(u32));
1812
+ "bug: Undefined status subtype received "
1813
+ "for a re-open indication on the port with "
1814
+ "DID 0x%3.3x, on the adapter with devno "
1815
+ "0x%4.4x. Ignored. (debug info 0x%x)\n",
1816
+ status_buffer->d_id,
1818
+ status_buffer->status_subtype);
1824
+#undef ZFCP_LOG_AREA
1825
+#undef ZFCP_LOG_AREA_PREFIX
1830
* function: zfcp_fsf_status_read_handler
1832
@@ -10826,8 +10985,6 @@
1835
zfcp_adapter_t *adapter = fsf_req->adapter;
1836
- zfcp_port_t *port;
1837
- unsigned long flags;
1838
fsf_status_read_buffer_t *status_buffer = fsf_req->data.status_read.buffer;
1841
@@ -10853,56 +11010,13 @@
1842
debug_event(adapter->erp_dbf,3,
1843
&status_buffer->d_id,
1845
- ZFCP_WRITE_LOCK_IRQSAVE(&adapter->port_list_lock, flags);
1846
- ZFCP_FOR_EACH_PORT (adapter, port) {
1847
- if(port->d_id==((status_buffer->d_id)
1848
- & ZFCP_DID_MASK)) {
1852
- ZFCP_WRITE_UNLOCK_IRQRESTORE(&adapter->port_list_lock, flags);
1853
- if(port->d_id!=((status_buffer->d_id)
1854
- & ZFCP_DID_MASK)) {
1855
- ZFCP_LOG_NORMAL("bug: Re-open port indication received "
1856
- "for the non-existing port with DID "
1857
- "0x%3.3x, on the adapter with devno "
1858
- "0x%4.4x. Ignored.\n",
1859
- status_buffer->d_id,
1862
- switch(status_buffer->status_subtype) {
1864
- case FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT:
1865
- ZFCP_LOG_FLAGS(2,"FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT\n");
1866
- debug_text_event(adapter->erp_dbf,3,"unsol_pc_phys:");
1867
- zfcp_erp_port_reopen(port,0);
1869
- case FSF_STATUS_READ_SUB_ERROR_PORT:
1870
- ZFCP_LOG_FLAGS(1,"FSF_STATUS_READ_SUB_ERROR_PORT\n");
1871
- debug_text_event(adapter->erp_dbf,1,"unsol_pc_err:");
1872
- zfcp_erp_port_shutdown(port, 0);
1875
- debug_text_event(adapter->erp_dbf,0,"unsol_unk_sub:");
1876
- debug_exception(adapter->erp_dbf,0,
1877
- &status_buffer->status_subtype,
1879
- ZFCP_LOG_NORMAL("bug: Undefined status subtype received "
1880
- "for a re-open indication on the port with DID "
1881
- "0x%3.3x, on the adapter with devno "
1882
- "0x%4.4x. Ignored. (debug info 0x%x)\n",
1883
- status_buffer->d_id,
1885
- status_buffer->status_subtype);
1889
+ zfcp_fsf_status_read_port_closed(fsf_req);
1892
case FSF_STATUS_READ_INCOMING_ELS:
1893
ZFCP_LOG_FLAGS(1,"FSF_STATUS_READ_INCOMING_ELS\n");
1894
debug_text_event(adapter->erp_dbf,3,"unsol_els:");
1895
- zfcp_fsf_els_processing(fsf_req);
1896
+ zfcp_fsf_incoming_els(fsf_req);
1899
case FSF_STATUS_READ_BIT_ERROR_THRESHOLD:
1900
@@ -10917,7 +11031,7 @@
1902
case FSF_STATUS_READ_LINK_DOWN:
1903
ZFCP_LOG_FLAGS(1,"FSF_STATUS_READ_LINK_DOWN\n");
1904
- /* Unneccessary, igonoring.... */
1905
+ /* Unneccessary, ignoring.... */
1908
case FSF_STATUS_READ_LINK_UP:
1909
@@ -10947,13 +11061,14 @@
1910
"type was received by the zfcp-driver "
1911
"(debug info 0x%x)\n",
1912
status_buffer->status_type);
1913
- ZFCP_LOG_NORMAL("Dump of status_read_buffer 0x%lx:\n",
1914
+ ZFCP_LOG_DEBUG("Dump of status_read_buffer 0x%lx:\n",
1915
(unsigned long)status_buffer);
1916
- ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
1917
+ ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
1918
(char*)status_buffer,
1919
sizeof(fsf_status_read_buffer_t));
1923
zfcp_mem_pool_return(status_buffer, &adapter->pool.status_read_buf);
1924
if (zfcp_fsf_req_cleanup(fsf_req)) {
1925
ZFCP_LOG_NORMAL("bug: Could not remove one FSF "
1926
@@ -10999,14 +11114,8 @@
1931
- * function: zfcp_fsf_rscn_processing
1933
- * purpose: tells FSF to abort a running SCSI command
1936
-inline void zfcp_fsf_rscn_processing(
1937
- zfcp_fsf_req_t *fsf_req,
1938
+void zfcp_fsf_incoming_els_rscn(
1939
+ zfcp_adapter_t *adapter,
1940
fsf_status_read_buffer_t *status_buffer)
1942
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_FSF
1943
@@ -11026,6 +11135,8 @@
1945
int no_entries=(fcp_rscn_head->payload_len / 4);
1947
+ zfcp_in_els_dbf_event(adapter, "##rscn", status_buffer, fcp_rscn_head->payload_len);
1949
for (i=1; i < no_entries; i++) {
1950
/* skip head and start with 1st element */
1952
@@ -11056,8 +11167,8 @@
1956
- ZFCP_WRITE_LOCK_IRQSAVE(&fsf_req->adapter->port_list_lock, flags);
1957
- ZFCP_FOR_EACH_PORT (fsf_req->adapter, port) {
1958
+ ZFCP_WRITE_LOCK_IRQSAVE(&adapter->port_list_lock, flags);
1959
+ ZFCP_FOR_EACH_PORT (adapter, port) {
1960
if (!atomic_test_mask(ZFCP_STATUS_PORT_DID_DID, &port->status)) {
1963
@@ -11069,10 +11180,11 @@
1965
fcp_rscn_element->nport_did);
1967
+ debug_text_event(adapter->erp_dbf,1,"unsol_els_rscnk:");
1968
zfcp_erp_port_reopen(port, 0);
1971
- ZFCP_WRITE_UNLOCK_IRQRESTORE(&fsf_req->adapter->port_list_lock, flags);
1972
+ ZFCP_WRITE_UNLOCK_IRQRESTORE(&adapter->port_list_lock, flags);
1974
printk("known %d, no_notifications %d\n",
1975
known, no_notifications);
1976
@@ -11087,21 +11199,21 @@
1977
if(reopen_unknown) {
1978
ZFCP_LOG_DEBUG("At least one unknown did "
1979
"underwent a state change.\n");
1980
- ZFCP_WRITE_LOCK_IRQSAVE(&fsf_req->adapter->port_list_lock, flags);
1981
- ZFCP_FOR_EACH_PORT (fsf_req->adapter, port) {
1982
+ ZFCP_WRITE_LOCK_IRQSAVE(&adapter->port_list_lock, flags);
1983
+ ZFCP_FOR_EACH_PORT (adapter, port) {
1984
if (!atomic_test_mask((ZFCP_STATUS_PORT_DID_DID
1985
| ZFCP_STATUS_PORT_NAMESERVER),
1988
- ZFCP_LOG_NORMAL("Received state change notification."
1989
+ ZFCP_LOG_INFO("Received state change notification."
1990
"Trying to open the port with wwpn "
1991
"0x%Lx. Hope it's there now.\n",
1992
(llui_t)port->wwpn);
1993
+ debug_text_event(adapter->erp_dbf,1,"unsol_els_rscnu:");
1994
zfcp_erp_port_reopen(port,
1995
ZFCP_STATUS_COMMON_ERP_FAILED);
1998
- ZFCP_WRITE_UNLOCK_IRQRESTORE(&fsf_req->adapter->port_list_lock, flags);
1999
+ ZFCP_WRITE_UNLOCK_IRQRESTORE(&adapter->port_list_lock, flags);
2002
#undef ZFCP_LOG_AREA
2003
@@ -11109,96 +11221,126 @@
2008
- * function: zfcp_fsf_els_processing
2010
- * purpose: tells FSF to abort a running SCSI command
2013
-inline void zfcp_fsf_els_processing(zfcp_fsf_req_t *fsf_req)
2014
+void zfcp_fsf_incoming_els_plogi(
2015
+ zfcp_adapter_t *adapter,
2016
+ fsf_status_read_buffer_t *status_buffer)
2018
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_FSF
2019
#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_FSF
2020
- fsf_status_read_buffer_t *status_buffer = fsf_req->data.status_read.buffer;
2021
- u32 els_type=*(u32 *)(status_buffer->payload);
2022
- zfcp_adapter_t *adapter=fsf_req->adapter;
2023
- zfcp_port_t *port;
2024
- unsigned long flags;
2026
- /* see fcp.h, it's ugly, but it's there */
2027
- logi *els_logi=NULL;
2028
- /* there seems to be no linux define for this */
2029
- fcp_logo_t *els_logo=NULL;
2031
- if(els_type==LS_PLOGI) {
2032
- ZFCP_LOG_FLAGS(2,"LS_PLOGI\n");
2033
- els_logi=(logi *)status_buffer->payload;
2034
- debug_text_event(adapter->erp_dbf,1,"unsol_els_plogi:");
2035
- debug_event(adapter->erp_dbf,1,
2036
- &els_logi->nport_wwn,
2038
- ZFCP_WRITE_LOCK_IRQSAVE(&adapter->port_list_lock, flags);
2039
- ZFCP_FOR_EACH_PORT (adapter, port) {
2040
- if(port->wwpn == (*(wwn_t *)&els_logi->nport_wwn))
2043
- ZFCP_WRITE_UNLOCK_IRQRESTORE(&adapter->port_list_lock, flags);
2044
- if(port->wwpn != (*(wwn_t*)&els_logi->nport_wwn)) {
2045
- ZFCP_LOG_DEBUG("Re-open port indication received "
2046
- "for the non-existing port with DID "
2047
- "0x%3.3x, on the adapter with devno "
2048
- "0x%4.4x. Ignored.\n",
2049
- status_buffer->d_id,
2052
- zfcp_erp_port_forced_reopen(port,0);
2056
- if(els_type==LS_LOGO) {
2057
- ZFCP_LOG_FLAGS(2,"LS_LOGO\n");
2058
- els_logo=(fcp_logo_t *)status_buffer->payload;
2059
- debug_text_event(adapter->erp_dbf,1,"unsol_els_logo");
2060
- debug_event(adapter->erp_dbf,1,
2061
- &els_logo->nport_wwpn,
2063
- ZFCP_WRITE_LOCK_IRQSAVE(&adapter->port_list_lock, flags);
2064
- ZFCP_FOR_EACH_PORT (adapter, port) {
2065
- if(port->wwpn==els_logo->nport_wwpn)
2068
- ZFCP_WRITE_UNLOCK_IRQRESTORE(&adapter->port_list_lock, flags);
2069
- if(port->wwpn!=els_logo->nport_wwpn) {
2070
- ZFCP_LOG_DEBUG("Re-open port indication received "
2071
- "for the non-existing port with DID "
2072
- "0x%3.3x, on the adapter with devno "
2073
- "0x%4.4x. Ignored.\n",
2074
- status_buffer->d_id,
2077
- zfcp_erp_port_forced_reopen(port,0);
2081
- /* we are only concerned with the command, not the length */
2082
- if((els_type & 0xffff0000) == LS_RSCN) {
2083
- ZFCP_LOG_FLAGS(2,"LS_RSCN\n");
2084
- debug_text_event(adapter->erp_dbf,1,"unsol_els_rscn:");
2085
- zfcp_fsf_rscn_processing(fsf_req, status_buffer);
2088
+ logi *els_logi = (logi*) status_buffer->payload;
2089
+ zfcp_port_t *port;
2090
+ unsigned long flags;
2092
- ZFCP_LOG_INFO("Unknown Incoming ELS received:\n");
2093
- ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_INFO,
2094
- (char *)status_buffer->payload,
2095
- FSF_STATUS_READ_PAYLOAD_SIZE);
2098
+ zfcp_in_els_dbf_event(adapter, "##plogi", status_buffer, 28);
2100
+ ZFCP_WRITE_LOCK_IRQSAVE(&adapter->port_list_lock, flags);
2101
+ ZFCP_FOR_EACH_PORT(adapter, port) {
2102
+ if (port->wwpn == (*(wwn_t *)&els_logi->nport_wwn))
2105
+ ZFCP_WRITE_UNLOCK_IRQRESTORE(&adapter->port_list_lock, flags);
2109
+ "Re-open port indication received "
2110
+ "for the non-existing port with D_ID "
2111
+ "0x%3.3x, on the adapter with devno "
2112
+ "0x%4.4x. Ignored.\n",
2113
+ status_buffer->d_id,
2116
+ debug_text_event(adapter->erp_dbf, 1, "unsol_els_plogi:");
2117
+ debug_event(adapter->erp_dbf, 1, &els_logi->nport_wwn, 8);
2118
+ zfcp_erp_port_forced_reopen(port, 0);
2121
#undef ZFCP_LOG_AREA
2122
#undef ZFCP_LOG_AREA_PREFIX
2126
+void zfcp_fsf_incoming_els_logo(
2127
+ zfcp_adapter_t *adapter,
2128
+ fsf_status_read_buffer_t *status_buffer)
2130
+#define ZFCP_LOG_AREA ZFCP_LOG_AREA_FSF
2131
+#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_FSF
2133
+ fcp_logo_t *els_logo = (fcp_logo_t*) status_buffer->payload;
2134
+ zfcp_port_t *port;
2135
+ unsigned long flags;
2137
+ zfcp_in_els_dbf_event(adapter, "##logo", status_buffer, 16);
2139
+ ZFCP_WRITE_LOCK_IRQSAVE(&adapter->port_list_lock, flags);
2140
+ ZFCP_FOR_EACH_PORT(adapter, port) {
2141
+ if (port->wwpn == els_logo->nport_wwpn)
2144
+ ZFCP_WRITE_UNLOCK_IRQRESTORE(&adapter->port_list_lock, flags);
2148
+ "Re-open port indication received "
2149
+ "for the non-existing port with D_ID "
2150
+ "0x%3.3x, on the adapter with devno "
2151
+ "0x%4.4x. Ignored.\n",
2152
+ status_buffer->d_id,
2155
+ debug_text_event(adapter->erp_dbf, 1, "unsol_els_logo:");
2156
+ debug_event(adapter->erp_dbf, 1, &els_logo->nport_wwpn, 8);
2157
+ zfcp_erp_port_forced_reopen(port, 0);
2160
+#undef ZFCP_LOG_AREA
2161
+#undef ZFCP_LOG_AREA_PREFIX
2165
+void zfcp_fsf_incoming_els_unknown(
2166
+ zfcp_adapter_t *adapter,
2167
+ fsf_status_read_buffer_t *status_buffer)
2169
+#define ZFCP_LOG_AREA ZFCP_LOG_AREA_FSF
2170
+#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_FSF
2172
+ zfcp_in_els_dbf_event(adapter, "##undef", status_buffer, 24);
2174
+ "warning: Unknown incoming ELS (0x%x) received "
2175
+ "for the adapter with devno 0x%4.4x\n",
2176
+ *(u32*)(status_buffer->payload),
2179
+#undef ZFCP_LOG_AREA
2180
+#undef ZFCP_LOG_AREA_PREFIX
2184
+void zfcp_fsf_incoming_els(zfcp_fsf_req_t *fsf_req)
2186
+#define ZFCP_LOG_AREA ZFCP_LOG_AREA_FSF
2187
+#define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_FSF
2189
+ fsf_status_read_buffer_t *status_buffer = fsf_req->data.status_read.buffer;
2190
+ u32 els_type = *(u32*)(status_buffer->payload);
2191
+ zfcp_adapter_t *adapter = fsf_req->adapter;
2193
+ if (els_type == LS_PLOGI)
2194
+ zfcp_fsf_incoming_els_plogi(adapter, status_buffer);
2195
+ else if (els_type == LS_LOGO)
2196
+ zfcp_fsf_incoming_els_logo(adapter, status_buffer);
2197
+ else if ((els_type & 0xffff0000) == LS_RSCN)
2198
+ /* we are only concerned with the command, not the length */
2199
+ zfcp_fsf_incoming_els_rscn(adapter, status_buffer);
2200
+ else zfcp_fsf_incoming_els_unknown(adapter, status_buffer);
2202
+#undef ZFCP_LOG_AREA
2203
+#undef ZFCP_LOG_AREA_PREFIX
2208
* function: zfcp_fsf_start_scsi_er_timer
2210
@@ -11253,7 +11395,7 @@
2212
unsigned long lock_flags;
2216
"enter (old_req_id=0x%lx, adapter=0x%lx, "
2217
"unit=0x%lx, req_flags=0x%x)\n",
2219
@@ -11356,8 +11498,8 @@
2220
int retval = -EINVAL;
2221
zfcp_unit_t *unit = new_fsf_req->data.abort_fcp_command.unit;
2222
unsigned char status_qual = new_fsf_req->qtcb->header.fsf_status_qual.word[0];
2227
"enter (new_fsf_req=0x%lx)\n",
2228
(unsigned long)new_fsf_req);