aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/s390/cds.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/s390/cds.txt')
-rw-r--r--Documentation/s390/cds.txt64
1 files changed, 30 insertions, 34 deletions
diff --git a/Documentation/s390/cds.txt b/Documentation/s390/cds.txt
index d80e5733827d..05a2b4f7e38f 100644
--- a/Documentation/s390/cds.txt
+++ b/Documentation/s390/cds.txt
@@ -98,7 +98,7 @@ The following chapters describe the I/O related interface routines the
98Linux/390 common device support (CDS) provides to allow for device specific 98Linux/390 common device support (CDS) provides to allow for device specific
99driver implementations on the IBM ESA/390 hardware platform. Those interfaces 99driver implementations on the IBM ESA/390 hardware platform. Those interfaces
100intend to provide the functionality required by every device driver 100intend to provide the functionality required by every device driver
101implementaion to allow to drive a specific hardware device on the ESA/390 101implementation to allow to drive a specific hardware device on the ESA/390
102platform. Some of the interface routines are specific to Linux/390 and some 102platform. Some of the interface routines are specific to Linux/390 and some
103of them can be found on other Linux platforms implementations too. 103of them can be found on other Linux platforms implementations too.
104Miscellaneous function prototypes, data declarations, and macro definitions 104Miscellaneous function prototypes, data declarations, and macro definitions
@@ -114,7 +114,7 @@ the ESA/390 architecture has implemented a so called channel subsystem, that
114provides a unified view of the devices physically attached to the systems. 114provides a unified view of the devices physically attached to the systems.
115Though the ESA/390 hardware platform knows about a huge variety of different 115Though the ESA/390 hardware platform knows about a huge variety of different
116peripheral attachments like disk devices (aka. DASDs), tapes, communication 116peripheral attachments like disk devices (aka. DASDs), tapes, communication
117controllers, etc. they can all by accessed by a well defined access method and 117controllers, etc. they can all be accessed by a well defined access method and
118they are presenting I/O completion a unified way : I/O interruptions. Every 118they are presenting I/O completion a unified way : I/O interruptions. Every
119single device is uniquely identified to the system by a so called subchannel, 119single device is uniquely identified to the system by a so called subchannel,
120where the ESA/390 architecture allows for 64k devices be attached. 120where the ESA/390 architecture allows for 64k devices be attached.
@@ -174,14 +174,10 @@ read_dev_chars() - Read Device Characteristics
174 174
175This routine returns the characteristics for the device specified. 175This routine returns the characteristics for the device specified.
176 176
177The function is meant to be called with an irq handler in place; that is, 177The function is meant to be called with the device already enabled; that is,
178at earliest during set_online() processing. 178at earliest during set_online() processing.
179 179
180While the request is processed synchronously, the device interrupt 180The ccw_device must not be locked prior to calling read_dev_chars().
181handler is called for final ending status. In case of error situations the
182interrupt handler may recover appropriately. The device irq handler can
183recognize the corresponding interrupts by the interruption parameter be
1840x00524443. The ccw_device must not be locked prior to calling read_dev_chars().
185 181
186The function may be called enabled or disabled. 182The function may be called enabled or disabled.
187 183
@@ -342,7 +338,7 @@ DOIO_REPORT_ALL - report all interrupt conditions
342The ccw_device_start() function returns : 338The ccw_device_start() function returns :
343 339
344 0 - successful completion or request successfully initiated 340 0 - successful completion or request successfully initiated
345-EBUSY - The device is currently processing a previous I/O request, or ther is 341-EBUSY - The device is currently processing a previous I/O request, or there is
346 a status pending at the device. 342 a status pending at the device.
347-ENODEV - cdev is invalid, the device is not operational or the ccw_device is 343-ENODEV - cdev is invalid, the device is not operational or the ccw_device is
348 not online. 344 not online.
@@ -365,7 +361,7 @@ first:
365-EIO: the common I/O layer terminated the request due to an error state 361-EIO: the common I/O layer terminated the request due to an error state
366 362
367If the concurrent sense flag in the extended status word in the irb is set, the 363If the concurrent sense flag in the extended status word in the irb is set, the
368field irb->scsw.count describes the numer of device specific sense bytes 364field irb->scsw.count describes the number of device specific sense bytes
369available in the extended control word irb->scsw.ecw[0]. No device sensing by 365available in the extended control word irb->scsw.ecw[0]. No device sensing by
370the device driver itself is required. 366the device driver itself is required.
371 367
@@ -410,30 +406,11 @@ individual flag meanings.
410 406
411Usage Notes : 407Usage Notes :
412 408
413Prior to call ccw_device_start() the device driver must assure disabled state, 409ccw_device_start() must be called disabled and with the ccw device lock held.
414i.e. the I/O mask value in the PSW must be disabled. This can be accomplished
415by calling local_save_flags( flags). The current PSW flags are preserved and
416can be restored by local_irq_restore( flags) at a later time.
417
418If the device driver violates this rule while running in a uni-processor
419environment an interrupt might be presented prior to the ccw_device_start()
420routine returning to the device driver main path. In this case we will end in a
421deadlock situation as the interrupt handler will try to obtain the irq
422lock the device driver still owns (see below) !
423
424The driver must assure to hold the device specific lock. This can be
425accomplished by
426
427(i) spin_lock(get_ccwdev_lock(cdev)), or
428(ii) spin_lock_irqsave(get_ccwdev_lock(cdev), flags)
429
430Option (i) should be used if the calling routine is running disabled for
431I/O interrupts (see above) already. Option (ii) obtains the device gate und
432puts the CPU into I/O disabled state by preserving the current PSW flags.
433 410
434The device driver is allowed to issue the next ccw_device_start() call from 411The device driver is allowed to issue the next ccw_device_start() call from
435within its interrupt handler already. It is not required to schedule a 412within its interrupt handler already. It is not required to schedule a
436bottom-half, unless an non deterministically long running error recovery procedure 413bottom-half, unless a non deterministically long running error recovery procedure
437or similar needs to be scheduled. During I/O processing the Linux/390 generic 414or similar needs to be scheduled. During I/O processing the Linux/390 generic
438I/O device driver support has already obtained the IRQ lock, i.e. the handler 415I/O device driver support has already obtained the IRQ lock, i.e. the handler
439must not try to obtain it again when calling ccw_device_start() or we end in a 416must not try to obtain it again when calling ccw_device_start() or we end in a
@@ -454,7 +431,7 @@ information prior to device-end the device driver urgently relies on. In this
454case all I/O interruptions are presented to the device driver until final 431case all I/O interruptions are presented to the device driver until final
455status is recognized. 432status is recognized.
456 433
457If a device is able to recover from asynchronosly presented I/O errors, it can 434If a device is able to recover from asynchronously presented I/O errors, it can
458perform overlapping I/O using the DOIO_EARLY_NOTIFICATION flag. While some 435perform overlapping I/O using the DOIO_EARLY_NOTIFICATION flag. While some
459devices always report channel-end and device-end together, with a single 436devices always report channel-end and device-end together, with a single
460interrupt, others present primary status (channel-end) when the channel is 437interrupt, others present primary status (channel-end) when the channel is
@@ -488,7 +465,7 @@ int ccw_device_resume(struct ccw_device *cdev);
488 465
489cdev - ccw_device the resume operation is requested for 466cdev - ccw_device the resume operation is requested for
490 467
491The resume_IO() function returns: 468The ccw_device_resume() function returns:
492 469
493 0 - suspended channel program is resumed 470 0 - suspended channel program is resumed
494-EBUSY - status pending 471-EBUSY - status pending
@@ -507,6 +484,8 @@ a long-running channel program or the device might require to initially issue
507a halt subchannel (HSCH) I/O command. For those purposes the ccw_device_halt() 484a halt subchannel (HSCH) I/O command. For those purposes the ccw_device_halt()
508command is provided. 485command is provided.
509 486
487ccw_device_halt() must be called disabled and with the ccw device lock held.
488
510int ccw_device_halt(struct ccw_device *cdev, 489int ccw_device_halt(struct ccw_device *cdev,
511 unsigned long intparm); 490 unsigned long intparm);
512 491
@@ -517,7 +496,7 @@ intparm : interruption parameter; value is only used if no I/O
517 496
518The ccw_device_halt() function returns : 497The ccw_device_halt() function returns :
519 498
520 0 - successful completion or request successfully initiated 499 0 - request successfully initiated
521-EBUSY - the device is currently busy, or status pending. 500-EBUSY - the device is currently busy, or status pending.
522-ENODEV - cdev invalid. 501-ENODEV - cdev invalid.
523-EINVAL - The device is not operational or the ccw device is not online. 502-EINVAL - The device is not operational or the ccw device is not online.
@@ -533,6 +512,23 @@ can then perform an appropriate action. Prior to interrupt of an outstanding
533read to a network device (with or without PCI flag) a ccw_device_halt() 512read to a network device (with or without PCI flag) a ccw_device_halt()
534is required to end the pending operation. 513is required to end the pending operation.
535 514
515ccw_device_clear() - Terminage I/O Request Processing
516
517In order to terminate all I/O processing at the subchannel, the clear subchannel
518(CSCH) command is used. It can be issued via ccw_device_clear().
519
520ccw_device_clear() must be called disabled and with the ccw device lock held.
521
522int ccw_device_clear(struct ccw_device *cdev, unsigned long intparm);
523
524cdev: ccw_device the clear operation is requested for
525intparm: interruption parameter (see ccw_device_halt())
526
527The ccw_device_clear() function returns:
528
529 0 - request successfully initiated
530-ENODEV - cdev invalid
531-EINVAL - The device is not operational or the ccw device is not online.
536 532
537Miscellaneous Support Routines 533Miscellaneous Support Routines
538 534