Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67704
b: refs/heads/master
c: 7e6973e
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Oct 12, 2007
1 parent 022d1db commit 7dd9261
Show file tree
Hide file tree
Showing 113 changed files with 2,771 additions and 1,915 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b018fc09498f73da0014b44acbd59ea4a94300b4
refs/heads/master: 7e6973e9aca997d95995a7b17768f7b77b7c6c24
2 changes: 1 addition & 1 deletion trunk/Documentation/DocBook/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \
procfs-guide.xml writing_usb_driver.xml \
kernel-api.xml filesystems.xml lsm.xml usb.xml \
gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
genericirq.xml
genericirq.xml s390-drivers.xml

###
# The build process is as follows (targets):
Expand Down
149 changes: 149 additions & 0 deletions trunk/Documentation/DocBook/s390-drivers.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>

<book id="s390drivers">
<bookinfo>
<title>Writing s390 channel device drivers</title>

<authorgroup>
<author>
<firstname>Cornelia</firstname>
<surname>Huck</surname>
<affiliation>
<address>
<email>cornelia.huck@de.ibm.com</email>
</address>
</affiliation>
</author>
</authorgroup>

<copyright>
<year>2007</year>
<holder>IBM Corp.</holder>
</copyright>

<legalnotice>
<para>
This documentation is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
version.
</para>

<para>
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
</para>

<para>
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
</para>

<para>
For more details see the file COPYING in the source
distribution of Linux.
</para>
</legalnotice>
</bookinfo>

<toc></toc>

<chapter id="intro">
<title>Introduction</title>
<para>
This document describes the interfaces available for device drivers that
drive s390 based channel attached devices. This includes interfaces for
interaction with the hardware and interfaces for interacting with the
common driver core. Those interfaces are provided by the s390 common I/O
layer.
</para>
<para>
The document assumes a familarity with the technical terms associated
with the s390 channel I/O architecture. For a description of this
architecture, please refer to the "z/Architecture: Principles of
Operation", IBM publication no. SA22-7832.
</para>
<para>
While most I/O devices on a s390 system are typically driven through the
channel I/O mechanism described here, there are various other methods
(like the diag interface). These are out of the scope of this document.
</para>
<para>
Some additional information can also be found in the kernel source
under Documentation/s390/driver-model.txt.
</para>
</chapter>
<chapter id="ccw">
<title>The ccw bus</title>
<para>
The ccw bus typically contains the majority of devices available to
a s390 system. Named after the channel command word (ccw), the basic
command structure used to address its devices, the ccw bus contains
so-called channel attached devices. They are addressed via subchannels,
visible on the css bus. A device driver, however, will never interact
with the subchannel directly, but only via the device on the ccw bus,
the ccw device.
</para>
<sect1 id="channelIO">
<title>I/O functions for channel-attached devices</title>
<para>
Some hardware structures have been translated into C structures for use
by the common I/O layer and device drivers. For more information on
the hardware structures represented here, please consult the Principles
of Operation.
</para>
!Iinclude/asm-s390/cio.h
</sect1>
<sect1 id="ccwdev">
<title>ccw devices</title>
<para>
Devices that want to initiate channel I/O need to attach to the ccw bus.
Interaction with the driver core is done via the common I/O layer, which
provides the abstractions of ccw devices and ccw device drivers.
</para>
<para>
The functions that initiate or terminate channel I/O all act upon a
ccw device structure. Device drivers must not bypass those functions
or strange side effects may happen.
</para>
!Iinclude/asm-s390/ccwdev.h
!Edrivers/s390/cio/device.c
!Edrivers/s390/cio/device_ops.c
</sect1>
<sect1 id="cmf">
<title>The channel-measurement facility</title>
<para>
The channel-measurement facility provides a means to collect
measurement data which is made available by the channel subsystem
for each channel attached device.
</para>
!Iinclude/asm-s390/cmb.h
!Edrivers/s390/cio/cmf.c
</sect1>
</chapter>

<chapter id="ccwgroup">
<title>The ccwgroup bus</title>
<para>
The ccwgroup bus only contains artificial devices, created by the user.
Many networking devices (e.g. qeth) are in fact composed of several
ccw devices (like read, write and data channel for qeth). The
ccwgroup bus provides a mechanism to create a meta-device which
contains those ccw devices as slave devices and can be associated
with the netdevice.
</para>
<sect1 id="ccwgroupdevices">
<title>ccw group devices</title>
!Iinclude/asm-s390/ccwgroup.h
!Edrivers/s390/cio/ccwgroup.c
</sect1>
</chapter>

