History log of /drivers/s390/cio/device_fsm.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
50c8e31f38f380f04885c66bde0bc4c946e786ee 01-Dec-2011 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: provide fake irb for transport mode IO

If a driver wants to do command mode IO while CIO is doing
online path verification we ignore this request and provide
a fake irb when we are done and the driver can do IO again.

For transport mode IO we have no such mechanism, giving the
driver no other chance then to retry the action until we are
done. This is not very reliable.

Provide a fake irb for transport mode IO as well.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
7712f83aa904fef0d7d6e5ba7684c3272bddbb19 23-May-2011 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] get rid of unused variables

Remove trivially unused variables as detected with -Wunused-but-set-variable.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
9bf05098ce34e68a9e15f09ad6cdfea4ed64057a 23-May-2011 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: fix unreg race in set_online path

In ccw_device_set_online we basically start path verification and
wait for the device to reach a final state. If it turns out that the
device has no useable path we schedule the deregistration of the
device (which is still in an non-final state) and wake up the waiting
process. The deregistration process will set a final state, but if
the wake up happens to be prior to this, the device will hang forever
in ccw_device_set_online.

To fix this just set the final NOT_OPER state prior to the scheduled
deregistration of the device.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
25985edcedea6396277003854657b5f3cb31a628 31-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi> Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
/drivers/s390/cio/device_fsm.c
376ae4752e3a387d41a2ba9c9ea45c2df625e6e4 25-Oct-2010 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: fix I/O cancel function

Function ccw_device_cancel_halt_clear may cause an unexpected kernel
panic if a clear function is currently active at the subchannel for
which it is called. In that case, the iretry counter used to determine
the number of retries is never initialized, leading to an immediate
failure of the function which results in a kernel panic.

Fix this by initializing the iretry counter when the function is
first called. Also replace the kernel panic with a return code: a
single malfunctioning I/O device should not automatically cause a
system-wide kernel panic.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
585b954e1f2fa325d425b0786e4525ac7c9ae575 25-Oct-2010 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: notify drivers of channel path events

This patch adds a notification mechanism to inform ccw drivers
about changes to channel paths, which occured while the device
is online.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
8821d24cd261aede9b0436cd3252b17a60ccc33a 22-Apr-2010 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: use exception-save stsch

Using stsch on schids with ssid != 0 can lead to an operand
exception. Use stsch_err to handle potential exceptions
if we fail to reenable mss after hibernation.

Cc: <stable@kernel.org>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
cbb870c8221147ae337612e04b2bb0211f31a74b 26-Feb-2010 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Cleanup struct _lowcore usage and defines.

Use asm offsets to make sure the offset defines to struct _lowcore and
its layout don't get out of sync.
Also add a BUILD_BUG_ON() which checks that the size of the structure
is sane.
And while being at it change those sites which use odd casts to access
the current lowcore. These should use S390_lowcore instead.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
76e6fb4b86446e4605379b99ad3dd3f96bb1696f 26-Feb-2010 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] ccw_device_notify: improve return codes

Callers of ccw_device_notify could not distinguish between a driver
who has no notifier registered and a driver who doesn't want to keep
a device after a certain event. Change this by adding proper return
codes.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
ec64333c3a9bc52e34d79cff23acf4e5764b1353 07-Dec-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: handle failed disable_subchannel after device recognition

Handle a failing cio_disable_subchannel at the end of our device
recognition as if the recognition itself failed. This way
subsequent registration steps do not need to handle enabled
subchannels.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
56e6b796fe9b99287648fc5686aae00106b37bab 07-Dec-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: fix quiesce state

DEV_STATE_QUIESCE is used to stop all IO on a busy subchannel.
This patch fixes the following problems related to the QUIESCE
state:

* Fix a potential race condition which could occur when the
resulting state was DEV_STATE_OFFLINE.

* Add missing locking around cio_disable_subchannel,
ccw_device_cancel_halt_clear and the cdev's handler.

* Loop until we know for sure that the subchannel is disabled.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
d7d12ef2befac4fed0dccaddff11338b654804df 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: make steal lock procedure more robust

An Unconditional Reserve + Release operation (steal lock) for a
boxed device may fail when encountering special error cases
(e.g. unit checks or path errors). Fix this by using the more
robust ccw_request infrastructure for performing the steal lock
CCW program.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
52ef0608e3ee4a511725e443c4b572fece22b353 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: use sense-pgid operation for path verification

