History log of /drivers/s390/cio/device.c
Revision Date Author Comments
9f30ea950edfaefa51221dd26a065b3442599778 24-Jan-2012 Sebastian Ott <sebott@linux.vnet.ibm.com> cio: remove {get,put}_driver

Remove useless {get,put}_driver - the caller of the functions
has to ensure valid driver pointers.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
817e5000ebc4d448ca514db49b55073a724f8552 01-Dec-2011 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] hibernate: directly trigger subchannel evaluation

Using the generic css_schedule_eval to evaluate subchannels
while resuming from hibernation is very slow when used with
many devices. Provide a new evaluation trigger which exploits
css_sched_sch_todo and use this in the resume callback for
ccw devices.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
de400d6b78d15a73023485f050bc6b1709dc7a79 30-Oct-2011 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] fix mismatch in summation of I/O IRQ statistics

Current IRQ statistics support does not show detail counts for I/O
interrupts which are processed internally only. The result is a
summation count which is way off such as this one:

CPU0 CPU1 CPU2
I/O: 1331 710 442
[...]
QAI: 15 16 16 [I/O] QDIO Adapter Interrupt
QDI: 1 0 0 [I/O] QDIO Interrupt
DAS: 706 645 381 [I/O] DASD
C15: 26 10 0 [I/O] 3215
C70: 0 0 0 [I/O] 3270
TAP: 0 0 0 [I/O] Tape
VMR: 0 0 0 [I/O] Unit Record Devices
LCS: 0 0 0 [I/O] LCS
CLW: 0 0 0 [I/O] CLAW
CTC: 0 0 0 [I/O] CTC
APB: 0 0 0 [I/O] AP Bus

Fix this by moving I/O interrupt accounting into the common I/O layer.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
a2fc8485f838ccd2ce5db690f81ac086489a9e7e 04-Apr-2011 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: prevent purging of CCW devices in the online state

The cio_ignore purge function is intended to only remove CCW devices
which are in the offline state. There is a time frame after the purge
function finished where a CCW device is scheduled for removal but
still accessible. When the device is set online during this time
frame, it may first appear online before it is then removed.

Fix this by preventing that CCW devices can be set online while there
is work (such as removal triggered by the purge function) for it
pending. Also ensure that the purge function does not schedule devices
for removal which are in the process of being set online.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
d5ab5276baf9fd8b581cfbf41b10b6d4eae55960 23-Mar-2011 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] ccw_bus_type: make it static

Make ccw_bus_type static. ccw_device drivers have to
use ccw_driver_register.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
3bda058b0c39fc72188116d2fd71af08dd0fe5b0 23-Mar-2011 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] ccw_driver: remove duplicate members

Remove the owner and name members of struct
ccw_driver and convert all drivers to store
this data in the embedded struct device_driver.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
e6aed122a9185d0fe5890f02ea8efc32c355bc44 15-Mar-2011 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] css_driver: remove duplicate members

Remove the owner and name members of struct
css_driver and convert all drivers to store
this data in the embedded struct device_driver.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
f92519e83e3bd509cb861a946701a26f74cb77fa 15-Mar-2011 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] css: move io_private to drv_data

Use the subchannels drv_data to access io_subchannel_private
for io subchannels.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
b17295e646562a2122ce84c1e55c9ae66fb6ae50 12-Jan-2011 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: path_event overindication after resume

While resuming report any found paths as new to the
device drivers.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16d2ce271c6b8b3527ed1461d03b5f373d53f78f 10-Nov-2010 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: fix incorrect ccw_device_init_count

If device recognition is interrupted by a subchannel event
indicating that the device is gone, ccw_device_init_count
is not correctly decreased.

Fix this by reporting the corresponding event to the device
recognition callback via the state machine.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
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>
74b6127e6c35abf06364468636dd261850639f8b 25-Oct-2010 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: fix memleak in resume path

If a ccwdevice is lost during hibernation and a different
ccwdevice is attached to the same subchannel, we will
deregister the old ccw device and register the new one.

Since deregistration is not allowed in this context, we
handle this action later. However, some parts of the
registration process for the new device were started anyway,
so that the old device structure is no longer accessible.

Fix this by deferring both actions to the afterwards
scheduled subchannel event.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
7cd403142d5dbffa354b7dd369b1069e01b1ae19 09-Aug-2010 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: ccw_device_online_store return -EINVAL in case of missing driver

If no driver is attached to a device or the driver provides no
set_online/set_offline function, setting this device online/offline
via its sysfs online attribute will silently fail but return success.