</book>
4 changes: 3 additions & 1 deletion trunk/Documentation/filesystems/ntfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ raiddev /dev/md0
device /dev/hda5
raid-disk 0
device /dev/hdb1
raid-disl 1
raid-disk 1

For linear raid, just change the raid-level above to "raid-level linear", for
mirrors, change it to "raid-level 1", and for stripe sets with parity, change
Expand Down Expand Up @@ -457,6 +457,8 @@ ChangeLog

Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.

2.1.29:
- Fix a deadlock when mounting read-write.
2.1.28:
- Fix a deadlock.
2.1.27:
Expand Down
26 changes: 26 additions & 0 deletions trunk/Documentation/s390/00-INDEX
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
00-INDEX
- this file.
3270.ChangeLog
- ChangeLog for the UTS Global 3270-support patch (outdated).
3270.txt
- how to use the IBM 3270 display system support.
cds.txt
- s390 common device support (common I/O layer).
CommonIO
- common I/O layer command line parameters, procfs and debugfs entries
config3270.sh
- example configuration for 3270 devices.
DASD
- information on the DASD disk device driver.
Debugging390.txt
- hints for debugging on s390 systems.
driver-model.txt
- information on s390 devices and the driver model.
monreader.txt
- information on accessing the z/VM monitor stream from Linux.
s390dbf.txt
- information on using the s390 debug feature.
TAPE
- information on the driver for channel-attached tapes.
zfcpdump
- information on the s390 SCSI dump tool.
51 changes: 29 additions & 22 deletions trunk/Documentation/s390/CommonIO
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
S/390 common I/O-Layer - command line parameters and /proc entries
==================================================================
S/390 common I/O-Layer - command line parameters, procfs and debugfs entries
============================================================================

Command line parameters
-----------------------

* cio_msg = yes | no

Determines whether information on found devices and sensed device
characteristics should be shown during startup, i. e. messages of the types
"Detected device 0.0.4711 on subchannel 0.0.0042" and "SenseID: Device
0.0.4711 reports: ...".
characteristics should be shown during startup or when new devices are
found, i. e. messages of the types "Detected device 0.0.4711 on subchannel
0.0.0042" and "SenseID: Device 0.0.4711 reports: ...".

Default is off.

Expand All @@ -26,8 +26,10 @@ Command line parameters
An ignored device can be un-ignored later; see the "/proc entries"-section for
details.

The devices must be given either as bus ids (0.0.abcd) or as hexadecimal
device numbers (0xabcd or abcd, for 2.4 backward compatibility).
The devices must be given either as bus ids (0.x.abcd) or as hexadecimal
device numbers (0xabcd or abcd, for 2.4 backward compatibility). If you
give a device number 0xabcd, it will be interpreted as 0.0.abcd.

You can use the 'all' keyword to ignore all devices.
The '!' operator will cause the I/O-layer to _not_ ignore a device.
The command line is parsed from left to right.
Expand Down Expand Up @@ -81,31 +83,36 @@ Command line parameters
will add 0.0.a000-0.0.accc and 0.0.af00-0.0.afff to the list of ignored
devices.

The devices can be specified either by bus id (0.0.abcd) or, for 2.4 backward
compatibility, by the device number in hexadecimal (0xabcd or abcd).
The devices can be specified either by bus id (0.x.abcd) or, for 2.4 backward
compatibility, by the device number in hexadecimal (0xabcd or abcd). Device
numbers given as 0xabcd will be interpreted as 0.0.abcd.

* For some of the information present in the /proc filesystem in 2.4 (namely,
/proc/subchannels and /proc/chpids), see driver-model.txt.
Information formerly in /proc/irq_count is now in /proc/interrupts.


debugfs entries
---------------

* /proc/s390dbf/cio_*/ (S/390 debug feature)
* /sys/kernel/debug/s390dbf/cio_*/ (S/390 debug feature)

Some views generated by the debug feature to hold various debug outputs.

- /proc/s390dbf/cio_crw/sprintf
- /sys/kernel/debug/s390dbf/cio_crw/sprintf
Messages from the processing of pending channel report words (machine check
handling), which will also show when CONFIG_DEBUG_CRW is defined.
handling).

- /proc/s390dbf/cio_msg/sprintf
Various debug messages from the common I/O-layer; generally, messages which
will also show when CONFIG_DEBUG_IO is defined.
- /sys/kernel/debug/s390dbf/cio_msg/sprintf
Various debug messages from the common I/O-layer, including messages
printed when cio_msg=yes.