Set-pgid operations fail for some device types under z/VM for which
the hypervisor has already set the pgid. Also reserved devices or
changed pgids are not correctly recognized. Fix these problems by
using a combination of sense-pgid and set-pgid and by also accepting
pre-defined pgid settings.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
454e1fa1ebae7cff707b2e3f12b775c263c8408b 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: split PGID settings and status

Split setting (driver wants feature enabled) and status (feature
setup was successful) for PGID related ccw device features so that
setup errors can be detected. Previously, incorrectly handled setup
errors could in rare cases lead to erratic I/O behavior and
permanently unusuable devices.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
4257aaecffab77bad43e12057f56a5590b360f9f 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: remove intretry flag

After changing all internal I/O functions to use the newly introduced
ccw request infrastructure, retries are handled automatically after a
clear operation. Therefore remove the internal retry flag and
associated code.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
9679baaf85b6e4dc662160bbbca344287ea6580d 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: use ccw request infrastructure for pgid

Use the newly introduced ccw request infrastructure to implement
pgid related operations: sense pgid, set pgid and disband pg.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
39f5360b3d68a8e96d280481d9c442e7c005c317 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: use ccw request infrastructure for sense id

Use the newly introduced ccw request infrastructure to implement
the sense id operation.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
16b9a0571da4ee5cd15ca75e871722b0b5aee64d 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: dont panic in non-fatal conditions

Remove the call to BUG() for situations which are unexpected
but do not cause actual problems.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
7c4d964fa4e857d6fb6b63159a898a5c63c173bf 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: handle error during path verification consistently

Handle verification errors consistently through the existing
callback ccw_device_done to reduce cleanup code duplication.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
736b5db895eb900c108fe9e9b1659c171481169e 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: handle error during device recognition consistently

Remove the return code from ccw_device_recognition and handle
recognition errors through the existing callback
ccw_device_recog_done to reduce cleanup code duplication.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
37de53bb52908726c18fc84515792a5b2f454532 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: introduce ccw device todos

Introduce a central mechanism for performing delayed ccw device work
to ensure that different types of work do not overwrite each other.
Prioritization ensures that the most important work is always
performed while less important tasks are either obsoleted or repeated
later.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
5d6e6b6f6f3eac10a7f5a15e961bac3b36824d9d 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: introduce parent-initiated device move

Change the initiative to update subchannel-ccw device associations
to the subchannel: when there is an indication that the internal
association no longer reflects the current hardware state, mark
each affected subchannel as requiring attention. Once processing
reaches a subchannel, determine the correct association for that
subchannel at that time and perform the necessary device_move
operations.

This change fixes problems with the previous approach which would
leave devices in an inconsistent state when a new hardware change
occurred while a device_move was already scheduled.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
102e835d5152e4299c1d150d6481b9bd47095998 06-Oct-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: allow setting boxed devices offline

Allow users to set boxed devices offline. After setting them
offline, the device state will still be boxed.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
6afcc775d9d66fe550fad6c579f78b3c3da895b8 06-Oct-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: make not operational handling consistent

When a ccw device appears not operational, inform the associated
device driver and act according to the response: if the driver
wants to keep the device, put it into the disconnected state.
If not, or if there is no driver or if the device is not online,
unregister it. This approach is consistent with no-path event
handling.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
9a332116948955bd25d122efd91feed103f0e3e4 06-Oct-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: make disconnected handling consistent

When there is no path left to a ccw device, inform the associated
device driver and act according to the response: if the driver
wants to keep the device, put it into the disconnected state.
If not, or if there is no driver or if the device is not online,
unregister it.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
217ee6c64a9589bc5ad4d1c88136fc359d17930b 11-Sep-2009 Michael Ernst <mernst@de.ibm.com> [S390] cio: failing set online/offline processing.

When unit checks trigger sensing the device state is set to W4SENSE
until sense completion; then the device state is set back to
ONLINE. If a unit check occurs while set online or set offline
requests are processed then it might happen that the device's
temporary W4SENSE state causes these functions to terminate,
leaving the device in an inconsistent state when the state is set
back to ONLINE later on so that the device cannot be set online or
offline any longer.
To solve this, set online/offline and related rollback or error
routines are processed only if the device is in a final or
DISCONNECTED state.

Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
626e476ae011cafddc0ccb39ab838b90cc5d2272 11-Sep-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: fix not oper handling after failed [on|off]line processing