This patch changes the behavior to return -EINVAL in those cases.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
fd0457a6ae52141718a15652fb80d867e1bf1d10 09-Aug-2010 Michael Ernst <mernst@de.ibm.com> [S390] cio: CHSC SIOSL Support

A Linux interface for the CHSC command
store-I/O-operation-status-and-initiate-logging (SIOSL).
Model-dependent logging within the channel subsystem can be invoked
via a helper function or a writable subchannel device attribute.

Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
a290156f479af436f94ac23f5729a1e33c94293b 08-Mar-2010 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: fix init_count in case of recognition after steal lock

After we try to steal a lock on a ccw device in boxed state,
we have to restart device recognition and potentially reprobing.

In this case ccw_device_init_count was erroneously decreased
twice. This patch fixes the issue.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
0d01bb89220490763d89571d27e7ee3f13f9b372 26-Feb-2010 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: trigger subchannel event at resume time

ccw_device_pm_restore: trigger subchannel event to better handle
changes to the subchannel device.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
b4c707214c987da021d4d5c4ed54612cf73d80d6 26-Feb-2010 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: make wait_events interruptible

Make the potentially long blocking wait_event's used by the cio
settle mechanism interruptible.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
be5d3823f29c09676abd2eeea4f9767bc4a1a531 26-Feb-2010 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: consolidate workqueues

We used to maintain 2 singlethreaded workqueues for synchronization
and to trigger work from interrupt context. Since our latest cio
changes we only use one of these workqueues. So get rid of the
unused workqueue, rename the remaining one to "cio_work_q" and move
its ownership to the channel subsystem driver.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
ffa8d2a3e80a3f0dee9886947dbd506d2bb226d2 18-Dec-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: fix drvdata usage for the console subchannel

Using dev_set_drvdata prior to device_register will force the driver core
to kmalloc its private data. Since we use this for the console subchannel
lets set the drvdata before taking the subchannels spinlock.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
471452104b8520337ae2fb48c4e61cd4896e025d 15-Dec-2009 Alexey Dobriyan <adobriyan@gmail.com> const: constify remaining dev_pm_ops

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
d40f7b75a23d1e59b6ec9d6701231fd4c6992ac6 07-Dec-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: dont unregister a busy device in ccw_device_set_offline

If we detect a busy subchannel after the driver's set_offline
callback returned in ccw_device_set_offline, the current behavior
is to unregister the device, which may lead to undesired
consequences. Change this to just quiesce the subchannel and go on
with the offline processing.

Note: This is no excuse for not fixing these drivers -
after the set_offline callback they should have no running IO!

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
7a8ad1001c51bba0507ee08cb4323d8ddcb07c70 07-Dec-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: change locking in io_subchannel_remove

IO subchannels are always unregistered in process context, so use
spin_lock_irq in the corresponding remove callback.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
6e9a0f67deeca90c433ac40b887cee8da3bdcea2 07-Dec-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: quiesce subchannel in io_subchannel_remove

Ensure that there will be no more interrupts for an
unregistered device by using the same quiesce and disable loop
as in io_subchannel_shutdown.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
0c609fca243d456af014e92ad1caca045072dfe8 07-Dec-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: handle busy subchannel in ccw_device_move_to_sch

Try to disable the old subchannel before we ask the driver core
to move the attached device to a new parent. This way we can use
the QUIESCE state during shutdown which prevents a possible use
after free situation in some error cases.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
24a1872d6411c7cce82c0888a4fbea23e993e051 07-Dec-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: add per device initialization status flag

The function ccw_device_unregister has to ensure to remove
all references obtained by device_add and device_initialize.
Unfortunately it gets called for devices which are
1) uninitialized, 2) initialized but unregistered, and
3) registered devices. To distinguish 1) and 2) this patch
introduces a new flag "initialized", which is 1 as long as we
hold the initial device reference.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
7d253b9a1aaf5192808e641659f4feb122faa536 07-Dec-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: remove registered flag from ccw_device_private

We used to maintain a "registered" flag in our ccw_device_private
structure. This patch removes the "registered" flag and converts
all users of it to device_is_registered which has the exact same
meaning.

Note: The usage the atomic operation test_and_clear_bit is replaced
by the non-atomic if (device_is_registered()) device_del(). This
will not do harm, since we serialize calls to ccw_device_unregister
with a single-threaded workqueue.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
350e91207bc9c6a464c22b9e0e30d21dfc07efe3 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: allow setting not-operational devices offline

Accept a request for setting a not-operational device offline.
This way, users can remove devices from Linux which would otherwise
remain unusable until reboot.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
1f5bd3848bfc56de4c32ef6971a6a966776204bb 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: ensure proper locking during device recognition

