Commit graph

583 commits

Author SHA1 Message Date
Michael Ernst ec00440786 [S390] cio: channel path memory leak
Move dev_set_name to when we know that the device will actually be
registered in order to avoid a memory leak if the allocated memory
for the channel path has to be freed.

Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-10-06 10:35:06 +02:00
Alexey Dobriyan 828c09509b const: constify remaining file_operations
[akpm@linux-foundation.org: fix KVM]
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01 16:11:11 -07:00
Jan Glauber 6541f7b68f [S390] qdio: change state of all primed input buffers
If input buffers stay in primed state qdio may not receive further interrupts
for the input queue depending on the firmware. That can cause a connection
hang on OSA cards.

Change the state of all primed input buffers that are not acknowledged to
not initialized.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-22 22:58:43 +02:00
Jan Glauber 1d7e1500a6 [S390] qdio: reduce per device debug messages
Even if turned off the debug message overhead is measurable in the hot path.
Reduce the number of debug message calls in do_QDIO and qdio_kick_handler.
Also use hex numbers to save space in the debug entries.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-22 22:58:42 +02:00
Sebastian Ott 703e5c9993 [S390] cio: introduce consistent subchannel scanning
Previously, there were multiple subchannel scanning mechanisms
which could potentially conflict with each other. Fix this problem
by moving blacklist and ccw driver triggered scanning to the
existing evaluation method.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-22 22:58:42 +02:00
Sebastian Ott b0a285d31b [S390] cio: idset use actual number of ssids
The functions idset_sch_new and for_each_subchannel_staged
use different values for the number of subchannel sets. Make
it consistent by changing idset_sch_new to also use the actual
number of subchannel sets.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-22 22:58:42 +02:00
Sebastian Ott b827d1c8b6 [S390] cio: dont kfree vmalloced memory
Don't use kfree to free memory allocated by vmalloc.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-22 22:58:42 +02:00
Sebastian Ott 8ea7f55901 [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>
2009-09-22 22:58:41 +02:00
Sebastian Ott 255305536c [S390] cio: introduce css_eval_scheduled
Use css_eval_scheduled to determine if all scheduled subchannel
evaluation is finished. Wait for this value to be 0 in the
channel subsystem init function.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-22 22:58:41 +02:00
Sebastian Ott 2f17644d1c [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>
2009-09-22 22:58:41 +02:00
David Brownell a4dbd6740d 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>
2009-09-15 09:50:47 -07:00
Heiko Carstens e86a6ed63f [S390] Get rid of cpuid.h header file.
Merge cpuid.h header file into cpu.h.
While at it convert from typedef to struct declaration and also
convert cio code to use proper lowcore structure instead of casts.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-11 10:29:56 +02:00
Sebastian Ott c630493327 [S390] proper use of device register
Don't use kfree directly after device registration started.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-11 10:29:45 +02:00
Sebastian Ott 3ac276f8cb [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>
2009-09-11 10:29:41 +02:00
Sebastian Ott 3b554a14f4 [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>
2009-09-11 10:29:40 +02:00
Sebastian Ott 6ee4fec6be [S390] cio: remove subchannel init_name
We used the init_name to set the console subchannels name early
at the boot stage. With the patch cio: fix memleak in subchannel validation
we moved the name setting to the point where we actually register the
console subchannel. 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>
2009-09-11 10:29:40 +02:00
Sebastian Ott ab6aae0902 [S390] cio: fix memleak in subchannel validation
When scanning for new subchannels we have a code path where we allocate
memory for a struct subchannel, set the device name (which is dynamically
allocated now) and do a check if the underlying device is blacklisted - if
so we free the subchannel structure.
Since we have not set up refcounting at this stage, the device name's memory
is lost. Fix this by moving the dev_set_name after the blacklist test.

Note: With this patch the init_name for the console subchannel becomes
virtually obsolete.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-11 10:29:39 +02:00
Sebastian Ott f014824ee7 [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>
2009-09-11 10:29:39 +02:00
Jan Glauber 3f09bb8965 [S390] qdio: remove limited number of debugfs entries
The number of qdio debugfs entries was limited. Remove this limit
and group the queue files in a per device directory.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-11 10:29:39 +02:00
Michael Ernst 217ee6c64a [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>
2009-09-11 10:29:38 +02:00
Sebastian Ott be7a2ddce6 [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>
2009-09-11 10:29:38 +02:00
Jan Glauber e2910bcf8c [S390] qdio: continue polling if the queue is not finished
With commit c38f960809 polling was
stopped for the queue even if new data is available.

Return immediately after scheduling the queue tasklet if the queue
is not done.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-11 10:29:37 +02:00
Sebastian Ott efd986db2d [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>
2009-09-11 10:29:37 +02:00
Sebastian Ott 626e476ae0 [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>
2009-09-11 10:29:37 +02:00
Peter Oberparleiter 1da73bc80b [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>
2009-09-11 10:29:36 +02:00
Heiko Carstens 62733e5a5a [S390] cio: move scsw helper functions to header file
All scsw helper functions are very short and usage of them shouldn't
result in function calls. Therefore we move them to a separate header
file.
Also saves a lot of EXPORT_SYMBOLs.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-11 10:29:36 +02:00
Peter Oberparleiter 1f1148c88a [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>
2009-09-11 10:29:36 +02:00
Sebastian Ott 06739a8ad3 [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>
2009-08-23 18:10:00 +02:00
Jan Glauber 6618241b47 [S390] qdio: Sanitize do_QDIO sanity checks
Remove unneeded sanity checks from do_QDIO since this is the hot path.
Change the type of bufnr and count to unsigned int so the check for the
maximum value works.

Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-22 12:08:21 +02:00
Jan Glauber f0a0b15e0f [S390] qdio: leave inbound SBALs primed
It is not required to change the state of primed SBALs. Leaving them
primed saves a SQBS instruction under z/VM.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-22 12:08:21 +02:00
Jan Glauber cf9a031c2c [S390] qdio: merge AI tasklet into interrupt handler
Since the adapter interrupt tasklet only schedules the queue tasklets
and contains no code that requires serialization in can be merged
with the adapter interrupt handler. That possibly safes some CPU
cycles.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-22 12:08:20 +02:00
Jan Glauber 36e3e72120 [S390] qdio: extract all primed SBALs at once
For devices without QIOASSIST primed SBALS were extracted in a loop.
Remove the loop since get_buf_states can already return more than
one primed SBAL.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-22 12:08:20 +02:00
Jan Glauber 9a2c160a8c [S390] qdio: fix check for running under z/VM
The check whether qdio runs under z/VM was incorrect since SIGA-Sync is not
set if the device runs with QIOASSIST. Use MACHINE_IS_VM instead to prevent
polling under z/VM.

Merge qdio_inbound_q_done and tiqdio_is_inbound_q_done.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-22 12:08:20 +02:00
Jan Glauber 60b5df2f12 [S390] qdio: move adapter interrupt tasklet code
Move the adapter interrupt tasklet function to the qdio main code
since all the functions used by the tasklet are located there.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-22 12:08:19 +02:00
Martin Schwidefsky 6664845cef [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>
2009-06-16 10:31:11 +02:00
Cornelia Huck ad285ae9fc [S390] pm: chsc 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>
2009-06-16 10:31:10 +02:00
Cornelia Huck 93a275921d [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>
2009-06-16 10:31:09 +02:00
Sebastian Ott dcbd16d511 [S390] pm: css bus power management callbacks
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-16 10:31:09 +02:00
Sebastian Ott 7e597a21a1 [S390] pm: ccwgroup bus power management callbacks
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-16 10:31:08 +02:00
Sebastian Ott 823d494ac1 [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>
2009-06-16 10:31:08 +02:00
Heiko Carstens 88dbd20372 [S390] ftrace: add function graph tracer support
Function graph tracer support for s390.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-12 10:27:39 +02:00
Roel Kluin 6b9d8e80bb [S390] qdio: fix access beyond ARRAY_SIZE of irq_ptr->{in,out}put_qs
Do not go beyond ARRAY_SIZE of irq_ptr->{in,out}put_qs

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-12 10:27:34 +02:00
Jan Glauber a7c65a559a [S390] qdio: inline qdio_perf_stat_inc
Move qdio_perf_stat_inc to the header file so it can be inlined.
Remove unused qdio_perf_stat_dec.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-12 10:27:32 +02:00
Jan Glauber 4c57542320 [S390] qdio: simplify error handling in irq handler
The check for the device status in qdio_establish_handle_irq()
had dead code. Remove the unused code and simplify the error
handling.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-12 10:27:32 +02:00
Sebastian Ott e45efa99b0 [S390] cio: fix sanity checks in device_ops.
Some sanity checks in device_ops.c test the output of container_of
macros to be !NULL. Test the input parameters instead.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-12 10:27:31 +02:00
Martin Schwidefsky 76d4e00a05 [S390] merge cpu.h into cputime.h
All definition in cpu.h have to do with cputime accounting. Move
them to cputime.h and remove the header file.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-12 10:27:29 +02:00
Jan Glauber 75cb71f318 [S390] qdio: remove dead timeout handler
The QDIO ccw devices are started by ccw_device_start so no timeout
can occur for the interrupt handler. Remove the dead code.

In case of an I/O error set the device state to error and wake up
a possibly running qdio_shutdown waiter.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-04-14 15:37:24 +02:00
Sebastian Ott 99f6a570ee [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>
2009-03-31 19:17:07 +02:00
Sebastian Ott b5cd99e6b0 [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>
2009-03-31 19:17:06 +02:00
Sebastian Ott 47593bfa10 [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>
2009-03-31 19:17:06 +02:00
Sebastian Ott c4621a6264 [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>
2009-03-31 19:17:05 +02:00
Sebastian Ott 156013ffd1 [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>
2009-03-31 19:17:03 +02:00
Linus Torvalds 21cdbc1378 Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: (81 commits)
  [S390] remove duplicated #includes
  [S390] cpumask: use mm_cpumask() wrapper
  [S390] cpumask: Use accessors code.
  [S390] cpumask: prepare for iterators to only go to nr_cpu_ids/nr_cpumask_bits.
  [S390] cpumask: remove cpu_coregroup_map
  [S390] fix clock comparator save area usage
  [S390] Add hwcap flag for the etf3 enhancement facility
  [S390] Ensure that ipl panic notifier is called late.
  [S390] fix dfp elf hwcap/facility bit detection
  [S390] smp: perform initial cpu reset before starting a cpu
  [S390] smp: fix memory leak on __cpu_up
  [S390] ipl: Improve checking logic and remove switch defaults.
  [S390] s390dbf: Remove needless check for NULL pointer.
  [S390] s390dbf: Remove redundant initilizations.
  [S390] use kzfree()
  [S390] BUG to BUG_ON changes
  [S390] zfcpdump: Prevent zcore from beeing built as a kernel module.
  [S390] Use csum_partial in checksum.h
  [S390] cleanup lowcore.h
  [S390] eliminate ipl_device from lowcore
  ...
2009-03-26 16:04:22 -07:00
Martin Schwidefsky 7b4684880d [S390] eliminate cpuinfo_S390 structure
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:26 +01:00
Jan Glauber 9c8a08d7a7 [S390] qdio: merge inbound and outbound handler functions
The inbound and outbound handlers are nearly identical if the outbound
handler uses first_to_check as end index instead of last_move. Since both
values are identical at that point the handlers can be merged.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:22 +01:00
Jan Glauber d303b6fd85 [S390] qdio: report SIGA errors directly
Errors from SIGA instructions are stored in the per queue qdio_error
and reported back when the queue handler is called. That opens a race
when multiple error conditions occur simultanously.

Report SIGA errors immediately in the return value of do_QDIO so the
upper layer can react and SIGA errors no longer interfere with other
errors.

Move the SIGA error handling in qeth from the outbound handler to
qeth_flush_buffers.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
2009-03-26 15:24:22 +01:00
Jan Glauber 9e890ad880 [S390] qdio: tasklet termination in case of module unload
If the qdio module is unloaded the tiqdio tasklet must be terminated
by tasklet_kill. Move the tasklet_kill after the unregistration of
the adapter interrupt so the tiqdio tasklet will not be scheduled
anymore before calling tasklet_kill.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:21 +01:00
Jan Glauber e85dea0e41 [S390] qdio: seperate last move index and polling index
The index value that indicated that the input queue moved was also used to
store the index of the first acknowledged buffer. For non-qebsm only the
newest buffer is acknowledged which may be different from the last move index
so two seperate values are needed to track the input queue.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:21 +01:00
Jan Glauber 3fdf1e18cb [S390] qdio: move ACK to newest buffer for devices without QEBSM
The ACKnowledgement state should be set on the newest SBAL so an
adapter interrupt surpression check needs to scan fewer SBALs.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:21 +01:00
Jan Glauber 700e982f28 [S390] qdio: call qdio_free also if qdio_shutdown fails
qdio_cleanup is a wrapper function that should call qdio_shutdown and
qdio_free. qdio_free was not called if an error occured in qdio_shutdown
resulting in a missing free of allocated resources.

Call qdio_free regardless of the return value of qdio_shutdown.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:20 +01:00
Jan Glauber c38f960809 [S390] qdio: proper kill of qdio tasklets
The queue tasklets were stopped with tasklet_disable. Although tasklet_disable
prevents the tasklet from beeing executed it is still possible that a tasklet
is scheduled on a CPU at that point. A following qdio_establish calls
tasklet_init which clears the tasklet count and the tasklet state leading to
the following Oops:

    <2>kernel BUG at kernel/softirq.c:392!
    <4>illegal operation: 0001 [#1] SMP
    <4>Modules linked in: iptable_filter ip_tables x_tables dm_round_robin dm_multipath scsi_dh sg sd_mod crc_t10dif nfs lockd nfs
_acl sunrpc fuse loop dm_mod qeth_l3 ipv6 zfcp qeth scsi_transport_fc qdio scsi_tgt scsi_mod chsc_sch ccwgroup dasd_eckd_mod dasdm
od ext3 mbcache jbd
    <4>Supported: Yes
    <4>CPU: 0 Not tainted 2.6.27.13-1.1.mz13-default #1
    <4>Process blast.LzS_64 (pid: 16445, task: 000000006cc02538, ksp: 000000006cb67998)
    <4>Krnl PSW : 0704c00180000000 00000000001399f4 (tasklet_action+0xc8/0x1d4)
    <4>           R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 EA:3
    <4>Krnl GPRS: ffffffff00000030 0000000000000002 0000000000000002 fffffffffffffffe
    <4>           000000000013aabe 00000000003b6a18 fffffffffffffffd 0000000000000000
    <4>           00000000006705a8 000000007d0914a8 000000007d0914b0 000000007fecfd30
    <4>           0000000000000000 00000000003b63e8 000000007fecfd90 000000007fecfd30
    <4>Krnl Code: 00000000001399e8: b9200021            cgr     %r2,%r1
    <4>           00000000001399ec: a7740004            brc     7,1399f4
    <4>           00000000001399f0: a7f40001            brc     15,1399f2
    <4>          >00000000001399f4: c0100027e8ee        larl    %r1,636bd0
    <4>           00000000001399fa: bf1f1008            icm     %r1,15,8(%r1)
    <4>           00000000001399fe: a7840019            brc     8,139a30
    <4>           0000000000139a02: c0300027e8ef        larl    %r3,636be0
    <4>           0000000000139a08: e3c030000004        lg      %r12,0(%r3)
    <4>Call Trace:
    <4>([<0000000000139c12>] tasklet_hi_action+0x112/0x1d4)
    <4> [<000000000013aabe>] __do_softirq+0xde/0x1c4
    <4> [<000000000010fa2e>] do_softirq+0x96/0xb0
    <4> [<000000000013a8d8>] irq_exit+0x70/0xcc
    <4> [<000000000010d1d8>] do_extint+0xf0/0x110
    <4> [<0000000000113b10>] ext_no_vtime+0x16/0x1a
    <4> [<000003e0000a3662>] ext3_dirty_inode+0xe6/0xe8 [ext3]
    <4>([<00000000001f6cf2>] __mark_inode_dirty+0x52/0x1d4)
    <4> [<000003e0000a44f0>] ext3_ordered_write_end+0x138/0x190 [ext3]
    <4> [<000000000018d5ec>] generic_perform_write+0x174/0x230
    <4> [<0000000000190144>] generic_file_buffered_write+0xb4/0x194
    <4> [<0000000000190864>] __generic_file_aio_write_nolock+0x418/0x454
    <4> [<0000000000190ee2>] generic_file_aio_write+0x76/0xe4
    <4> [<000003e0000a05c2>] ext3_file_write+0x3e/0xc8 [ext3]
    <4> [<00000000001cc2fe>] do_sync_write+0xd6/0x120
    <4> [<00000000001ccfc8>] vfs_write+0xac/0x184
    <4> [<00000000001cd218>] SyS_write+0x68/0xe0
    <4> [<0000000000113402>] sysc_noemu+0x10/0x16
    <4> [<0000020000043188>] 0x20000043188
    <4>Last Breaking-Event-Address:
    <4> [<00000000001399f0>] tasklet_action+0xc4/0x1d4
    <6>qdio: 0.0.c61b ZFCP on SC f67 using AI:1 QEBSM:0 PCI:1 TDD:1 SIGA: W AOP
    <4> <0>Kernel panic - not syncing: Fatal exception in interrupt

Use tasklet_kill instead of tasklet_disbale. Since tasklet_schedule must not be
called after tasklet_kill use the QDIO_IRQ_STATE_STOPPED to inidicate that a
queue is going down and prevent further tasklet schedules in that case.

Remove superflous tasklet_schedule from input queue setup, at that time
the queues are not ready so the schedule results in a NOP.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:20 +01:00
Jan Glauber e4c14e2085 [S390] qdio: Dont call qdio_shutdown in case qdio_activate fails
Remove the call to qdio_shutdown from qdio_activate since the upper-layer
drivers are responsible to call qdio_shutdown when qdio_activate returns
with an error.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:20 +01:00
Jan Glauber b454740246 [S390] qdio: add missing tiq_list locking
Add a mutex to protect the tiq_list. Although reading the list is done
using RCU adding and removing elements from the list must still
happen locked since multiple qdio devices may change the list in parallel
otherwise.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:19 +01:00
Peter Oberparleiter 56e25e9777 [S390] cio: prevent workqueue deadlock
Subchannel reprobing can block the kslowcrw workqueue indefinitely
while waiting for device recognition to finish which is also scheduled
to run on kslowcrw. Prevent this deadlock by moving the waiting
portion of subchannel reprobing to the cio workqueue.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:18 +01:00
Sebastian Ott 0cc110651b [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>
2009-03-26 15:24:17 +01:00
Peter Oberparleiter 7a968f0565 [S390] cio: incorrect status check in interrogate function
Fix incorrect check for active I/O in interrogate function.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:17 +01:00
Sebastian Ott 17e7d87d9f [S390] cio: fix rc generation after chsc call
In some situations a rc in __chsc_do_secm will be overwritten
by another one. This shouldn't do harm since todays callers
don't check for _specific_ errors but fix it for the sake of
correctness.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:16 +01:00
Sebastian Ott 94cbc203be [S390] cio: fix wrong buffer access in cio_ignore_write
Writing only spaces to /proc/cio_ignore will cause a buffer overflow
since the size_t value i will not become negative and so buf[-1UL] is
accessed. Change the value of i to ssize_t.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:16 +01:00
Sebastian Ott e909074bb9 [S390] cio: ccw group fix unbind behaviour.
For a ccw group device unbinding it from its driver should do the
same as a call to ungroup, since this virtual device can not exist
without a driver.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:16 +01:00
Sebastian Ott 50f1548399 [S390] cio: fix sanity checks in ccwgroup driver.
Some sanity checks in the ccw group driver test the output of
container_of macros to be !NULL. Test the input parameters instead.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:15 +01:00
Sebastian Ott 40c9f9992b [S390] cio: ccw group online store - report rcs to the caller.
In case the ccw group driver refuses to set a device [on|off]line,
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>
2009-03-26 15:24:15 +01:00
Sebastian Ott a1f640734a [S390] cio: airq - fix array boundary
MAX_ISC is a valid isc number, so arrays with an index of isc
need to have a length of MAX_ISC+1

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:14 +01:00
Sebastian Ott 90ac24a5ae [S390] cio: device scan oom fallback.
Since some callers rely on for_each_subchannel_staged to not fail,
fall back to brute force scanning using get_subchannel_by_schid in
case of a oom situation.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:14 +01:00
Heiko Carstens 87fa5af80c [S390] cio: ensure single load of irq handler pointer
Add barrier to prevent compiler from reloading pointer to irq handler.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:14 +01:00
Heiko Carstens 98c1c68252 [S390] cio/crw: add/fix locking
The crw_unregister_handler uses xchg + synchronize_sched when
unregistering a crw_handler.
This doesn't protect crw_collect_info to potentially jump to NULL since
it has unlocked code like this:

if (crw_handlers[i])
        crw_handlers[i](NULL, NULL, 1);

So add a mutex which protects the crw handler array for changes.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:13 +01:00
Sebastian Ott e74fe0cec9 [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>
2009-03-26 15:24:13 +01:00
Cornelia Huck c08f294a14 [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>
2009-03-26 15:24:13 +01:00
Cornelia Huck ed04b892e2 [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>
2009-03-26 15:24:12 +01:00
Cornelia Huck eb32ae8d0e [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>
2009-03-26 15:24:12 +01:00
Heiko Carstens f5daba1d41 [S390] split/move machine check handler code
Split machine check handler code and move it to cio and kernel code
where it belongs to. No functional change.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 15:24:10 +01:00
Alex Chiang 669420644c sysfs: only allow one scheduled removal callback per kobj
The only way for a sysfs attribute to remove itself (without
deadlock) is to use the sysfs_schedule_callback() interface.

Vegard Nossum discovered that a poorly written sysfs ->store
callback can repeatedly schedule remove callbacks on the same
device over and over, e.g.

	$ while true ; do echo 1 > /sys/devices/.../remove ; done

If the 'remove' attribute uses the sysfs_schedule_callback API
and also does not protect itself from concurrent accesses, its
callback handler will be called multiple times, and will
eventually attempt to perform operations on a freed kobject,
leading to many problems.

Instead of requiring all callers of sysfs_schedule_callback to
implement their own synchronization, provide the protection in
the infrastructure.

Now, sysfs_schedule_callback will only allow one scheduled
callback per kobject. On subsequent calls with the same kobject,
return -EAGAIN.

This is a short term fix. The long term fix is to allow sysfs
attributes to remove themselves directly, without any of this
callback hokey pokey.

[cornelia.huck@de.ibm.com: s390 ccwgroup bits]

Reported-by: vegard.nossum@gmail.com
Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-24 16:38:26 -07:00
Cornelia Huck ffa6a7054d 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>
2009-03-24 16:38:26 -07:00
Ming Lei f67f129e51 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>
2009-03-24 16:38:26 -07:00
Jan Glauber 19cdd08ba1 [S390] qdio: fix broken pointer in case of CONFIG_DEBUG_FS is disabled
If CONFIG_DEBUG_FS is disabled debugfs_create_file returns -ENODEV instead
of zero. Since the return value is stored and used at shutdown to remove
existing entries an OOPS may be triggered.

Add a check of the debugfs_create_file return value and in case of an error
set the entry to NULL so it will be ignored at shutdown.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-01-09 12:15:07 +01:00
Coly Li 73ac36ea14 fix similar typos to successfull
When I review ocfs2 code, find there are 2 typos to "successfull".  After
doing grep "successfull " in kernel tree, 22 typos found totally -- great
minds always think alike :)

This patch fixes all the similar typos. Thanks for Randy's ack and comments.

Signed-off-by: Coly Li <coyli@suse.de>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Roland Dreier <rolandd@cisco.com>
Cc: Jeremy Kerr <jk@ozlabs.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
Cc: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:15 -08:00
Martin Schwidefsky 9cfb9b3c3a [PATCH] improve idle cputime accounting
Distinguish the cputime of the idle process where idle is actually using
cpu cycles from the cputime where idle is sleeping on an enabled wait psw.
The former is accounted as system time, the later as idle time.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-31 15:11:48 +01:00
Michael Ernst e6d5a428e0 [S390] convert cio printks to pr_xxx macros.
Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:39:20 +01:00
Sebastian Ott d36f0c6638 [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>
2008-12-25 13:39:11 +01:00
Sebastian Ott f444cc0e52 [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>
2008-12-25 13:39:10 +01:00
Sebastian Ott 13952ec12d [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>
2008-12-25 13:39:10 +01:00
Sebastian Ott cdb912a40d [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>
2008-12-25 13:39:10 +01:00
Cornelia Huck d6a30761d8 [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>
2008-12-25 13:39:09 +01:00
Cornelia Huck 283fdd0b8a [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>
2008-12-25 13:39:09 +01:00
Cornelia Huck 90ed2b692f [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>
2008-12-25 13:39:08 +01:00
Cornelia Huck 5fb6b8544d [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>
2008-12-25 13:39:08 +01:00
Cornelia Huck 6eff208f47 [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>
2008-12-25 13:39:08 +01:00
Cornelia Huck 9cd6742197 [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>
2008-12-25 13:39:07 +01:00
Cornelia Huck 97166f52fc [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>
2008-12-25 13:39:07 +01:00
Peter Oberparleiter c619d4223e [S390] cio: fix ccwgroup online vs. ungroup race condition
Ensure atomicity of ungroup operation to prevent concurrent ungroup
and online processing which may lead to use-after-release situations.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:39:06 +01:00
Sebastian Ott 111e95a4ca [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>
2008-12-25 13:39:06 +01:00
Heiko Carstens 191fd44c11 [S390] cio: get rid of compile warning
Move cio_tpi() to the rest of the CONFIG_CCW_CONSOLE functions to
get rid of this one:

drivers/s390/cio/cio.c:115: warning: 'cio_tpi' defined but not used

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:39:05 +01:00
Kay Sievers 98df67b324 [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>
2008-12-25 13:39:03 +01:00
Jan Glauber 7a0b4cbc7d [S390] qdio: fix error reporting for hipersockets
Hipersocket connections can encounter temporary busy conditions.
In case of the busy bit set we retry the SIGA operation immediatelly.
If the busy condition still persists after 100 ms we fail and report
the error to the upper layer. The second stage retry logic is removed.
In case of ongoing busy conditions the upper layer needs to reset the
connection.

The reporting of a SIGA error is now done synchronously to allow the
network driver to requeue the buffers. Also no error trace is created
for the temporary SIGA errors so the error message view is not flooded.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:39:00 +01:00
Jan Glauber 50f769df1c [S390] qdio: improve inbound buffer acknowledgement
- Use automatic acknowledgement of incoming buffers in QEBSM mode
- Move ACK for non-QEBSM mode always to the newest buffer to prevent
  a race with qdio_stop_polling
- Remove the polling spinlock, the upper layer drivers return new buffers
  in the same code path and could not run in parallel
- Don't flood the error log in case of no-target-buffer-empty
- In handle_inbound we check if we would overwrite an ACK'ed buffer, if so
  advance the pointer to the oldest ACK'ed buffer so we don't overwrite an
  empty buffer in qdio_stop_polling

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:38:59 +01:00
Jan Glauber 22f9934767 [S390] qdio: rework debug feature logging
- make qdio_trace a per device view
- remove s390dbf exceptions
- remove CONFIG_QDIO_DEBUG, not needed anymore if we check for the level
  before calling sprintf
- use snprintf for dbf entries
- add start markers to see if the dbf view wrapped
- add a global error view for all queues

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:38:59 +01:00
Jan Glauber 9a1ce28aeb [S390] qdio: fix compile warning under 31 bit
The QEBSM instructions are only available for CONFIG_64BIT, they are not
used under 31 bit. Make compiler happy about the false positive:

drivers/s390/cio/qdio_main.c: In function ?qdio_inbound_q_done?:
drivers/s390/cio/qdio_main.c:532: warning: ?state? may be used uninitialized in this function

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:38:58 +01:00
Jan Glauber 23589d057a [S390] qdio: add eqbs/sqbs instruction counters
Add counters for the eqbs and sqbs instructions that indicate how often
we issued the instructions and how often the instructions returned with
less buffers than specified.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:38:58 +01:00
Jan Glauber bbd50e172f [S390] qdio: fix qeth port count detection
qeth needs to get the port count information before
qdio has allocated a page for the chsc operation.
Extend qdio_get_ssqd_desc() to store the data in the
specified structure.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:38:58 +01:00
Cornelia Huck 85acc407bf [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>
2008-11-14 18:18:54 +01:00
Jan Glauber 2c78091405 [S390] qdio: remove incorrect memset
Remove the memset since zeroing the string is not needed and use
snprintf instead of sprintf.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-10-28 11:12:03 +01:00
Jan Glauber 7c045aa2c8 [S390] qdio: prevent double qdio shutdown in case of I/O errors
In case of I/O errors on a qdio subchannel qdio_shutdown may be
called twice by the qdio driver and by zfcp. Remove the
superfluous shutdown from qdio and let the upper layer driver
handle the error condition.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-10-28 11:12:02 +01:00
Heiko Carstens 5a0d0e6537 [S390] Move private simple udelay function to arch/s390/lib/delay.c.
Move cio's private simple udelay function to lib/delay.c and turn it
into something much more readable. So we have all implementations
at one place.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-10-10 21:33:58 +02:00
Klaus-Dieter Wacker 7a0f475513 [S390] qdio enhanced SIGA (iqdio) support.
Add support for z10 HiperSockets multiwrite SBALs on output
queues. This is used on LPAR with EDDP enabled devices.

Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-10-10 21:33:55 +02:00
Heiko Carstens b1e766137f [S390] cio: fix cio_tpi.
In cio_tpi only disable bottom halves when not in interrupt context.
Otherwise a WARN_ON gets triggered. Besides that, when we are in
interrupt context bottom halves are disabled anyway.
Fixes this one:

Badness at kernel/softirq.c:77
Modules linked in:
CPU: 2 Not tainted 2.6.26 #4
Process swapper (pid: 0, task: 000000003fe83db0, ksp: 000000003fea7d28)
Krnl PSW : 0404c00180000000 0000000000053f4e (__local_bh_disable+0xbe/0xcc)
           R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 EA:3
Krnl GPRS: 0000000000008ee0 00000000005f95e0 0000000000000000 0000000000000001
           000000000020be92 0000000000000000 0000000000000210 00000000005d36c0
           000000003fb5f4d8 0000000000000000 000000000020bed0 000000003fb5f3c8
           00000000009be920 0000000000364898 000000003fb5f408 000000003fb5f3c8
Krnl Code: 0000000000053f42: bf2f1000           icm     %r2,15,0(%r1)
           0000000000053f46: a774ffc5           brc     7,53ed0
           0000000000053f4a: a7f40001           brc     15,53f4c
          >0000000000053f4e: a7280001           lhi     %r2,1
           0000000000053f52: 50201000           st      %r2,0(%r1)
           0000000000053f56: a7f4ffbd           brc     15,53ed0
           0000000000053f5a: 0707               bcr     0,%r7
           0000000000053f5c: a7f13fc0           tmll    %r15,16320
Call Trace:
([<0000000000000210>] 0x210)
 [<0000000000053f86>] local_bh_disable+0x2a/0x38
 [<000000000020bed0>] wait_cons_dev+0xd4/0x154
 [<0000000000247cb2>] raw3215_make_room+0x6a/0x1a8
 [<000000000024861a>] raw3215_write+0x86/0x28c
 [<00000000002488a0>] con3215_write+0x80/0x110
 [<000000000004c3e0>] __call_console_drivers+0xc8/0xe4
 [<000000000004c47e>] _call_console_drivers+0x82/0xc4
 [<000000000004c744>] release_console_sem+0x218/0x2c0
 [<000000000004cf64>] vprintk+0x3c0/0x504
 [<0000000000354a4a>] printk+0x52/0x64
 [<0000000000088004>] __print_symbol+0x40/0x50
 [<0000000000071dbc>] print_stack_trace+0x78/0xac
 [<0000000000079e78>] print_lock_dependencies+0x148/0x208
 [<000000000007a050>] print_irq_inversion_bug+0x118/0x15c
 [<000000000007a106>] check_usage_forwards+0x72/0x84
 [<000000000007a36e>] mark_lock+0x1d2/0x594
 [<000000000007baca>] __lock_acquire+0x886/0xf48
 [<000000000007c234>] lock_acquire+0xa8/0xe0
 [<0000000000350316>] _write_lock+0x56/0x98
 [<000000000026cd92>] zfcp_erp_adapter_reopen+0x4e/0x8c
 [<000000000026f1e8>] zfcp_qdio_int_resp+0x2e4/0x2f4
 [<00000000002210f4>] qdio_int_handler+0x274/0x888
 [<00000000002177b6>] ccw_device_call_handler+0x6e/0xd8
 [<0000000000215336>] ccw_device_irq+0xd6/0x160
 [<0000000000212f88>] io_subchannel_irq+0x8c/0x118
 [<000000000020c120>] do_IRQ+0x1d0/0x1fc
 [<00000000000270b2>] io_return+0x0/0x8
 [<000000000001c8a4>] cpu_idle+0x178/0x21c
([<000000000001c884>] cpu_idle+0x158/0x21c)
 [<00000000003483a2>] start_secondary+0xb6/0xc8
INFO: lockdep is turned off.
Last Breaking-Event-Address:
 [<0000000000053f4a>] __local_bh_disable+0xba/0xcc

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-10-10 21:33:55 +02:00
Julia Lawall b2bbb642ac [S390] cio: Correct use of ! and &
In commit e6bafba5b4, a bug was fixed that
involved converting !x & y to !(x & y).  The code below shows the same
pattern, and thus should perhaps be fixed in the same way.  In particular,
the result of !scsw_stctl(&request->irb.scsw) & SCSW_STCTL_STATUS_PEND is
always just !scsw_stctl(&request->irb.scsw).

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@ expression E; constant C; @@
(
  !E & !C
|
- !E & C
+ !(E & C)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-10-10 21:33:54 +02:00
Peter Oberparleiter f9c9fe3ecf [S390] cio: inline assembly cleanup
Fix incorrect in- and output constraints, remove volatile declaration
of inline assembly parameters and reformat constraint declarations to
be more consistent.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-10-10 21:33:53 +02:00
Cornelia Huck 1f4e7edabc [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>
2008-10-10 21:33:53 +02:00
Martin Schwidefsky 9286b7ed68 [S390] bus_id ->dev_name() conversions in qdio
Use dev_name() in the new qdio driver.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-10-10 21:33:52 +02:00
Cornelia Huck b9d3aed7e1 [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>
2008-10-10 21:33:50 +02:00
Cornelia Huck 1bf5b28539 [S390] bus_id -> dev_set_name() changes
Convert most s390 users setting bus_id to dev_set_name().
css and ccw busses are deferred since they need some special
treatment.

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>
2008-10-10 21:33:50 +02:00
Kay Sievers 2a0217d5c7 [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>
2008-10-10 21:33:49 +02:00
Peter Oberparleiter ecf5d9ef68 [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>
2008-10-10 21:33:47 +02:00
Peter Oberparleiter 46fbe4e46d [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>
2008-10-10 21:33:47 +02:00
Ursula Braun 4bcb3a3718 [S390] qdio: speed up multicast traffic on full HiperSocket queue
If an asynchronous HiperSockets queue runs full, no further packet
can be sent. In this case the next initiative to give transmitted
skbs back to the stack is triggered only by a 10-seconds qdio timer.
This timer has been introduced for low multicast traffic scenarios
to guarantee freeing of skbs in a limited amount of time. For high
HiperSocket multicast traffic scenarios progress checking on the
outbound queue should be enforced by tasklet rescheduling.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-10-10 21:33:46 +02:00
Jan Glauber 75f6276187 [S390] qdio: prevent stack clobber
Don't print more information than fits into the string on the
stack. Combine the informational output of qdio to fit into
one line.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-10-03 21:55:55 +02:00
Stefan Weinhuber 9adb8c1d4f [S390] cio: fix orb initialization in cio_start_key
The functions cio_tm_start_key and cio_start_key use the same private
orb structure of a subchannel, so the orb needs to be cleared of old
data before it is used again. A respective memset is missing from
cio_start_key and hereby added.

Signed-off-by: Stefan Weinhuber <wein@de.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-09-16 09:34:32 -07:00
Cornelia Huck f26fd5d6e5 [S390] cio: Fix driver_data handling for ccwgroup devices.
Since 16f7f9564c, we've seen
oopses when grouping/ungrouping devices:

Unable to handle kernel pointer dereference at virtual kernel address 0000000000
114000
Oops: 0004 [#1] PREEMPT SMP
Modules linked in: bonding qeth_l2 dm_multipath sunrpc qeth_l3 dm_mod qeth chsc_
sch ccwgroup
CPU: 1 Not tainted 2.6.26-29.x.20080815-s390xdefault #1
Process iperf (pid: 24412, task: 000000003f446038, ksp: 000000003c929e08)
Krnl PSW : 0404d00180000000 000003e00006f6e6 (qeth_irq+0xda/0xb28 [qeth])
           R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 EA:3
Krnl GPRS: 0000000000000000 000003e000000003 0000000000000000 0000000000114ccc
           000000003fb82e48 000003e00006f60c 000000000000000c 000000003ce72100
           0000000000114944 000000003fb82e48 0000000000114ccc 000000003fe8fd28
           000003e000066000 000003e000076128 000000003fe8fdb8 000000003fe8fd28
Krnl Code: 000003e00006f6da: bf3f2024            icm     %r3,15,36(%r2)
           000003e00006f6de: a774023c            brc     7,3e00006fb56
           000003e00006f6e2: a7280000            lhi     %r2,0
          >000003e00006f6e6: 5020a1a0            st      %r2,416(%r10)
           000003e00006f6ea: 58109000            l       %r1,0(%r9)
           000003e00006f6ee: a7111000            tmll    %r1,4096
           000003e00006f6f2: a77400f9            brc     7,3e00006f8e4
           000003e00006f6f6: 8810000c            srl     %r1,12
Call Trace:
([<000000003fe8fd20>] 0x3fe8fd20)
 [<000000000033bf2a>] ccw_device_call_handler+0xb2/0xd8
 [<0000000000339e1c>] ccw_device_irq+0x124/0x164
 [<0000000000339758>] io_subchannel_irq+0x8c/0x118
 [<00000000003309ba>] do_IRQ+0x192/0x1bc
 [<0000000000114f66>] io_return+0x0/0x8
 [<00000000001149cc>] sysc_do_svc+0x0/0x22
([<0000000000114a18>] sysc_noemu+0x10/0x16)
 [<00000200002e047c>] 0x200002e047c
Last Breaking-Event-Address:
 [<000003e00006f6d6>] qeth_irq+0xca/0xb28 [qeth]

The problem is that dev->driver_data for a ccw device is NULL,
while it should point to the ccwgroup device it is a member of.
This happened due to incorrect cleanup if creating a ccwgroup
device failed because the ccw devices were already grouped.

Fix this by setting cdev[i] to NULL in the error handling of
ccwgroup_create_from_string() after we give up our reference and
by checking if the driver_data points to the ccwgroup device in
ccwgroup_release() just to be really sure.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-09-16 09:34:31 -07:00
Peter Oberparleiter b301ea8c81 [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>
2008-09-09 12:39:07 +02:00
Cornelia Huck c91ebe4961 [S390] cio: handle ssch() return codes correctly.
ssch() has two classes of return codes:
- condition codes (0-3) which need to be translated to Linux
  error codes
- Linux error codes (-EIO on exceptions) which should be passed
  to the caller (instead of erronously being handled like
  condition code 3)

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-09-09 12:39:07 +02:00
Cornelia Huck a2164b8174 [S390] cio: Correct cleanup on error.
Fix cleanup on error in chp_new() and init_channel_subsystem()
(must not call kfree() on structures that had been registered).

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-09-09 12:39:07 +02:00
Peter Oberparleiter 91c36919a4 [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>
2008-08-21 19:46:41 +02:00
Peter Oberparleiter 16f7f9564c [S390] cio: fix ccw group device cleanup
Fix ccw group device initialization: initialize device object before
using reference counting during cleanup.

Fixes the following message when group device initialization fails
(e.g. because too few devices where specified):

  kobject: '<NULL>' (..): is not initialized, yet kobject_put() is
           being called.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-21 19:46:40 +02:00
Jan Glauber 0686e402c3 [S390] qdio: remove the module_get & module_put pair
Increasing the qdio reference count for every used subchannel
is unnecessary since unloading qdio (if build as a module) is
only possible if other modules that use qdio are unloaded.
Unloading modules that use qdio in turn requires that these
modules shut down all qdio subchannels. Therefore the additional
module_get reference is not needed.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-21 19:46:40 +02:00
Jan Glauber 58eb27cd7f [S390] qdio: improve s390 debug feature usage
Improve s390 debug feature usage:
- log busy bit in dbf
- increase size of dbf views
- consistent logging of qdio api calls to setup view
- print subchannel number so one can associate the interface
  with the dbf data
- only log events to one view

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-21 19:46:40 +02:00
Jan Glauber 53b41ba7ce [S390] qdio: prevent oopsing if qdio_establish fails
If qdio_establish fails we call qdio_shutdown to cleanup the
qdio subchannel. The tiq_list entry may not be valid at that
time, therefore we must ignore queues with an invalid list entry
in tiqdio_remove_input_queues.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-21 19:46:39 +02:00
Heiko Carstens 3f1934bc1a [S390] qdio: fix section mismatch bug.
Fix the two section mismatch warnings below.
This fixes two real bugs since the code which has __exit annotations
may already be gone when it is called.

WARNING: vmlinux.o(.init.text+0x1cc4a): Section mismatch in reference from the function init_QDIO() to the function .exit.text:qdio_setup_exit()
The function __init init_QDIO() references
a function __exit qdio_setup_exit().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __exit annotation of
qdio_setup_exit() so it may be used outside an exit section.

WARNING: vmlinux.o(.init.text+0x1cc7a): Section mismatch in reference from the function init_QDIO() to the function .exit.text:qdio_remove_perf_stats()
The function __init init_QDIO() references
a function __exit qdio_remove_perf_stats().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __exit annotation of
qdio_remove_perf_stats() so it may be used outside an exit section.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-01 16:39:35 +02:00
Jan Glauber 3b8e3004ae [S390] qdio: make sure qdr is aligned to page size
kzalloc does not guarantee the required alignment of qdr to page size,
use get_zeroed_page instead.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
2008-08-01 16:39:34 +02:00
Michael Ernst 883e512c99 [S390] cio: Memory allocation for idset changed.
Memory allocation for the quite huge idset changed from
kzalloc to vmalloc.

Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-01 16:39:31 +02:00
Jan Glauber 779e6e1c72 [S390] qdio: new qdio driver.
List of major changes:
- split qdio driver into several files
- seperation of thin interrupt code
- improved handling for multiple thin interrupt devices
- inbound and outbound processing now always runs in tasklet context
- significant less tasklet schedules per interrupt needed
- merged qebsm with non-qebsm handling
- cleanup qdio interface and added kerneldoc
- coding style

Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Utz Bacher <utz.bacher@de.ibm.com>
Reviewed-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2008-07-17 17:22:10 +02:00
Cornelia Huck dae39843f4 [S390] cio: Export chsc_error_from_response().
Make chsc_error_from_response() available to chsc callers outside
of chsc.c (namely qdio) to avoid duplicating error checking code.

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>
2008-07-17 17:22:10 +02:00
Michael Ernst c78aa6cbac [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>
2008-07-14 10:02:18 +02:00
Sebastian Ott ef60cd13ec [S390] cio: fix double unregistering of subchannels
In some cases where the channel subsystem decides to drop a subchannel
device device_unregister may be called twice, which results in an oops.
The patch prevents this by only unregistering registered devices.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-07-14 10:02:17 +02:00
Akinobu Mita d9cef21af0 [S390] s390/cio: use memory_read_from_buffer()
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-07-14 10:02:15 +02:00
Cornelia Huck 9d92a7e1b0 [S390] cio: Add chsc subchannel driver.
This patch adds a driver for subchannels of type chsc.

A device /dev/chsc is created which may be used to issue ioctls to:
- obtain information about the machine's I/O configuration
- dynamically change the machine's I/O configuration via
  asynchronous chsc commands

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>
2008-07-14 10:02:12 +02:00
Peter Oberparleiter 683c5418e6 [S390] cio: suppress chpid event in case of configure error
Do not send CHP_ONLINE/CHP_OFFLINE events to subchannel drivers when a
channel-path configure request failed.

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>
2008-07-14 10:02:12 +02:00
Cornelia Huck f08adc008d [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>
2008-07-14 10:02:12 +02:00
Cornelia Huck 99611f8717 [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>
2008-07-14 10:02:11 +02:00
Cornelia Huck 6ef556ccc8 [S390] cio: Use isc_{register,unregister}.
Use the new isc registration functions for all places that need
an I/O interruption subclass.

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>
2008-07-14 10:02:11 +02:00
Sebastian Ott fcc6ab335b [S390] cio: introduce isc_(un)register functions.
This interface makes it easy for drivers to register usage of different
I/O interruption subclasses without needing to worry about possible
other users of the same isc.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2008-07-14 10:02:11 +02:00
Cornelia Huck da7c5af828 [S390] cio: Allow adapter interrupt handlers per isc.
Enhance the adapter interruption API so that device drivers can
register a handler for a specific interruption subclass. This
will allow different device drivers to move to differently
prioritized subclasses in order to avoid congestion.

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>
2008-07-14 10:02:10 +02:00
Cornelia Huck 3a3fc29a6d [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>
2008-07-14 10:02:10 +02:00
Cornelia Huck 75784c0087 [S390] cio: Get rid of css_characteristics_avail.
Checking for the validity of the css_*_characteristics is
superfluous since they stay 0 for non-successful scsc.

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>
2008-07-14 10:02:10 +02:00
Martin Schwidefsky d2fec59551 [S390] stp support.
Add support for clock synchronization with the server time protocol.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2008-07-14 10:02:09 +02:00
Sebastian Ott ae437a452e [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>
2008-07-14 10:02:08 +02:00
Peter Oberparleiter 23f6268947 [S390] cio: provide helper functions for fcx enabled I/O
Provide functions which can be used to incrementally construct fcx
enabled I/O control 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>
2008-07-14 10:02:08 +02:00
Peter Oberparleiter 83262d6349 [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>
2008-07-14 10:02:08 +02:00
Peter Oberparleiter 23d805b647 [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>
2008-07-14 10:02:07 +02:00
Peter Oberparleiter 4f2bd92e3b [S390] cio: introduce fcx bit to chsc characteristics
Introduce fcx bit to chsc characteristics.

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>
2008-07-14 10:02:07 +02:00
Cornelia Huck b3a686f47a [S390] cio: Base message subchannel handling.
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>
2008-07-14 10:02:06 +02:00
Cornelia Huck 44a1c19e3b [S390] cio: Export some symbols for modular css drivers.
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>
2008-07-14 10:02:06 +02:00
Cornelia Huck c11561897a [S390] cio: Cleanup crw interface.
Eliminate the need for the machine check handler to call into
the common I/O layer directly by introducing an interface to
register handlers for crws per rsc.

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>
2008-07-14 10:02:06 +02:00
Cornelia Huck c820de39bd [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>
2008-07-14 10:02:05 +02:00
Cornelia Huck 7e9db9eaef [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>
2008-07-14 10:02:05 +02:00
Cornelia Huck 0ae7a7b250 [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>
2008-07-14 10:02:05 +02:00
Ursula Braun bb0ca330a7 [S390] qdio: Repair timeout handling for qdio_shutdown
If qdio shutdown runs in parallel with a channel error,
the qdio_timeout_handler might not be triggered.
In this case neither state INACTIVE nor state ERR
is reached and the following wait_event hangs forever.
Solution: do not make use of ccw_device_set_timeout(),
but add a timeout to the following wait_event.
And make sure, wake_up is called in case of an
i/o error on the qdio-device.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2008-07-14 10:01:59 +02:00
Cornelia Huck 9689b336e1 [S390] cio: Clear correct bit in cio_release_console().
Fallout from the console isc 7 -> 1 change.

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>
2008-07-14 10:01:59 +02:00
Cornelia Huck 85b0d7c0ad [S390] cio: Fix inverted isc priorities.
Priorities for I/O interruption subclasses range from 0 (highest)
to 7 (lowest). Unfortunately, the console has been using isc 7
instead of an isc with a higher priority than regular I/O
subchannels (which use 3). Fix this by making the console use
isc 1.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-06-10 10:03:27 +02:00
Cornelia Huck 12829126aa [S390] cio: Fix sparse warnings in blacklist.c.
sparse complains about signedness:

drivers/s390/cio/blacklist.c:132:28: warning: incorrect type in
argument 2 (different signedness)
drivers/s390/cio/blacklist.c:132:28:    expected unsigned int *val
drivers/s390/cio/blacklist.c:132:28:    got int *cssid
drivers/s390/cio/blacklist.c:136:28: warning: incorrect type in
argument 2 (different signedness)
drivers/s390/cio/blacklist.c:136:28:    expected unsigned int *val
drivers/s390/cio/blacklist.c:136:28:    got int *ssid
drivers/s390/cio/blacklist.c:140:28: warning: incorrect type in
argument 2 (different signedness)
drivers/s390/cio/blacklist.c:140:28:    expected unsigned int *val
drivers/s390/cio/blacklist.c:140:28:    got int *devno

cssid, ssid and devno are of course unsigned, so let's make the
variables unsigned as well.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-06-10 10:03:26 +02:00
Huang Weiyi c7a8548ffa [S390] blacklist.c: removed duplicated include
Removed duplicated include <asm/cio.h>
in drivers/s390/cio/blacklist.c.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-05-15 16:52:39 +02:00
Michael Ernst 32aff5732a [S390] cio: Remove CCW_CMD_SUSPEND_RECONN in front of CCW_CMD_SET_PGID.
CCW_CMD_SUSPEND_RECONN causes a system hang if the cable of a
reserved DASD is disconnected and connected again.

Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-05-15 16:52:37 +02:00
Michael Ernst 5b8909871b [S390] cio: Fix parsing mechanism for blacklisted devices.
New format cssid.ssid.devno is now parsed correctly.

Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-05-07 09:23:01 +02:00
Michael Ernst 139b83dd57 [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>
2008-05-07 09:23:01 +02:00
Linus Torvalds 95dfec6ae1 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (53 commits)
  tcp: Overflow bug in Vegas
  [IPv4] UFO: prevent generation of chained skb destined to UFO device
  iwlwifi: move the selects to the tristate drivers
  ipv4: annotate a few functions __init in ipconfig.c
  atm: ambassador: vcc_sf semaphore to mutex
  MAINTAINERS: The socketcan-core list is subscribers-only.
  netfilter: nf_conntrack: padding breaks conntrack hash on ARM
  ipv4: Update MTU to all related cache entries in ip_rt_frag_needed()
  sch_sfq: use del_timer_sync() in sfq_destroy()
  net: Add compat support for getsockopt (MCAST_MSFILTER)
  net: Several cleanups for the setsockopt compat support.
  ipvs: fix oops in backup for fwmark conn templates
  bridge: kernel panic when unloading bridge module
  bridge: fix error handling in br_add_if()
  netfilter: {nfnetlink,ip,ip6}_queue: fix skb_over_panic when enlarging packets
  netfilter: x_tables: fix net namespace leak when reading /proc/net/xxx_tables_names
  netfilter: xt_TCPOPTSTRIP: signed tcphoff for ipv6_skip_exthdr() retval
  tcp: Limit cwnd growth when deferring for GSO
  tcp: Allow send-limited cwnd to grow up to max_burst when gso disabled
  [netdrvr] gianfar: Determine TBIPA value dynamically
  ...
2008-04-30 08:45:48 -07:00
Cornelia Huck edf2209692 [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>
2008-04-30 13:38:45 +02:00
Cornelia Huck 2f97220231 [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>
2008-04-30 13:38:43 +02:00
Denis V. Lunev 8b594007c3 s390: use non-racy method for proc entries creation
Use proc_create() to make sure that ->proc_fops be setup before gluing PDE to
main tree.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:21 -07:00
Alexey Dobriyan c74c120a21 proc: remove proc_root from drivers
Remove proc_root export.  Creation and removal works well if parent PDE is
supplied as NULL -- it worked always that way.

So, one useless export removed and consistency added, some drivers created
PDEs with &proc_root as parent but removed them as NULL and so on.

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>
2008-04-29 08:06:18 -07:00
Ursula Braun 022b660ae5 ccwgroup: Unify parsing for group attribute.
Instead of having each driver for ccwgroup slave device parsing the
input itself and calling ccwgroup_create(), introduce a new function
ccwgroup_create_from_string() and handle parsing inside the ccwgroup
core.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-29 01:56:29 -04:00
Matthew Wilcox 6188e10d38 Convert asm/semaphore.h users to linux/semaphore.h
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2008-04-18 22:22:54 -04:00
Matthew Wilcox d3135846f6 drivers: Remove unnecessary inclusions of asm/semaphore.h
None of these files use any of the functionality promised by
asm/semaphore.h.  It's possible that they rely on it dragging in some
unrelated header file, but I can't build all these files, so we'll have
fix any build failures as they come up.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2008-04-18 22:16:32 -04:00
Heiko Carstens a806170e29 [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>
2008-04-17 07:47:06 +02:00
Heiko Carstens 5a62b19219 [S390] Convert s390 to GENERIC_CLOCKEVENTS.
This way we get rid of s390's NO_IDLE_HZ and use the generic dynticks
variant instead. In addition we get high resolution timers for free.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2008-04-17 07:47:05 +02:00
Heiko Carstens 43ca5c3a1c [S390] Convert monitor calls to function calls.
Remove the program check generating monitor calls and use function
calls instead. Theres is no real advantage in using monitor calls,
but they do make debugging harder, because of all the program checks
it generates.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2008-04-17 07:47:05 +02:00
Ursula Braun e177685628 [S390] qdio (new feature): enhancing info-retrieval from QDIO-adapters
Next generation of OSA adapters allows retrieval of further self-describing
infos. This is the preparational infrastructure patch for further exploitation
in the qeth driver.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2008-04-17 07:47:04 +02:00
Harvey Harrison 2a2cf6b186 [S390] replace remaining __FUNCTION__ occurrences
__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2008-04-17 07:47:04 +02:00
Ursula Braun 35b58b028d [S390] qdio: Unrecognized inbound traffic if many FCP devices are online
Problem:
Usually every FCP device has its own indicator field the adapter
uses to signal outstanding work. Once a certain limit of devices
is reached, a common indicator field is used. In certain scenarios
qdio resets this common indicator field, but handles only part of
the FCP-devices sharing the common indicator field. Thus inbound
traffic on the non-processed shared FCP-devices is not recognized
immediately.

Solution:
Make sure common indicator field is reset only, if all FCP-devices
sharing the indicator are processed.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2008-04-17 07:46:58 +02:00
Michael Ernst 8284fb19ef [S390] cio: fix parallel cm_enable processing.
It is now possible to trigger cm_enable processing several times in
parallel without causing a kernel panic.

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>
2008-04-17 07:46:57 +02:00
Cornelia Huck fe6173d9b3 [S390] cio: Trigger verification on device/path not operational.
Currently, we don't do much on no path or no device situations during
normal user I/O, since we rely on reports regarding those events by
the machine. If we trigger a path verification to bring our device
state up-to-date, we (a) may recover from path failures earlier and
(b) better handle situations where the hardware/hypervisor doesn't
give us enough notifications.

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>
2008-04-17 07:46:57 +02:00
Cornelia Huck 22806dc1a8 [S390] cio: Fix race for "fast" path gone/path back situations.
Make sure we wait for previous evaluations triggered by path state
changes to have settled before we manipulate path states again.

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>
2008-04-17 07:46:57 +02:00
Ursula Braun e5fa443ea0 [S390] qdio: FCP/SCSI write I/O stagnates on LPAR
If running on LPAR, qdio might overlook an incoming buffer in certain
scenarios. The patch makes sure that incoming buffers are detected
immediately in all situations.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-02-19 15:29:35 +01:00
Heiko Carstens b32ecdb725 [S390] qdio: fix qdio_activate timeout handling.
Current code in qdio_activate waits for at least 5 seconds
until it returns. It may return earlier if an error occurs,
but not if everything is ok. This large timeout value
became visible with commit dfa77f611f
"qdio: set QDIO_ACTIVATE_TIMEOUT to 5s", which intended to
fix the timeout value which was zero. In turn setting an
FCP adapter online took 5 seconds.

In practice waiting for 5ms before continuing is sufficient
as pointed out by Utz Bacher and Cornelia Huck.

Cc: Utz Bacher <utz.bacher@de.ibm.com>
Cc: Jan Glauber <jan.glauber@de.ibm.com>
Cc: Ursula Braun <braunu@de.ibm.com>
Cc: Martin Peschke <mp3@de.ibm.com>
Acked-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>
2008-02-19 15:29:34 +01:00
Cornelia Huck 4c629727ce [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>
2008-02-19 15:29:32 +01:00
Cornelia Huck 486d0a0079 [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>
2008-02-19 15:29:32 +01:00
Ursula Braun bf3f837804 [S390] qdio: avoid hang when establishing qdio queues
If qdio establish runs in parallel with a channel error,
ccw_device_start_timeout may not trigger the qdio_timeout_handler.
In this case neither QDIO_IRQ_STATE_ESTABLISHED nor
QDIO_IRQ_STATE_ERR is reached and the following wait_event hangs
forever.
Solution: do not make use of the timeout option with
ccw_device_start, but add a timeout to the following wait_event.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-02-09 18:24:39 +01:00
Cornelia Huck 01bc8ad165 [S390] cio: Add shutdown callback for ccwgroup.
This intendeds to make proper shutdown of qeth devices easier.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-02-05 16:50:54 +01:00
Cornelia Huck b9c9a21a7c [S390] cio: Clean up chsc response code handling.
This provides unified return codes for common response codes and
also makes the debug feature messages more similar and informational.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-02-05 16:50:53 +01:00
Peter Oberparleiter 6f52ac2971 [S390] cio: make sense id procedure work with partial hardware response
In some cases the current sense id procedure trips over incomplete
hardware responses. In these cases, checking against the preset value
of 0xFFFF is not enough. More critically, the VM DIAG call will always be
considered to have provided data after such an incident, even if it was not
successful at all.

The solution is to always initialize the control unit data before doing a
sense id call. Check the condition code before considering the control unit
data. And initialize again, before evaluating the VM data.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-02-05 16:50:52 +01:00
Peter Tiedemann 361f494d4e [S390] usage of s390dbf: shrink number of debug areas to use.
Signed-off-by: Peter Tiedemann <ptiedem@de.ibm.com>
2008-01-26 14:11:33 +01:00
Jan Engelhardt 5c81cdbeff [S390] constify function pointer tables.
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-01-26 14:11:32 +01:00
Joe Perches ceb3dfbae1 [S390] drivers/s390: Add missing "space"
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-01-26 14:11:19 +01:00