If online/offline processing of a ccw device fails, resulting in not
operational state, notify the driver and unregister the device in case
the driver dosn't want to keep it.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
1f1148c88ad37c87f14d2153416a605bf0aeaf74 11-Sep-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: fix ineffective verify event

Path verification events occurring for offline devices are currently
ignored. As a result, offline devices are not removed, even though
they might no longer be accessible (for example because the last path
to the device was varied offline). Fix this by scheduling a status
evaluation for the affected subchannel when a path verification event
occurs.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
823d494ac11111064cf39abd4178ce299414c771 16-Jun-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] pm: ccw bus power management callbacks

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
47593bfa1056d306fde067b28dd8617009be4121 31-Mar-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: introduce notifier for boxed state

If a ccw device did not respond in time during internal io, we set it
into boxed state. With this patch we have the following behaviour:
* the ccw driver will get a notification if the device was online and
goes into the boxed state
* if the device was disconnected and got boxed nothing special is to be
done (it will be handled in reprobing later)
* if the device got boxed while initial sensing it will be unregistered

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
156013ffd1225ef862853a4340b46f76845f8db1 31-Mar-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: wake up on failed recognition

Wake up even on failed device recognition, since this may be triggered
from a user trying to force a device online. With this patch a write
to the online sysfs attribute will not block for ever but return with
-EAGAIN in this case.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
c08f294a14cb4c2abbd1a9a619c2d8d07afd41e3 26-Mar-2009 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Use ccw_device_set_notoper().

Use ccw_device_set_notoper() (which also deletes the device
timer and disables the subchannel) instead of simply setting
the state to DEV_STATE_NOT_OPER in the generic not operational
handling code. This prevents unexpected interrupts popping up
for devices that are deemed not operational.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
ed04b892e28ae96662fbb3f4c961df5ff3385d28 26-Mar-2009 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Try harder to disable subchannel.