Device recognition needs to be started with the ccw device lock
held to prevent race conditions between I/O starting and interrupt
reception.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
a7ae2c02f5ab7080646a4cc6c01065ae9decad54 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: inform user when online/offline processing fails

Print a warning message in case a ccw device enters boxed or
not operational state during online/offline processing.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
390935acac21f3ea1a130bdca8eb9397cb293643 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: introduce subchannel todos

Ensure that current and future users of sch->work do not overwrite
each other by introducing a single mechanism for delayed subchannel
work.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
60e4dac1abdf49ccdb7545ec406325f08423d848 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: fix repeat setting of cdev parent association

sch_create_and_recog_new_device() associates a parent subchannel
with its ccw device child even though this is already done by
the subsequently called io_subchannel_recog(). Also make sure
io_subchannel_recog() sets the association under lock.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
48e4c385c5f54626651cca027afe242439281899 07-Dec-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: fix double free in case of probe failure

io_subchannel_probe() frees memory for sch->private which is later
freed again when io_subchannel_remove() is called. Fix this problem
by removing the cleanup in io_subchannel_probe().

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
6d7c5afc890d0c9345ee05ccf0e6c692b6c8f8a8 14-Oct-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: change misleading console logic

Use cio_is_console() in io_subchannel_probe to indicate that the
special handling is console specific. As long as there is no other
subchannel for which this might be true, it is misleading to speak
of "early devices". Should more of these devices be introduced,
a cleanup of all console special handling is in order anyway.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
8ea7f5590142c0b9ab319aa3cae85cf430a207d8 22-Sep-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: introduce css_settle

Introduce the css_driver callback settle which can be implemented
by a subchannel driver to wait for the subchannel type specific
asynchronous work to finish.
In channel_subsystem_init_sync we call that for each subchannel
driver.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2f17644d1cd0121daa0a997ff4eca5b3b44d1fae 22-Sep-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: merge init calls

Define initialization sequence of css and ccw bus init calls by merging
them into a single init call. Also introduce channel_subsystem_init_sync
to wait for the initialization of devices to finish.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
a4dbd6740df0872cdf0a86841f75beec8381964d 24-Jun-2009 David Brownell <dbrownell@users.sourceforge.net> driver model: constify attribute groups

Let attribute group vectors be declared "const". We'd
like to let most attribute metadata live in read-only
sections... this is a start.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
3ac276f8cb020adbbc3399c47edc1100748c2c16 11-Sep-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: remove ccw_device init_name

We used the init_name to set the console ccw_device's name early
at the boot stage. This patch moves the name setting (for all ccw
devices) to the point where we actually register the device. At this
time we can do dynamic allocations and therefore use dev_set_name.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
3b554a14f4bdf754ba9d2f64c2b6edf8dafe93b9 11-Sep-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: move final put_device to ccw_device_unregister

We use a test_and_clear_bit to prevent a device from being
unregistered twice. Unfortunately in this cases the "final"
put_device (from device_initialize) was issued more than once,
resulting in an use after free error. Fix this by moving this
put_device to ccw_device_unregister.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
f014824ee72e66292c3b1172dc142f959b42e61b 11-Sep-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: fix use after free in s390 debug feature

When using s390dbf with "%s" in sprintf format strings the string itself
is not copied to the dbf buffer.
Since in this case only pointers are stored in the s390dbf, we should
not use dev_name - which is bound to the lifetime of the device.
Reading this entry from s390dbf after the device was released will cause
an use after free error.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
be7a2ddce66991c05a1c6ad19790289591e53547 11-Sep-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: ensure to hold a reference for deferred deregistration

Ensure to always hold an extra device reference for scheduling a
subchannel deregistration, by moving the get_device to
ccw_device_schedule_sch_unregister. This fixes an use after free
error in ccw_device_call_sch_unregister where put_device was called
on an already freed device structure.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
efd986db2d720e8f6660ec2c292509ee7d28cc6a 11-Sep-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: increase trace level

Move debug traces for start I/O and interrupt events to exclusive
trace levels. Also change tracing in hot-path from sprintf (costly)
to hex.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1da73bc80bdfc9588192a6e6f5a72f8138f7378d 11-Sep-2009 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: consolidate subchannel intparm reset

Ensure that the hardware interruption parameter for a subchannel is
reset when the associated subchannel data structure is freed.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
06739a8ad321b1e5140b318c648b0cc4bf8c6daa 23-Aug-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: fix double free after failed device initialization