- /proc/s390dbf/cio_trace/hex_ascii
- /sys/kernel/debug/s390dbf/cio_trace/hex_ascii
Logs the calling of functions in the common I/O-layer and, if applicable,
which subchannel they were called for, as well as dumps of some data
structures (like irb in an error case).

The level of logging can be changed to be more or less verbose by piping to
/proc/s390dbf/cio_*/level a number between 0 and 6; see the documentation on
the S/390 debug feature (Documentation/s390/s390dbf.txt) for details.

* For some of the information present in the /proc filesystem in 2.4 (namely,
/proc/subchannels and /proc/chpids), see driver-model.txt.
Information formerly in /proc/irq_count is now in /proc/interrupts.
/sys/kernel/debug/s390dbf/cio_*/level a number between 0 and 6; see the
documentation on the S/390 debug feature (Documentation/s390/s390dbf.txt)
for details.
8 changes: 4 additions & 4 deletions trunk/Documentation/s390/cds.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ first:
timeout value
-EIO: the common I/O layer terminated the request due to an error state

If the concurrent sense flag in the extended status word in the irb is set, the
field irb->scsw.count describes the number of device specific sense bytes
available in the extended control word irb->scsw.ecw[0]. No device sensing by
the device driver itself is required.
If the concurrent sense flag in the extended status word (esw) in the irb is
set, the field erw.scnt in the esw describes the number of device specific
sense bytes available in the extended control word irb->scsw.ecw[]. No device
sensing by the device driver itself is required.

The device interrupt handler can use the following definitions to investigate
the primary unit check source coded in sense byte 0 :
Expand Down
59 changes: 5 additions & 54 deletions trunk/arch/s390/appldata/appldata_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,7 @@ static void __cpuinit appldata_online_cpu(int cpu)
spin_unlock(&appldata_timer_lock);
}

static void
appldata_offline_cpu(int cpu)
static void __cpuinit appldata_offline_cpu(int cpu)
{
del_virt_timer(&per_cpu(appldata_timer, cpu));
if (atomic_dec_and_test(&appldata_expire_count)) {
Expand All @@ -560,9 +559,9 @@ appldata_offline_cpu(int cpu)
spin_unlock(&appldata_timer_lock);
}

static int __cpuinit
appldata_cpu_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
static int __cpuinit appldata_cpu_notify(struct notifier_block *self,
unsigned long action,
void *hcpu)
{
switch (action) {
case CPU_ONLINE:
Expand Down Expand Up @@ -608,63 +607,15 @@ static int __init appldata_init(void)
register_hotcpu_notifier(&appldata_nb);

appldata_sysctl_header = register_sysctl_table(appldata_dir_table);
#ifdef MODULE
appldata_dir_table[0].de->owner = THIS_MODULE;
appldata_table[0].de->owner = THIS_MODULE;
appldata_table[1].de->owner = THIS_MODULE;
#endif

P_DEBUG("Base interface initialized.\n");
return 0;
}

/*
* appldata_exit()
*
* stop timer, unregister /proc entries
*/
static void __exit appldata_exit(void)
{
struct list_head *lh;
struct appldata_ops *ops;
int rc, i;
__initcall(appldata_init);

P_DEBUG("Unloading module ...\n");
/*
* ops list should be empty, but just in case something went wrong...
*/
spin_lock(&appldata_ops_lock);
list_for_each(lh, &appldata_ops_list) {
ops = list_entry(lh, struct appldata_ops, list);
rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
(unsigned long) ops->data, ops->size,
ops->mod_lvl);
if (rc != 0) {
P_ERROR("STOP DIAG 0xDC for %s failed, "
"return code: %d\n", ops->name, rc);
}
}
spin_unlock(&appldata_ops_lock);

for_each_online_cpu(i)
appldata_offline_cpu(i);

appldata_timer_active = 0;

unregister_sysctl_table(appldata_sysctl_header);

destroy_workqueue(appldata_wq);
P_DEBUG("... module unloaded!\n");
}
/**************************** init / exit <END> ******************************/


module_init(appldata_init);
module_exit(appldata_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Gerald Schaefer");
MODULE_DESCRIPTION("Linux-VM Monitor Stream, base infrastructure");

EXPORT_SYMBOL_GPL(appldata_register_ops);
EXPORT_SYMBOL_GPL(appldata_unregister_ops);
EXPORT_SYMBOL_GPL(appldata_diag);
Expand Down
Loading

0 comments on commit 7dd9261

Please sign in to comment.