Acting upon the assumption that cio_disable_subchannel()
is only called when we really want to disable the subchannel
(a) remove the check for activity (it is already done in
ccw_device_offline(), which is the place where it matters)
(b) collect pending status via tsch() and ignore it (it
can't matter anymore since the subchannel will be disabled).

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
eb32ae8d0e052d1a287f99f93130ea2ad9af317e 26-Mar-2009 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Use unbind/bind instead of unregister/register.

The common I/O layer may encounter a situation where the
device number of a ccw device has changed or a device
driver doesn't want to keep a formerly disconnected device
becoming operational again. Instead of using device_del()/
device_add() as now, we can just unbind the driver from the
device and rebind it to get the desired effect (rebinding)
with less overhead.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
f444cc0e52523560a8dfc12f5374e5d5ecf5375b 25-Dec-2008 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: commit all pmcw changes.

Sometimes we change the pmcw configuration but don't call msch
to transmit these changes to the channel subsystem.

The patch fixes this by calling cio_commit_config in such cases.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
13952ec12dfeea793ff83c2a96139ed57eb0b897 25-Dec-2008 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: introduce cio_commit_config

To change the configuration of a subchannel we alter the modifiable
bits of the subchannel's schib field and issue a modify subchannel.
There can be the case that not all changes were applied -or worse-
quietly overwritten by the hardware. With the next store subchannel
we obtain the current state of the hardware but lose our target
configuration.

With this patch we introduce a subchannel_config structure which
contains the target subchannel configuration. Additionally the msch
wrapper cio_modify is replaced with cio_commit_config which
copies the desired changes to a temporary schib. msch is then
called with the temporary schib. This schib is only written back
to the subchannel if all changes were applied.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
cdb912a40df8b8507ab60b3d52f9980c0ba1f44d 25-Dec-2008 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: introduce cio_update_schib

There is the chance that we get condition code 0 for a stsch but
the resulting schib is not vaild. In the current code there are
2 cases:
* we do a check for validity of the schib after stsch, but at this
time we have already stored the invaild schib in the subchannel
structure. This may lead to problems.
* we don't do a check for validity, which is not that good either.

The patch addresses both issues by introducing the stsch wrapper
cio_update_schib which performs stsch on a local schib. This schib
is only written back to the subchannel if it's valid.

side note: For some functions (chp_events) the return codes are
different now (-ENXIO vs -ENODEV) but this shouldn't do harm
since the caller doesn't check for _specific_ errors.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
9cd67421977a701272820987ff9e6f197b1b97b7 25-Dec-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Fix reference counting for online/offline.

The current code attempts to get an extra reference count
for online devices by doing a get_device() in ccw_device_online()
and a put_device() in ccw_device_done(). However, this
- incorrectly obtains an extra reference for disconnected
devices becoming available again (since they are already
online)
- needs special checks for css_init_done in order to handle
the console device
- is not obvious and
- may incorretly drop a reference count in ccw_device_done() if
that function is called after path verification for a device
that just became not operational.

So let's just get the reference in ccw_device_set_online() and
drop it in ccw_device_set_offline(). (Unfortunately, we still
need the special case in io_subchannel_probe().)

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
2a0217d5c7d22d6dd28f8ae5d20b06d24dc426b8 10-Oct-2008 Kay Sievers <kay.sievers@vrfy.org> [S390] bus_id -> dev_name conversions

bus_id -> dev_name() conversions in s390 code.

[cornelia.huck@de.ibm.com: minor adaptions]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
b301ea8c81b13123761772f344faf606c76ba174 09-Sep-2008 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: allow offline processing for disconnected devices

When disconnected ccw devices are removed, the device has to be set
offline, otherwise there will be side effects including a reference
count imbalance. This patch modifies ccw_device_offline to work for
devices in disconnecte/not operational state. ccw_device_offline is
called by cio for devices which are online during device removal.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
91c36919a456589f4f073671474a1f899e0d3c2b 21-Aug-2008 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: call ccw driver notify function with lock held

Calling a ccw driver's notify function without the ccw device lock
held opens up a race window between discovery and handling of a change
in the device operational state. As a result, the device driver may
encounter unexpected device malfunction, leading to out-of-retry
situations or similar.

Remove race by extending the ccw device lock from state change
discovery to the calling of the notify function.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
ae437a452ed20f9d13c1f17b0356201d54394efa 14-Jul-2008 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: remove lock from ccw_device_oper_notify.

Remove unnecessary ccw device locking inside ccw_device_oper_notify.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
/drivers/s390/cio/device_fsm.c
83262d6349e60b9d10798d489719d80029c00798 14-Jul-2008 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: provide functions for fcx enabled I/O

Provide functions for assembling and starting fcx enabled I/O request
blocks.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
/drivers/s390/cio/device_fsm.c
23d805b647db6c2063a13089497615efa9deacdd 14-Jul-2008 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: introduce fcx enabled scsw format

Extend the scsw data structure to the format required by fcx. Also
provide helper functions for easier access to fields which are present
in both the traditional as well as the modified format.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
/drivers/s390/cio/device_fsm.c
c820de39bd083222f5be2563181c87493e436f7c 14-Jul-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Rework css driver.

Rework the css driver methods to provide sane callbacks for
subchannels of all types.

As a bonus, this cleans up and simplyfies the machine check
handling for I/O subchannels a lot.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
/drivers/s390/cio/device_fsm.c
139b83dd57248a3c8fcfb256e562311ad61478e9 07-May-2008 Michael Ernst <mernst@de.ibm.com> [S390] cio: Remove cio_msg kernel parameter.

The only sporadically used CIO_DEBUG messages are replaced by ordinary
CIO_MSG_EVENT messages. The CIO_MSG_EVENT messages debug levels are
consolidated.

Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
edf2209692769d3e461c0351553098bc017c2caf 30-Apr-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Make isc handling more robust.

Introduce an ->isc field in the subchannel to store the desired
interruption subclass, since sch->schib.pmcw.isc may be overwritten
by the hardware on stsch() after machine checks.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
90ab133603d066e850fc9ed297b6eb52f888dd25 26-Jan-2008 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: introduce timed recovery procedure

Add a timed recovery procedure to reactivate ccw devices in cases
where HW/VM events are not sufficient to allow for proper recovery
of reappearing channel paths.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
46258ab5e42eed5cbe20a83b732d6538c49ea2fe 26-Jan-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Delete timer in ccw_device_verify_done().

Make sure pending timers are always deleted, even if we don't go
through ccw_device_done().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
db6a64238a927777e6e7b251927313f186455b1c 26-Jan-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Use dev_{g,s}et_drvdata().

Also define helpers sch_{g,s}et_cdev() to make the intention more
clear.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
b279a4f56d5476a0b9b0a97397f7a7bbe00b9b2f 26-Jan-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: I/O subchannel specific fields.

Some fields may be !0 only for I/O subchannels. Add some checks
where required. Also adapt cio_enable_subchannel() to make the
caller specify the intparm, which makes it more generic.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
cd6b4f27b9bb2a6a5ec82b96b87c85421257be6c 26-Jan-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Introduce subchannel->private.

Introduce a private pointer in struct subchannel to store
per-subchannel type data (cannot use dev->priv since this
is already used for something else).

Create a new header io_sch.h for I/O subchannel specific structures
and instructions.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
bc698bcf8897363732226dc9ecba044771679996 26-Jan-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Cleanup debug feature usage.

Cleanup cio_debug.h.
Also make CIO_DEBUG add the "cio:" prefix to the printk string
so that it isn't needed for the debug feature.
Fix outdated comments for cio_debug_init() and clean it up.
Enlarge cio_crw to the same size as cio_msg so we may actually
find some relevant information there.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
602b20f2bf335d0d5fce11cb2ade22aa74e7ba25 26-Jan-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: css_driver: Use consistent parameters.

Make all callbacks in css_driver take a struct subchannel (and not
a struct device).

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
14ff56bbb3422cc465a12e81f5e1b5f06168aeda 26-Jan-2008 Sebastian Ott <sebott@de.ibm.com> [S390] cio: Dump ccw device information in case of timeout.

Information about a ccw device will be dumped in
case of a ccw timeout. This can be enabled with
the kernel parameter ccw_timeout_log.

Signed-off-by: Sebastian Ott <sebott@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
c5d4a9997b4b2ec71cff0b219f05c6bc51f3fc79 20-Nov-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Register/unregister subchannels only from kslowcrw.

Make sure all subchannel handling is done on the slow path workqueue
so that we don't have races between an old subchannel unregistering
and a new subchannel with the same name registering.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
3f4cf6e72f9f6a0b046b32881acc4f829f3aaa46 12-Oct-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Avoid machine check vs. not operational races.

There was the possibilty that an action like ccw_device_set_offline()
triggered by a device gone machine check might trigger a not oper
event. Unfortunately, this could lead to the situation that we tried
to unregister a subchannel twice: Once from the slow path evaluation,
and once via the not oper event.

Fix this by always using the same mechanism (css_schedule_eval()) for
triggering the unregister. This makes sure that unregistration will
only be done once. As an added bonus, it also simplyfies the code.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
7c9f4e3aaae020fc674f52393cbac1bdb648bf90 12-Oct-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: rename css to channel_subsystems

Rename css[] to channel_subsystems[] to avoid name clashes.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
/drivers/s390/cio/device_fsm.c
e556bbbd9d2ff2b158915945ac82e2ac7def4d2f 27-Jul-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Clean up messages.

- Remove unneeded messages.
- Move some messages into the debug feature.
- Use dev_* where appropriate.
- Use "cio: " prefix consistently.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
3ecb0a5a7b567c9719d61938bcdba22938084b65 31-May-2007 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: deregister ccw device when pgid disband failed

Deregister ccw device when device failure is detected during offline-
processing (e.g. when no last-path-gone indication was presented by
the hardware) to prevent the device from entering a non-recoverable
not-operational state.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
82b7ac058f60e0c92f9237fbaf440671f437ecdf 27-Apr-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Dont call css_update_ssd_info from interrupt context.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
7ad6a24970325294a22a08446d473384c15b928e 27-Apr-2007 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: fix subchannel channel-path data usage

Ensure that channel-path related subchannel data is only retrieved and
used when it is valid and that it is updated when it may have changed.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
83b3370c79b91b9be3f6540c3c914e689134b45f 27-Apr-2007 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: replace subchannel evaluation queue with bitmap

Use a bitmap for indicating which subchannels require evaluation
instead of allocating memory for each evaluation request. This
approach reduces memory consumption during recovery in case of
massive evaluation request occurrence and removes the need for
memory allocation failure handling.

Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
e5854a5839fa426a7873f038080f63587de5f1f1 27-Apr-2007 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: Channel-path configure function.

Add a new attribute to the channel-path sysfs directory through which
channel-path configure operations can be triggered. Also listen for
hardware events requesting channel-path configure operations and
process them accordingly.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
/drivers/s390/cio/device_fsm.c
e6b6e10ac1de116fc6d2288f185393014851cccf 27-Apr-2007 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: Introduce separate files for channel-path related code.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
/drivers/s390/cio/device_fsm.c
f86635fad14c4a6810cf0e08488fc9129a3b3b32 27-Apr-2007 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: Introduce struct chp_id.

Introduce data type for channel-path IDs.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
/drivers/s390/cio/device_fsm.c
2470b648e17e0216922bb78c7f05b4668402459a 05-Mar-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Call cancel_halt_clear even when actl == 0.

The subchannel may just be status pending, even with actl == 0. We
must go through the cancel_halt_clear procedure to put the subchannel
into a defined state.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
7c8427c3fa1b2e77c5bd8cf219c1d55dccd0f167 05-Mar-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Use path verification to check for path state.

After I/O has been killed by the common I/O layer, trigger path
verification which will queue cio_device_nopath_notify itself if it
finds a device to be without paths.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
ee04bbccdeb11bdbc54015be8dca30a0deeca5e4 05-Mar-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Fix locking when calling notify function.

Make sure we hold the device lock when we modify the ccw device
structure but always call the notify function without the lock held.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
4d284cac76d0bfebc42d76b428c4e44d921200a9 05-Feb-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Avoid excessive inlining.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
18374d376c7eb30b6359759e767cd99397b377d2 05-Feb-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Restart path verification after unsolicited interrupt.

If we try to start path verification when an unsolicited interrupt
is already pending, stctl shows status pending and we delay path
verification again. We need to check for the doverify bit when the
unsolicited interrupt comes in and then do path verification.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
2b67fc46061b2171fb8fbb55d1ac717abd533569 05-Feb-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Get rid of a lot of sparse warnings.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
d7b5a4c94f49131811112526f7d404a50f0b5ca7 08-Dec-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] Support for disconnected devices reappearing on another subchannel.