If io_subchannel_initialize_dev fails it will release the only
reference to the ccw device therefore the caller should not
kfree this device since this is done in the release function.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
6664845cef13b0a224f43f6c46eddd0b3e018c04 16-Jun-2009 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] cio: force console function

If something goes wrong in a suspend / resume cycle a ccw based console
if very likely in the suspended state and cannot print anything.
Introduce ccw_device_force_console to force the wake up of the console
device to be able to print the oops message. The console device drivers
should use this function only if the system paniced.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
93a275921daf83e6e4efbafdd82712bcaa93f491 16-Jun-2009 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] pm: io subchannel driver power management callbacks

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
99f6a570eedc885675b6aa36b7acdbdcc3a7f55b 31-Mar-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: online_store - trigger recognition for boxed devices

Start a new device recognition if someone writes to sysfs online attribute
of a boxed ccw device. The current test will fail, since cu_type != 0
for devices which were recognized before.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
b5cd99e6b002776c0e946f38292adbb0258b7983 31-Mar-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: disallow online setting of device in transient state

Return -EAGAIN on writes to sysfs online attribute if the corresponding
ccw device is in transient state.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
c4621a62649a56f155a96dfc5de479be226f0768 31-Mar-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: introduce ccw_device_schedule_sch_unregister

Introduce ccw_device_schedule_sch_unregister as a wrapper for queuing
ccw_device_call_sch_unregister on the slow_path_wq. This wrapper
will be used in the next patch.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
0cc110651bed4612074eeb445a23418a5ee34cd0 26-Mar-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: remove unused local variable

Remove unused subchannel pointer in io_subchannel_recog_done.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
e74fe0cec92439115630b51195444b89b910800a 26-Mar-2009 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: ccw device online store - report rc from ccw driver.

In case the ccw driver refuses to set a device offline, we should
transmit the return code to the caller.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
ffa6a7054d172a2f57248dff2de600ca795c5656 04-Mar-2009 Cornelia Huck <cornelia.huck@de.ibm.com> Driver core: Fix device_move() vs. dpm list ordering, v2

dpm_list currently relies on the fact that child devices will
be registered after their parents to get a correct suspend
order. Using device_move() however destroys this assumption, as
an already registered device may be moved under a newly registered
one.

This patch adds a new argument to device_move(), allowing callers
to specify how dpm_list should be adapted.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
f67f129e519fa87f8ebd236b6336fe43f31ee141 01-Mar-2009 Ming Lei <tom.leiming@gmail.com> Driver core: implement uevent suppress in kobject

This patch implements uevent suppress in kobject and removes it
from struct device, based on the following ideas:

1,Uevent sending should be one attribute of kobject, so suppressing it
in kobject layer is more natural than in device layer. By this way,
we can do it for other objects embedded with kobject.

2,It may save several bytes for each instance of struct device.(On my
omap3(32bit ARM) based box, can save 8bytes per device object)

This patch also introduces dev_set|get_uevent_suppress() helpers to
set and query uevent_suppress attribute in case to help kobject
as private part of struct device in future.

[This version is against the latest driver-core patch set of Greg,please
ignore the last version.]

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d36f0c66389eb5e4dbd9b095eea252230ba3273e 25-Dec-2008 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: use pim to check for multipath.

To check if multipath is available we count the bits set in lpm,
which could change over time (via configure [on|off] of a path).

The following patch uses the pim (which is persistent) for this
decision.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
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>
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>
d6a30761d8116b8de8a5b5e79e68cce81d36414b 25-Dec-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Use device_is_registered().

Check if a ccw device is registered via device_is_registered()
and not via the old kludge of checking the membership in driver
core internal klists.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
283fdd0b8ab102080dbffe4bcaae245f9ceda184 25-Dec-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Dont call ->release directly.

Just put the cdev's reference count to give up our reference.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
90ed2b692fa75272d7395c4e4c2de4423d52f506 25-Dec-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Dont fail probe for I/O subchannels.

If we fail the probe for an I/O subchannel, we won't be able
to unregister it again since there are no sch_event()
callbacks for unbound subchannels. Just succeed the probe in
any case and schedule unregistering the subchannel.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
5fb6b8544d9ccd2ed478af777f9e99e342eb8886 25-Dec-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Only register ccw_device for registered subchannel.

There is a race between io_subchannel_register() and
io_subchannel_sch_event() which may cause a subchannel to be
unregistered because it is no longer operational before
io_subchannel_register() had run. We need to check whether the
subchannel is still registered before the ccw device can be
registered and just bail out if it is not.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
6eff208f479d6fe99fd92c0e6bf7e930bb45cd30 25-Dec-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Fix I/O subchannel refcounting.

