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
5
* Bugreports.to..: <Linux390@de.ibm.com>
6
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
8
- * $Revision: 1.234.2.35 $
9
+ * $Revision: 1.234.2.39 $
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 )
16
#ifdef CONFIG_ARCH_S390X
19
int count = cp->count;
21
- if (set_normalized_cda (cp, address)!=-ENOMEM) {
23
+ rc = set_normalized_cda (cp, address);
28
+ /* check if emergency buffers already in use for other request */
29
if ((device->lowmem_cqr!=NULL ) &&
30
(device->lowmem_cqr!=request) ) {
32
@@ -1336,9 +1339,10 @@
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 "
50
device->lowmem_cqr=request;
52
+ /* print message if called the first time for the request */
53
if (device->lowmem_idal_ptr == device->lowmem_idals) {
55
DBF_DEV_EVENT (DBF_WARNING, device,
56
@@ -1356,12 +1361,18 @@
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 ) {
66
+ if ((device->lowmem_idal_ptr + nridaws * sizeof(unsigned long)) >
67
+ (device->lowmem_idals + PAGE_SIZE ) ) {
68
/* Ouch! No Idals left for emergency request */
72
+ /* fill the idals table */
73
cp->flags |= CCW_FLAG_IDA;
74
cp->cda = (__u32)(unsigned long)device->lowmem_idal_ptr;
76
@@ -2325,7 +2336,22 @@
77
"Status without sense (IFCC,...) CS/DS %04x flag %08x",
78
((stat->cstat<<8)|stat->dstat),
80
- era = dasd_era_recover;
81
+ /* we got no sense data, therefore we just retry */
82
+ check_then_set (&cqr->status,
85
+ dasd_schedule_bh(device);
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,
95
+ dasd_schedule_bh(device);
100
@@ -3596,9 +3622,6 @@
104
- DBF_EVENT (DBF_NOTICE,
105
- "called for devno %04x",
110
@@ -3940,18 +3963,17 @@
111
s390irq_spin_lock_irqsave (device->devinfo.irq,
113
rc = device->discipline->start_IO (device->init_cqr);
115
+ device->level = DASD_STATE_INIT;
116
s390irq_spin_unlock_irqrestore(device->devinfo.irq,
120
- device->level = DASD_STATE_INIT;
125
rc = dasd_state_init_to_ready ( device );
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
136
* Bugreports.to..: <Linux390@de.ibm.com>
137
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
139
- * $Revision: 1.82.6.8 $
140
+ * $Revision: 1.82.6.9 $
142
* History of changes (starts July 2000)
143
* 07/11/00 Enabled rotational position sensing
145
data->ep_sys_time = get_clock ();
147
de_ccw->count = sizeof (DE_eckd_data_t);
148
- de_ccw->flags = CCW_FLAG_SLI;
149
+ de_ccw->flags |= CCW_FLAG_SLI;
153
@@ -1012,14 +1012,14 @@
154
switch (fdata->intensity & ~0x08) {
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,
162
last_ccw->flags |= CCW_FLAG_CC;
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)) {
170
@@ -1034,7 +1034,7 @@
171
last_ccw->flags |= CCW_FLAG_CC;
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)) {
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
183
* Bugreports.to..: <Linux390@de.ibm.com>
184
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
186
- * $Revision: 1.20.2.6 $
187
+ * $Revision: 1.20.2.8 $
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
196
* drivers/s390/s390io.c
197
* S/390 common I/O routines
198
- * $Revision: 1.171.2.34 $
199
+ * $Revision: 1.171.2.39 $
202
* Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH,
203
@@ -3735,12 +3735,15 @@
204
CIO_TRACE_EVENT (4, "VMvdinf");
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);
210
p_diag_data = alloc_bootmem_low (sizeof (diag210_t));
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) {
223
kmalloc (ioinfo[irq]->senseid.ciw[ciw_cnt].
225
+ count, GFP_DMA | GFP_ATOMIC);
228
alloc_bootmem_low (ioinfo[irq]->senseid.
229
@@ -4989,9 +4992,11 @@
230
alloc_bootmem_low (sizeof (ioinfo_t));
232
ioinfo[irq] = (ioinfo_t *)
233
- kmalloc (sizeof (ioinfo_t), GFP_DMA);
234
+ kmalloc (sizeof (ioinfo_t), GFP_DMA | GFP_ATOMIC);
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);
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);
249
sense_ccw = alloc_bootmem_low (2 * sizeof (ccw1_t));
253
+ s390irq_spin_unlock (irq);
255
+ free_irq (irq, &devstat);
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);
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);
268
spid_ccw = alloc_bootmem_low (2 * sizeof (ccw1_t));
272
+ s390irq_spin_unlock_irqrestore(irq, flags);
274
+ free_irq(irq, pdevstat);
278
spid_ccw[0].cmd_code = CCW_CMD_SUSPEND_RECONN;
280
@@ -6398,13 +6415,32 @@
281
ioinfo[irq]->ui.flags.unfriendly = 0; /* assume it's friendly... */
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);
289
snid_ccw = alloc_bootmem_low (sizeof (ccw1_t));
290
tmp_pgid = alloc_bootmem_low (sizeof (pgid_t));
293
+ if (!snid_ccw || !tmp_pgid) {
295
+ if (init_IRQ_complete)
298
+ free_bootmem((unsigned long) snid_ccw, sizeof(ccw1_t));
301
+ if (init_IRQ_complete)
304
+ free_bootmem((unsigned long) tmp_pgid, sizeof(pgid_t));
306
+ s390irq_spin_unlock_irqrestore(irq, flags);
308
+ free_irq (irq, pdevstat);
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
319
- if (pgid->inf.ps.state2 ==
320
+ if (tmp_pgid->inf.ps.state2 ==
321
SNID_STATE2_RESVD_ELSE) {
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
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 $"
334
#define ZFCP_QTCB_VERSION FSF_QTCB_CURRENT_VERSION
336
@@ -2301,42 +2301,6 @@
338
#endif //ZFCP_CAUSE_ERRORS
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
345
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,16))
346
-void (*zfcp_smp_send_stop)(void) = (void *)0x00000000001b400;
348
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,17))
349
-void (*zfcp_smp_send_stop)(void) = (void *)0x000000000001c88c;
351
-#else // !ZFCP_64BIT
352
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,16))
353
-void (*zfcp_smp_send_stop)(void) = (void *)0x8001aab8;
355
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,17))
356
-void (*zfcp_smp_send_stop)(void) = (void *)0x8001b3a0;
358
-#endif // !ZFCP_64_BIT
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)
364
- unsigned long caller = (unsigned long) __builtin_return_address(0);
365
- printk("%s\n",msg);
366
- zfcp_smp_send_stop();
367
- disabled_wait(caller);
370
-void zfcp_panic(char *msg)
377
static inline int zfcp_fsf_req_is_scsi_cmnd(zfcp_fsf_req_t *fsf_req)
379
@@ -2396,7 +2360,7 @@
380
debug_event(adapter->cmd_dbf, level, &scsi_cmnd, sizeof(unsigned long));
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));
386
debug_text_event(adapter->cmd_dbf, level, "");
387
debug_text_event(adapter->cmd_dbf, level, "");
388
@@ -5748,7 +5712,7 @@
391
zfcp_data.add_map_proc_file=create_proc_entry(ZFCP_ADD_MAP_FILE,
392
- S_IFREG|S_IRUGO|S_IWUSR,
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);
401
- // zfcp_panic("void of grace");
402
+ // panic("void of grace");
406
@@ -10486,7 +10450,7 @@
407
debug_exception(adapter->erp_dbf,0,
408
&fsf_req->qtcb->prefix.prot_status,
410
- // zfcp_panic("it was pity");
411
+ // panic("it was pity");
412
zfcp_erp_adapter_shutdown(adapter, 0);
413
zfcp_cmd_dbf_event_fsf(
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");
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);
433
@@ -14531,7 +14495,7 @@
434
scpnt->result |= COMMAND_COMPLETE << 8;
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
441
scpnt->result |= fcp_rsp_iu->scsi_status;
442
@@ -14731,6 +14695,70 @@
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
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.
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);
519
ZFCP_LOG_DEBUG("scpnt->result =0x%x\n",
521
@@ -19615,6 +19644,7 @@
523
switch (erp_action->step) {
525
+ /* FIXME: the ULP spec. begs for waiting for oustanding commands */
526
case ZFCP_ERP_STEP_UNINITIALIZED :
527
zfcp_erp_port_strategy_clearstati(port);
529
@@ -19680,6 +19710,7 @@
531
switch (erp_action->step) {
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 @@
539
switch (erp_action->step) {
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
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();
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
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();
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
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.