- create a 'pseudo_subchannel' per channel subsystem (the 'orphanage')
- use the orphanage as a shelter for ccw_devices that can't remain on the same
subchannel

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
7674da77cb2d27ae6559c55151da171ceb02beb4 08-Dec-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] Some preparations for the dynamic subchannel mapping patch.

- Move adding subchannel attributes to css_register_subchannel().
- Don't call device_trigger_reprobe() for non-operational devices.
- Introduce io_subchannel_create_ccwdev().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
c16375329c2ab4667df873394c4be7a61d163c62 08-Dec-2006 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] more workqueue fixes.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
d23861ff1a4da1f4a5255eb4582f620191c6e1c0 04-Dec-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Retry internal operations after vary off.

If I/O was running on a just varied off chpid, it will be terminated.
If this was a common I/O layer internal I/O, it needs to be retried.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
24cb5b4846ebae5543869b5c596c2650f380df53 04-Dec-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Use path verification for last path gone after vary off.

If the last path to a device is gone after a chpid has been varied
off, putting it on the slow queue doesn't prevent a device driver
from still attempting to use it (it may stay on the slow queue for a
long time). Instead, trigger a verify event which will prevent I/O
attempts from the device driver immediately.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
8b42f5c20251060cb1ab875459fe66ad7bb92cbd 18-Oct-2006 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: invalid device operational notification

