~ubuntu-branches/ubuntu/hoary/s390-tools/hoary

« back to all changes in this revision

Viewing changes to zfcpdump/kernel/patches/linux-2.4.19-s390-4-may2002.diff

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2004-06-27 18:45:15 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040627184515-q7lnvli1j94gr6dv
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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      Tue Mar 11 17:06:03 2003
 
3
+++ linux-2.3/drivers/s390/block/dasd.c Mon Mar 10 18:35:12 2003
 
4
@@ -6,7 +6,7 @@
 
5
  * Bugreports.to..: <Linux390@de.ibm.com>
 
6
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
 
7
  *
 
8
- * $Revision: 1.234.2.35 $
 
9
+ * $Revision: 1.234.2.39 $
 
10
  *
 
11
  * History of changes (starts July 2000)
 
12
  * 11/09/00 complete redesign after code review
 
13
@@ -1317,13 +1317,16 @@
 
14
                          ccw_req_t* request, dasd_device_t* device )
 
15
 {
 
16
 #ifdef CONFIG_ARCH_S390X
 
17
+        int rc;
 
18
        int nridaws;
 
19
         int count = cp->count;
 
20
         
 
21
-        if (set_normalized_cda (cp, address)!=-ENOMEM) {
 
22
-                return 0;
 
23
+        rc = set_normalized_cda (cp, address);
 
24
+        if (rc !=-ENOMEM) {
 
25
+                return rc;
 
26
         }
 
27
 
 
28
+        /* check if emergency buffers already in use for other request */
 
29
         if ((device->lowmem_cqr!=NULL   ) && 
 
30
             (device->lowmem_cqr!=request)   ) {
 
31
 
 
32
@@ -1336,9 +1339,10 @@
 
33
                 return -ENOMEM;
 
34
         }
 
35
 
 
36
-       if ((device->queue.head != NULL) && 
 
37
+        /* use emergency request only for ERP or if it is the only request on queue */
 
38
+       if ((device->queue.head != NULL                    ) && 
 
39
             (device->queue.head->status != CQR_STATUS_ERROR) && 
 
40
-            (device->lowmem_cqr!=request)) {
 
41
+            (device->lowmem_cqr!=request                   )   ) {
 
42
                DBF_DEV_EVENT (DBF_WARNING, device,
 
43
                                "Refusing emergency idals for request %p "
 
44
                                "because other requests are running & no ERP "
 
45
@@ -1346,8 +1350,9 @@
 
46
                                request);
 
47
                return -ENOMEM;
 
48
        }
 
49
-
 
50
         device->lowmem_cqr=request;
 
51
+
 
52
+        /* print message if called the first time for the request */
 
53
         if (device->lowmem_idal_ptr == device->lowmem_idals) {
 
54
 
 
55
                 DBF_DEV_EVENT (DBF_WARNING, device, 
 
56
@@ -1356,12 +1361,18 @@
 
57
                                request);
 
58
 
 
59
         }
 
60
+
 
61
+        /* get number of idal words needed */
 
62
         nridaws = ((address & (IDA_BLOCK_SIZE-1)) + count + 
 
63
                   (IDA_BLOCK_SIZE-1)) >> IDA_SIZE_LOG;
 
64
-       if ( device->lowmem_idal_ptr>=device->lowmem_idals + PAGE_SIZE ) {
 
65
+
 
66
+       if ((device->lowmem_idal_ptr + nridaws * sizeof(unsigned long)) > 
 
67
+            (device->lowmem_idals + PAGE_SIZE                         )  ) {
 
68
                /* Ouch! No Idals left for emergency request */
 
69
                BUG();
 
70
        }
 
71
+
 
72
+        /* fill the idals table */
 
73
        cp->flags |= CCW_FLAG_IDA;
 
74
        cp->cda = (__u32)(unsigned long)device->lowmem_idal_ptr;
 
75
         do {
 
76
@@ -2325,7 +2336,22 @@
 
77
                              "Status without sense (IFCC,...) CS/DS %04x flag %08x",
 
78
                             ((stat->cstat<<8)|stat->dstat),
 
79
                             stat->flag);
 
80
-                era = dasd_era_recover;
 
81
+                /* we got no sense data, therefore we just retry */
 
82
+                check_then_set (&cqr->status,
 
83
+                                CQR_STATUS_IN_IO,
 
84
+                                CQR_STATUS_QUEUED);
 
85
+                dasd_schedule_bh(device);
 
86
+                return;
 
87
+        } else  if (stat->flag & DEVSTAT_NOT_OPER) {
 
88
+                /* path became offline or similar */
 
89
+                /* => retry to see if there are any other pathes available */
 
90
+                DEV_MESSAGE (KERN_DEBUG, device, "%s",
 
91
+                             "Device or a path became not operational while in IO");
 
92
+                check_then_set (&cqr->status,
 
93
+                                CQR_STATUS_IN_IO,
 
94
+                                CQR_STATUS_QUEUED);
 
95
+                dasd_schedule_bh(device);
 
96
+                return;
 
97
         } else {
 
98
                 era = dasd_era_none;
 
99
         }
 
100
@@ -3596,9 +3622,6 @@
 
101
                        break;
 
102
        }
 
103
 
 
104
-       DBF_EVENT (DBF_NOTICE,
 
105
-                   "called for devno %04x", 
 
106
-                   devno);
 
107
 
 
108
        if (devno < 0) {
 
109
 
 
110
@@ -3940,18 +3963,17 @@
 
111
                         s390irq_spin_lock_irqsave (device->devinfo.irq, 
 
112
                                                    flags);
 
113
                         rc = device->discipline->start_IO (device->init_cqr);
 
114
+                        if ( ! rc )
 
115
+                               device->level = DASD_STATE_INIT;
 
116
                         s390irq_spin_unlock_irqrestore(device->devinfo.irq, 
 
117
                                                        flags);
 
118
-                        if ( rc )
 
119
-                                goto out;
 
120
-                        device->level = DASD_STATE_INIT;
 
121
                 } else {
 
122
                         rc = -ENOMEM;
 
123
                 }
 
124
         } else {
 
125
                 rc = dasd_state_init_to_ready ( device ); 
 
126
         }
 
127
- out:
 
128
+
 
129
         return rc;
 
130
 }
 