Subchannel refcounting was incorrect in some places, especially
a refcount was missing when ccw_device_call_sch_unregister()
was called and the refcount was not correctly switched after
moving devices.

Fix this by establishing the following rules:
- The ccw_device obtains a reference on its parent subchannel
when dev.parent is set and gives it up in its release
function. This is needed because we need a parent reference
for correct refcounting even before the ccw device is (if at
all) registered.
- When calling device_move(), obtain a reference on the new
subchannel before moving the ccw device and give up the
reference on the old parent after moving. This brings the
refcount in line with the first rule.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
97166f52fc84c0bc49c7dbba2a26720110acb458 25-Dec-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Put referernce on correct device after moving.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
111e95a4cae01d6dadbbd1d8ab28dcd10fa5619c 25-Dec-2008 Sebastian Ott <sebott@linux.vnet.ibm.com> [S390] cio: move irritating comment.

Due to former patches a comment and device id initialization were
split from the addressed function call in io_subchannel_probe.

Move it back to where it belongs.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
98df67b324a2a986987ce29986e44ae9156b6698 25-Dec-2008 Kay Sievers <kay.sievers@vrfy.org> [S390] struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
85acc407bf1c49fb40b8f461c2c7526af736d87e 14-Nov-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Fix refcount after moving devices.

In ccw_device_move_to_orphanage(), a replacing ccw_device
is searched via get_{disc,orphaned}_ccwdev_by_dev_id()
which obtain a reference on the returned ccw_device.
This reference must be given up again after the device
has been moved to its new parent.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1f4e7edabc4071cdff0133e7e04db2d7287d0e36 10-Oct-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] bus_id -> dev_set_name() for css and ccw busses

Convert remaining s390 users setting bus_id to dev_set_name()
or init_name.

Signed-off-by: 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>
b9d3aed7e1e50183085fcd2af643bf42d6b4bd95 10-Oct-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] more bus_id -> dev_name conversions

Some further bus_id -> dev_name() conversions in s390 code.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: 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>
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>
ecf5d9ef68b868b293b40b89615a92de7310d065 10-Oct-2008 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: introduce purge function for /proc/cio_ignore

Allow users to remove blacklisted ccw devices by using the
/proc/cio_ignore interface:

echo purge > /proc/cio_ignore

will remove all devices which are offline and blacklisted.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
46fbe4e46ddb88805245a24f684400b50ead68a7 10-Oct-2008 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio: move device unregistration to dedicated work queue

Use dedicated slow path work queue when unregistering a device due to
a user action. This ensures serialialization of other register/
unregister requests.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
c78aa6cbace460081ddc6227f02b6d3203a21585 14-Jul-2008 Michael Ernst <mernst@de.ibm.com> [S390] Cleanup cio printk messages.

Unnecessary dev_info, dev_warn and printk messages are removed.

Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
f08adc008d84f6b03d377ede951e29ed169e76e2 14-Jul-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] css: Use css_device_id for bus matching.

css_device_id exists, so use it for determining the right driver
(and add a match_flags which is always 1 for valid types).

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>
99611f87176b2a908d8c66ab19a5fc550a3cd13a 14-Jul-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Repair chpid event handling.

Passing the affected chpid in chp_event() worked only by
chance since chpid is the first element in res_acc_data.
Make it work properly by generalizing res_acc_data as
chp_link and always passing around a properly filled out
chp_link structure in chp_event().

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>
3a3fc29a6d0626fb4897b7391c4e956efbacd394 14-Jul-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Introduce abstract isc definitions.

Replace the numeric values for I/O interruption subclass usage
with abstract definitions and collect them all in asm/isc.h.
This gives us a better overview of which iscs are actually used
and makes it possible to better spread out isc usage in the
future.

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>
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>
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>
7e9db9eaefdb8798730790214ff1b7746006ec98 14-Jul-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Introduce modalias for css bus.

Add modalias and subchannel type attributes for all subchannels.
I/O subchannel specific attributes are now created in
io_subchannel_probe(). modalias and subchannel type are also
added to the uevent for the css bus. Also make the css modalias
known.

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>
0ae7a7b250bdf7ee87c8346164ef3c47fb79dfbd 14-Jul-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Register all subchannels.

Register all valid subchannels, not only I/O subchannels.
Move I/O subchannel specific initialization to io_subchannel_probe().

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>
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>
2f972202315cf71fd60e890ebbed7d5bcf620ba4 30-Apr-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Use strict_strtoul() for attributes.

Make parsing of attribute writes handle incorrect input better.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
a806170e29c5468b1d641a22518243bdf1b8d58b 17-Apr-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Fix a lot of sparse warnings.

