Termination of Input/Output Operations
When the operation or sequence of operations initiated
by START I/O is terminated, the channel and the device
generate status conditions. These conditions can be
brought to the attention of the program by the I/O interruption mechanism, by TEST I/O, or, in certain
cases, by START I/O. The status conditions, as well as
an address and a count indicating the extent of the op­
eration sequence, are presented to the program in the
form of a csw.
Types of Termination
Normally an I/O operation at the subchannellasts until
the device signals channel end. The channel-end con­
dition can be signaled during the sequence initiating
the operation, or later. When the channel detects
equipment malfunctioning or a system reset is per­
formed, the channel disconnects the device without
receiving channel end. The program can force a de­
vice on the selector channel to be disconnected pre­
maturely by issuing HALT I/O. Termination at Operation Initiation
After the addressed channel and subchannel have been
verified to be in a state where START I/O can be exe­
cuted, certain tests are performed on the validity of
the information specified by the program and on the
availability of the addressed control unit and I/O de­
vice. This testing occurs both during the execution of START I/O and during command chaining.
A data-transfer operation is initiated at the subchan­
nel and device only when no programming or equip­
ment errors are detected by the channel and when the
device responds with zero status during the initiation
sequence. When the channel detects or the device sig­
nals any unusual condition during the initiation of an
operation, but channel end is off, the command is said
to be rejected.
Rejection of the command during the execution of START I/O is indicated by the setting of the condition
code in the psw. Unless the device is not operational,
the conditions that precluded the initiation are de­
tailed by the portion of the csw stored by START I/O. The device is not started, no interruption conditions
are generated, and the subchannel is not tied up be­
yond the initiation sequence. The device is immedi­
ately available for the initiation of another operation,
provided the command was not rejected because of
the busy or non-operational condition.
When an unusual condition causes a command to be
rejected during initiation of an I/O operation by com­
mand chaining, an interruption condition is generated,
and the subchannel is not available until the condition
is cleared. The not-operational state on command
chaining is indicated by means of interface control
check; the other conditions are identified by the cor­
responding status bits in the associated csw. The new
operation at the I/O device is not started.
Immediate Operations
Instcad of accepting or rejecting a command, the I/O device can signal the channel-end condition immedi­
atcly upon receipt of the command code. An I/O op­
eration causing the channel-end condition to be sig­
nalcd during the initiation sequence is called an "immediate operation." When the first ccw designated by the CAW initiates
an immediate operation, no interruption condition is
generated. If no command chaining occurs, the chan­
nel-end condition is brought to the attention of the
program by causing START I/O to store the csw status
portion, and the subchannel is immediately made avail­
able to the program. The I/O operation, however, is
initiated, and, if channel-end is not accompanied by
device end, the devicc remains busy. Device end, when
subsequently provided by the device, causes an inter­
ruption condition to be generated.
When command chaining is specified after an im­
mediate operation and no unusual conditions have
been detected during the execution, START I/O does not
cause storing of csw status. The subsequent commands
in the chain are handled normally, and the channel-end
condition for the last operation generates an inter­
ruption condition even if the device provides the sig­
nal immediately upon receipt of the command code.
Whenever immediate completion of an I/O oper­
ation is signaled, no data have been transferred to or
from the device. The data address in the ccw is not
checked for validity, except that it may not exceed
the addressing capacity of the model. Since a count of zero is not valid, any ccw specifying
an immediate operation must contain a nonzero count.
When an immediate operation is executed, however,
incorrect length is not indicated to the program, and
command chaining is not suppressed.
Input / Output Interruptions
Input/output interruptions provide a means for the CPU to change its state in response to conditions that
occur in I/O devices or channels. These conditions can
be caused by the program or by an external event at
the device.
Interruption Conditions
The conditions causing requests for I/O interruptions
to be initiated are called interruption conditions. An
interruption condition can be brought to the attention
of the program only once and is cleared when it causes
an interruption. Alternatively, an interruption con­
dition can be cleared by TEST I/O, and conditions gen­
erated by the I/O device following the termination of
the operation at the subchannel can be cleared by
START I/O. The latter include the attention, device-end,
and control-unit-end conditions, and the channel-end
condition when provided by a device on the selector
channel after termination of the operation by HALT I/O. The device initiates a request to the channel for an
interruption whenever it detects any of the following
Channel end
Control unit end
Device end
Attention Unit check Unit exception
When command chaining is specified and is not sup­
pressed because of error conditions, channel end and
device end do not cause interruption conditions and
are not made available to the program. Unit-check and
unit-exception conditions cause interruption to be re­
quested only when the conditions are detected during
the initiation of a chained command. Once the com­
mand has been accepted by the device, unit check
and unit exception do not occur in the absence of
channel end, control unit end, or device end.
When the channel detects any of the following con­
ditions, it initiates a request for an I/O interruption
without having received the status byte from the de­
vice: PCI flag in a ccw.
Execution of HALT I/O on selector channel.
The interruption conditions from the channel can be
accompanied by other channel status indications, but
none of the device status bits is on when the channel
initiates the interruption.
A request for an I/O interruption due to a program­
check condition detected during command chaining
(such as invalid command code, count of zero, or two
sequential transfer-in-channel commands) may be ini­
tiated either by the I/O device or by the channel, de-
pending on the type of channel. To stack the inter­
ruption condition in the device, as occurs on the
multiplexor channel, the channel signals the device to
respond with a unit-status byte consisting of all zeros
on a subsequent scan for interruption conditions. The
error indication is preserved in the subchannel.
The method of processing a request for interruption
due to equipment malfunctioning, as indicated by the
presence of the channel-control-check and interface­
control-check conditions, depends on the model.
More than one interruption condition can be cleared
concurrently. As an example, when the PCI condition
exists in the subchannel at the termination of an oper­
ation, the PCI condition is indicated with channel end
and only one I/O interruption occurs, or only one TEST I/O is needed. Similarly, if the channel-end condition
is not cleared until device end is generated, both con­
ditions may be indicated in the csw and cleared at
the device concurrently.
However, at the time the channel assigns highest
priority for interruptions to a condition associated with
an operation at the subehannel, the channel accepts
the status from the device and clears the condition at
the device. The interruption condition is subsequently
preserved in the snbchannel. Any subsequent status
generated by the device is not included with the con­
dition at the suhchannel, even if the status is generated
before the CPU accepts the condition.
Priority of Interruptions
All requests for I/O interruption are asynchronous to
the activity in the CPU, and interruption conditions as­
sociated with more than one I/O device can exist at
the same time. The priority among requests is con­
trolled by two types of mechanisms -one establishes
the priority among interruption conditions associated
with devices attached to the same channel, and another
establishes priority among requests from different
channels. A channel requests an I/O interruption only
after it has established priority among requests from
its devices. The conditions responsible for the requests
are preserved in the dcvices or channels until accepted
by the CPU. Assignment of priority to requests for interruption
associated with devices on anyone channel is a func­
tion of the type of interruption condition and the po­
sition of the device on the I/O interface cable.
The selector channel assigns the highest priority to
conditions associated with the portion of the operation
in which the channel is involved. These conditions in­
clude channel end, program-controlled interruptions,
errors detected or command chaining, and execution
of HALT I/O in the channel. The channel cannot handle Input/Output Operations 105
Previous Page Next Page