131
 
 
132
diff -ruN linux-2.4.19/drivers/s390/block/dasd_eckd.c linux-2.3/drivers/s390/block/dasd_eckd.c
 
133
--- linux-2.4.19/drivers/s390/block/dasd_eckd.c Tue Mar 11 17:06:03 2003
 
134
+++ linux-2.3/drivers/s390/block/dasd_eckd.c    Thu Mar  6 10:46:04 2003
 
135
@@ -6,7 +6,7 @@
 
136
  * Bugreports.to..: <Linux390@de.ibm.com>
 
137
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
 
138
  *
 
139
- * $Revision: 1.82.6.8 $
 
140
+ * $Revision: 1.82.6.9 $
 
141
  *
 
142
  * History of changes (starts July 2000)
 
143
  * 07/11/00 Enabled rotational position sensing
 
144
@@ -218,7 +218,7 @@
 
145
                 data->ep_sys_time = get_clock ();
 
146
                 
 
147
                 de_ccw->count = sizeof (DE_eckd_data_t);
 
148
-                de_ccw->flags = CCW_FLAG_SLI;  
 
149
+                de_ccw->flags |= CCW_FLAG_SLI;  
 
150
         }
 
151
 
 
152
         return;
 
153
@@ -1012,14 +1012,14 @@
 