Most noteable part of this commit is the new local header file entry.h
which contains all the function declarations of functions that get only
called from asm code or are arch internal. That way we can avoid extern
declarations in C files.
This is more or less the same that was done for sparc64.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
4c629727cefe45abb2f7459836bfc4b41c5e55ba 19-Feb-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Do timed recovery on workqueue.

We can't do our recovery in softirq context, so we schedule it from
our timer function.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
486d0a0079eb782cdb73f18246e26076c615a020 19-Feb-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Remember to initialize recovery_lock.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
4beee64685e116b01c47655daf6d88df87e053c8 26-Jan-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Set driver->owner on css, ccw and ccwgroup busses.

Set the owner field in the embedded struct device_driver to the
value provided in the {css,ccw,ccwgroup}_driver.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
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>
25b7bb5838ab81b68a9de72df577103d8b4aba3c 26-Jan-2008 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Add css_driver_{register,unregister}.

Add wrapper functions for driver_register and driver_unregister so
that css drivers don't need to muck with struct device_driver
directly.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
33583c3657ef30cd7f4cb563071ac23cb6ff69a0 05-Nov-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] cio: use INIT_WORK to initialize struct work.

Use INIT_WORK to initialize struct work and don't initialize a
struct work partial by explicitly initializing its private structures.
Fixes the following lockdep bug because no key was assigned:

INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
0000000001f07bb8 0000000001f07bf8 0000000000000002 0000000000000000
0000000001f07c98 0000000001f07c10 0000000001f07c10 0000000000015406
0000000000000000 0000000000000002 0000000000000000 0000000000000000
0000000001f07bf8 000000000000000c 0000000001f07bf8 0000000001f07c68
000000000039ae60 0000000000015406 0000000001f07bf8 0000000001f07c48
Call Trace:
([<0000000000015376>] show_trace+0xda/0x104)
[<0000000000015460>] show_stack+0xc0/0xf8
[<00000000000154c6>] dump_stack+0x2e/0x3c
[<000000000006a71e>] __lock_acquire+0x47e/0x11a0
[<000000000006b4f0>] lock_acquire+0xb0/0xd8
[<00000000000555a6>] run_workqueue+0x1aa/0x24c
[<00000000000556de>] worker_thread+0x96/0xf4
[<000000000005c210>] kthread+0x90/0xb4
[<000000000001947a>] kernel_thread_starter+0x6/0xc
[<0000000000019474>] kernel_thread_starter+0x0/0xc

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
7eff2e7a8b65c25920207324e56611150eb1cd9a 14-Aug-2007 Kay Sievers <kay.sievers@vrfy.org> Driver core: change add_uevent_var to use a struct

This changes the uevent buffer functions to use a struct instead of a
long list of parameters. It does no longer require the caller to do the
proper buffer termination and size accounting, which is currently wrong
in some places. It fixes a known bug where parts of the uevent
environment are overwritten because of wrong index calculations.

Many thanks to Mathieu Desnoyers for finding bugs and improving the
error handling.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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>
e103178658f07131fee4e643596982b604cc63a9 12-Oct-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Fix device attributes for early devices.

Don't forget to set dev->groups for early ccw devices like the
console device so the default attributes are created.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1842f2b1847155805f9cc8c834ef4272198b272b 12-Oct-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Disable channel measurements (cmf) on shutdown/reboot.

Disable channel measurements for all ccw devices via the ccw bus's
shutdown method. Clear residual cmf related information that may be
in the schib when setting up a new subchannel.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
958974fb596ad037fb571cf2899f783764a83e1a 12-Oct-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Introduce ccw_bus_type.shutdown.

Introduce a shutdown method for the ccw bus that calls the driver
specific shutdown method in struct ccw_driver.
Switch zfcp to the new ccw_driver shutdown method.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
b2ffd8e9a76ec90bd4a509f3d092e35978c568a3 12-Oct-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Add docbook comments.

Comment a bunch of function in docbook style and convert existing
comments on structures to docbook.

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>
3520c92283bb7ddd59daf90cfc1eb107dc9ab76c 22-Aug-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: dont forget to set last slot to NULL in ccw_uevent().

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>
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>
086a6c6249995e49db0f7196d59f69dc3a1e1ef8 17-Jul-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Dont print trailing \0 in modalias_show().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
59a8a6e227cf0bc42e5be741ebfea97c222ab9ef 31-May-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Use device_schedule_callback() for removing disconnected devices.