Reset device operational notification flag when channel paths become
unavailable during path verification.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
12975aef62836e9f3e179afaaded8045f8a25ac4 11-Oct-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: remove casts from/to (void *).

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
e7769b48a0216d7262fe2ba59b1b3697be462cbb 11-Oct-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Remove grace period for vary off chpid.

The grace period handling introduced needless complexity. It didn't
help the dasd driver (which can handle terminated I/O just well),
and it doesn't help for long running channel programs (which won't
complete during the grace period anyway). Terminating I/O using a
path that just disappeared immediately is much more consistent with
what the user expects.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
789642680518b28e7dc13f96061460a8238ec622 11-Oct-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Use ccw_dev_id and subchannel_id in ccw_device_private

Use the proper structures to identify device and subchannel. Change
get_disc_ccwdev_by_devno() to get_disc_ccwdev_by_dev_id().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
08983787d2ccab64cb790965ba89621d96cc22c1 11-Oct-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: add missing KERN_INFO printk header.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
f1ee3281bedbbca70a1f53bc715ea6f27c616052 04-Oct-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] Add timeouts during sense PGID, path verification and disband PGID.

While the machine owns us an interrupt in these cases (and we should get
one), reality isn't always like that...

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
28bdc6f6233f380ddc0b430cabd88ffeafea34c7 20-Sep-2006 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: always query all paths on path verification.