154
                switch (fdata->intensity & ~0x08) {
 
155
                case 0x03:
 
156
                        if (define_extent (last_ccw, DE_data, fdata->start_unit, fdata->start_unit,
 
157
-                                      DASD_ECKD_CCW_WRITE_HOME_ADDRESS,
 
158
+                                           DASD_ECKD_CCW_WRITE_HOME_ADDRESS,
 
159
                                            device, fcp)) {
 
160
                                 goto clear_fcp;
 
161
                         }
 
162
                        last_ccw->flags |= CCW_FLAG_CC;
 
163
                        last_ccw++;
 
164
                        if (locate_record (last_ccw, LO_data, fdata->start_unit, 0, wrccws,
 
165
-                                      DASD_ECKD_CCW_WRITE_HOME_ADDRESS, device,
 
166
+                                           DASD_ECKD_CCW_WRITE_HOME_ADDRESS, device,
 
167
                                            device->sizes.bp_block, fcp)) {
 
168
                                 goto clear_fcp;
 
169
                         }
 
170
@@ -1034,7 +1034,7 @@
 
171
                        last_ccw->flags |= CCW_FLAG_CC;
 
172
                        last_ccw++;
 
173
                        if (locate_record (last_ccw, LO_data, fdata->start_unit, 0, wrccws,
 
174
-                                      DASD_ECKD_CCW_WRITE_RECORD_ZERO, device,
 
175
+                                           DASD_ECKD_CCW_WRITE_RECORD_ZERO, device,
 
176
                                            device->sizes.bp_block, fcp)) {
 
177
                                 goto clear_fcp;
 
178
                         }
 
179
diff -ruN linux-2.4.19/drivers/s390/block/dasd_int.h linux-2.3/drivers/s390/block/dasd_int.h
 
180
--- linux-2.4.19/drivers/s390/block/dasd_int.h  Tue Mar 11 17:06:03 2003
 
181
+++ linux-2.3/drivers/s390/block/dasd_int.h     Mon Mar 10 18:35:13 2003
 
182
@@ -5,7 +5,7 @@
 
183
  * Bugreports.to..: <Linux390@de.ibm.com>
 
184
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
 
185
  *
 
186
- * $Revision: 1.20.2.6 $
 
187
+ * $Revision: 1.20.2.8 $
 
188
  *
 
189
  * History of changes (starts July 2000)
 
190
  * 02/01/01 added dynamic registration of ioctls
 
191
diff -ruN linux-2.4.19/drivers/s390/s390io.c linux-2.3/drivers/s390/s390io.c
 
192
--- linux-2.4.19/drivers/s390/s390io.c  Tue Mar 11 17:06:03 2003
 
193
+++ linux-2.3/drivers/s390/s390io.c     Mon Mar 10 18:40:42 2003
 
194
@@ -1,7 +1,7 @@
 
195
 /*
 
196
  *  drivers/s390/s390io.c
 
197
  *   S/390 common I/O routines
 
198
- *   $Revision: 1.171.2.34 $
 
199
+ *   $Revision: 1.171.2.39 $
 
200
  *
 
201
  *  S390 version
 
202
  *    Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH,
 
203
@@ -3735,12 +3735,15 @@
 
204
        CIO_TRACE_EVENT (4, "VMvdinf");
 
205
 
 
206
        if (init_IRQ_complete) {
 
207
-               p_diag_data = kmalloc (sizeof (diag210_t), GFP_DMA);
 
208
+               p_diag_data = kmalloc (sizeof (diag210_t), GFP_DMA | GFP_ATOMIC);
 
209
        } else {
 
210
                p_diag_data = alloc_bootmem_low (sizeof (diag210_t));
 
211
 
 
212
        }
 
213
 
 
214
+       if (!p_diag_data)
 
215
+               return;
 
216
+
 
217
        p_diag_data->vrdcdvno = devno;
 
218
        p_diag_data->vrdclen = sizeof (diag210_t);
 
219
        ccode = diag210 ((diag210_t *) virt_to_phys (p_diag_data));
 
220
@@ -4271,7 +4274,7 @@
 
221
                        if (init_IRQ_complete) {
 
222
                                rcd_buf =
 
223
                                    kmalloc (ioinfo[irq]->senseid.ciw[ciw_cnt].
 
224
-                                            count, GFP_DMA);
 
225
+                                            count, GFP_DMA | GFP_ATOMIC);
 
226
                        } else {
 
227
                                rcd_buf =
 
228
                                    alloc_bootmem_low (ioinfo[irq]->senseid.
 
229
@@ -4989,9 +4992,11 @@
 
230
                            alloc_bootmem_low (sizeof (ioinfo_t));
 
231
                } else {
 
232
                        ioinfo[irq] = (ioinfo_t *)
 
233
-                           kmalloc (sizeof (ioinfo_t), GFP_DMA);
 
234
+                           kmalloc (sizeof (ioinfo_t), GFP_DMA | GFP_ATOMIC);
 
235
 
 
236
                }
 
237
+               if (!ioinfo[irq])
 
238
+                       return -ENOMEM;
 
239
 
 
240
                memset (ioinfo[irq], '\0', sizeof (ioinfo_t));
 
241
                memcpy (&ioinfo[irq]->schib, p_init_schib, sizeof (schib_t));
 
242
@@ -5337,11 +5342,17 @@
 
243
        s390irq_spin_lock (irq);
 
244
 
 
245
        if (init_IRQ_complete) {
 
246
-               sense_ccw = kmalloc (2 * sizeof (ccw1_t), GFP_DMA);
 
247
+               sense_ccw = kmalloc (2 * sizeof (ccw1_t), GFP_DMA | GFP_ATOMIC);
 
248
        } else {
 
249
                sense_ccw = alloc_bootmem_low (2 * sizeof (ccw1_t));
 
250
 
 
251
        }
 
252
+       if (!sense_ccw) {
 
253
+               s390irq_spin_unlock (irq);
 
254
+               if (inlreq)
 
255
+                       free_irq (irq, &devstat);
 
256
+               return -ENOMEM;
 
257
+       }
 
258
 
 
259
        /* more than one path installed ? */
 
260
        if (ioinfo[irq]->schib.pmcw.pim != 0x80) {
 
261
@@ -6114,11 +6125,17 @@
 
262
        s390irq_spin_lock_irqsave (irq, flags);
 
263
 
 
264
        if (init_IRQ_complete) {
 
265
-               spid_ccw = kmalloc (2 * sizeof (ccw1_t), GFP_DMA);
 
266
+               spid_ccw = kmalloc (2 * sizeof (ccw1_t), GFP_DMA | GFP_ATOMIC);
 
267
        } else {
 
268
                spid_ccw = alloc_bootmem_low (2 * sizeof (ccw1_t));
 
269
 
 
270
        }
 
271
+       if (!spid_ccw) {
 
272
+               s390irq_spin_unlock_irqrestore(irq, flags);
 
273
+               if (inlreq)
 
274
+                       free_irq(irq, pdevstat);
 
275
+               return -ENOMEM;
 
276
+       }
 
277
 
 
278
        spid_ccw[0].cmd_code = CCW_CMD_SUSPEND_RECONN;
 
279
        spid_ccw[0].cda = 0;
 
280
@@ -6398,13 +6415,32 @@
 
281
        ioinfo[irq]->ui.flags.unfriendly = 0; /* assume it's friendly... */
 
282
 
 
283
        if (init_IRQ_complete) {
 
284
-               snid_ccw = kmalloc (sizeof (ccw1_t), GFP_DMA);
 
285
-               tmp_pgid = kmalloc (sizeof (pgid_t), GFP_DMA);
 
286
+               snid_ccw = kmalloc (sizeof (ccw1_t), GFP_DMA | GFP_ATOMIC);
 
287
+               tmp_pgid = kmalloc (sizeof (pgid_t), GFP_DMA | GFP_ATOMIC);
 
288
        } else {
 
289
                snid_ccw = alloc_bootmem_low (sizeof (ccw1_t));
 
290
                tmp_pgid = alloc_bootmem_low (sizeof (pgid_t));
 
291
        }
 
292
 
 
293
+       if (!snid_ccw || !tmp_pgid) {
 
294
+               if (snid_ccw) {
 
295
+                       if (init_IRQ_complete)
 
296
+                               kfree(snid_ccw);
 
297
+                       else
 
298
+                               free_bootmem((unsigned long) snid_ccw, sizeof(ccw1_t));
 
299
+               }
 
300
+               if (tmp_pgid) {
 
301
+                       if (init_IRQ_complete)
 
302
+                               kfree(tmp_pgid);
 
303
+                       else
 
304
+                               free_bootmem((unsigned long) tmp_pgid, sizeof(pgid_t));
 
305
+               }
 
306
+               s390irq_spin_unlock_irqrestore(irq, flags);
 
307
+               if (inlreq) 
 
308
+                       free_irq (irq, pdevstat);
 
309
+               return -ENOMEM;
 
310
+       }
 
311
 
312
        snid_ccw->cmd_code = CCW_CMD_SENSE_PGID;
 
313
        snid_ccw->cda = (__u32) virt_to_phys (tmp_pgid);
 
314
        snid_ccw->count = sizeof (pgid_t);
 
315
@@ -6529,7 +6565,7 @@
 
316
                                 * -- we'll fail other commands if that is
 
317
                                 * the case
 
318
                                 */
 
319
-                               if (pgid->inf.ps.state2 ==
 
320
+                               if (tmp_pgid->inf.ps.state2 ==
 
321
                                    SNID_STATE2_RESVD_ELSE) {
 
322
                                        printk (KERN_WARNING 
 
323
                                                "SNID - Device %04X "
 
324
diff -ruN linux-2.4.19/drivers/s390/scsi/zfcp.c linux-2.3/drivers/s390/scsi/zfcp.c
 
325
--- linux-2.4.19/drivers/s390/scsi/zfcp.c       Tue Mar 11 17:06:03 2003
 
326
+++ linux-2.3/drivers/s390/scsi/zfcp.c  Thu Mar  6 20:44:43 2003
 
327
@@ -12,7 +12,7 @@
 
328
  */
 
329
 
 
330
 /* this drivers version (do not edit !!! generated and updated by cvs) */
 
331
-#define ZFCP_REVISION          "$Revision: 3.60.4.29 $"
 
332
+#define ZFCP_REVISION          "$Revision: 3.60.4.32 $"
 
333
 
 
334
 #define ZFCP_QTCB_VERSION      FSF_QTCB_CURRENT_VERSION
 
335
 
 
336
@@ -2301,42 +2301,6 @@
 
337
 }
 
338
 #endif //ZFCP_CAUSE_ERRORS
 
339
 
 
340
-/****************** buggy panic workaround **********************/
 
341
-/*Note: This only works for the IBM Internal drivers 
 
342
- * ESA(ME)24_21 and ESA(ME)24_22.3
 
343
- */
 
344
-#if ZFCP_64BIT
 
345
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,16))
 
346
-void (*zfcp_smp_send_stop)(void) = (void *)0x00000000001b400;
 
347
-#endif
 
348
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,17))
 