We can't deregister disconnected and orphaned devices directly from
the online attribute's store method, but must take a detour.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
f7e5d67c7928bfdbcdfd95a0b3d75122238e23e0 10-May-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Make some structures and a function static.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
fa1a8c23eb7d3ded8a3c6d0e653339a2bc7fca9e 26-Apr-2007 Cornelia Huck <cornelia.huck@de.ibm.com> s390: cio: Delay uevents for subchannels

We often have the situation that we register a subchannel and start device
recognition, only to find out that the device is not usable after all, which
triggers an unregister of the subchannel. This often happens on hundreds of
subchannels on a LPAR, leading to a storm of events which aren't of any use.
Therefore, use uevent_suppress to delay the KOBJ_ADD uevent for a subchannel
until we know that its ccw_device is to be registered.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Eric Rannaud <eric.rannaud@gmail.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ef99516c9646802c3d38c3eb83de302e05b3c1b5 27-Apr-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Unregister ccw devices directly.

We used to unregister ccw devices not directly from the I/O
subchannel remove function in order to avoid lifelocks on the
css bus semaphore. This semaphore is gone, and there is no reason
to not unregister the ccw device directly (it is even better since
it is more in keeping with the goal of immediate disconnect).

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
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>
cfbe9bb2fb5de1da58d351432a9465c22d6d3ee5 27-Apr-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Use add_uevent_var.

Convert ccw_uevent to use add_uevent_var and adapt snprint_alias.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
f5ba6c863617c15d22cce5f8666ff4c832773025 27-Apr-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Clean up online_store.

Detangle the online_store code and make it more readable.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
32c5b050927c515cea4083eb8f3a7177dc4279a1 05-Feb-2007 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Remove check for ssd in chpids_show().

Since ssd_info is now available before the subchannel is registered,
we don't need to check whether it is available.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
529192f3b90682e37c5fcab461d968d062f1e0e4 08-Dec-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] Use dev->groups for adding/removing the subchannel attribute group.

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>
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>
2ec2298412e1ab4674b3780005058d4f0b8bd858 08-Dec-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] subchannel lock conversion.

Convert the subchannel lock to a pointer to a lock. Needed for the dynamic
subchannel mapping patch.

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>
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>
c16375329c2ab4667df873394c4be7a61d163c62 08-Dec-2006 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] more workqueue fixes.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
47af5518526d435d0d56a329a578f240e86eb678 04-Dec-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Use device_reprobe() instead of bus_rescan_devices().

In io_subchannel_register(), it is better to just reprobe the current
device if it hasn't a driver yet than to rescan the whole bus.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
3c9da7ba049d11caccc219576a3a23404aa2fc50 27-Oct-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] cio: Make ccw_device_register() static.

ccw_device_register() is only called from io_subchannel_register()
and io_subchannel_probe() and will never be called for possible
non-io subchannels.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
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>
db0c2d59087296b3567ec408abe17108db88b385 20-Sep-2006 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] set modalias for ccw bus uevents.

Add the MODALIAS environment variable for ccw bus uevents.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
d2c993d845781d160a7ef759a3e65c6892c4a270 12-Jul-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Fix sparse warnings.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
6ab4879a0d074c938fd17dba141dce042fc17bee 12-Jul-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [S390] subchannel register/unregister mutex.

Add a reg_mutex to prevent unregistering a subchannel before it has been
registered. Since 2.6.17, we've seen oopses in kslowcrw when a device is
found to be not operational during sense id when doing initial device
recognition; it is not clear yet why that particular problem was not (yet)
observed with earlier kernels...

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
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>
40154b824331cd9c81c06545761338f3d80a36e2 29-Jun-2006 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] cio async subchannel reprobe.

Changes in the DASD driver require an asynchronous implementation of the
subchannel reprobe loop. This loop was so far only used by the blacklisting
mechanism but is now available to all CCW device drivers.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
88abaab4f9b08381e30e737980a1c49d6b524dfc 24-Mar-2006 Eric Sesterhenn <snakebyte@gmx.de> [PATCH] s390: kzalloc() conversion in drivers/s390

Convert all kmalloc + memset sequences in drivers/s390 to kzalloc usage.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
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>
6cadb78b3bec0a439a99db8fb550dc568e924ae6 17-Feb-2006 Cornelia Huck <cornelia.huck@de.ibm.com> [PATCH] s390: fix assignment instead of check in ccw_device_set_online()

Fix assignment instead of check in ccw_device_set_online(). Also remove
unneeded assignment in ccw_device_do_sense().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
b1969fa46d95efcdb0b84c540eca10db99665148 01-Feb-2006 Cornelia Huck <cohuck@de.ibm.com> [PATCH] s390: Fix modalias for ccw devices