Reappearing channel paths are sometimes not utilized by CCW devices
because path verification incorrectly relies on path-operational-mask
information which is not updated until a channel path has been used
again.
Modify path verification procedure to always query all available paths
to a device.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
81388d2a45b89c890b981cfc83b01ec15ae3483b 20-Sep-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Missing initialization in common i/o layer.

Previous patch that was intended to reduce stack usage within common
i/o layer didn't consider implicit memset(..., 0, ...) used with the
initializations used before.
Add these missing memsets wherever it's not obvious that the
concerned memory region is zeroed. This should give the same semantics
as before.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
292888c81e74115db5e5a4a838f730a7c3662982 30-Aug-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] cio: kernel stack overflow.

Use different kind of assignment to make sure gcc doesn't create code
that creates temp variables on the stack, assigns values to it and
copies the content of the whole temp variable to the destination.
This reduces stack usage of e.g. ccwgroup_driver_register from 976
to 48 bytes instead.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
65200c291c4ce397835d8232eaa0878b765a9bce 07-Aug-2006 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] lost interrupt after chpid vary off/on cycle.

I/O on a CCW device may stall if a channel path to that device is
logicaly varied off/on. A user I/O interrupt can get misinterpreted
as interrupt for an internal path verification operation due to a
missing check and is therefore never reported to the device driver.

Correct check for pending interruptions before starting path
verification.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
ba4ba8a69dcb446450b5ddeca48a7bd15783f4c2 27-Jul-2006 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] permanent subchannel busy conditions may cause I/O stall

In special conditions where a subchannel rejects the HALT I/O-
instruction with a busy indication (cc 2), I/O may stall.
I/O request termination logic retries HALT I/O indefinitely
because it expects HALT I/O to alter the subchannel status which
is not true when cc 2 is returned.
In case of a busy indication, try CLEAR I/O instruction immediately.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
7e560814de1972e1bfc780616841d7a0032ca467 12-Jul-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] path grouping and path verifications fixes.

1. Multipath devices for which SetPGID is not supported are not handled well.
Use NOP ccws for path verification (sans path grouping) when SetPGID is not
supported.
2. Check for PGIDs already set with SensePGID on _all_ paths (not just the
first one) and try to find a common one. Moan if no common PGID can be
found (and use NOP verification). If no PGIDs have been set, use the css
global PGID (as before). (Rationale: SetPGID will get a command reject if
the PGID it tries to set does not match the already set PGID.)
3. Immediately before reboot, issue RESET CHANNEL PATH (rcp) on all chpids. This
will remove the old PGIDs. rcp will generate solicited CRWs which can be
savely ignored by the machine check handler (all other actions create
unsolicited CRWs).

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
/drivers/s390/cio/device_fsm.c
94bb063312d872d9269deb2e5c0c7c6d5b0318e1 29-Jun-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] rework of channel measurement facility.

Fixes for several channel measurement facility bugs:
* Blocks copied from the hardware might not be consistent. Solve this
by moving the copying into idle state and repeating the copying.
* avg_sample_interval changed with every read, even though no new block
was available. Solve this by storing a timestamp when the last new
block was received.
* Several locking issues.
* Measurements were not reenabled after a disconnected device became
available again.
* Remove #defines for ioctls that were never implemented.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
b4f7b1ee577857aca467e6825122a3b29d6c3c0e 29-Jun-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio chpid offline.

After setting a path to a dasd offline at the SE, I/O hangs on that
dasd for 5 minutes, then continues.
I/O for which an interrupt will not be reported after the channel
path has been disabled was not terminated by the common I/O layer,
causing the dasd MIH to hit after 5 minutes.