349
-void (*zfcp_smp_send_stop)(void) = (void *)0x000000000001c88c;
 
350
-#endif
 
351
-#else // !ZFCP_64BIT
 
352
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,16))
 
353
-void (*zfcp_smp_send_stop)(void) = (void *)0x8001aab8;
 
354
-#endif
 
355
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,17))
 
356
-void (*zfcp_smp_send_stop)(void) = (void *)0x8001b3a0;
 
357
-#endif
 
358
-#endif // !ZFCP_64_BIT
 
359
-
 
360
-#if ( (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,16)) \
 
361
-     || (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,17)) )
 
362
-void zfcp_panic(char *msg)
 
363
-{
 
364
-        unsigned long caller = (unsigned long) __builtin_return_address(0);
 
365
-        printk("%s\n",msg);
 
366
-        zfcp_smp_send_stop();
 
367
-        disabled_wait(caller);
 
368
-}
 
369
-#else
 
370
-void zfcp_panic(char *msg)
 
371
-{
 
372
-        panic("msg");
 
373
-}
 
374
-#endif
 
375
-
 
376
 
 
377
 static inline int zfcp_fsf_req_is_scsi_cmnd(zfcp_fsf_req_t *fsf_req)
 
378
 {
 
379
@@ -2396,7 +2360,7 @@
 
380
        debug_event(adapter->cmd_dbf, level, &scsi_cmnd, sizeof(unsigned long));
 
381
        if (fsf_req) {
 
382
                debug_event(adapter->cmd_dbf, level, &fsf_req, sizeof(unsigned long));
 
383
-               debug_event(adapter->cmd_dbf, level, &fsf_req->seq_no, sizeof(unsigned long));
 
384
+               debug_event(adapter->cmd_dbf, level, &fsf_req->seq_no, sizeof(u32));
 
385
        } else  {
 
386
                debug_text_event(adapter->cmd_dbf, level, "");
 
387
                debug_text_event(adapter->cmd_dbf, level, "");
 
388
@@ -5748,7 +5712,7 @@
 
389
 
 
390
      /* add_map file */
 
391
      zfcp_data.add_map_proc_file=create_proc_entry(ZFCP_ADD_MAP_FILE, 
 
392
-                                            S_IFREG|S_IRUGO|S_IWUSR,
 
393
+                                            S_IFREG|S_IWUSR,
 
394
                                             zfcp_data.proc_dir);
 
395
      if (!zfcp_data.map_proc_file) {
 
396
              ZFCP_LOG_INFO("error: Allocation of proc-fs entry %s for module "
 
397
@@ -9817,7 +9781,7 @@
 
398
                                fsf_req->specific_magic,
 
399
                                (unsigned long)fsf_req);
 
400
                        retval = -EINVAL;
 
401
-                        //                        zfcp_panic("void of grace");
 
402
+                        //                        panic("void of grace");
 
403
                        goto out;
 
404
                }
 
405
 
 
406
@@ -10486,7 +10450,7 @@
 
407
                         debug_exception(adapter->erp_dbf,0,
 
408
                                         &fsf_req->qtcb->prefix.prot_status,
 
409
                                         sizeof(u32));
 
410
-                        //                        zfcp_panic("it was pity");
 
411
+                        //                        panic("it was pity");
 
412
                         zfcp_erp_adapter_shutdown(adapter, 0);
 
413
                        zfcp_cmd_dbf_event_fsf(
 
414
                                "undefps", fsf_req,
 
415
@@ -13038,7 +13002,7 @@
 
416
                         debug_text_event(fsf_req->adapter->erp_dbf,1,"fsf_s_phand_nv");
 
417
                         zfcp_erp_adapter_reopen(port->adapter, 0);
 
418
                         fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
 
419
-                        //                        zfcp_panic("for ralph");
 
420
+                        //                        panic("for ralph");
 
421
                        break;
 
422
 
 
423
         case FSF_PORT_BOXED :
 
424
@@ -13962,7 +13926,7 @@
 
425
                                unit->port->adapter->devno,
 
426
                                (llui_t)unit->port->wwpn,
 
427
                                (llui_t)unit->fcp_lun);
 
428
-                //                zfcp_panic("invalid sg_index");
 
429
+                //                panic("invalid sg_index");
 
430
                zfcp_erp_unit_shutdown(unit, 0);
 
431
                 retval=-EINVAL;
 
432
                 goto no_fit;
 
433
@@ -14531,7 +14495,7 @@
 
434
        scpnt->result |= COMMAND_COMPLETE << 8;
 
435
 
 
436
        /*
 
437
-        * copy SCSI status code of FCP_STATUS of FCP_RSP IU to ststus byte
 
438
+        * copy SCSI status code of FCP_STATUS of FCP_RSP IU to status byte
 
439
         * of result in SCSI command
 
440
         */
 
441
        scpnt->result |= fcp_rsp_iu->scsi_status;
 
442
@@ -14731,6 +14695,70 @@
 
443
        }
 
444
 
 
445
 skip_fsfstatus:
 
446
+#if 0
 
447
+       /*
 
448
+        * This nasty chop at the problem is not working anymore
 
449
+        * as we do not adjust the retry count anylonger in order
 
450
+        * to have a number of retries that avoids I/O errors.
 
451
+        * The manipulation of the retry count has been removed
 
452
+        * in favour of a safe tape device handling. We must not
 
453
+        * sent SCSI commands more than once to a device if no
 
454
+        * retries are permitted by the high level driver. Generally
 
455
+        * speaking, it was a mess to change retry counts. So it is
 
456
+        * fine that this sort of workaround is gone.
 
457
+        * Then, we had to face a certain number of immediate retries in case of
 
458
+        * busy and queue full conditions (see below).
 
459
+        * This is not acceptable
 
460
+        * for the latter. Queue full conditions are used
 
461
+        * by devices to indicate to a host that the host can rely
 
462
+        * on the completion (or timeout) of at least one outstanding
 
463
+        * command as a suggested trigger for command retries.
 
464
+        * Busy conditions require a different trigger since
 
465
+        * no commands are outstanding for that initiator from the
 
466
+        * devices perspective.
 
467
+        * The drawback of mapping a queue full condition to a
 
468
+        * busy condition is the chance of wasting all retries prior
 
469
+        * to the time when the device indicates that a command
 
470
+        * rejected due to a queue full condition should be re-driven.
 
471
+        * This case would lead to unnecessary I/O errors that
 
472
+        * have to be considered fatal if for example ext3's
 
473
+        * journaling would be torpedoed by such an avoidable
 
474
+        * I/O error.
 
475
+        * So, what issues are there with not mapping a queue-full
 
476
+        * condition to a busy condition?
 
477
+        * Due to the 'exclusive LUN'
 
478
+        * policy enforced by the zSeries FCP channel, this 
 
479
+        * Linux instance is the only initiator with regard to
 
480
+        * this adapter. It is safe to rely on the information
 
481
+        * 'don't disturb me now ... and btw. no other commands
 
482
+        * pending for you' (= queue full) sent by the LU,
 
483
+        * since no other Linux can use this LUN via this adapter
 
484
+        * at the same time. If there is a potential race
 
485
+        * introduced by the FCP channel by not inhibiting Linux A
 
486
+        * to give up a LU with commands pending while Linux B
 
487
+        * grabs this LU and sends commands  - thus providing
 
488
+        * an exploit at the 'exclusive LUN' policy - then this
 
489
+        * issue has to be considered a hardware problem. It should
 
490
+        * be tracked as such if it really occurs. Even if the
 
491
+        * FCP Channel spec. begs exploiters to wait for the
 
492
+        * completion of all request sent to a LU prior to
 
493
+        * closing this LU connection.
 
494
+        * This spec. statement in conjunction with
 
495
+        * the 'exclusive LUN' policy is not consistent design.
 
496
+        * Another issue is how resource constraints for SCSI commands
 
497
+        * might be handled by the FCP channel (just guessing for now).
 
498
+        * If the FCP channel would always map resource constraints,
 
499
+        * e.g. no free FC exchange ID due to I/O stress caused by
 
500
+        * other sharing Linux instances, to faked queue-full
 
501
+        * conditions then this would be a misinterpretation and
 
502
+        * violation of SCSI standards.
 
503
+        * If there are SCSI stack races as indicated below
 
504
+        * then they need to be fixed just there.
 
505
+        * Providing all issue above are not applicable or will
 
506
+        * be fixed appropriately, removing the following hack
 
507
+        * is the right thing to do.
 
508
+        */
 
509
+
 
510
        /*
 
511
         * Note: This is a rather nasty chop at the problem. We cannot 
 
512
         * risk adding to the mlqueue however as this will block the 
 
513
@@ -14746,6 +14774,7 @@
 
514
                scpnt->result &= ~(QUEUE_FULL << 1);
 
515
                scpnt->result |= (BUSY << 1);
 
516
        }
 
517
+#endif
 
518
 
 
519
         ZFCP_LOG_DEBUG("scpnt->result =0x%x\n",
 
520
                        scpnt->result);
 
521
@@ -19615,6 +19644,7 @@
 
522
 
 
523
        switch (erp_action->step) {
 
524
 
 
525
+               /* FIXME: the ULP spec. begs for waiting for oustanding commands */
 
526
                case ZFCP_ERP_STEP_UNINITIALIZED :
 
527
                        zfcp_erp_port_strategy_clearstati(port);
 
528
                        /*
 
529
@@ -19680,6 +19710,7 @@
 
530
 
 
531
        switch (erp_action->step) {
 
532
 
 
533
+               /* FIXME: the ULP spec. begs for waiting for oustanding commands */
 
534
                case ZFCP_ERP_STEP_UNINITIALIZED :
 
535
                        zfcp_erp_port_strategy_clearstati(port);
 
536
                        if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status)) {
 
537
@@ -20242,6 +20273,7 @@
 
538
 
 
539
        switch (erp_action->step) {
 
540
 
 
541
+               /* FIXME: the ULP spec. begs for waiting for oustanding commands */
 
542
                case ZFCP_ERP_STEP_UNINITIALIZED :
 
543
                        zfcp_erp_unit_strategy_clearstati(unit);
 
544
                        if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status)) {
 
545
diff -ruN linux-2.4.19/include/asm-s390/pgalloc.h linux-2.3/include/asm-s390/pgalloc.h
 
546
--- linux-2.4.19/include/asm-s390/pgalloc.h     Tue Mar 11 17:06:03 2003
 
547
+++ linux-2.3/include/asm-s390/pgalloc.h        Thu Feb 13 17:57:42 2003
 
548
@@ -240,7 +240,7 @@
 
549
        if (mm->cpu_vm_mask != (1UL << smp_processor_id())) {
 
550
                /* mm was active on more than one cpu. */
 
551
                if (mm == current->active_mm &&
 
552
-                   atomic_read(&mm->mm_count) == 1)
 
553
+                   atomic_read(&mm->mm_users) == 1)
 
554
                        /* this cpu is the only one using the mm. */
 
555
                        mm->cpu_vm_mask = 1UL << smp_processor_id();
 
556
                global_flush_tlb();
 
557
diff -ruN linux-2.4.19/include/asm-s390x/pgalloc.h linux-2.3/include/asm-s390x/pgalloc.h
 
558
--- linux-2.4.19/include/asm-s390x/pgalloc.h    Tue Mar 11 17:06:03 2003
 
559
+++ linux-2.3/include/asm-s390x/pgalloc.h       Thu Feb 13 17:57:42 2003
 
560
@@ -269,7 +269,7 @@
 
561
        if (mm->cpu_vm_mask != (1UL << smp_processor_id())) {
 
562
                /* mm was active on more than one cpu. */
 
563
                if (mm == current->active_mm &&
 
564
-                   atomic_read(&mm->mm_count) == 1)
 
565
+                   atomic_read(&mm->mm_users) == 1)
 
566
                        /* this cpu is the only one using the mm. */
 
567
                        mm->cpu_vm_mask = 1UL << smp_processor_id();
 
568
                global_flush_tlb();
 
569
diff -ruN linux-2.4.19/mm/mmap.c linux-2.3/mm/mmap.c
 
570
--- linux-2.4.19/mm/mmap.c      Thu Aug  8 13:23:22 2002
 
571
+++ linux-2.3/mm/mmap.c Fri Feb  7 15:35:47 2003
 
572
@@ -900,6 +900,8 @@
 
573
                break;
 
574
        }
 
575
 no_mmaps:
 
576
+       if (last < first)
 
577
+               return;
 
578
        /*
 
579
         * If the PGD bits are not consecutive in the virtual address, the
 
580
         * old method of shifting the VA >> by PGDIR_SHIFT doesn't work.