Fix modalias for ccw devices: cu_type should be in capitals as well.

Signed-off-by: Cornelia Huck <cohuck@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
600b5d163d7434332539cac7be00f649cbbfedcc 01-Feb-2006 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [PATCH] s390: ccw_device_probe_console return value

The return code of ccw_device_probe_console() is not properly handled. It
should only return a valid ccw device pointer or a error value converted by
ERR_PTR. Fix the console driver code to check with IS_ERR instead against
NULL.

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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
e018ba1fceee5bd306e31f6e3a60934d5f143ac5 01-Feb-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [PATCH] s390: Remove CVS generated information

- Remove all CVS generated information like e.g. revision IDs from
drivers/s390 and include/asm-s390 (none present in arch/s390).

- Add newline at end of arch/s390/lib/Makefile to avoid diff message.

Acked-by: Andreas Herrmann <aherrman@de.ibm.com>
Acked-by: Frank Pavlic <pavlic@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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>
8bbace7e686f1536905c703038a7eddfb1520264 11-Jan-2006 Cornelia Huck <huckc@de.ibm.com> [PATCH] Add {css,ccw}_bus_type probe, remove, shutdown methods.

The following patch converts css_bus_type and ccw_bus_type to use
the new bus_type methods.

Signed-off-by: Cornelia Huck <huckc@de.ibm.com>
CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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>
a28c69448154a0901e8815922030c5dcd2f8e388 06-Jan-2006 Cornelia Huck <cohuck@de.ibm.com> [PATCH] s390: introduce struct channel_subsystem

struct channel_subsystem encapsulates several per channel subsystem
properties, like status of chpids or the global path group id.

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>
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>
973bd9937569146de0917f54f05b2942f8257912 06-Jan-2006 Martin Schwidefsky <schwidefsky@de.ibm.com> [PATCH] s390: atomic primitives

Hugh Dickins <hugh@veritas.com>

Fix the broken atomic_cmpxchg primitive. Add atomic_sub_and_test,
atomic64_sub_return, atomic64_sub_and_test, atomic64_cmpxchg,
atomic64_add_unless and atomic64_inc_not_zero. Replace old style
atomic_compare_and_swap by atomic_cmpxchg. Shorten the whole header by
defining most primitives with the two inline functions atomic_add_return and
atomic_sub_return.

In addition this patch contains the s390 related fixes of Hugh's "mm: fill
arch atomic64 gaps" patch.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
6d20b035dee4300e9786c6e1cb77a765c7f9460a 26-Nov-2005 Paul Jackson <pj@sgi.com> [PATCH] driver kill hotplug word from sn and others fix

The first of these changes s/hotplug/uevent/ was needed to
compile sn2_defconfig (ia64/sn). The other three files
changed are blind changes of all remaining bus_type.hotplug
references I could find to bus_type.uevent.

This patch attempts to finish similar changes made in the
gregkh-driver-kill-hotplug-word-from-driver-core Nov 22 patch.

Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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>
f1fc78a8c7f3a784b9fd1e07cc1438a0ea569555 31-Oct-2005 Bastian Blank <bastian@waldi.eu.org> [PATCH] s390, ccw - export modalias

This patch exports modalias for ccw devices.

So you can do:
modprobe `echo /sys/device/path_to_device/modalias`
and the proper driver will automatically be loaded by userspace.

Signed-off-by: Bastian Blank <waldi@debian.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
e5945b4f605d1479d5b44252a2c691168c5d38d6 11-Oct-2005 Cornelia Huck <cohuck@de.ibm.com> [PATCH] s390: ccw device reconnect oops.

Search for a disconnect ccw_device on the ccw bus rather than on the css
bus (was a typo in patch I did for the klist conversion). A cast to an
embedding ccw_device from an embedded device in a struct subchannel will
lead us to oopses.

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>
b0744bd2925a4a24865963322534107d2ad553f9 25-Jun-2005 Cornelia Huck <cohuck@de.ibm.com> [PATCH] s/390: Use klist in cio

Convert the common I/O layer to use the klist interfaces.

This patch has been adapted from the previous version to the changed interface
semantics. Also, gcc 4.0 compile warnings have been removed.

Signed-off-by: Cornelia Huck <cohuck@de.ibm.com>
Cc: Greg KH <greg@kroah.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
3fd3c0a5f53a0f9d8987b90acbd84f7dd8ef606e 17-May-2005 Yani Ioannou <yani.ioannou@gmail.com> [PATCH] Driver Core: drivers/char/raw3270.c - drivers/net/netiucv.c: update device attribute callbacks

Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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!