Be more aggressive in terminating I/O after setting a channel path
offline. Also make sure to generate a fake irb if the device
driver issues an I/O request after being notified of the killed
I/O and clear residual information from the irb before trying to
start the delayed verification.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
/drivers/s390/cio/device_fsm.c
e0ec574987a3301f7767750bb6e8be47d6323bfa 04-Jun-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [PATCH] s390: irb memcpy argument swap

From: Cornelia Huck <cornelia.huck@de.ibm.com>

Swapped memcpy arguments in ccw_device_irq() when doing basic sense after
unsolicited interrupt.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/s390/cio/device_fsm.c
3ba1998e90239ed0d7af918998bc866fa77303eb 24-Mar-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [PATCH] s390: wrong interrupt delivered for hsch() or csch()

When cio waits for the interrupt for a basic sense, interrupts for hsch() or
csch() issued in the meantime are wrongly counted as interrupts for the basic
sense and the accumulated irb is passed to the device driver. In
ccw_device_w4sense(), check for clear or halt function in the irb and pass the
irb for the csch() or hsch() to the device driver.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/s390/cio/device_fsm.c
4ce3b30cf32c5c078518f0f3e6623bcb6eee9872 14-Jan-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [PATCH] s390: email-address change

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/s390/cio/device_fsm.c
fb6958a594da49ece869793e6ec163b89fc5f79f 06-Jan-2006 Cornelia Huck <cohuck@de.ibm.com> [PATCH] s390: multiple subchannel sets support

Add support for multiple subchannel sets. Works with arbitrary devices in
subchannel set 1 and is transparent to device drivers. Although currently
only two subchannel sets are available, this will work with the architectured
maximum number of subchannel sets as well.

Signed-off-by: Cornelia Huck <cohuck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/s390/cio/device_fsm.c
a8237fc4108060402d904bea5e1062e22e731969 06-Jan-2006 Cornelia Huck <cohuck@de.ibm.com> [PATCH] s390: introduce struct subchannel_id

This patch introduces a struct subchannel_id containing the subchannel number
(formerly referred to as "irq") and switches code formerly relying on the
subchannel number over to it.

While we're touching inline assemblies anyway, make sure they have correct
memory constraints.

Signed-off-by: Cornelia Huck <cohuck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/s390/cio/device_fsm.c
4e57b6817880946a3a78d5d8cad1ace363f7e449 31-Oct-2005 Tim Schmielau <tim@physik3.uni-rostock.de> [PATCH] fix missing includes

I recently picked up my older work to remove unnecessary #includes of
sched.h, starting from a patch by Dave Jones to not include sched.h
from module.h. This reduces the number of indirect includes of sched.h
by ~300. Another ~400 pointless direct includes can be removed after
this disentangling (patch to follow later).
However, quite a few indirect includes need to be fixed up for this.

In order to feed the patches through -mm with as little disturbance as
possible, I've split out the fixes I accumulated up to now (complete for
i386 and x86_64, more archs to follow later) and post them before the real
patch. This way this large part of the patch is kept simple with only
adding #includes, and all hunks are independent of each other. So if any
hunk rejects or gets in the way of other patches, just drop it. My scripts
will pick it up again in the next round.

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/s390/cio/device_fsm.c
4c24da79e29537f0e240a331220a1c46cb9bc085 04-Sep-2005 Cornelia Huck <cohuck@de.ibm.com> [PATCH] s390: reIPL fix and extern/static inline

Common i/o layer changes:

- Collect the irb at the correct subchannel when waiting for the clear
interrupt during subchannel cleaning befor reIPL - don't stop at the first
interrupt that comes in.

- Change "extern __inline__" to "static inline".

- Remove unneeded qdio includes.

Signed-off-by: Cornelia Huck <cohuck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/s390/cio/device_fsm.c
4ffa92340b22a59575afe60ea155195c43213120 29-Jul-2005 Cornelia Huck <cohuck@de.ibm.com> [PATCH] s390: device recognition

Close a small window where a device may be not operational again after senseid
finished and the "same device" check fails due to dev=0000 by checking for dnv
after stsch() by then setting the device to not operational. (No need to
check for dnv in ccw_device_handle_oper() again since we don't do stsch() into
the subchannel's schib in the meantime and will get a crw anyway if the device
becomes not oper again).

Signed-off-by: Cornelia Huck <cohuck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/s390/cio/device_fsm.c
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
/drivers/s390/cio/device_fsm.c