diff --git a/[refs] b/[refs]
index bc2ce1e442e2..3ede9641d5ff 100644
--- a/[refs]
+++ b/[refs]
@@ -1,2 +1,2 @@
---
-refs/heads/master: af9473118979f3b09ee5d92fdbd8014cf085f7c5
+refs/heads/master: 4e8e6ee380c3858151165d7455b4954782f145a0
diff --git a/trunk/Documentation/DocBook/kernel-api.tmpl b/trunk/Documentation/DocBook/kernel-api.tmpl
index ec7c498b69fc..eb42bf9847cb 100644
--- a/trunk/Documentation/DocBook/kernel-api.tmpl
+++ b/trunk/Documentation/DocBook/kernel-api.tmpl
@@ -704,23 +704,14 @@ X!Idrivers/video/console/fonts.c
splice API
-
+ )
splice is a method for moving blocks of data around inside the
- kernel, without continually transferring them between the kernel
+ kernel, without continually transferring it between the kernel
and user space.
!Iinclude/linux/splice.h
!Ffs/splice.c
-
- pipes API
-
- Pipe interfaces are all for in-kernel (builtin image) use.
- They are not exported for use by modules.
-
-!Iinclude/linux/pipe_fs_i.h
-!Ffs/pipe.c
-
diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt
index a43d2878a4ef..c175eedadb5f 100644
--- a/trunk/Documentation/feature-removal-schedule.txt
+++ b/trunk/Documentation/feature-removal-schedule.txt
@@ -211,6 +211,22 @@ Who: Richard Purdie
---------------------------
+What: read_dev_chars(), read_conf_data{,_lpm}() (s390 common I/O layer)
+When: December 2007
+Why: These functions are a leftover from 2.4 times. They have several
+ problems:
+ - Duplication of checks that are done in the device driver's
+ interrupt handler
+ - common I/O layer can't do device specific error recovery
+ - device driver can't be notified for conditions happening during
+ execution of the function
+ Device drivers should issue the read device characteristics and read
+ configuration data ccws and do the appropriate error handling
+ themselves.
+Who: Cornelia Huck
+
+---------------------------
+
What: i2c-ixp2000, i2c-ixp4xx and scx200_i2c drivers
When: September 2007
Why: Obsolete. The new i2c-gpio driver replaces all hardware-specific
diff --git a/trunk/Documentation/ja_JP/HOWTO b/trunk/Documentation/ja_JP/HOWTO
index 9f08dab1e75b..b2446a090870 100644
--- a/trunk/Documentation/ja_JP/HOWTO
+++ b/trunk/Documentation/ja_JP/HOWTO
@@ -1,24 +1,23 @@
-NOTE:
-This is a version of Documentation/HOWTO translated into Japanese.
-This document is maintained by Tsugikazu Shibata
-and the JF Project team .
-If you find any difference between this document and the original file
-or a problem with the translation,
-please contact the maintainer of this file or JF project.
-
-Please also note that the purpose of this file is to be easier to read
-for non English (read: Japanese) speakers and is not intended as a
-fork. So if you have any comments or updates for this file, please try
-to update the original English file first.
-
-Last Updated: 2007/07/18
+NOTE:
+This is Japanese translated version of "Documentation/HOWTO".
+This one is maintained by Tsugikazu Shibata
+and JF Project team .
+If you find difference with original file or problem in translation,
+please contact maintainer of this file or JF project.
+
+Please also note that purpose of this file is easier to read for non
+English natives and not to be intended to fork. So, if you have any
+comments or updates of this file, please try to update Original(English)
+file at first.
+
+Last Updated: 2007/06/04
==================================
これは、
-linux-2.6.22/Documentation/HOWTO
+linux-2.6.21/Documentation/HOWTO
の和訳です。
翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
-翻訳日: 2007/07/16
+翻訳日: 2007/06/04
翻訳者: Tsugikazu Shibata
校正者: 松倉さん
小林 雅典さん (Masanori Kobayasi)
@@ -53,7 +52,6 @@ Linux カーネル開発コミュニティと共に活動するやり方を学
また、このコミュニティがなぜ今うまくまわっているのかという理由の一部も
説明しようと試みています。
-
カーネルは 少量のアーキテクチャ依存部分がアセンブリ言語で書かれている
以外は大部分は C 言語で書かれています。C言語をよく理解していることはカー
ネル開発者には必要です。アーキテクチャ向けの低レベル部分の開発をするの
@@ -143,7 +141,6 @@ Linux カーネルソースツリーは幅広い範囲のドキュメントを
これらのルールに従えばうまくいくことを保証することではありません
が (すべてのパッチは内容とスタイルについて精査を受けるので)、
ルールに従わなければ間違いなくうまくいかないでしょう。
-
この他にパッチを作る方法についてのよくできた記述は-
"The Perfect Patch"
@@ -363,42 +360,44 @@ linux-kernel メーリングリストで収集された多数のパッチと同
git ツリー-
- Kbuild の開発ツリー、Sam Ravnborg
- git.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git
+ kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git
- ACPI の開発ツリー、 Len Brown
- git.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
+ kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
- Block の開発ツリー、Jens Axboe
- git.kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
+ kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
- DRM の開発ツリー、Dave Airlie
- git.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git
+ kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git
- ia64 の開発ツリー、Tony Luck
- git.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git
+ kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git
+
+ - ieee1394 の開発ツリー、Jody McIntyre
+ kernel.org:/pub/scm/linux/kernel/git/scjody/ieee1394.git
- infiniband, Roland Dreier
- git.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git
+ kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git
- libata, Jeff Garzik
- git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
+ kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
- ネットワークドライバ, Jeff Garzik
- git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
+ kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
- pcmcia, Dominik Brodowski
- git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
+ kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
- SCSI, James Bottomley
- git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
+ kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
+
+ その他の git カーネルツリーは http://kernel.org/git に一覧表がありま
+ す。
quilt ツリー-
- USB, PCI ドライバコアと I2C, Greg Kroah-Hartman
kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
- - x86-64 と i386 の仲間 Andi Kleen
-
- その他のカーネルツリーは http://git.kernel.org/ と MAINTAINERS ファ
- イルに一覧表があります。
バグレポート
-------------
@@ -509,7 +508,6 @@ MAINTAINERS ファイルにリストがありますので参照してくださ
せん*。単に自分のパッチに対して指摘された問題を全て修正して再送すれば
いいのです。
-
カーネルコミュニティと企業組織のちがい
-----------------------------------------------------------------
@@ -579,7 +577,6 @@ Linux カーネルコミュニティは、一度に大量のコードの塊を
かし、500行のパッチは、正しいことをレビューするのに数時間かかるかも
しれません(時間はパッチのサイズなどにより指数関数に比例してかかりま
す)
-
小さいパッチは何かあったときにデバッグもとても簡単になります。パッ
チを1個1個取り除くのは、とても大きなパッチを当てた後に(かつ、何かお
かしくなった後で)解剖するのに比べればとても簡単です。
@@ -594,7 +591,6 @@ Linux カーネルコミュニティは、一度に大量のコードの塊を
う。先生は簡潔な最高の解をみたいのです。良い生徒はこれを知って
おり、そして最終解の前の中間作業を提出することは決してないので
す"
-
カーネル開発でもこれは同じです。メンテナー達とレビューア達は、
問題を解決する解の背後になる思考プロセスをみたいとは思いません。
彼らは単純であざやかな解決方法をみたいのです。
diff --git a/trunk/Documentation/ja_JP/stable_api_nonsense.txt b/trunk/Documentation/ja_JP/stable_api_nonsense.txt
index 7653b5cbfed2..b3f2b27f0881 100644
--- a/trunk/Documentation/ja_JP/stable_api_nonsense.txt
+++ b/trunk/Documentation/ja_JP/stable_api_nonsense.txt
@@ -1,17 +1,17 @@
NOTE:
-This is a version of Documentation/stable_api_nonsense.txt into Japanese.
-This document is maintained by IKEDA, Munehiro
-and the JF Project team .
-If you find any difference between this document and the original file
-or a problem with the translation,
+This is a Japanese translated version of
+"Documentation/stable_api_nonsense.txt".
+This one is maintained by
+IKEDA, Munehiro
+and JF Project team .
+If you find difference with original file or problem in translation,
please contact the maintainer of this file or JF project.
-Please also note that the purpose of this file is to be easier to read
-for non English (read: Japanese) speakers and is not intended as a
-fork. So if you have any comments or updates of this file, please try
-to update the original English file first.
+Please also note that purpose of this file is easier to read for non
+English natives and not to be intended to fork. So, if you have any
+comments or updates of this file, please try to update
+Original(English) file at first.
-Last Updated: 2007/07/18
==================================
これは、
linux-2.6.22-rc4/Documentation/stable_api_nonsense.txt の和訳
diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt
index 1156653338fe..fb80e9ffea68 100644
--- a/trunk/Documentation/kernel-parameters.txt
+++ b/trunk/Documentation/kernel-parameters.txt
@@ -30,7 +30,6 @@ the beginning of each description states the restrictions within which a
parameter is applicable:
ACPI ACPI support is enabled.
- AGP AGP (Accelerated Graphics Port) is enabled.
ALSA ALSA sound support is enabled.
APIC APIC support is enabled.
APM Advanced Power Management support is enabled.
@@ -228,12 +227,6 @@ and is between 256 and 4096 characters. It is defined in the file
to assume that this machine's pmtimer latches its value
and always returns good values.
- agp= [AGP]
- { off | try_unsupported }
- off: disable AGP support
- try_unsupported: try to drive unsupported chipsets
- (may crash computer or cause data corruption)
-
enable_timer_pin_1 [i386,x86-64]
Enable PIN 1 of APIC timer
Can be useful to work around chipset bugs
diff --git a/trunk/Documentation/kobject.txt b/trunk/Documentation/kobject.txt
index 8ee49ee7c963..e44855513b3d 100644
--- a/trunk/Documentation/kobject.txt
+++ b/trunk/Documentation/kobject.txt
@@ -27,6 +27,7 @@ in detail, and briefly here:
- kobjects a simple object.
- kset a set of objects of a certain type.
- ktype a set of helpers for objects of a common type.
+- subsystem a controlling object for a number of ksets.
The kobject infrastructure maintains a close relationship with the
@@ -53,15 +54,13 @@ embedded in larger data structures and replace fields they duplicate.
1.2 Definition
struct kobject {
- const char * k_name;
char name[KOBJ_NAME_LEN];
- struct kref kref;
+ atomic_t refcount;
struct list_head entry;
struct kobject * parent;
struct kset * kset;
struct kobj_type * ktype;
- struct sysfs_dirent * sd;
- wait_queue_head_t poll;
+ struct dentry * dentry;
};
void kobject_init(struct kobject *);
@@ -138,7 +137,8 @@ If a kobject does not have a parent when it is registered, its parent
becomes its dominant kset.
If a kobject does not have a parent nor a dominant kset, its directory
-is created at the top-level of the sysfs partition.
+is created at the top-level of the sysfs partition. This should only
+happen for kobjects that are embedded in a struct subsystem.
@@ -150,10 +150,10 @@ A kset is a set of kobjects that are embedded in the same type.
struct kset {
+ struct subsystem * subsys;
struct kobj_type * ktype;
struct list_head list;
struct kobject kobj;
- struct kset_uevent_ops * uevent_ops;
};
@@ -169,7 +169,8 @@ struct kobject * kset_find_obj(struct kset *, char *);
The type that the kobjects are embedded in is described by the ktype
-pointer.
+pointer. The subsystem that the kobject belongs to is pointed to by the
+subsys pointer.
A kset contains a kobject itself, meaning that it may be registered in
the kobject hierarchy and exported via sysfs. More importantly, the
@@ -208,58 +209,6 @@ the hierarchy.
kset_find_obj() may be used to locate a kobject with a particular
name. The kobject, if found, is returned.
-There are also some helper functions which names point to the formerly
-existing "struct subsystem", whose functions have been taken over by
-ksets.
-
-
-decl_subsys(name,type,uevent_ops)
-
-Declares a kset named '_subsys' of type with
-uevent_ops . For example,
-
-decl_subsys(devices, &ktype_device, &device_uevent_ops);
-
-is equivalent to doing:
-
-struct kset devices_subsys = {
- .kobj = {
- .name = "devices",
- },
- .ktype = &ktype_devices,
- .uevent_ops = &device_uevent_ops,
-};
-
-
-The objects that are registered with a subsystem that use the
-subsystem's default list must have their kset ptr set properly. These
-objects may have embedded kobjects or ksets. The
-following helpers make setting the kset easier:
-
-
-kobj_set_kset_s(obj,subsys)
-
-- Assumes that obj->kobj exists, and is a struct kobject.
-- Sets the kset of that kobject to the kset .
-
-
-kset_set_kset_s(obj,subsys)
-
-- Assumes that obj->kset exists, and is a struct kset.
-- Sets the kset of the embedded kobject to the kset .
-
-subsys_set_kset(obj,subsys)
-
-- Assumes obj->subsys exists, and is a struct subsystem.
-- Sets obj->subsys.kset.kobj.kset to the subsystem's embedded kset.
-
-void subsystem_init(struct kset *s);
-int subsystem_register(struct kset *s);
-void subsystem_unregister(struct kset *s);
-struct kset *subsys_get(struct kset *s);
-void kset_put(struct kset *s);
-
-These are just wrappers around the respective kset_* functions.
2.3 sysfs
@@ -305,3 +254,114 @@ Instances of struct kobj_type are not registered; only referenced by
the kset. A kobj_type may be referenced by an arbitrary number of
ksets, as there may be disparate sets of identical objects.
+
+
+4. subsystems
+
+4.1 Description
+
+A subsystem represents a significant entity of code that maintains an
+arbitrary number of sets of objects of various types. Since the number
+of ksets and the type of objects they contain are variable, a
+generic representation of a subsystem is minimal.
+
+
+struct subsystem {
+ struct kset kset;
+ struct rw_semaphore rwsem;
+};
+
+int subsystem_register(struct subsystem *);
+void subsystem_unregister(struct subsystem *);
+
+struct subsystem * subsys_get(struct subsystem * s);
+void subsys_put(struct subsystem * s);
+
+
+A subsystem contains an embedded kset so:
+
+- It can be represented in the object hierarchy via the kset's
+ embedded kobject.
+
+- It can maintain a default list of objects of one type.
+
+Additional ksets may attach to the subsystem simply by referencing the
+subsystem before they are registered. (This one-way reference means
+that there is no way to determine the ksets that are attached to the
+subsystem.)
+
+All ksets that are attached to a subsystem share the subsystem's R/W
+semaphore.
+
+
+4.2 subsystem Programming Interface.
+
+The subsystem programming interface is simple and does not offer the
+flexibility that the kset and kobject programming interfaces do. They
+may be registered and unregistered, as well as reference counted. Each
+call forwards the calls to their embedded ksets (which forward the
+calls to their embedded kobjects).
+
+
+4.3 Helpers
+
+A number of macros are available to make dealing with subsystems and
+their embedded objects easier.
+
+
+decl_subsys(name,type)
+
+Declares a subsystem named '_subsys', with an embedded kset of
+type . For example,
+
+decl_subsys(devices,&ktype_devices);
+
+is equivalent to doing:
+
+struct subsystem device_subsys = {
+ .kset = {
+ .kobj = {
+ .name = "devices",
+ },
+ .ktype = &ktype_devices,
+ }
+};
+
+
+The objects that are registered with a subsystem that use the
+subsystem's default list must have their kset ptr set properly. These
+objects may have embedded kobjects, ksets, or other subsystems. The
+following helpers make setting the kset easier:
+
+
+kobj_set_kset_s(obj,subsys)
+
+- Assumes that obj->kobj exists, and is a struct kobject.
+- Sets the kset of that kobject to the subsystem's embedded kset.
+
+
+kset_set_kset_s(obj,subsys)
+
+- Assumes that obj->kset exists, and is a struct kset.
+- Sets the kset of the embedded kobject to the subsystem's
+ embedded kset.
+
+subsys_set_kset(obj,subsys)
+
+- Assumes obj->subsys exists, and is a struct subsystem.
+- Sets obj->subsys.kset.kobj.kset to the subsystem's embedded kset.
+
+
+4.4 sysfs
+
+subsystems are represented in sysfs via their embedded kobjects. They
+follow the same rules as previously mentioned with no exceptions. They
+typically receive a top-level directory in sysfs, except when their
+embedded kobject is part of another kset, or the parent of the
+embedded kobject is explicitly set.
+
+Note that the subsystem's embedded kset must be 'attached' to the
+subsystem itself in order to use its rwsem. This is done after
+kset_add() has been called. (Not before, because kset_add() uses its
+subsystem for a default parent if it doesn't already have one).
+
diff --git a/trunk/Documentation/stable_api_nonsense.txt b/trunk/Documentation/stable_api_nonsense.txt
index 847b342b7b20..a2afca3b2bab 100644
--- a/trunk/Documentation/stable_api_nonsense.txt
+++ b/trunk/Documentation/stable_api_nonsense.txt
@@ -10,7 +10,7 @@ kernel to userspace interfaces. The kernel to userspace interface is
the one that application programs use, the syscall interface. That
interface is _very_ stable over time, and will not break. I have old
programs that were built on a pre 0.9something kernel that still work
-just fine on the latest 2.6 kernel release. That interface is the one
+just fine on the latest 2.6 kernel release. This interface is the one
that users and application programmers can count on being stable.
diff --git a/trunk/Documentation/sysfs-rules.txt b/trunk/Documentation/sysfs-rules.txt
index 80ef562160bb..42861bb0bc9b 100644
--- a/trunk/Documentation/sysfs-rules.txt
+++ b/trunk/Documentation/sysfs-rules.txt
@@ -1,18 +1,19 @@
Rules on how to access information in the Linux kernel sysfs
-The kernel-exported sysfs exports internal kernel implementation details
+The kernel exported sysfs exports internal kernel implementation-details
and depends on internal kernel structures and layout. It is agreed upon
by the kernel developers that the Linux kernel does not provide a stable
internal API. As sysfs is a direct export of kernel internal
-structures, the sysfs interface cannot provide a stable interface either;
+structures, the sysfs interface can not provide a stable interface eighter,
it may always change along with internal kernel changes.
To minimize the risk of breaking users of sysfs, which are in most cases
low-level userspace applications, with a new kernel release, the users
-of sysfs must follow some rules to use an as-abstract-as-possible way to
+of sysfs must follow some rules to use an as abstract-as-possible way to
access this filesystem. The current udev and HAL programs already
implement this and users are encouraged to plug, if possible, into the
-abstractions these programs provide instead of accessing sysfs directly.
+abstractions these programs provide instead of accessing sysfs
+directly.
But if you really do want or need to access sysfs directly, please follow
the following rules and then your programs should work with future
@@ -24,22 +25,22 @@ versions of the sysfs interface.
implementation details in its own API. Therefore it is not better than
reading directories and opening the files yourself.
Also, it is not actively maintained, in the sense of reflecting the
- current kernel development. The goal of providing a stable interface
- to sysfs has failed; it causes more problems than it solves. It
+ current kernel-development. The goal of providing a stable interface
+ to sysfs has failed, it causes more problems, than it solves. It
violates many of the rules in this document.
- sysfs is always at /sys
Parsing /proc/mounts is a waste of time. Other mount points are a
system configuration bug you should not try to solve. For test cases,
possibly support a SYSFS_PATH environment variable to overwrite the
- application's behavior, but never try to search for sysfs. Never try
+ applications behavior, but never try to search for sysfs. Never try
to mount it, if you are not an early boot script.
- devices are only "devices"
There is no such thing like class-, bus-, physical devices,
interfaces, and such that you can rely on in userspace. Everything is
just simply a "device". Class-, bus-, physical, ... types are just
- kernel implementation details which should not be expected by
+ kernel implementation details, which should not be expected by
applications that look for devices in sysfs.
The properties of a device are:
@@ -47,11 +48,11 @@ versions of the sysfs interface.
- identical to the DEVPATH value in the event sent from the kernel
at device creation and removal
- the unique key to the device at that point in time
- - the kernel's path to the device directory without the leading
+ - the kernels path to the device-directory without the leading
/sys, and always starting with with a slash
- all elements of a devpath must be real directories. Symlinks
pointing to /sys/devices must always be resolved to their real
- target and the target path must be used to access the device.
+ target, and the target path must be used to access the device.
That way the devpath to the device matches the devpath of the
kernel used at event time.
- using or exposing symlink values as elements in a devpath string
@@ -72,17 +73,17 @@ versions of the sysfs interface.
link
- it is retrieved by reading the "driver"-link and using only the
last element of the target path
- - devices which do not have "driver"-link just do not have a
- driver; copying the driver value in a child device context is a
+ - devices which do not have "driver"-link, just do not have a
+ driver; copying the driver value in a child device context, is a
bug in the application
o attributes
- - the files in the device directory or files below subdirectories
+ - the files in the device directory or files below a subdirectories
of the same device directory
- accessing attributes reached by a symlink pointing to another device,
like the "device"-link, is a bug in the application
- Everything else is just a kernel driver-core implementation detail
+ Everything else is just a kernel driver-core implementation detail,
that should not be assumed to be stable across kernel releases.
- Properties of parent devices never belong into a child device.
@@ -90,25 +91,25 @@ versions of the sysfs interface.
context properties. If the device 'eth0' or 'sda' does not have a
"driver"-link, then this device does not have a driver. Its value is empty.
Never copy any property of the parent-device into a child-device. Parent
- device properties may change dynamically without any notice to the
+ device-properties may change dynamically without any notice to the
child device.
-- Hierarchy in a single device tree
+- Hierarchy in a single device-tree
There is only one valid place in sysfs where hierarchy can be examined
and this is below: /sys/devices.
- It is planned that all device directories will end up in the tree
+ It is planned, that all device directories will end up in the tree
below this directory.
- Classification by subsystem
There are currently three places for classification of devices:
/sys/block, /sys/class and /sys/bus. It is planned that these will
- not contain any device directories themselves, but only flat lists of
+ not contain any device-directories themselves, but only flat lists of
symlinks pointing to the unified /sys/devices tree.
All three places have completely different rules on how to access
device information. It is planned to merge all three
- classification directories into one place at /sys/subsystem,
- following the layout of the bus directories. All buses and
- classes, including the converted block subsystem, will show up
+ classification-directories into one place at /sys/subsystem,
+ following the layout of the bus-directories. All buses and
+ classes, including the converted block-subsystem, will show up
there.
The devices belonging to a subsystem will create a symlink in the
"devices" directory at /sys/subsystem//devices.
@@ -120,38 +121,38 @@ versions of the sysfs interface.
subsystem name.
Assuming /sys/class/ and /sys/bus/, or
- /sys/block and /sys/class/block are not interchangeable is a bug in
+ /sys/block and /sys/class/block are not interchangeable, is a bug in
the application.
- Block
- The converted block subsystem at /sys/class/block or
+ The converted block-subsystem at /sys/class/block, or
/sys/subsystem/block will contain the links for disks and partitions
- at the same level, never in a hierarchy. Assuming the block subsytem to
- contain only disks and not partition devices in the same flat list is
+ at the same level, never in a hierarchy. Assuming the block-subsytem to
+ contain only disks and not partition-devices in the same flat list is
a bug in the application.
- "device"-link and :-links
Never depend on the "device"-link. The "device"-link is a workaround
- for the old layout, where class devices are not created in
- /sys/devices/ like the bus devices. If the link-resolving of a
- device directory does not end in /sys/devices/, you can use the
+ for the old layout, where class-devices are not created in
+ /sys/devices/ like the bus-devices. If the link-resolving of a
+ device-directory does not end in /sys/devices/, you can use the
"device"-link to find the parent devices in /sys/devices/. That is the
- single valid use of the "device"-link; it must never appear in any
+ single valid use of the "device"-link, it must never appear in any
path as an element. Assuming the existence of the "device"-link for
a device in /sys/devices/ is a bug in the application.
Accessing /sys/class/net/eth0/device is a bug in the application.
Never depend on the class-specific links back to the /sys/class
directory. These links are also a workaround for the design mistake
- that class devices are not created in /sys/devices. If a device
+ that class-devices are not created in /sys/devices. If a device
directory does not contain directories for child devices, these links
may be used to find the child devices in /sys/class. That is the single
- valid use of these links; they must never appear in any path as an
+ valid use of these links, they must never appear in any path as an
element. Assuming the existence of these links for devices which are
- real child device directories in the /sys/devices tree is a bug in
+ real child device directories in the /sys/devices tree, is a bug in
the application.
- It is planned to remove all these links when all class device
+ It is planned to remove all these links when when all class-device
directories live in /sys/devices.
- Position of devices along device chain can change.
@@ -160,5 +161,6 @@ versions of the sysfs interface.
the chain. You must always request the parent device you are looking for
by its subsystem value. You need to walk up the chain until you find
the device that matches the expected subsystem. Depending on a specific
- position of a parent device or exposing relative paths using "../" to
- access the chain of parents is a bug in the application.
+ position of a parent device, or exposing relative paths, using "../" to
+ access the chain of parents, is a bug in the application.
+
diff --git a/trunk/arch/alpha/kernel/smp.c b/trunk/arch/alpha/kernel/smp.c
index ad176441be55..0804b6abe203 100644
--- a/trunk/arch/alpha/kernel/smp.c
+++ b/trunk/arch/alpha/kernel/smp.c
@@ -16,7 +16,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig
index c8569e862c6b..85016313bd11 100644
--- a/trunk/arch/arm/Kconfig
+++ b/trunk/arch/arm/Kconfig
@@ -341,7 +341,6 @@ config ARCH_PXA
select ARCH_MTD_XIP
select GENERIC_GPIO
select GENERIC_TIME
- select GENERIC_CLOCKEVENTS
help
Support for Intel's PXA2XX processor line.
diff --git a/trunk/arch/arm/kernel/setup.c b/trunk/arch/arm/kernel/setup.c
index 4de432ec903a..5be2e987b843 100644
--- a/trunk/arch/arm/kernel/setup.c
+++ b/trunk/arch/arm/kernel/setup.c
@@ -23,7 +23,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/trunk/arch/arm/kernel/smp.c b/trunk/arch/arm/kernel/smp.c
index eafbb2b05eb8..1b76d87fa335 100644
--- a/trunk/arch/arm/kernel/smp.c
+++ b/trunk/arch/arm/kernel/smp.c
@@ -17,7 +17,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -631,7 +630,7 @@ void smp_send_stop(void)
/*
* not supported here
*/
-int setup_profiling_timer(unsigned int multiplier)
+int __init setup_profiling_timer(unsigned int multiplier)
{
return -EINVAL;
}
diff --git a/trunk/arch/arm/kernel/traps.c b/trunk/arch/arm/kernel/traps.c
index 8ad47619c079..f2114bcf09d5 100644
--- a/trunk/arch/arm/kernel/traps.c
+++ b/trunk/arch/arm/kernel/traps.c
@@ -352,8 +352,10 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
asmlinkage void do_unexp_fiq (struct pt_regs *regs)
{
+#ifndef CONFIG_IGNORE_FIQ
printk("Hmm. Unexpected FIQ received, but trying to continue\n");
printk("You may have a hardware problem...\n");
+#endif
}
/*
diff --git a/trunk/arch/arm/mach-sa1100/jornada720.c b/trunk/arch/arm/mach-sa1100/jornada720.c
index 52ac37d1e23a..64067cd58d36 100644
--- a/trunk/arch/arm/mach-sa1100/jornada720.c
+++ b/trunk/arch/arm/mach-sa1100/jornada720.c
@@ -3,7 +3,6 @@
*
* HP Jornada720 init code
*
- * Copyright (C) 2007 Kristoffer Ericson
* Copyright (C) 2006 Filip Zyzniewski
* Copyright (C) 2005 Michael Gernoth
*
@@ -221,16 +220,14 @@ static struct platform_device sa1111_device = {
.resource = sa1111_resources,
};
-static struct platform_device jornada_ssp_device = {
- .name = "jornada_ssp",
- .id = -1,
+static struct platform_device jornada720_mcu_device = {
+ .name = "jornada720_mcu",
+ .id = -1,
};
static struct platform_device *devices[] __initdata = {
&sa1111_device,
-#ifdef CONFIG_SA1100_JORNADA720_SSP
- &jornada_ssp_device,
-#endif
+ &jornada720_mcu_device,
&s1d13xxxfb_device,
};
@@ -239,19 +236,19 @@ static int __init jornada720_init(void)
int ret = -ENODEV;
if (machine_is_jornada720()) {
- /* we want to use gpio20 as input to drive the clock of our uart 3 */
- GPDR |= GPIO_GPIO20; /* Clear gpio20 pin as input */
+ GPDR |= GPIO_GPIO20;
+ /* oscillator setup (line 116 of HP's doc) */
TUCR = TUCR_VAL;
- GPSR = GPIO_GPIO20; /* start gpio20 pin */
+ /* resetting SA1111 (line 118 of HP's doc) */
+ GPSR = GPIO_GPIO20;
udelay(1);
- GPCR = GPIO_GPIO20; /* stop gpio20 */
+ GPCR = GPIO_GPIO20;
udelay(1);
- GPSR = GPIO_GPIO20; /* restart gpio20 */
- udelay(20); /* give it some time to restart */
+ GPSR = GPIO_GPIO20;
+ udelay(20);
ret = platform_add_devices(devices, ARRAY_SIZE(devices));
}
-
return ret;
}
@@ -348,7 +345,7 @@ static void __init jornada720_mach_init(void)
}
MACHINE_START(JORNADA720, "HP Jornada 720")
- /* Maintainer: Kristoffer Ericson */
+ /* Maintainer: Michael Gernoth */
.phys_io = 0x80000000,
.io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
.boot_params = 0xc0000100,
diff --git a/trunk/arch/arm/mach-sa1100/jornada720_ssp.c b/trunk/arch/arm/mach-sa1100/jornada720_ssp.c
index 395c39bed7d8..0a45e1ac8ad6 100644
--- a/trunk/arch/arm/mach-sa1100/jornada720_ssp.c
+++ b/trunk/arch/arm/mach-sa1100/jornada720_ssp.c
@@ -161,7 +161,7 @@ static int __init jornada_ssp_probe(struct platform_device *dev)
ret = jornada_ssp_inout(GETBRIGHTNESS);
/* seems like it worked, just feed it with TxDummy to get rid of data */
- if (ret == TXDUMMY)
+ if (ret == TxDummy)
jornada_ssp_inout(TXDUMMY);
jornada_ssp_end();
diff --git a/trunk/arch/blackfin/Makefile b/trunk/arch/blackfin/Makefile
index 20841663270f..1b75672dfc8f 100644
--- a/trunk/arch/blackfin/Makefile
+++ b/trunk/arch/blackfin/Makefile
@@ -24,8 +24,6 @@ machine-$(CONFIG_BF533) := bf533
machine-$(CONFIG_BF534) := bf537
machine-$(CONFIG_BF536) := bf537
machine-$(CONFIG_BF537) := bf537
-machine-$(CONFIG_BF542) := bf548
-machine-$(CONFIG_BF544) := bf548
machine-$(CONFIG_BF548) := bf548
machine-$(CONFIG_BF549) := bf548
machine-$(CONFIG_BF561) := bf561
@@ -38,8 +36,6 @@ cpu-$(CONFIG_BF533) := bf533
cpu-$(CONFIG_BF534) := bf534
cpu-$(CONFIG_BF536) := bf536
cpu-$(CONFIG_BF537) := bf537
-cpu-$(CONFIG_BF542) := bf542
-cpu-$(CONFIG_BF544) := bf544
cpu-$(CONFIG_BF548) := bf548
cpu-$(CONFIG_BF549) := bf549
cpu-$(CONFIG_BF561) := bf561
diff --git a/trunk/arch/blackfin/kernel/dma-mapping.c b/trunk/arch/blackfin/kernel/dma-mapping.c
index 94d7b119b71e..ea48d5b13f11 100644
--- a/trunk/arch/blackfin/kernel/dma-mapping.c
+++ b/trunk/arch/blackfin/kernel/dma-mapping.c
@@ -160,8 +160,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
BUG_ON(direction == DMA_NONE);
for (i = 0; i < nents; i++, sg++) {
- sg->dma_address = (dma_addr_t)(page_address(sg->page) +
- sg->offset);
+ sg->dma_address = page_address(sg->page) + sg->offset;
invalidate_dcache_range(sg_dma_address(sg),
sg_dma_address(sg) +
diff --git a/trunk/arch/blackfin/kernel/setup.c b/trunk/arch/blackfin/kernel/setup.c
index 88f221b89b33..f59dcee7bae3 100644
--- a/trunk/arch/blackfin/kernel/setup.c
+++ b/trunk/arch/blackfin/kernel/setup.c
@@ -402,7 +402,11 @@ void __init setup_arch(char **cmdline_p)
if (l1_length > L1_DATA_A_LENGTH)
panic("L1 data memory overflow\n");
+#ifdef BF561_FAMILY
+ _bfin_swrst = bfin_read_SICA_SWRST();
+#else
_bfin_swrst = bfin_read_SWRST();
+#endif
/* Copy atomic sequences to their fixed location, and sanity check that
these locations are the ones that we advertise to userspace. */
@@ -425,7 +429,6 @@ void __init setup_arch(char **cmdline_p)
BUG_ON((char *)&atomic_xor32 - (char *)&fixed_code_start
!= ATOMIC_XOR32 - FIXED_CODE_START);
- init_exception_vectors();
bf53x_cache_init();
}
diff --git a/trunk/arch/blackfin/kernel/traps.c b/trunk/arch/blackfin/kernel/traps.c
index 8766bd612b47..3909f5b35536 100644
--- a/trunk/arch/blackfin/kernel/traps.c
+++ b/trunk/arch/blackfin/kernel/traps.c
@@ -140,7 +140,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
#ifdef CONFIG_KGDB
# define CHK_DEBUGGER_TRAP() \
do { \
- CHK_DEBUGGER(trapnr, sig, info.si_code, fp, ); \
+ CHK_DEBUGGER(trapnr, sig, info.si_code, fp); \
} while (0)
# define CHK_DEBUGGER_TRAP_MAYBE() \
do { \
diff --git a/trunk/arch/blackfin/kernel/vmlinux.lds.S b/trunk/arch/blackfin/kernel/vmlinux.lds.S
index fb53780247bc..d06f860f4790 100644
--- a/trunk/arch/blackfin/kernel/vmlinux.lds.S
+++ b/trunk/arch/blackfin/kernel/vmlinux.lds.S
@@ -32,7 +32,6 @@
#include
#include
#include
-#include
OUTPUT_FORMAT("elf32-bfin")
ENTRY(__start)
@@ -65,12 +64,8 @@ SECTIONS
.data :
{
- /* make sure the init_task is aligned to the
- * kernel thread size so we can locate the kernel
- * stack properly and quickly.
- */
+ . = ALIGN(PAGE_SIZE);
__sdata = .;
- . = ALIGN(THREAD_SIZE);
*(.data.init_task)
DATA_DATA
CONSTRUCTORS
@@ -78,14 +73,14 @@ SECTIONS
. = ALIGN(32);
*(.data.cacheline_aligned)
- . = ALIGN(THREAD_SIZE);
+ . = ALIGN(PAGE_SIZE);
__edata = .;
}
+ . = ALIGN(PAGE_SIZE);
___init_begin = .;
.init :
{
- . = ALIGN(PAGE_SIZE);
__sinittext = .;
*(.init.text)
__einittext = .;
@@ -158,9 +153,10 @@ SECTIONS
__ebss_b_l1 = .;
}
- ___init_end = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
+ . = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
+ ___init_end = ALIGN(PAGE_SIZE);
- .bss LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1) :
+ .bss ___init_end :
{
. = ALIGN(4);
___bss_start = .;
diff --git a/trunk/arch/blackfin/mach-bf561/head.S b/trunk/arch/blackfin/mach-bf561/head.S
index 38650a628980..2f08bcb2dded 100644
--- a/trunk/arch/blackfin/mach-bf561/head.S
+++ b/trunk/arch/blackfin/mach-bf561/head.S
@@ -440,15 +440,15 @@ ENTRY(_bfin_reset)
SSYNC;
/* make sure SYSCR is set to use BMODE */
- P0.h = hi(SYSCR);
- P0.l = lo(SYSCR);
- R0.l = 0x20; /* on BF561, disable core b */
+ P0.h = hi(SICA_SYSCR);
+ P0.l = lo(SICA_SYSCR);
+ R0.l = 0x20;
W[P0] = R0.l;
SSYNC;
/* issue a system soft reset */
- P1.h = hi(SWRST);
- P1.l = lo(SWRST);
+ P1.h = hi(SICA_SWRST);
+ P1.l = lo(SICA_SWRST);
R1.l = 0x0007;
W[P1] = R1;
SSYNC;
diff --git a/trunk/arch/blackfin/mach-common/cacheinit.S b/trunk/arch/blackfin/mach-common/cacheinit.S
index 5be6b975ae4a..9d475623b724 100644
--- a/trunk/arch/blackfin/mach-common/cacheinit.S
+++ b/trunk/arch/blackfin/mach-common/cacheinit.S
@@ -60,9 +60,6 @@ ENDPROC(_bfin_write_IMEM_CONTROL)
#if defined(CONFIG_BLKFIN_DCACHE)
ENTRY(_bfin_write_DMEM_CONTROL)
- P0.l = (DMEM_CONTROL & 0xFFFF);
- P0.h = (DMEM_CONTROL >> 16);
-
CLI R1;
SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
.align 8;
diff --git a/trunk/arch/blackfin/mach-common/ints-priority-dc.c b/trunk/arch/blackfin/mach-common/ints-priority-dc.c
index 660f881b620a..6b9fd03ce835 100644
--- a/trunk/arch/blackfin/mach-common/ints-priority-dc.c
+++ b/trunk/arch/blackfin/mach-common/ints-priority-dc.c
@@ -358,10 +358,26 @@ static void bf561_demux_gpio_irq(unsigned int inta_irq,
#endif /* CONFIG_IRQCHIP_DEMUX_GPIO */
-void __init init_exception_vectors(void)
+/*
+ * This function should be called during kernel startup to initialize
+ * the BFin IRQ handling routines.
+ */
+int __init init_arch_irq(void)
{
+ int irq;
+ unsigned long ilat = 0;
+ /* Disable all the peripheral intrs - page 4-29 HW Ref manual */
+ bfin_write_SICA_IMASK0(SIC_UNMASK_ALL);
+ bfin_write_SICA_IMASK1(SIC_UNMASK_ALL);
SSYNC();
+ bfin_write_SICA_IWR0(IWR_ENABLE_ALL);
+ bfin_write_SICA_IWR1(IWR_ENABLE_ALL);
+
+ local_irq_disable();
+
+ init_exception_buff();
+
#ifndef CONFIG_KGDB
bfin_write_EVT0(evt_emulation);
#endif
@@ -379,27 +395,6 @@ void __init init_exception_vectors(void)
bfin_write_EVT14(evt14_softirq);
bfin_write_EVT15(evt_system_call);
CSYNC();
-}
-
-/*
- * This function should be called during kernel startup to initialize
- * the BFin IRQ handling routines.
- */
-int __init init_arch_irq(void)
-{
- int irq;
- unsigned long ilat = 0;
- /* Disable all the peripheral intrs - page 4-29 HW Ref manual */
- bfin_write_SICA_IMASK0(SIC_UNMASK_ALL);
- bfin_write_SICA_IMASK1(SIC_UNMASK_ALL);
- SSYNC();
-
- bfin_write_SICA_IWR0(IWR_ENABLE_ALL);
- bfin_write_SICA_IWR1(IWR_ENABLE_ALL);
-
- local_irq_disable();
-
- init_exception_buff();
for (irq = 0; irq <= SYS_IRQS; irq++) {
if (irq <= IRQ_CORETMR)
diff --git a/trunk/arch/blackfin/mach-common/ints-priority-sc.c b/trunk/arch/blackfin/mach-common/ints-priority-sc.c
index 4708023fe716..28a878c3577a 100644
--- a/trunk/arch/blackfin/mach-common/ints-priority-sc.c
+++ b/trunk/arch/blackfin/mach-common/ints-priority-sc.c
@@ -579,12 +579,8 @@ static unsigned int bfin_gpio_irq_startup(unsigned int irq)
u16 gpionr = irq - IRQ_PA0;
u8 pint_val = irq2pint_lut[irq - SYS_IRQS];
- if (pint_val == IRQ_NOT_AVAIL) {
- printk(KERN_ERR
- "GPIO IRQ %d :Not in PINT Assign table "
- "Reconfigure Interrupt to Port Assignemt\n", irq);
+ if (pint_val == IRQ_NOT_AVAIL)
return -ENODEV;
- }
if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
ret = gpio_request(gpionr, NULL);
@@ -717,29 +713,6 @@ static void bfin_demux_gpio_irq(unsigned int intb_irq,
}
#endif /* CONFIG_IRQCHIP_DEMUX_GPIO */
-void __init init_exception_vectors(void)
-{
- SSYNC();
-
-#ifndef CONFIG_KGDB
- bfin_write_EVT0(evt_emulation);
-#endif
- bfin_write_EVT2(evt_evt2);
- bfin_write_EVT3(trap);
- bfin_write_EVT5(evt_ivhw);
- bfin_write_EVT6(evt_timer);
- bfin_write_EVT7(evt_evt7);
- bfin_write_EVT8(evt_evt8);
- bfin_write_EVT9(evt_evt9);
- bfin_write_EVT10(evt_evt10);
- bfin_write_EVT11(evt_evt11);
- bfin_write_EVT12(evt_evt12);
- bfin_write_EVT13(evt_evt13);
- bfin_write_EVT14(evt14_softirq);
- bfin_write_EVT15(evt_system_call);
- CSYNC();
-}
-
/*
* This function should be called during kernel startup to initialize
* the BFin IRQ handling routines.
@@ -760,10 +733,29 @@ int __init init_arch_irq(void)
bfin_write_SIC_IMASK(SIC_UNMASK_ALL);
bfin_write_SIC_IWR(IWR_ENABLE_ALL);
#endif
+
SSYNC();
local_irq_disable();
+#ifndef CONFIG_KGDB
+ bfin_write_EVT0(evt_emulation);
+#endif
+ bfin_write_EVT2(evt_evt2);
+ bfin_write_EVT3(trap);
+ bfin_write_EVT5(evt_ivhw);
+ bfin_write_EVT6(evt_timer);
+ bfin_write_EVT7(evt_evt7);
+ bfin_write_EVT8(evt_evt8);
+ bfin_write_EVT9(evt_evt9);
+ bfin_write_EVT10(evt_evt10);
+ bfin_write_EVT11(evt_evt11);
+ bfin_write_EVT12(evt_evt12);
+ bfin_write_EVT13(evt_evt13);
+ bfin_write_EVT14(evt14_softirq);
+ bfin_write_EVT15(evt_system_call);
+ CSYNC();
+
#if defined(CONFIG_IRQCHIP_DEMUX_GPIO) && defined(CONFIG_BF54x)
#ifdef CONFIG_PINTx_REASSIGN
pint[0]->assign = CONFIG_PINT0_ASSIGN;
diff --git a/trunk/arch/frv/kernel/sys_frv.c b/trunk/arch/frv/kernel/sys_frv.c
index 6fbe2665c577..26b3df32b9a7 100644
--- a/trunk/arch/frv/kernel/sys_frv.c
+++ b/trunk/arch/frv/kernel/sys_frv.c
@@ -13,7 +13,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/i386/Kconfig b/trunk/arch/i386/Kconfig
index 5c8a845a4129..abb582bc218f 100644
--- a/trunk/arch/i386/Kconfig
+++ b/trunk/arch/i386/Kconfig
@@ -938,7 +938,7 @@ source "drivers/acpi/Kconfig"
menuconfig APM
tristate "APM (Advanced Power Management) BIOS support"
- depends on PM_SLEEP && !X86_VISWS
+ depends on PM && !X86_VISWS
---help---
APM is a BIOS specification for saving power using several different
techniques. This is mostly useful for battery powered laptops with
diff --git a/trunk/arch/i386/Kconfig.debug b/trunk/arch/i386/Kconfig.debug
index f03531eacdfb..b31c0802e1cc 100644
--- a/trunk/arch/i386/Kconfig.debug
+++ b/trunk/arch/i386/Kconfig.debug
@@ -36,11 +36,11 @@ config DEBUG_STACK_USAGE
This option will slow down process creation somewhat.
comment "Page alloc debug is incompatible with Software Suspend on i386"
- depends on DEBUG_KERNEL && HIBERNATION
+ depends on DEBUG_KERNEL && SOFTWARE_SUSPEND
config DEBUG_PAGEALLOC
bool "Debug page memory allocations"
- depends on DEBUG_KERNEL && !HIBERNATION && !HUGETLBFS
+ depends on DEBUG_KERNEL && !SOFTWARE_SUSPEND && !HUGETLBFS
help
Unmap pages from the kernel linear mapping after free_pages().
This results in a large slowdown, but helps to find certain types
diff --git a/trunk/arch/i386/kernel/acpi/Makefile b/trunk/arch/i386/kernel/acpi/Makefile
index 7f7be01f44e6..223f58fc9f46 100644
--- a/trunk/arch/i386/kernel/acpi/Makefile
+++ b/trunk/arch/i386/kernel/acpi/Makefile
@@ -2,7 +2,7 @@ obj-$(CONFIG_ACPI) += boot.o
ifneq ($(CONFIG_PCI),)
obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o
endif
-obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
+obj-$(CONFIG_ACPI) += sleep.o wakeup.o
ifneq ($(CONFIG_ACPI_PROCESSOR),)
obj-y += cstate.o processor.o
diff --git a/trunk/arch/i386/kernel/e820.c b/trunk/arch/i386/kernel/e820.c
index 3c86b979a40a..e60cddbc4cfb 100644
--- a/trunk/arch/i386/kernel/e820.c
+++ b/trunk/arch/i386/kernel/e820.c
@@ -321,7 +321,7 @@ static int __init request_standard_resources(void)
subsys_initcall(request_standard_resources);
-#if defined(CONFIG_PM) && defined(CONFIG_HIBERNATION)
+#if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND)
/**
* e820_mark_nosave_regions - Find the ranges of physical addresses that do not
* correspond to e820 RAM areas and mark the corresponding pages as nosave for
diff --git a/trunk/arch/i386/kernel/microcode.c b/trunk/arch/i386/kernel/microcode.c
index 09cf78110358..d865d041bea1 100644
--- a/trunk/arch/i386/kernel/microcode.c
+++ b/trunk/arch/i386/kernel/microcode.c
@@ -82,7 +82,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/i386/kernel/setup.c b/trunk/arch/i386/kernel/setup.c
index d474cd639bcb..7fe5da3c932e 100644
--- a/trunk/arch/i386/kernel/setup.c
+++ b/trunk/arch/i386/kernel/setup.c
@@ -422,7 +422,7 @@ void __init setup_bootmem_allocator(void)
*/
reserve_bootmem(PAGE_SIZE, PAGE_SIZE);
#endif
-#ifdef CONFIG_ACPI_SLEEP
+#ifdef CONFIG_ACPI
/*
* Reserve low memory region for sleep support.
*/
diff --git a/trunk/arch/i386/kernel/sys_i386.c b/trunk/arch/i386/kernel/sys_i386.c
index 42147304de88..e5dcb9379018 100644
--- a/trunk/arch/i386/kernel/sys_i386.c
+++ b/trunk/arch/i386/kernel/sys_i386.c
@@ -9,7 +9,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/i386/kernel/sysenter.c b/trunk/arch/i386/kernel/sysenter.c
index 4eb2e408764f..6deb159d08e0 100644
--- a/trunk/arch/i386/kernel/sysenter.c
+++ b/trunk/arch/i386/kernel/sysenter.c
@@ -16,7 +16,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/trunk/arch/i386/mm/init.c b/trunk/arch/i386/mm/init.c
index 730a5b177b1f..4c4809f13cb1 100644
--- a/trunk/arch/i386/mm/init.c
+++ b/trunk/arch/i386/mm/init.c
@@ -432,7 +432,7 @@ static void __init pagetable_init (void)
paravirt_pagetable_setup_done(pgd_base);
}
-#if defined(CONFIG_HIBERNATION) || defined(CONFIG_ACPI)
+#if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI)
/*
* Swap suspend & friends need this for resume because things like the intel-agp
* driver might have split up a kernel 4MB mapping.
diff --git a/trunk/arch/i386/power/Makefile b/trunk/arch/i386/power/Makefile
index d764ec950065..2de7bbf03cd7 100644
--- a/trunk/arch/i386/power/Makefile
+++ b/trunk/arch/i386/power/Makefile
@@ -1,2 +1,2 @@
obj-$(CONFIG_PM) += cpu.o
-obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o
+obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o suspend.o
diff --git a/trunk/arch/ia64/hp/sim/simscsi.c b/trunk/arch/ia64/hp/sim/simscsi.c
index e62694f8ef75..64248b58f63f 100644
--- a/trunk/arch/ia64/hp/sim/simscsi.c
+++ b/trunk/arch/ia64/hp/sim/simscsi.c
@@ -121,23 +121,49 @@ simscsi_biosparam (struct scsi_device *sdev, struct block_device *n,
return 0;
}
+static void
+simscsi_readwrite (struct scsi_cmnd *sc, int mode, unsigned long offset, unsigned long len)
+{
+ struct disk_stat stat;
+ struct disk_req req;
+
+ req.addr = __pa(sc->request_buffer);
+ req.len = len; /* # of bytes to transfer */
+
+ if (sc->request_bufflen < req.len)
+ return;
+
+ stat.fd = desc[sc->device->id];
+ if (DBG)
+ printk("simscsi_%s @ %lx (off %lx)\n",
+ mode == SSC_READ ? "read":"write", req.addr, offset);
+ ia64_ssc(stat.fd, 1, __pa(&req), offset, mode);
+ ia64_ssc(__pa(&stat), 0, 0, 0, SSC_WAIT_COMPLETION);
+
+ if (stat.count == req.len) {
+ sc->result = GOOD;
+ } else {
+ sc->result = DID_ERROR << 16;
+ }
+}
+
static void
simscsi_sg_readwrite (struct scsi_cmnd *sc, int mode, unsigned long offset)
{
- int i;
- struct scatterlist *sl;
+ int list_len = sc->use_sg;
+ struct scatterlist *sl = (struct scatterlist *)sc->request_buffer;
struct disk_stat stat;
struct disk_req req;
stat.fd = desc[sc->device->id];
- scsi_for_each_sg(sc, sl, scsi_sg_count(sc), i) {
+ while (list_len) {
req.addr = __pa(page_address(sl->page) + sl->offset);
req.len = sl->length;
if (DBG)
printk("simscsi_sg_%s @ %lx (off %lx) use_sg=%d len=%d\n",
mode == SSC_READ ? "read":"write", req.addr, offset,
- scsi_sg_count(sc) - i, sl->length);
+ list_len, sl->length);
ia64_ssc(stat.fd, 1, __pa(&req), offset, mode);
ia64_ssc(__pa(&stat), 0, 0, 0, SSC_WAIT_COMPLETION);
@@ -147,6 +173,8 @@ simscsi_sg_readwrite (struct scsi_cmnd *sc, int mode, unsigned long offset)
return;
}
offset += sl->length;
+ sl++;
+ list_len--;
}
sc->result = GOOD;
}
@@ -162,7 +190,10 @@ simscsi_readwrite6 (struct scsi_cmnd *sc, int mode)
unsigned long offset;
offset = (((sc->cmnd[1] & 0x1f) << 16) | (sc->cmnd[2] << 8) | sc->cmnd[3])*512;
- simscsi_sg_readwrite(sc, mode, offset);
+ if (sc->use_sg > 0)
+ simscsi_sg_readwrite(sc, mode, offset);
+ else
+ simscsi_readwrite(sc, mode, offset, sc->cmnd[4]*512);
}
static size_t
@@ -199,21 +230,26 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode)
| ((unsigned long)sc->cmnd[3] << 16)
| ((unsigned long)sc->cmnd[4] << 8)
| ((unsigned long)sc->cmnd[5] << 0))*512UL;
- simscsi_sg_readwrite(sc, mode, offset);
+ if (sc->use_sg > 0)
+ simscsi_sg_readwrite(sc, mode, offset);
+ else
+ simscsi_readwrite(sc, mode, offset, ((sc->cmnd[7] << 8) | sc->cmnd[8])*512);
}
static void simscsi_fillresult(struct scsi_cmnd *sc, char *buf, unsigned len)
{
- int i;
- unsigned thislen;
+ int scatterlen = sc->use_sg;
struct scatterlist *slp;
- scsi_for_each_sg(sc, slp, scsi_sg_count(sc), i) {
- if (!len)
- break;
- thislen = min(len, slp->length);
+ if (scatterlen == 0)
+ memcpy(sc->request_buffer, buf, len);
+ else for (slp = (struct scatterlist *)sc->request_buffer;
+ scatterlen-- > 0 && len > 0; slp++) {
+ unsigned thislen = min(len, slp->length);
+
memcpy(page_address(slp->page) + slp->offset, buf, thislen);
+ slp++;
len -= thislen;
}
}
@@ -239,7 +275,7 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
if (target_id <= 15 && sc->device->lun == 0) {
switch (sc->cmnd[0]) {
case INQUIRY:
- if (scsi_bufflen(sc) < 35) {
+ if (sc->request_bufflen < 35) {
break;
}
sprintf (fname, "%s%c", simscsi_root, 'a' + target_id);
@@ -292,7 +328,7 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
break;
case READ_CAPACITY:
- if (desc[target_id] < 0 || scsi_bufflen(sc) < 8) {
+ if (desc[target_id] < 0 || sc->request_bufflen < 8) {
break;
}
buf = localbuf;
@@ -314,7 +350,7 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
case MODE_SENSE:
case MODE_SENSE_10:
/* sd.c uses this to determine whether disk does write-caching. */
- simscsi_fillresult(sc, (char *)empty_zero_page, scsi_bufflen(sc));
+ simscsi_fillresult(sc, (char *)empty_zero_page, sc->request_bufflen);
sc->result = GOOD;
break;
diff --git a/trunk/arch/ia64/kernel/init_task.c b/trunk/arch/ia64/kernel/init_task.c
index bc8efcad28b8..b69c397ed1bf 100644
--- a/trunk/arch/ia64/kernel/init_task.c
+++ b/trunk/arch/ia64/kernel/init_task.c
@@ -8,7 +8,6 @@
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/m32r/kernel/ptrace.c b/trunk/arch/m32r/kernel/ptrace.c
index 62a51429306e..57a92ef31a90 100644
--- a/trunk/arch/m32r/kernel/ptrace.c
+++ b/trunk/arch/m32r/kernel/ptrace.c
@@ -17,7 +17,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/m32r/kernel/smpboot.c b/trunk/arch/m32r/kernel/smpboot.c
index 9dae410014d8..3eb305953497 100644
--- a/trunk/arch/m32r/kernel/smpboot.c
+++ b/trunk/arch/m32r/kernel/smpboot.c
@@ -43,7 +43,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/m32r/kernel/sys_m32r.c b/trunk/arch/m32r/kernel/sys_m32r.c
index b13dbbeaeafa..bda85548de6c 100644
--- a/trunk/arch/m32r/kernel/sys_m32r.c
+++ b/trunk/arch/m32r/kernel/sys_m32r.c
@@ -10,7 +10,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/m68k/kernel/process.c b/trunk/arch/m68k/kernel/process.c
index 3ee918695215..99fc1226f7f8 100644
--- a/trunk/arch/m68k/kernel/process.c
+++ b/trunk/arch/m68k/kernel/process.c
@@ -15,7 +15,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/m68k/kernel/sys_m68k.c b/trunk/arch/m68k/kernel/sys_m68k.c
index 36d78cf1a7bc..90238a8c9e14 100644
--- a/trunk/arch/m68k/kernel/sys_m68k.c
+++ b/trunk/arch/m68k/kernel/sys_m68k.c
@@ -10,7 +10,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/mips/kernel/smp.c b/trunk/arch/mips/kernel/smp.c
index 04bbbd8d91ab..be7362bc2c9a 100644
--- a/trunk/arch/mips/kernel/smp.c
+++ b/trunk/arch/mips/kernel/smp.c
@@ -30,7 +30,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/trunk/arch/mips/kernel/syscall.c b/trunk/arch/mips/kernel/syscall.c
index 541b5005957e..b53f7edbc159 100644
--- a/trunk/arch/mips/kernel/syscall.c
+++ b/trunk/arch/mips/kernel/syscall.c
@@ -12,7 +12,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/parisc/hpux/fs.c b/trunk/arch/parisc/hpux/fs.c
index 1263f00dc35d..f2042e6466a4 100644
--- a/trunk/arch/parisc/hpux/fs.c
+++ b/trunk/arch/parisc/hpux/fs.c
@@ -23,7 +23,6 @@
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/parisc/kernel/init_task.c b/trunk/arch/parisc/kernel/init_task.c
index 446f98d3fd7b..8384bf9cecd2 100644
--- a/trunk/arch/parisc/kernel/init_task.c
+++ b/trunk/arch/parisc/kernel/init_task.c
@@ -23,7 +23,6 @@
*/
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/parisc/kernel/process.c b/trunk/arch/parisc/kernel/process.c
index b80e02a4d81d..355664812b83 100644
--- a/trunk/arch/parisc/kernel/process.c
+++ b/trunk/arch/parisc/kernel/process.c
@@ -38,7 +38,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/parisc/kernel/smp.c b/trunk/arch/parisc/kernel/smp.c
index d7bc7bb42c94..04c7e1d36cea 100644
--- a/trunk/arch/parisc/kernel/smp.c
+++ b/trunk/arch/parisc/kernel/smp.c
@@ -28,7 +28,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/trunk/arch/powerpc/Kconfig.debug b/trunk/arch/powerpc/Kconfig.debug
index 22acece95b11..5c71624ee38d 100644
--- a/trunk/arch/powerpc/Kconfig.debug
+++ b/trunk/arch/powerpc/Kconfig.debug
@@ -20,7 +20,7 @@ config DEBUG_STACK_USAGE
config DEBUG_PAGEALLOC
bool "Debug page memory allocations"
- depends on DEBUG_KERNEL && !HIBERNATION
+ depends on DEBUG_KERNEL && !SOFTWARE_SUSPEND
help
Unmap pages from the kernel linear mapping after free_pages().
This results in a large slowdown, but helps to find certain types
diff --git a/trunk/arch/powerpc/configs/lite5200_defconfig b/trunk/arch/powerpc/configs/lite5200_defconfig
index 9c30ca451617..d12a981398b8 100644
--- a/trunk/arch/powerpc/configs/lite5200_defconfig
+++ b/trunk/arch/powerpc/configs/lite5200_defconfig
@@ -196,7 +196,7 @@ CONFIG_PM=y
# CONFIG_PM_LEGACY is not set
# CONFIG_PM_DEBUG is not set
# CONFIG_PM_SYSFS_DEPRECATED is not set
-# CONFIG_HIBERNATION is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
CONFIG_SECCOMP=y
# CONFIG_WANT_DEVICE_TREE is not set
CONFIG_ISA_DMA_API=y
diff --git a/trunk/arch/powerpc/configs/pmac32_defconfig b/trunk/arch/powerpc/configs/pmac32_defconfig
index 08525d6fb1f1..0d8ba623e29a 100644
--- a/trunk/arch/powerpc/configs/pmac32_defconfig
+++ b/trunk/arch/powerpc/configs/pmac32_defconfig
@@ -218,7 +218,7 @@ CONFIG_PM=y
CONFIG_PM_DEBUG=y
# CONFIG_DISABLE_CONSOLE_SUSPEND is not set
CONFIG_PM_SYSFS_DEPRECATED=y
-CONFIG_HIBERNATION=y
+CONFIG_SOFTWARE_SUSPEND=y
CONFIG_PM_STD_PARTITION=""
CONFIG_APM_EMULATION=y
CONFIG_SECCOMP=y
diff --git a/trunk/arch/powerpc/kernel/Makefile b/trunk/arch/powerpc/kernel/Makefile
index f39a72f30aad..42c42ecad00c 100644
--- a/trunk/arch/powerpc/kernel/Makefile
+++ b/trunk/arch/powerpc/kernel/Makefile
@@ -37,9 +37,9 @@ obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
obj-$(CONFIG_TAU) += tau_6xx.o
-obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o
-obj32-$(CONFIG_HIBERNATION) += swsusp_32.o
-obj64-$(CONFIG_HIBERNATION) += swsusp_64.o swsusp_asm64.o
+obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o suspend.o
+obj32-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_32.o
+obj64-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_64.o swsusp_asm64.o
obj32-$(CONFIG_MODULES) += module_32.o
ifeq ($(CONFIG_PPC_MERGE),y)
diff --git a/trunk/arch/powerpc/kernel/syscalls.c b/trunk/arch/powerpc/kernel/syscalls.c
index f85f402ceaef..fc6647d332cb 100644
--- a/trunk/arch/powerpc/kernel/syscalls.c
+++ b/trunk/arch/powerpc/kernel/syscalls.c
@@ -23,7 +23,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/powerpc/lib/rheap.c b/trunk/arch/powerpc/lib/rheap.c
index ada5b42dd231..2f24ea0d723a 100644
--- a/trunk/arch/powerpc/lib/rheap.c
+++ b/trunk/arch/powerpc/lib/rheap.c
@@ -16,7 +16,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/trunk/arch/powerpc/oprofile/cell/spu_task_sync.c b/trunk/arch/powerpc/oprofile/cell/spu_task_sync.c
index 4a890cb42b98..133665754a75 100644
--- a/trunk/arch/powerpc/oprofile/cell/spu_task_sync.c
+++ b/trunk/arch/powerpc/oprofile/cell/spu_task_sync.c
@@ -21,7 +21,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/ppc/configs/TQM8540_defconfig b/trunk/arch/ppc/configs/TQM8540_defconfig
index f33f0e772dcb..99bf3b7a2762 100644
--- a/trunk/arch/ppc/configs/TQM8540_defconfig
+++ b/trunk/arch/ppc/configs/TQM8540_defconfig
@@ -136,7 +136,7 @@ CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_CMDLINE_BOOL is not set
# CONFIG_PM is not set
-# CONFIG_HIBERNATION is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
CONFIG_SECCOMP=y
CONFIG_ISA_DMA_API=y
diff --git a/trunk/arch/ppc/configs/TQM8541_defconfig b/trunk/arch/ppc/configs/TQM8541_defconfig
index e00cd62daa3f..0ff56695d349 100644
--- a/trunk/arch/ppc/configs/TQM8541_defconfig
+++ b/trunk/arch/ppc/configs/TQM8541_defconfig
@@ -138,7 +138,7 @@ CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_CMDLINE_BOOL is not set
# CONFIG_PM is not set
-# CONFIG_HIBERNATION is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
CONFIG_SECCOMP=y
CONFIG_ISA_DMA_API=y
diff --git a/trunk/arch/ppc/configs/TQM8555_defconfig b/trunk/arch/ppc/configs/TQM8555_defconfig
index 43a0d9df1e23..730b3db2e47a 100644
--- a/trunk/arch/ppc/configs/TQM8555_defconfig
+++ b/trunk/arch/ppc/configs/TQM8555_defconfig
@@ -138,7 +138,7 @@ CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_CMDLINE_BOOL is not set
# CONFIG_PM is not set
-# CONFIG_HIBERNATION is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
CONFIG_SECCOMP=y
CONFIG_ISA_DMA_API=y
diff --git a/trunk/arch/ppc/configs/TQM8560_defconfig b/trunk/arch/ppc/configs/TQM8560_defconfig
index a814d17a2be9..1d902072825e 100644
--- a/trunk/arch/ppc/configs/TQM8560_defconfig
+++ b/trunk/arch/ppc/configs/TQM8560_defconfig
@@ -137,7 +137,7 @@ CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_CMDLINE_BOOL is not set
# CONFIG_PM is not set
-# CONFIG_HIBERNATION is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
CONFIG_SECCOMP=y
CONFIG_ISA_DMA_API=y
diff --git a/trunk/arch/ppc/configs/ev64360_defconfig b/trunk/arch/ppc/configs/ev64360_defconfig
index f297c4bb632b..d471e578dcb5 100644
--- a/trunk/arch/ppc/configs/ev64360_defconfig
+++ b/trunk/arch/ppc/configs/ev64360_defconfig
@@ -142,7 +142,7 @@ CONFIG_BINFMT_MISC=y
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyMM0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2"
# CONFIG_PM is not set
-# CONFIG_HIBERNATION is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
CONFIG_SECCOMP=y
CONFIG_ISA_DMA_API=y
diff --git a/trunk/arch/ppc/configs/ml300_defconfig b/trunk/arch/ppc/configs/ml300_defconfig
index 69bad91a6b65..4a33aca948cc 100644
--- a/trunk/arch/ppc/configs/ml300_defconfig
+++ b/trunk/arch/ppc/configs/ml300_defconfig
@@ -148,7 +148,7 @@ CONFIG_BINFMT_ELF=y
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0,9600"
# CONFIG_PM is not set
-# CONFIG_HIBERNATION is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
CONFIG_SECCOMP=y
CONFIG_ISA_DMA_API=y
diff --git a/trunk/arch/ppc/configs/ml403_defconfig b/trunk/arch/ppc/configs/ml403_defconfig
index a78896ea4560..fafd2516fa51 100644
--- a/trunk/arch/ppc/configs/ml403_defconfig
+++ b/trunk/arch/ppc/configs/ml403_defconfig
@@ -149,7 +149,7 @@ CONFIG_BINFMT_ELF=y
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0,9600"
# CONFIG_PM is not set
-# CONFIG_HIBERNATION is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
CONFIG_SECCOMP=y
CONFIG_ISA_DMA_API=y
diff --git a/trunk/arch/ppc/configs/mpc834x_sys_defconfig b/trunk/arch/ppc/configs/mpc834x_sys_defconfig
index d90c8a7e060c..b96a6d6dad0e 100644
--- a/trunk/arch/ppc/configs/mpc834x_sys_defconfig
+++ b/trunk/arch/ppc/configs/mpc834x_sys_defconfig
@@ -130,7 +130,7 @@ CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_CMDLINE_BOOL is not set
# CONFIG_PM is not set
-# CONFIG_HIBERNATION is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
CONFIG_SECCOMP=y
CONFIG_ISA_DMA_API=y
diff --git a/trunk/arch/ppc/configs/prep_defconfig b/trunk/arch/ppc/configs/prep_defconfig
index b7cee2d71405..0aa333178b2a 100644
--- a/trunk/arch/ppc/configs/prep_defconfig
+++ b/trunk/arch/ppc/configs/prep_defconfig
@@ -166,7 +166,7 @@ CONFIG_PROC_PREPRESIDUAL=y
CONFIG_PM=y
# CONFIG_PM_LEGACY is not set
# CONFIG_PM_DEBUG is not set
-CONFIG_HIBERNATION=y
+CONFIG_SOFTWARE_SUSPEND=y
CONFIG_PM_STD_PARTITION=""
# CONFIG_SECCOMP is not set
CONFIG_ISA_DMA_API=y
diff --git a/trunk/arch/s390/appldata/appldata_base.c b/trunk/arch/s390/appldata/appldata_base.c
index 62391fb1f61f..6ffbab77ae4d 100644
--- a/trunk/arch/s390/appldata/appldata_base.c
+++ b/trunk/arch/s390/appldata/appldata_base.c
@@ -173,7 +173,7 @@ int appldata_diag(char record_nr, u16 function, unsigned long buffer,
/*
* appldata_mod_vtimer_wrap()
*
- * wrapper function for mod_virt_timer(), because smp_call_function_single()
+ * wrapper function for mod_virt_timer(), because smp_call_function_on()
* accepts only one parameter.
*/
static void __appldata_mod_vtimer_wrap(void *p) {
@@ -208,9 +208,9 @@ __appldata_vtimer_setup(int cmd)
num_online_cpus()) * TOD_MICRO;
for_each_online_cpu(i) {
per_cpu(appldata_timer, i).expires = per_cpu_interval;
- smp_call_function_single(i, add_virt_timer_periodic,
- &per_cpu(appldata_timer, i),
- 0, 1);
+ smp_call_function_on(add_virt_timer_periodic,
+ &per_cpu(appldata_timer, i),
+ 0, 1, i);
}
appldata_timer_active = 1;
P_INFO("Monitoring timer started.\n");
@@ -236,8 +236,8 @@ __appldata_vtimer_setup(int cmd)
} args;
args.timer = &per_cpu(appldata_timer, i);
args.expires = per_cpu_interval;
- smp_call_function_single(i, __appldata_mod_vtimer_wrap,
- &args, 0, 1);
+ smp_call_function_on(__appldata_mod_vtimer_wrap,
+ &args, 0, 1, i);
}
}
}
diff --git a/trunk/arch/s390/kernel/compat_wrapper.S b/trunk/arch/s390/kernel/compat_wrapper.S
index 6ee1bedbd1bf..acc415457b45 100644
--- a/trunk/arch/s390/kernel/compat_wrapper.S
+++ b/trunk/arch/s390/kernel/compat_wrapper.S
@@ -1710,13 +1710,3 @@ compat_sys_timerfd_wrapper:
sys_eventfd_wrapper:
llgfr %r2,%r2 # unsigned int
jg sys_eventfd
-
- .globl sys_fallocate_wrapper
-sys_fallocate_wrapper:
- lgfr %r2,%r2 # int
- lgfr %r3,%r3 # int
- sllg %r4,%r4,32 # get high word of 64bit loff_t
- lr %r4,%r5 # get low word of 64bit loff_t
- sllg %r5,%r6,32 # get high word of 64bit loff_t
- l %r5,164(%r15) # get low word of 64bit loff_t
- jg sys_fallocate
diff --git a/trunk/arch/s390/kernel/entry.S b/trunk/arch/s390/kernel/entry.S
index f3bceb165321..bc7ff3658c3d 100644
--- a/trunk/arch/s390/kernel/entry.S
+++ b/trunk/arch/s390/kernel/entry.S
@@ -624,11 +624,9 @@ io_work_loop:
# _TIF_MCCK_PENDING is set, call handler
#
io_mcck_pending:
- TRACE_IRQS_OFF
l %r1,BASED(.Ls390_handle_mcck)
- basr %r14,%r1 # TIF bit will be cleared by handler
- TRACE_IRQS_ON
- b BASED(io_work_loop)
+ la %r14,BASED(io_work_loop)
+ br %r1 # TIF bit will be cleared by handler
#
# _TIF_NEED_RESCHED is set, call schedule
diff --git a/trunk/arch/s390/kernel/entry64.S b/trunk/arch/s390/kernel/entry64.S
index 9c0d5cc8269d..2a7b1304418b 100644
--- a/trunk/arch/s390/kernel/entry64.S
+++ b/trunk/arch/s390/kernel/entry64.S
@@ -611,10 +611,8 @@ io_work_loop:
# _TIF_MCCK_PENDING is set, call handler
#
io_mcck_pending:
- TRACE_IRQS_OFF
- brasl %r14,s390_handle_mcck # TIF bit will be cleared by handler
- TRACE_IRQS_ON
- j io_work_loop
+ larl %r14,io_work_loop
+ jg s390_handle_mcck # TIF bit will be cleared by handler
#
# _TIF_NEED_RESCHED is set, call schedule
diff --git a/trunk/arch/s390/kernel/head.S b/trunk/arch/s390/kernel/head.S
index 83477c7dc743..8f8c802f1bcf 100644
--- a/trunk/arch/s390/kernel/head.S
+++ b/trunk/arch/s390/kernel/head.S
@@ -35,7 +35,6 @@
#define ARCH_OFFSET 0
#endif
-.section ".text.head","ax"
#ifndef CONFIG_IPL
.org 0
.long 0x00080000,0x80000000+startup # Just a restart PSW
diff --git a/trunk/arch/s390/kernel/init_task.c b/trunk/arch/s390/kernel/init_task.c
index d494161b05b4..d73a74013e73 100644
--- a/trunk/arch/s390/kernel/init_task.c
+++ b/trunk/arch/s390/kernel/init_task.c
@@ -7,7 +7,6 @@
*/
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/s390/kernel/process.c b/trunk/arch/s390/kernel/process.c
index abb447a3e472..441975b796fb 100644
--- a/trunk/arch/s390/kernel/process.c
+++ b/trunk/arch/s390/kernel/process.c
@@ -21,7 +21,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/s390/kernel/smp.c b/trunk/arch/s390/kernel/smp.c
index 35edbef1d222..182c085ae4dd 100644
--- a/trunk/arch/s390/kernel/smp.c
+++ b/trunk/arch/s390/kernel/smp.c
@@ -23,7 +23,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -121,7 +120,7 @@ static void __smp_call_function_map(void (*func) (void *info), void *info,
if (wait)
data.finished = CPU_MASK_NONE;
- spin_lock(&call_lock);
+ spin_lock_bh(&call_lock);
call_data = &data;
for_each_cpu_mask(cpu, map)
@@ -130,16 +129,18 @@ static void __smp_call_function_map(void (*func) (void *info), void *info,
/* Wait for response */
while (!cpus_equal(map, data.started))
cpu_relax();
+
if (wait)
while (!cpus_equal(map, data.finished))
cpu_relax();
- spin_unlock(&call_lock);
+
+ spin_unlock_bh(&call_lock);
+
out:
- if (local) {
- local_irq_disable();
+ local_irq_disable();
+ if (local)
func(info);
- local_irq_enable();
- }
+ local_irq_enable();
}
/*
@@ -169,28 +170,30 @@ int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
EXPORT_SYMBOL(smp_call_function);
/*
- * smp_call_function_single:
- * @cpu: the CPU where func should run
+ * smp_call_function_on:
* @func: the function to run; this must be fast and non-blocking
* @info: an arbitrary pointer to pass to the function
* @nonatomic: unused
* @wait: if true, wait (atomically) until function has completed on other CPUs
+ * @cpu: the CPU where func should run
*
* Run a function on one processor.
*
* You must not call this function with disabled interrupts, from a
* hardware interrupt handler or from a bottom half.
*/
-int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
- int nonatomic, int wait)
+int smp_call_function_on(void (*func) (void *info), void *info, int nonatomic,
+ int wait, int cpu)
{
+ cpumask_t map = CPU_MASK_NONE;
+
preempt_disable();
- __smp_call_function_map(func, info, nonatomic, wait,
- cpumask_of_cpu(cpu));
+ cpu_set(cpu, map);
+ __smp_call_function_map(func, info, nonatomic, wait, map);
preempt_enable();
return 0;
}
-EXPORT_SYMBOL(smp_call_function_single);
+EXPORT_SYMBOL(smp_call_function_on);
static void do_send_stop(void)
{
diff --git a/trunk/arch/s390/kernel/sys_s390.c b/trunk/arch/s390/kernel/sys_s390.c
index 1eaff84a1eb6..1c90c7e99978 100644
--- a/trunk/arch/s390/kernel/sys_s390.c
+++ b/trunk/arch/s390/kernel/sys_s390.c
@@ -16,7 +16,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -266,23 +265,3 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args)
return -EFAULT;
return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice);
}
-
-#ifndef CONFIG_64BIT
-/*
- * This is a wrapper to call sys_fallocate(). For 31 bit s390 the last
- * 64 bit argument "len" is split into the upper and lower 32 bits. The
- * system call wrapper in the user space loads the value to %r6/%r7.
- * The code in entry.S keeps the values in %r2 - %r6 where they are and
- * stores %r7 to 96(%r15). But the standard C linkage requires that
- * the whole 64 bit value for len is stored on the stack and doesn't
- * use %r6 at all. So s390_fallocate has to convert the arguments from
- * %r2: fd, %r3: mode, %r4/%r5: offset, %r6/96(%r15)-99(%r15): len
- * to
- * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len
- */
-asmlinkage long s390_fallocate(int fd, int mode, loff_t offset,
- u32 len_high, u32 len_low)
-{
- return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low);
-}
-#endif
diff --git a/trunk/arch/s390/kernel/syscalls.S b/trunk/arch/s390/kernel/syscalls.S
index 9e26ed9fe4e7..738feb4a0aad 100644
--- a/trunk/arch/s390/kernel/syscalls.S
+++ b/trunk/arch/s390/kernel/syscalls.S
@@ -322,7 +322,7 @@ NI_SYSCALL /* 310 sys_move_pages */
SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper)
SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper)
SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper)
-SYSCALL(s390_fallocate,sys_fallocate,sys_fallocate_wrapper)
+NI_SYSCALL /* 314 sys_fallocate */
SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */
SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper)
SYSCALL(sys_timerfd,sys_timerfd,compat_sys_timerfd_wrapper)
diff --git a/trunk/arch/s390/kernel/vmlinux.lds.S b/trunk/arch/s390/kernel/vmlinux.lds.S
index b4622a3889b0..6ab7d4ee13a4 100644
--- a/trunk/arch/s390/kernel/vmlinux.lds.S
+++ b/trunk/arch/s390/kernel/vmlinux.lds.S
@@ -21,7 +21,6 @@ SECTIONS
. = 0x00000000;
_text = .; /* Text and read-only data */
.text : {
- *(.text.head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
diff --git a/trunk/arch/s390/kernel/vtime.c b/trunk/arch/s390/kernel/vtime.c
index 84ff78de6bac..b6ed143e8597 100644
--- a/trunk/arch/s390/kernel/vtime.c
+++ b/trunk/arch/s390/kernel/vtime.c
@@ -415,7 +415,7 @@ EXPORT_SYMBOL(add_virt_timer_periodic);
/*
* If we change a pending timer the function must be called on the CPU
- * where the timer is running on, e.g. by smp_call_function_single()
+ * where the timer is running on, e.g. by smp_call_function_on()
*
* The original mod_timer adds the timer if it is not pending. For compatibility
* we do the same. The timer will be added on the current CPU as a oneshot timer.
diff --git a/trunk/arch/s390/mm/vmem.c b/trunk/arch/s390/mm/vmem.c
index fd594d5fe142..92a565190028 100644
--- a/trunk/arch/s390/mm/vmem.c
+++ b/trunk/arch/s390/mm/vmem.c
@@ -29,8 +29,8 @@ struct memory_segment {
static LIST_HEAD(mem_segs);
-void __meminit memmap_init(unsigned long size, int nid, unsigned long zone,
- unsigned long start_pfn)
+void memmap_init(unsigned long size, int nid, unsigned long zone,
+ unsigned long start_pfn)
{
struct page *start, *end;
struct page *map_start, *map_end;
@@ -66,7 +66,7 @@ void __meminit memmap_init(unsigned long size, int nid, unsigned long zone,
}
}
-static void __init_refok *vmem_alloc_pages(unsigned int order)
+static inline void *vmem_alloc_pages(unsigned int order)
{
if (slab_is_available())
return (void *)__get_free_pages(GFP_KERNEL, order);
diff --git a/trunk/arch/sparc/defconfig b/trunk/arch/sparc/defconfig
index f7a509149199..fdc67238408a 100644
--- a/trunk/arch/sparc/defconfig
+++ b/trunk/arch/sparc/defconfig
@@ -1,14 +1,12 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc1
-# Wed Jul 25 15:30:21 2007
+# Linux kernel version: 2.6.22-rc1
+# Mon May 14 03:25:14 2007
#
CONFIG_MMU=y
CONFIG_HIGHMEM=y
CONFIG_ZONE_DMA=y
CONFIG_GENERIC_ISA_DMA=y
-CONFIG_ARCH_NO_VIRT_TO_BUS=y
-CONFIG_OF=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
#
@@ -25,11 +23,12 @@ CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
+# CONFIG_UTS_NS is not set
# CONFIG_AUDIT is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=14
@@ -64,17 +63,24 @@ CONFIG_SLAB=y
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_KMOD=y
+
+#
+# Block layer
+#
CONFIG_BLOCK=y
# CONFIG_LBD is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_LSF is not set
-# CONFIG_BLK_DEV_BSG is not set
#
# IO Schedulers
@@ -107,14 +113,11 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-CONFIG_EMULATED_CMPXCHG=y
CONFIG_SUN_PM=y
# CONFIG_SUN4 is not set
CONFIG_PCI=y
-CONFIG_PCI_SYSCALL=y
# CONFIG_ARCH_SUPPORTS_MSI is not set
# CONFIG_PCI_DEBUG is not set
-# CONFIG_NO_DMA is not set
CONFIG_SUN_OPENPROMFS=m
# CONFIG_SPARC_LED is not set
CONFIG_BINFMT_ELF=y
@@ -131,7 +134,6 @@ CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_SPLIT_PTLOCK_CPUS=4
# CONFIG_RESOURCES_64BIT is not set
CONFIG_ZONE_DMA_FLAG=1
-CONFIG_BOUNCE=y
#
# Networking
@@ -195,13 +197,25 @@ CONFIG_IPV6_TUNNEL=m
# CONFIG_IPV6_MULTIPLE_TABLES is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
CONFIG_IP_SCTP=m
# CONFIG_SCTP_DBG_MSG is not set
CONFIG_SCTP_DBG_OBJCNT=y
# CONFIG_SCTP_HMAC_NONE is not set
# CONFIG_SCTP_HMAC_SHA1 is not set
CONFIG_SCTP_HMAC_MD5=y
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
@@ -239,7 +253,6 @@ CONFIG_AF_RXRPC=m
# CONFIG_MAC80211 is not set
# CONFIG_IEEE80211 is not set
# CONFIG_RFKILL is not set
-# CONFIG_NET_9P is not set
#
# Device Drivers
@@ -254,12 +267,28 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
# CONFIG_CONNECTOR is not set
# CONFIG_MTD is not set
-CONFIG_OF_DEVICE=y
+
+#
+# Parallel port support
+#
# CONFIG_PARPORT is not set
-CONFIG_BLK_DEV=y
+
+#
+# Plug and Play support
+#
+# CONFIG_PNPACPI is not set
+
+#
+# Block devices
+#
# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
@@ -274,11 +303,18 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
-CONFIG_MISC_DEVICES=y
+
+#
+# Misc devices
+#
# CONFIG_PHANTOM is not set
-# CONFIG_EEPROM_93CX6 is not set
# CONFIG_SGI_IOC4 is not set
# CONFIG_TIFM_CORE is not set
+# CONFIG_BLINK is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
# CONFIG_IDE is not set
#
@@ -286,7 +322,6 @@ CONFIG_MISC_DEVICES=y
#
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
-CONFIG_SCSI_DMA=y
# CONFIG_SCSI_TGT is not set
# CONFIG_SCSI_NETLINK is not set
CONFIG_SCSI_PROC_FS=y
@@ -317,8 +352,12 @@ CONFIG_SCSI_WAIT_SCAN=m
CONFIG_SCSI_SPI_ATTRS=y
# CONFIG_SCSI_FC_ATTRS is not set
# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
# CONFIG_SCSI_SAS_LIBSAS is not set
-CONFIG_SCSI_LOWLEVEL=y
+
+#
+# SCSI low-level drivers
+#
# CONFIG_ISCSI_TCP is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_3W_9XXX is not set
@@ -328,6 +367,7 @@ CONFIG_SCSI_LOWLEVEL=y
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
@@ -349,9 +389,14 @@ CONFIG_SCSI_QLOGICPTI=m
# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_NSP32 is not set
# CONFIG_SCSI_DEBUG is not set
+CONFIG_SCSI_ESP_CORE=y
CONFIG_SCSI_SUNESP=y
# CONFIG_SCSI_SRP is not set
# CONFIG_ATA is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
# CONFIG_MD is not set
#
@@ -367,16 +412,30 @@ CONFIG_SCSI_SUNESP=y
#
# CONFIG_FIREWIRE is not set
# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
# CONFIG_I2O is not set
+
+#
+# Network device support
+#
CONFIG_NETDEVICES=y
-# CONFIG_NETDEVICES_MULTIQUEUE is not set
CONFIG_DUMMY=m
# CONFIG_BONDING is not set
-# CONFIG_MACVLAN is not set
# CONFIG_EQUALIZER is not set
CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
# CONFIG_ARCNET is not set
# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
CONFIG_NET_ETHERNET=y
CONFIG_MII=m
CONFIG_SUNLANCE=y
@@ -386,6 +445,10 @@ CONFIG_SUNQE=m
# CONFIG_SUNGEM is not set
# CONFIG_CASSINI is not set
# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
# CONFIG_NET_TULIP is not set
# CONFIG_HP100 is not set
# CONFIG_NET_PCI is not set
@@ -401,7 +464,7 @@ CONFIG_NETDEV_1000=y
# CONFIG_SIS190 is not set
# CONFIG_SKGE is not set
# CONFIG_SKY2 is not set
-# CONFIG_VIA_VELOCITY is not set
+# CONFIG_SK98LIN is not set
# CONFIG_TIGON3 is not set
# CONFIG_BNX2 is not set
# CONFIG_QLA3XXX is not set
@@ -414,6 +477,11 @@ CONFIG_NETDEV_10000=y
# CONFIG_MYRI10GE is not set
# CONFIG_NETXEN_NIC is not set
# CONFIG_MLX4_CORE is not set
+CONFIG_MLX4_DEBUG=y
+
+#
+# Token Ring devices
+#
# CONFIG_TR is not set
#
@@ -431,7 +499,15 @@ CONFIG_NETDEV_10000=y
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
# CONFIG_PHONE is not set
#
@@ -439,7 +515,6 @@ CONFIG_NETDEV_10000=y
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
-# CONFIG_INPUT_POLLDEV is not set
#
# Userland interfaces
@@ -518,13 +593,22 @@ CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
# CONFIG_IPMI_HANDLER is not set
# CONFIG_WATCHDOG is not set
CONFIG_HW_RANDOM=m
CONFIG_JS_RTC=m
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
+# CONFIG_DRM is not set
# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
# CONFIG_TCG_TPM is not set
CONFIG_DEVPORT=y
# CONFIG_I2C is not set
@@ -534,24 +618,20 @@ CONFIG_DEVPORT=y
#
# CONFIG_SPI is not set
# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
# CONFIG_W1 is not set
-# CONFIG_POWER_SUPPLY is not set
CONFIG_HWMON=y
# CONFIG_HWMON_VID is not set
# CONFIG_SENSORS_ABITUGURU is not set
-# CONFIG_SENSORS_ABITUGURU3 is not set
# CONFIG_SENSORS_F71805F is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
-# CONFIG_SENSORS_SIS5595 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
-# CONFIG_SENSORS_VIA686A is not set
# CONFIG_SENSORS_VT1211 is not set
-# CONFIG_SENSORS_VT8231 is not set
# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_HWMON_DEBUG_CHIP is not set
#
@@ -576,7 +656,6 @@ CONFIG_HWMON=y
#
# CONFIG_DISPLAY_SUPPORT is not set
# CONFIG_VGASTATE is not set
-# CONFIG_VIDEO_OUTPUT_CONTROL is not set
# CONFIG_FB is not set
#
@@ -589,10 +668,16 @@ CONFIG_DUMMY_CONSOLE=y
# Sound
#
# CONFIG_SOUND is not set
-CONFIG_HID_SUPPORT=y
+
+#
+# HID Devices
+#
CONFIG_HID=y
# CONFIG_HID_DEBUG is not set
-CONFIG_USB_SUPPORT=y
+
+#
+# USB support
+#
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
@@ -607,9 +692,29 @@ CONFIG_USB_ARCH_HAS_EHCI=y
#
# CONFIG_USB_GADGET is not set
# CONFIG_MMC is not set
+
+#
+# LED devices
+#
# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
# CONFIG_INFINIBAND is not set
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
#
# Real Time Clock
#
@@ -628,11 +733,6 @@ CONFIG_USB_ARCH_HAS_EHCI=y
# DMA Devices
#
-#
-# Userspace I/O
-#
-# CONFIG_UIO is not set
-
#
# Misc Linux/SPARC drivers
#
@@ -753,6 +853,7 @@ CONFIG_CIFS=m
# CONFIG_CODA_FS is not set
CONFIG_AFS_FS=m
# CONFIG_AFS_DEBUG is not set
+# CONFIG_9P_FS is not set
#
# Partition Types
@@ -826,7 +927,6 @@ CONFIG_MAGIC_SYSRQ=y
# CONFIG_HEADERS_CHECK is not set
CONFIG_DEBUG_KERNEL=y
CONFIG_DETECT_SOFTLOCKUP=y
-# CONFIG_SCHED_DEBUG is not set
# CONFIG_SCHEDSTATS is not set
# CONFIG_TIMER_STATS is not set
# CONFIG_DEBUG_SLAB is not set
@@ -853,6 +953,10 @@ CONFIG_FORCED_INLINING=y
CONFIG_KEYS=y
# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_BLKCIPHER=y
@@ -892,7 +996,10 @@ CONFIG_CRYPTO_MICHAEL_MIC=m
CONFIG_CRYPTO_CRC32C=m
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_TEST is not set
-# CONFIG_CRYPTO_HW is not set
+
+#
+# Hardware crypto devices
+#
#
# Library routines
@@ -902,7 +1009,6 @@ CONFIG_BITREVERSE=y
# CONFIG_CRC16 is not set
# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
-# CONFIG_CRC7 is not set
CONFIG_LIBCRC32C=m
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
diff --git a/trunk/arch/sparc/kernel/init_task.c b/trunk/arch/sparc/kernel/init_task.c
index d9d4f96360c7..fc31de66b1c2 100644
--- a/trunk/arch/sparc/kernel/init_task.c
+++ b/trunk/arch/sparc/kernel/init_task.c
@@ -1,5 +1,4 @@
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/sparc/kernel/prom.c b/trunk/arch/sparc/kernel/prom.c
index 39fbd3c8ab0b..e3a537650db1 100644
--- a/trunk/arch/sparc/kernel/prom.c
+++ b/trunk/arch/sparc/kernel/prom.c
@@ -415,7 +415,7 @@ static void __init of_console_init(void)
unsigned long flags;
const char *type;
phandle node;
- int skip, tmp, fd;
+ int skip, fd;
of_console_path = prom_early_alloc(256);
@@ -442,9 +442,8 @@ static void __init of_console_init(void)
prom_halt();
}
- tmp = skip;
for_each_node_by_type(dp, type) {
- if (!tmp--)
+ if (!skip--)
break;
}
if (!dp) {
diff --git a/trunk/arch/sparc64/Kconfig.debug b/trunk/arch/sparc64/Kconfig.debug
index a5faa3683bd6..1f130f3b6c24 100644
--- a/trunk/arch/sparc64/Kconfig.debug
+++ b/trunk/arch/sparc64/Kconfig.debug
@@ -29,7 +29,7 @@ config DEBUG_BOOTMEM
config DEBUG_PAGEALLOC
bool "Debug page memory allocations"
- depends on DEBUG_KERNEL && !HIBERNATION
+ depends on DEBUG_KERNEL && !SOFTWARE_SUSPEND
help
Unmap pages from the kernel linear mapping after free_pages().
This results in a large slowdown, but helps to find certain types
diff --git a/trunk/arch/sparc64/kernel/Makefile b/trunk/arch/sparc64/kernel/Makefile
index 40d2f3aae91e..b66876bf410c 100644
--- a/trunk/arch/sparc64/kernel/Makefile
+++ b/trunk/arch/sparc64/kernel/Makefile
@@ -8,14 +8,14 @@ EXTRA_CFLAGS := -Werror
extra-y := head.o init_task.o vmlinux.lds
obj-y := process.o setup.o cpu.o idprom.o \
- traps.o auxio.o una_asm.o sysfs.o iommu.o \
+ traps.o auxio.o una_asm.o sysfs.o \
irq.o ptrace.o time.o sys_sparc.o signal.o \
unaligned.o central.o pci.o starfire.o semaphore.o \
power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \
visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o
-obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o \
+obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \
pci_psycho.o pci_sabre.o pci_schizo.o \
pci_sun4v.o pci_sun4v_asm.o pci_fire.o
obj-$(CONFIG_SMP) += smp.o trampoline.o hvtramp.o
diff --git a/trunk/arch/sparc64/kernel/ebus.c b/trunk/arch/sparc64/kernel/ebus.c
index bc9ae36f7a43..6d2956179cde 100644
--- a/trunk/arch/sparc64/kernel/ebus.c
+++ b/trunk/arch/sparc64/kernel/ebus.c
@@ -391,8 +391,6 @@ static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_de
sd = &dev->ofdev.dev.archdata;
sd->prom_node = dp;
sd->op = &dev->ofdev;
- sd->iommu = dev->bus->ofdev.dev.parent->archdata.iommu;
- sd->stc = dev->bus->ofdev.dev.parent->archdata.stc;
dev->ofdev.node = dp;
dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
diff --git a/trunk/arch/sparc64/kernel/init_task.c b/trunk/arch/sparc64/kernel/init_task.c
index 90007cf88bac..329b38fa5c89 100644
--- a/trunk/arch/sparc64/kernel/init_task.c
+++ b/trunk/arch/sparc64/kernel/init_task.c
@@ -1,5 +1,4 @@
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/sparc64/kernel/isa.c b/trunk/arch/sparc64/kernel/isa.c
index 0f19dce1c905..1a1043fcf97d 100644
--- a/trunk/arch/sparc64/kernel/isa.c
+++ b/trunk/arch/sparc64/kernel/isa.c
@@ -90,8 +90,6 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
sd = &isa_dev->ofdev.dev.archdata;
sd->prom_node = dp;
sd->op = &isa_dev->ofdev;
- sd->iommu = isa_br->ofdev.dev.parent->archdata.iommu;
- sd->stc = isa_br->ofdev.dev.parent->archdata.stc;
isa_dev->ofdev.node = dp;
isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
diff --git a/trunk/arch/sparc64/kernel/pci.c b/trunk/arch/sparc64/kernel/pci.c
index 3d93e9203ba2..55ad1b899bb8 100644
--- a/trunk/arch/sparc64/kernel/pci.c
+++ b/trunk/arch/sparc64/kernel/pci.c
@@ -283,6 +283,12 @@ int __init pcic_present(void)
return pci_controller_scan(pci_is_controller);
}
+const struct pci_iommu_ops *pci_iommu_ops;
+EXPORT_SYMBOL(pci_iommu_ops);
+
+extern const struct pci_iommu_ops pci_sun4u_iommu_ops,
+ pci_sun4v_iommu_ops;
+
/* Find each controller in the system, attach and initialize
* software state structure for each and link into the
* pci_pbm_root. Setup the controller enough such
@@ -290,6 +296,11 @@ int __init pcic_present(void)
*/
static void __init pci_controller_probe(void)
{
+ if (tlb_type == hypervisor)
+ pci_iommu_ops = &pci_sun4v_iommu_ops;
+ else
+ pci_iommu_ops = &pci_sun4u_iommu_ops;
+
printk("PCI: Probing for controllers.\n");
pci_controller_scan(pci_controller_init);
@@ -395,10 +406,6 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
sd->op = of_find_device_by_node(node);
sd->msi_num = 0xffffffff;
- sd = &sd->op->dev.archdata;
- sd->iommu = pbm->iommu;
- sd->stc = &pbm->stc;
-
type = of_get_property(node, "device_type", NULL);
if (type == NULL)
type = "";
@@ -415,15 +422,10 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
dev->multifunction = 0; /* maybe a lie? */
if (host_controller) {
- if (tlb_type != hypervisor) {
- pci_read_config_word(dev, PCI_VENDOR_ID,
- &dev->vendor);
- pci_read_config_word(dev, PCI_DEVICE_ID,
- &dev->device);
- } else {
- dev->vendor = PCI_VENDOR_ID_SUN;
- dev->device = 0x80f0;
- }
+ dev->vendor = 0x108e;
+ dev->device = 0x8000;
+ dev->subsystem_vendor = 0x0000;
+ dev->subsystem_device = 0x0000;
dev->cfg_size = 256;
dev->class = PCI_CLASS_BRIDGE_HOST << 8;
sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus),
@@ -816,7 +818,7 @@ int pci_host_bridge_read_pci_cfg(struct pci_bus *bus_dev,
{
static u8 fake_pci_config[] = {
0x8e, 0x10, /* Vendor: 0x108e (Sun) */
- 0xf0, 0x80, /* Device: 0x80f0 (Fire) */
+ 0x00, 0x80, /* Device: 0x8000 (PBM) */
0x46, 0x01, /* Command: 0x0146 (SERR, PARITY, MASTER, MEM) */
0xa0, 0x22, /* Status: 0x02a0 (DEVSEL_MED, FB2B, 66MHZ) */
0x00, 0x00, 0x00, 0x06, /* Class: 0x06000000 host bridge */
@@ -1219,51 +1221,4 @@ struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
}
EXPORT_SYMBOL(pci_device_to_OF_node);
-static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit)
-{
- struct pci_dev *ali_isa_bridge;
- u8 val;
-
- /* ALI sound chips generate 31-bits of DMA, a special register
- * determines what bit 31 is emitted as.
- */
- ali_isa_bridge = pci_get_device(PCI_VENDOR_ID_AL,
- PCI_DEVICE_ID_AL_M1533,
- NULL);
-
- pci_read_config_byte(ali_isa_bridge, 0x7e, &val);
- if (set_bit)
- val |= 0x01;
- else
- val &= ~0x01;
- pci_write_config_byte(ali_isa_bridge, 0x7e, val);
- pci_dev_put(ali_isa_bridge);
-}
-
-int pci_dma_supported(struct pci_dev *pdev, u64 device_mask)
-{
- u64 dma_addr_mask;
-
- if (pdev == NULL) {
- dma_addr_mask = 0xffffffff;
- } else {
- struct iommu *iommu = pdev->dev.archdata.iommu;
-
- dma_addr_mask = iommu->dma_addr_mask;
-
- if (pdev->vendor == PCI_VENDOR_ID_AL &&
- pdev->device == PCI_DEVICE_ID_AL_M5451 &&
- device_mask == 0x7fffffff) {
- ali_sound_dma_hack(pdev,
- (dma_addr_mask & 0x80000000) != 0);
- return 1;
- }
- }
-
- if (device_mask >= (1UL << 32UL))
- return 0;
-
- return (device_mask & dma_addr_mask) == dma_addr_mask;
-}
-
#endif /* !(CONFIG_PCI) */
diff --git a/trunk/arch/sparc64/kernel/pci_common.c b/trunk/arch/sparc64/kernel/pci_common.c
index 2f61c4b12596..4249214608af 100644
--- a/trunk/arch/sparc64/kernel/pci_common.c
+++ b/trunk/arch/sparc64/kernel/pci_common.c
@@ -44,67 +44,6 @@ static void *sun4u_config_mkaddr(struct pci_pbm_info *pbm,
return (void *) (pbm->config_space | bus | devfn | reg);
}
-/* At least on Sabre, it is necessary to access all PCI host controller
- * registers at their natural size, otherwise zeros are returned.
- * Strange but true, and I see no language in the UltraSPARC-IIi
- * programmer's manual that mentions this even indirectly.
- */
-static int sun4u_read_pci_cfg_host(struct pci_pbm_info *pbm,
- unsigned char bus, unsigned int devfn,
- int where, int size, u32 *value)
-{
- u32 tmp32, *addr;
- u16 tmp16;
- u8 tmp8;
-
- addr = sun4u_config_mkaddr(pbm, bus, devfn, where);
- if (!addr)
- return PCIBIOS_SUCCESSFUL;
-
- switch (size) {
- case 1:
- if (where < 8) {
- unsigned long align = (unsigned long) addr;
-
- align &= ~1;
- pci_config_read16((u16 *)align, &tmp16);
- if (where & 1)
- *value = tmp16 >> 8;
- else
- *value = tmp16 & 0xff;
- } else {
- pci_config_read8((u8 *)addr, &tmp8);
- *value = (u32) tmp8;
- }
- break;
-
- case 2:
- if (where < 8) {
- pci_config_read16((u16 *)addr, &tmp16);
- *value = (u32) tmp16;
- } else {
- pci_config_read8((u8 *)addr, &tmp8);
- *value = (u32) tmp8;
- pci_config_read8(((u8 *)addr) + 1, &tmp8);
- *value |= ((u32) tmp8) << 8;
- }
- break;
-
- case 4:
- tmp32 = 0xffffffff;
- sun4u_read_pci_cfg_host(pbm, bus, devfn,
- where, 2, &tmp32);
- *value = tmp32;
-
- tmp32 = 0xffffffff;
- sun4u_read_pci_cfg_host(pbm, bus, devfn,
- where + 2, 2, &tmp32);
- *value |= tmp32 << 16;
- break;
- }
- return PCIBIOS_SUCCESSFUL;
-}
-
static int sun4u_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
int where, int size, u32 *value)
{
@@ -114,6 +53,10 @@ static int sun4u_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
u16 tmp16;
u8 tmp8;
+ if (bus_dev == pbm->pci_bus && devfn == 0x00)
+ return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
+ size, value);
+
switch (size) {
case 1:
*value = 0xff;
@@ -126,10 +69,6 @@ static int sun4u_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
break;
}
- if (!bus_dev->number && !PCI_SLOT(devfn))
- return sun4u_read_pci_cfg_host(pbm, bus, devfn, where,
- size, value);
-
addr = sun4u_config_mkaddr(pbm, bus, devfn, where);
if (!addr)
return PCIBIOS_SUCCESSFUL;
@@ -162,53 +101,6 @@ static int sun4u_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
return PCIBIOS_SUCCESSFUL;
}
-static int sun4u_write_pci_cfg_host(struct pci_pbm_info *pbm,
- unsigned char bus, unsigned int devfn,
- int where, int size, u32 value)
-{
- u32 *addr;
-
- addr = sun4u_config_mkaddr(pbm, bus, devfn, where);
- if (!addr)
- return PCIBIOS_SUCCESSFUL;
-
- switch (size) {
- case 1:
- if (where < 8) {
- unsigned long align = (unsigned long) addr;
- u16 tmp16;
-
- align &= ~1;
- pci_config_read16((u16 *)align, &tmp16);
- if (where & 1) {
- tmp16 &= 0x00ff;
- tmp16 |= value << 8;
- } else {
- tmp16 &= 0xff00;
- tmp16 |= value;
- }
- pci_config_write16((u16 *)align, tmp16);
- } else
- pci_config_write8((u8 *)addr, value);
- break;
- case 2:
- if (where < 8) {
- pci_config_write16((u16 *)addr, value);
- } else {
- pci_config_write8((u8 *)addr, value & 0xff);
- pci_config_write8(((u8 *)addr) + 1, value >> 8);
- }
- break;
- case 4:
- sun4u_write_pci_cfg_host(pbm, bus, devfn,
- where, 2, value & 0xffff);
- sun4u_write_pci_cfg_host(pbm, bus, devfn,
- where + 2, 2, value >> 16);
- break;
- }
- return PCIBIOS_SUCCESSFUL;
-}
-
static int sun4u_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
int where, int size, u32 value)
{
@@ -216,10 +108,9 @@ static int sun4u_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
unsigned char bus = bus_dev->number;
u32 *addr;
- if (!bus_dev->number && !PCI_SLOT(devfn))
- return sun4u_write_pci_cfg_host(pbm, bus, devfn, where,
- size, value);
-
+ if (bus_dev == pbm->pci_bus && devfn == 0x00)
+ return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
+ size, value);
addr = sun4u_config_mkaddr(pbm, bus, devfn, where);
if (!addr)
return PCIBIOS_SUCCESSFUL;
diff --git a/trunk/arch/sparc64/kernel/pci_fire.c b/trunk/arch/sparc64/kernel/pci_fire.c
index 14d67fe21ab2..7f5d473901c4 100644
--- a/trunk/arch/sparc64/kernel/pci_fire.c
+++ b/trunk/arch/sparc64/kernel/pci_fire.c
@@ -39,12 +39,12 @@ static void pci_fire_scan_bus(struct pci_pbm_info *pbm)
#define FIRE_IOMMU_FLUSH 0x40100UL
#define FIRE_IOMMU_FLUSHINV 0x40108UL
-static int pci_fire_pbm_iommu_init(struct pci_pbm_info *pbm)
+static void pci_fire_pbm_iommu_init(struct pci_pbm_info *pbm)
{
struct iommu *iommu = pbm->iommu;
u32 vdma[2], dma_mask;
u64 control;
- int tsbsize, err;
+ int tsbsize;
/* No virtual-dma property on these guys, use largest size. */
vdma[0] = 0xc0000000; /* base */
@@ -68,9 +68,7 @@ static int pci_fire_pbm_iommu_init(struct pci_pbm_info *pbm)
*/
fire_write(iommu->iommu_flushinv, ~(u64)0);
- err = iommu_table_init(iommu, tsbsize * 8 * 1024, vdma[0], dma_mask);
- if (err)
- return err;
+ pci_iommu_table_init(iommu, tsbsize * 8 * 1024, vdma[0], dma_mask);
fire_write(iommu->iommu_tsbbase, __pa(iommu->page_table) | 0x7UL);
@@ -80,8 +78,6 @@ static int pci_fire_pbm_iommu_init(struct pci_pbm_info *pbm)
0x00000002 /* Bypass enable */ |
0x00000001 /* Translation enable */);
fire_write(iommu->iommu_control, control);
-
- return 0;
}
/* Based at pbm->controller_regs */
@@ -171,8 +167,8 @@ static void pci_fire_hw_init(struct pci_pbm_info *pbm)
fire_write(pbm->pbm_regs + FIRE_PEC_IENAB, ~(u64)0);
}
-static int pci_fire_pbm_init(struct pci_controller_info *p,
- struct device_node *dp, u32 portid)
+static void pci_fire_pbm_init(struct pci_controller_info *p,
+ struct device_node *dp, u32 portid)
{
const struct linux_prom64_registers *regs;
struct pci_pbm_info *pbm;
@@ -207,8 +203,7 @@ static int pci_fire_pbm_init(struct pci_controller_info *p,
pci_get_pbm_props(pbm);
pci_fire_hw_init(pbm);
-
- return pci_fire_pbm_iommu_init(pbm);
+ pci_fire_pbm_iommu_init(pbm);
}
static inline int portid_compare(u32 x, u32 y)
@@ -227,8 +222,7 @@ void fire_pci_init(struct device_node *dp, const char *model_name)
for (pbm = pci_pbm_root; pbm; pbm = pbm->next) {
if (portid_compare(pbm->portid, portid)) {
- if (pci_fire_pbm_init(pbm->parent, dp, portid))
- goto fatal_memory_error;
+ pci_fire_pbm_init(pbm->parent, dp, portid);
return;
}
}
@@ -256,9 +250,7 @@ void fire_pci_init(struct device_node *dp, const char *model_name)
*/
pci_memspace_mask = 0x7fffffffUL;
- if (pci_fire_pbm_init(p, dp, portid))
- goto fatal_memory_error;
-
+ pci_fire_pbm_init(p, dp, portid);
return;
fatal_memory_error:
diff --git a/trunk/arch/sparc64/kernel/iommu.c b/trunk/arch/sparc64/kernel/pci_iommu.c
similarity index 68%
rename from trunk/arch/sparc64/kernel/iommu.c
rename to trunk/arch/sparc64/kernel/pci_iommu.c
index b35a62167e9c..70d2364fdfe0 100644
--- a/trunk/arch/sparc64/kernel/iommu.c
+++ b/trunk/arch/sparc64/kernel/pci_iommu.c
@@ -1,32 +1,28 @@
-/* iommu.c: Generic sparc64 IOMMU support.
+/* pci_iommu.c: UltraSparc PCI controller IOM/STC support.
*
* Copyright (C) 1999, 2007 David S. Miller (davem@davemloft.net)
* Copyright (C) 1999, 2000 Jakub Jelinek (jakub@redhat.com)
*/
#include
-#include
+#include
+#include
#include
-#include
-#include
-#include
-
-#ifdef CONFIG_PCI
#include
-#endif
-#include
+#include
#include "iommu_common.h"
+#include "pci_impl.h"
-#define STC_CTXMATCH_ADDR(STC, CTX) \
+#define PCI_STC_CTXMATCH_ADDR(STC, CTX) \
((STC)->strbuf_ctxmatch_base + ((CTX) << 3))
-#define STC_FLUSHFLAG_INIT(STC) \
- (*((STC)->strbuf_flushflag) = 0UL)
-#define STC_FLUSHFLAG_SET(STC) \
- (*((STC)->strbuf_flushflag) != 0UL)
-#define iommu_read(__reg) \
+/* Accessing IOMMU and Streaming Buffer registers.
+ * REG parameter is a physical address. All registers
+ * are 64-bits in size.
+ */
+#define pci_iommu_read(__reg) \
({ u64 __ret; \
__asm__ __volatile__("ldxa [%1] %2, %0" \
: "=r" (__ret) \
@@ -34,7 +30,7 @@
: "memory"); \
__ret; \
})
-#define iommu_write(__reg, __val) \
+#define pci_iommu_write(__reg, __val) \
__asm__ __volatile__("stxa %0, [%1] %2" \
: /* no outputs */ \
: "r" (__val), "r" (__reg), \
@@ -44,19 +40,19 @@
static void __iommu_flushall(struct iommu *iommu)
{
if (iommu->iommu_flushinv) {
- iommu_write(iommu->iommu_flushinv, ~(u64)0);
+ pci_iommu_write(iommu->iommu_flushinv, ~(u64)0);
} else {
unsigned long tag;
int entry;
- tag = iommu->iommu_tags;
+ tag = iommu->iommu_flush + (0xa580UL - 0x0210UL);
for (entry = 0; entry < 16; entry++) {
- iommu_write(tag, 0);
+ pci_iommu_write(tag, 0);
tag += 8;
}
/* Ensure completion of previous PIO writes. */
- (void) iommu_read(iommu->write_complete_reg);
+ (void) pci_iommu_read(iommu->write_complete_reg);
}
}
@@ -84,7 +80,7 @@ static inline void iopte_make_dummy(struct iommu *iommu, iopte_t *iopte)
}
/* Based largely upon the ppc64 iommu allocator. */
-static long arena_alloc(struct iommu *iommu, unsigned long npages)
+static long pci_arena_alloc(struct iommu *iommu, unsigned long npages)
{
struct iommu_arena *arena = &iommu->arena;
unsigned long n, i, start, end, limit;
@@ -125,7 +121,7 @@ static long arena_alloc(struct iommu *iommu, unsigned long npages)
return n;
}
-static void arena_free(struct iommu_arena *arena, unsigned long base, unsigned long npages)
+static void pci_arena_free(struct iommu_arena *arena, unsigned long base, unsigned long npages)
{
unsigned long i;
@@ -133,8 +129,7 @@ static void arena_free(struct iommu_arena *arena, unsigned long base, unsigned l
__clear_bit(i, arena->map);
}
-int iommu_table_init(struct iommu *iommu, int tsbsize,
- u32 dma_offset, u32 dma_addr_mask)
+void pci_iommu_table_init(struct iommu *iommu, int tsbsize, u32 dma_offset, u32 dma_addr_mask)
{
unsigned long i, tsbbase, order, sz, num_tsb_entries;
@@ -151,8 +146,8 @@ int iommu_table_init(struct iommu *iommu, int tsbsize,
sz = (sz + 7UL) & ~7UL;
iommu->arena.map = kzalloc(sz, GFP_KERNEL);
if (!iommu->arena.map) {
- printk(KERN_ERR "IOMMU: Error, kmalloc(arena.map) failed.\n");
- return -ENOMEM;
+ prom_printf("PCI_IOMMU: Error, kmalloc(arena.map) failed.\n");
+ prom_halt();
}
iommu->arena.limit = num_tsb_entries;
@@ -161,8 +156,8 @@ int iommu_table_init(struct iommu *iommu, int tsbsize,
*/
iommu->dummy_page = __get_free_pages(GFP_KERNEL, 0);
if (!iommu->dummy_page) {
- printk(KERN_ERR "IOMMU: Error, gfp(dummy_page) failed.\n");
- goto out_free_map;
+ prom_printf("PCI_IOMMU: Error, gfp(dummy_page) failed.\n");
+ prom_halt();
}
memset((void *)iommu->dummy_page, 0, PAGE_SIZE);
iommu->dummy_page_pa = (unsigned long) __pa(iommu->dummy_page);
@@ -171,32 +166,20 @@ int iommu_table_init(struct iommu *iommu, int tsbsize,
order = get_order(tsbsize);
tsbbase = __get_free_pages(GFP_KERNEL, order);
if (!tsbbase) {
- printk(KERN_ERR "IOMMU: Error, gfp(tsb) failed.\n");
- goto out_free_dummy_page;
+ prom_printf("PCI_IOMMU: Error, gfp(tsb) failed.\n");
+ prom_halt();
}
iommu->page_table = (iopte_t *)tsbbase;
for (i = 0; i < num_tsb_entries; i++)
iopte_make_dummy(iommu, &iommu->page_table[i]);
-
- return 0;
-
-out_free_dummy_page:
- free_page(iommu->dummy_page);
- iommu->dummy_page = 0UL;
-
-out_free_map:
- kfree(iommu->arena.map);
- iommu->arena.map = NULL;
-
- return -ENOMEM;
}
static inline iopte_t *alloc_npages(struct iommu *iommu, unsigned long npages)
{
long entry;
- entry = arena_alloc(iommu, npages);
+ entry = pci_arena_alloc(iommu, npages);
if (unlikely(entry < 0))
return NULL;
@@ -205,7 +188,7 @@ static inline iopte_t *alloc_npages(struct iommu *iommu, unsigned long npages)
static inline void free_npages(struct iommu *iommu, dma_addr_t base, unsigned long npages)
{
- arena_free(&iommu->arena, base >> IO_PAGE_SHIFT, npages);
+ pci_arena_free(&iommu->arena, base >> IO_PAGE_SHIFT, npages);
}
static int iommu_alloc_ctx(struct iommu *iommu)
@@ -236,8 +219,11 @@ static inline void iommu_free_ctx(struct iommu *iommu, int ctx)
}
}
-static void *dma_4u_alloc_coherent(struct device *dev, size_t size,
- dma_addr_t *dma_addrp, gfp_t gfp)
+/* Allocate and map kernel buffer of size SIZE using consistent mode
+ * DMA for PCI device PDEV. Return non-NULL cpu-side address if
+ * successful and set *DMA_ADDRP to the PCI side dma address.
+ */
+static void *pci_4u_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp, gfp_t gfp)
{
struct iommu *iommu;
iopte_t *iopte;
@@ -255,7 +241,7 @@ static void *dma_4u_alloc_coherent(struct device *dev, size_t size,
return NULL;
memset((char *)first_page, 0, PAGE_SIZE << order);
- iommu = dev->archdata.iommu;
+ iommu = pdev->dev.archdata.iommu;
spin_lock_irqsave(&iommu->lock, flags);
iopte = alloc_npages(iommu, size >> IO_PAGE_SHIFT);
@@ -282,15 +268,15 @@ static void *dma_4u_alloc_coherent(struct device *dev, size_t size,
return ret;
}
-static void dma_4u_free_coherent(struct device *dev, size_t size,
- void *cpu, dma_addr_t dvma)
+/* Free and unmap a consistent DMA translation. */
+static void pci_4u_free_consistent(struct pci_dev *pdev, size_t size, void *cpu, dma_addr_t dvma)
{
struct iommu *iommu;
iopte_t *iopte;
unsigned long flags, order, npages;
npages = IO_PAGE_ALIGN(size) >> IO_PAGE_SHIFT;
- iommu = dev->archdata.iommu;
+ iommu = pdev->dev.archdata.iommu;
iopte = iommu->page_table +
((dvma - iommu->page_table_map_base) >> IO_PAGE_SHIFT);
@@ -305,8 +291,10 @@ static void dma_4u_free_coherent(struct device *dev, size_t size,
free_pages((unsigned long)cpu, order);
}
-static dma_addr_t dma_4u_map_single(struct device *dev, void *ptr, size_t sz,
- enum dma_data_direction direction)
+/* Map a single buffer at PTR of SZ bytes for PCI DMA
+ * in streaming mode.
+ */
+static dma_addr_t pci_4u_map_single(struct pci_dev *pdev, void *ptr, size_t sz, int direction)
{
struct iommu *iommu;
struct strbuf *strbuf;
@@ -316,10 +304,10 @@ static dma_addr_t dma_4u_map_single(struct device *dev, void *ptr, size_t sz,
u32 bus_addr, ret;
unsigned long iopte_protection;
- iommu = dev->archdata.iommu;
- strbuf = dev->archdata.stc;
+ iommu = pdev->dev.archdata.iommu;
+ strbuf = pdev->dev.archdata.stc;
- if (unlikely(direction == DMA_NONE))
+ if (unlikely(direction == PCI_DMA_NONE))
goto bad_no_ctx;
oaddr = (unsigned long)ptr;
@@ -344,7 +332,7 @@ static dma_addr_t dma_4u_map_single(struct device *dev, void *ptr, size_t sz,
iopte_protection = IOPTE_STREAMING(ctx);
else
iopte_protection = IOPTE_CONSISTENT(ctx);
- if (direction != DMA_TO_DEVICE)
+ if (direction != PCI_DMA_TODEVICE)
iopte_protection |= IOPTE_WRITE;
for (i = 0; i < npages; i++, base++, base_paddr += IO_PAGE_SIZE)
@@ -357,12 +345,10 @@ static dma_addr_t dma_4u_map_single(struct device *dev, void *ptr, size_t sz,
bad_no_ctx:
if (printk_ratelimit())
WARN_ON(1);
- return DMA_ERROR_CODE;
+ return PCI_DMA_ERROR_CODE;
}
-static void strbuf_flush(struct strbuf *strbuf, struct iommu *iommu,
- u32 vaddr, unsigned long ctx, unsigned long npages,
- enum dma_data_direction direction)
+static void pci_strbuf_flush(struct strbuf *strbuf, struct iommu *iommu, u32 vaddr, unsigned long ctx, unsigned long npages, int direction)
{
int limit;
@@ -372,22 +358,22 @@ static void strbuf_flush(struct strbuf *strbuf, struct iommu *iommu,
u64 val;
flushreg = strbuf->strbuf_ctxflush;
- matchreg = STC_CTXMATCH_ADDR(strbuf, ctx);
+ matchreg = PCI_STC_CTXMATCH_ADDR(strbuf, ctx);
- iommu_write(flushreg, ctx);
- val = iommu_read(matchreg);
+ pci_iommu_write(flushreg, ctx);
+ val = pci_iommu_read(matchreg);
val &= 0xffff;
if (!val)
goto do_flush_sync;
while (val) {
if (val & 0x1)
- iommu_write(flushreg, ctx);
+ pci_iommu_write(flushreg, ctx);
val >>= 1;
}
- val = iommu_read(matchreg);
+ val = pci_iommu_read(matchreg);
if (unlikely(val)) {
- printk(KERN_WARNING "strbuf_flush: ctx flush "
+ printk(KERN_WARNING "pci_strbuf_flush: ctx flush "
"timeout matchreg[%lx] ctx[%lx]\n",
val, ctx);
goto do_page_flush;
@@ -397,7 +383,7 @@ static void strbuf_flush(struct strbuf *strbuf, struct iommu *iommu,
do_page_flush:
for (i = 0; i < npages; i++, vaddr += IO_PAGE_SIZE)
- iommu_write(strbuf->strbuf_pflush, vaddr);
+ pci_iommu_write(strbuf->strbuf_pflush, vaddr);
}
do_flush_sync:
@@ -405,15 +391,15 @@ static void strbuf_flush(struct strbuf *strbuf, struct iommu *iommu,
* the streaming cache, no flush-flag synchronization needs
* to be performed.
*/
- if (direction == DMA_TO_DEVICE)
+ if (direction == PCI_DMA_TODEVICE)
return;
- STC_FLUSHFLAG_INIT(strbuf);
- iommu_write(strbuf->strbuf_fsync, strbuf->strbuf_flushflag_pa);
- (void) iommu_read(iommu->write_complete_reg);
+ PCI_STC_FLUSHFLAG_INIT(strbuf);
+ pci_iommu_write(strbuf->strbuf_fsync, strbuf->strbuf_flushflag_pa);
+ (void) pci_iommu_read(iommu->write_complete_reg);
limit = 100000;
- while (!STC_FLUSHFLAG_SET(strbuf)) {
+ while (!PCI_STC_FLUSHFLAG_SET(strbuf)) {
limit--;
if (!limit)
break;
@@ -421,32 +407,37 @@ static void strbuf_flush(struct strbuf *strbuf, struct iommu *iommu,
rmb();
}
if (!limit)
- printk(KERN_WARNING "strbuf_flush: flushflag timeout "
+ printk(KERN_WARNING "pci_strbuf_flush: flushflag timeout "
"vaddr[%08x] ctx[%lx] npages[%ld]\n",
vaddr, ctx, npages);
}
-static void dma_4u_unmap_single(struct device *dev, dma_addr_t bus_addr,
- size_t sz, enum dma_data_direction direction)
+/* Unmap a single streaming mode DMA translation. */
+static void pci_4u_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction)
{
struct iommu *iommu;
struct strbuf *strbuf;
iopte_t *base;
unsigned long flags, npages, ctx, i;
- if (unlikely(direction == DMA_NONE)) {
+ if (unlikely(direction == PCI_DMA_NONE)) {
if (printk_ratelimit())
WARN_ON(1);
return;
}
- iommu = dev->archdata.iommu;
- strbuf = dev->archdata.stc;
+ iommu = pdev->dev.archdata.iommu;
+ strbuf = pdev->dev.archdata.stc;
npages = IO_PAGE_ALIGN(bus_addr + sz) - (bus_addr & IO_PAGE_MASK);
npages >>= IO_PAGE_SHIFT;
base = iommu->page_table +
((bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT);
+#ifdef DEBUG_PCI_IOMMU
+ if (IOPTE_IS_DUMMY(iommu, base))
+ printk("pci_unmap_single called on non-mapped region %08x,%08x from %016lx\n",
+ bus_addr, sz, __builtin_return_address(0));
+#endif
bus_addr &= IO_PAGE_MASK;
spin_lock_irqsave(&iommu->lock, flags);
@@ -458,8 +449,8 @@ static void dma_4u_unmap_single(struct device *dev, dma_addr_t bus_addr,
/* Step 1: Kick data out of streaming buffers if necessary. */
if (strbuf->strbuf_enabled)
- strbuf_flush(strbuf, iommu, bus_addr, ctx,
- npages, direction);
+ pci_strbuf_flush(strbuf, iommu, bus_addr, ctx,
+ npages, direction);
/* Step 2: Clear out TSB entries. */
for (i = 0; i < npages; i++)
@@ -476,8 +467,7 @@ static void dma_4u_unmap_single(struct device *dev, dma_addr_t bus_addr,
(__pa(page_address((SG)->page)) + (SG)->offset)
static inline void fill_sg(iopte_t *iopte, struct scatterlist *sg,
- int nused, int nelems,
- unsigned long iopte_protection)
+ int nused, int nelems, unsigned long iopte_protection)
{
struct scatterlist *dma_sg = sg;
struct scatterlist *sg_end = sg + nelems;
@@ -549,8 +539,12 @@ static inline void fill_sg(iopte_t *iopte, struct scatterlist *sg,
}
}
-static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
- int nelems, enum dma_data_direction direction)
+/* Map a set of buffers described by SGLIST with NELEMS array
+ * elements in streaming mode for PCI DMA.
+ * When making changes here, inspect the assembly output. I was having
+ * hard time to keep this routine out of using stack slots for holding variables.
+ */
+static int pci_4u_map_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
{
struct iommu *iommu;
struct strbuf *strbuf;
@@ -563,20 +557,19 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
/* Fast path single entry scatterlists. */
if (nelems == 1) {
sglist->dma_address =
- dma_4u_map_single(dev,
- (page_address(sglist->page) +
- sglist->offset),
+ pci_4u_map_single(pdev,
+ (page_address(sglist->page) + sglist->offset),
sglist->length, direction);
- if (unlikely(sglist->dma_address == DMA_ERROR_CODE))
+ if (unlikely(sglist->dma_address == PCI_DMA_ERROR_CODE))
return 0;
sglist->dma_length = sglist->length;
return 1;
}
- iommu = dev->archdata.iommu;
- strbuf = dev->archdata.stc;
-
- if (unlikely(direction == DMA_NONE))
+ iommu = pdev->dev.archdata.iommu;
+ strbuf = pdev->dev.archdata.stc;
+
+ if (unlikely(direction == PCI_DMA_NONE))
goto bad_no_ctx;
/* Step 1: Prepare scatter list. */
@@ -616,7 +609,7 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
iopte_protection = IOPTE_STREAMING(ctx);
else
iopte_protection = IOPTE_CONSISTENT(ctx);
- if (direction != DMA_TO_DEVICE)
+ if (direction != PCI_DMA_TODEVICE)
iopte_protection |= IOPTE_WRITE;
fill_sg(base, sglist, used, nelems, iopte_protection);
@@ -635,8 +628,8 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
return 0;
}
-static void dma_4u_unmap_sg(struct device *dev, struct scatterlist *sglist,
- int nelems, enum dma_data_direction direction)
+/* Unmap a set of streaming mode DMA translations. */
+static void pci_4u_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
{
struct iommu *iommu;
struct strbuf *strbuf;
@@ -644,14 +637,14 @@ static void dma_4u_unmap_sg(struct device *dev, struct scatterlist *sglist,
unsigned long flags, ctx, i, npages;
u32 bus_addr;
- if (unlikely(direction == DMA_NONE)) {
+ if (unlikely(direction == PCI_DMA_NONE)) {
if (printk_ratelimit())
WARN_ON(1);
}
- iommu = dev->archdata.iommu;
- strbuf = dev->archdata.stc;
-
+ iommu = pdev->dev.archdata.iommu;
+ strbuf = pdev->dev.archdata.stc;
+
bus_addr = sglist->dma_address & IO_PAGE_MASK;
for (i = 1; i < nelems; i++)
@@ -664,6 +657,11 @@ static void dma_4u_unmap_sg(struct device *dev, struct scatterlist *sglist,
base = iommu->page_table +
((bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT);
+#ifdef DEBUG_PCI_IOMMU
+ if (IOPTE_IS_DUMMY(iommu, base))
+ printk("pci_unmap_sg called on non-mapped region %016lx,%d from %016lx\n", sglist->dma_address, nelems, __builtin_return_address(0));
+#endif
+
spin_lock_irqsave(&iommu->lock, flags);
/* Record the context, if any. */
@@ -673,7 +671,7 @@ static void dma_4u_unmap_sg(struct device *dev, struct scatterlist *sglist,
/* Step 1: Kick data out of streaming buffers if necessary. */
if (strbuf->strbuf_enabled)
- strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
+ pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
/* Step 2: Clear out the TSB entries. */
for (i = 0; i < npages; i++)
@@ -686,16 +684,17 @@ static void dma_4u_unmap_sg(struct device *dev, struct scatterlist *sglist,
spin_unlock_irqrestore(&iommu->lock, flags);
}
-static void dma_4u_sync_single_for_cpu(struct device *dev,
- dma_addr_t bus_addr, size_t sz,
- enum dma_data_direction direction)
+/* Make physical memory consistent for a single
+ * streaming mode DMA translation after a transfer.
+ */
+static void pci_4u_dma_sync_single_for_cpu(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction)
{
struct iommu *iommu;
struct strbuf *strbuf;
unsigned long flags, ctx, npages;
- iommu = dev->archdata.iommu;
- strbuf = dev->archdata.stc;
+ iommu = pdev->dev.archdata.iommu;
+ strbuf = pdev->dev.archdata.stc;
if (!strbuf->strbuf_enabled)
return;
@@ -718,22 +717,23 @@ static void dma_4u_sync_single_for_cpu(struct device *dev,
}
/* Step 2: Kick data out of streaming buffers. */
- strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
+ pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
spin_unlock_irqrestore(&iommu->lock, flags);
}
-static void dma_4u_sync_sg_for_cpu(struct device *dev,
- struct scatterlist *sglist, int nelems,
- enum dma_data_direction direction)
+/* Make physical memory consistent for a set of streaming
+ * mode DMA translations after a transfer.
+ */
+static void pci_4u_dma_sync_sg_for_cpu(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
{
struct iommu *iommu;
struct strbuf *strbuf;
unsigned long flags, ctx, npages, i;
u32 bus_addr;
- iommu = dev->archdata.iommu;
- strbuf = dev->archdata.stc;
+ iommu = pdev->dev.archdata.iommu;
+ strbuf = pdev->dev.archdata.stc;
if (!strbuf->strbuf_enabled)
return;
@@ -759,51 +759,65 @@ static void dma_4u_sync_sg_for_cpu(struct device *dev,
i--;
npages = (IO_PAGE_ALIGN(sglist[i].dma_address + sglist[i].dma_length)
- bus_addr) >> IO_PAGE_SHIFT;
- strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
+ pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
spin_unlock_irqrestore(&iommu->lock, flags);
}
-const struct dma_ops sun4u_dma_ops = {
- .alloc_coherent = dma_4u_alloc_coherent,
- .free_coherent = dma_4u_free_coherent,
- .map_single = dma_4u_map_single,
- .unmap_single = dma_4u_unmap_single,
- .map_sg = dma_4u_map_sg,
- .unmap_sg = dma_4u_unmap_sg,
- .sync_single_for_cpu = dma_4u_sync_single_for_cpu,
- .sync_sg_for_cpu = dma_4u_sync_sg_for_cpu,
+const struct pci_iommu_ops pci_sun4u_iommu_ops = {
+ .alloc_consistent = pci_4u_alloc_consistent,
+ .free_consistent = pci_4u_free_consistent,
+ .map_single = pci_4u_map_single,
+ .unmap_single = pci_4u_unmap_single,
+ .map_sg = pci_4u_map_sg,
+ .unmap_sg = pci_4u_unmap_sg,
+ .dma_sync_single_for_cpu = pci_4u_dma_sync_single_for_cpu,
+ .dma_sync_sg_for_cpu = pci_4u_dma_sync_sg_for_cpu,
};
-const struct dma_ops *dma_ops = &sun4u_dma_ops;
-EXPORT_SYMBOL(dma_ops);
+static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit)
+{
+ struct pci_dev *ali_isa_bridge;
+ u8 val;
-int dma_supported(struct device *dev, u64 device_mask)
+ /* ALI sound chips generate 31-bits of DMA, a special register
+ * determines what bit 31 is emitted as.
+ */
+ ali_isa_bridge = pci_get_device(PCI_VENDOR_ID_AL,
+ PCI_DEVICE_ID_AL_M1533,
+ NULL);
+
+ pci_read_config_byte(ali_isa_bridge, 0x7e, &val);
+ if (set_bit)
+ val |= 0x01;
+ else
+ val &= ~0x01;
+ pci_write_config_byte(ali_isa_bridge, 0x7e, val);
+ pci_dev_put(ali_isa_bridge);
+}
+
+int pci_dma_supported(struct pci_dev *pdev, u64 device_mask)
{
- struct iommu *iommu = dev->archdata.iommu;
- u64 dma_addr_mask = iommu->dma_addr_mask;
+ u64 dma_addr_mask;
- if (device_mask >= (1UL << 32UL))
- return 0;
+ if (pdev == NULL) {
+ dma_addr_mask = 0xffffffff;
+ } else {
+ struct iommu *iommu = pdev->dev.archdata.iommu;
- if ((device_mask & dma_addr_mask) == dma_addr_mask)
- return 1;
+ dma_addr_mask = iommu->dma_addr_mask;
-#ifdef CONFIG_PCI
- if (dev->bus == &pci_bus_type)
- return pci_dma_supported(to_pci_dev(dev), device_mask);
-#endif
+ if (pdev->vendor == PCI_VENDOR_ID_AL &&
+ pdev->device == PCI_DEVICE_ID_AL_M5451 &&
+ device_mask == 0x7fffffff) {
+ ali_sound_dma_hack(pdev,
+ (dma_addr_mask & 0x80000000) != 0);
+ return 1;
+ }
+ }
- return 0;
-}
-EXPORT_SYMBOL(dma_supported);
+ if (device_mask >= (1UL << 32UL))
+ return 0;
-int dma_set_mask(struct device *dev, u64 dma_mask)
-{
-#ifdef CONFIG_PCI
- if (dev->bus == &pci_bus_type)
- return pci_set_dma_mask(to_pci_dev(dev), dma_mask);
-#endif
- return -EINVAL;
+ return (device_mask & dma_addr_mask) == dma_addr_mask;
}
-EXPORT_SYMBOL(dma_set_mask);
diff --git a/trunk/arch/sparc64/kernel/pci_psycho.c b/trunk/arch/sparc64/kernel/pci_psycho.c
index b6b4cfea5b5f..598393a2df16 100644
--- a/trunk/arch/sparc64/kernel/pci_psycho.c
+++ b/trunk/arch/sparc64/kernel/pci_psycho.c
@@ -813,19 +813,16 @@ static void psycho_scan_bus(struct pci_pbm_info *pbm)
psycho_register_error_handlers(pbm);
}
-static int psycho_iommu_init(struct pci_pbm_info *pbm)
+static void psycho_iommu_init(struct pci_pbm_info *pbm)
{
struct iommu *iommu = pbm->iommu;
unsigned long i;
u64 control;
- int err;
/* Register addresses. */
iommu->iommu_control = pbm->controller_regs + PSYCHO_IOMMU_CONTROL;
iommu->iommu_tsbbase = pbm->controller_regs + PSYCHO_IOMMU_TSBBASE;
iommu->iommu_flush = pbm->controller_regs + PSYCHO_IOMMU_FLUSH;
- iommu->iommu_tags = iommu->iommu_flush + (0xa580UL - 0x0210UL);
-
/* PSYCHO's IOMMU lacks ctx flushing. */
iommu->iommu_ctxflush = 0;
@@ -848,9 +845,7 @@ static int psycho_iommu_init(struct pci_pbm_info *pbm)
/* Leave diag mode enabled for full-flushing done
* in pci_iommu.c
*/
- err = iommu_table_init(iommu, IO_TSB_SIZE, 0xc0000000, 0xffffffff);
- if (err)
- return err;
+ pci_iommu_table_init(iommu, IO_TSB_SIZE, 0xc0000000, 0xffffffff);
psycho_write(pbm->controller_regs + PSYCHO_IOMMU_TSBBASE,
__pa(iommu->page_table));
@@ -863,8 +858,6 @@ static int psycho_iommu_init(struct pci_pbm_info *pbm)
/* If necessary, hook us up for starfire IRQ translations. */
if (this_is_starfire)
starfire_hookup(pbm->portid);
-
- return 0;
}
#define PSYCHO_IRQ_RETRY 0x1a00UL
@@ -1038,12 +1031,15 @@ void psycho_init(struct device_node *dp, char *model_name)
}
p = kzalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
- if (!p)
- goto fatal_memory_error;
+ if (!p) {
+ prom_printf("PSYCHO: Fatal memory allocation error.\n");
+ prom_halt();
+ }
iommu = kzalloc(sizeof(struct iommu), GFP_ATOMIC);
- if (!iommu)
- goto fatal_memory_error;
-
+ if (!iommu) {
+ prom_printf("PSYCHO: Fatal memory allocation error.\n");
+ prom_halt();
+ }
p->pbm_A.iommu = p->pbm_B.iommu = iommu;
p->pbm_A.portid = upa_portid;
@@ -1066,14 +1062,8 @@ void psycho_init(struct device_node *dp, char *model_name)
psycho_controller_hwinit(&p->pbm_A);
- if (psycho_iommu_init(&p->pbm_A))
- goto fatal_memory_error;
+ psycho_iommu_init(&p->pbm_A);
is_pbm_a = ((pr_regs[0].phys_addr & 0x6000) == 0x2000);
psycho_pbm_init(p, dp, is_pbm_a);
- return;
-
-fatal_memory_error:
- prom_printf("PSYCHO: Fatal memory allocation error.\n");
- prom_halt();
}
diff --git a/trunk/arch/sparc64/kernel/pci_sabre.c b/trunk/arch/sparc64/kernel/pci_sabre.c
index fba67c3d8809..22e1be5c7489 100644
--- a/trunk/arch/sparc64/kernel/pci_sabre.c
+++ b/trunk/arch/sparc64/kernel/pci_sabre.c
@@ -672,20 +672,18 @@ static void sabre_scan_bus(struct pci_pbm_info *pbm)
sabre_register_error_handlers(pbm);
}
-static int sabre_iommu_init(struct pci_pbm_info *pbm,
- int tsbsize, unsigned long dvma_offset,
- u32 dma_mask)
+static void sabre_iommu_init(struct pci_pbm_info *pbm,
+ int tsbsize, unsigned long dvma_offset,
+ u32 dma_mask)
{
struct iommu *iommu = pbm->iommu;
unsigned long i;
u64 control;
- int err;
/* Register addresses. */
iommu->iommu_control = pbm->controller_regs + SABRE_IOMMU_CONTROL;
iommu->iommu_tsbbase = pbm->controller_regs + SABRE_IOMMU_TSBBASE;
iommu->iommu_flush = pbm->controller_regs + SABRE_IOMMU_FLUSH;
- iommu->iommu_tags = iommu->iommu_flush + (0xa580UL - 0x0210UL);
iommu->write_complete_reg = pbm->controller_regs + SABRE_WRSYNC;
/* Sabre's IOMMU lacks ctx flushing. */
iommu->iommu_ctxflush = 0;
@@ -703,10 +701,7 @@ static int sabre_iommu_init(struct pci_pbm_info *pbm,
/* Leave diag mode enabled for full-flushing done
* in pci_iommu.c
*/
- err = iommu_table_init(iommu, tsbsize * 1024 * 8,
- dvma_offset, dma_mask);
- if (err)
- return err;
+ pci_iommu_table_init(iommu, tsbsize * 1024 * 8, dvma_offset, dma_mask);
sabre_write(pbm->controller_regs + SABRE_IOMMU_TSBBASE,
__pa(iommu->page_table));
@@ -727,8 +722,6 @@ static int sabre_iommu_init(struct pci_pbm_info *pbm,
break;
}
sabre_write(pbm->controller_regs + SABRE_IOMMU_CONTROL, control);
-
- return 0;
}
static void sabre_pbm_init(struct pci_controller_info *p, struct pci_pbm_info *pbm, struct device_node *dp)
@@ -782,12 +775,16 @@ void sabre_init(struct device_node *dp, char *model_name)
}
p = kzalloc(sizeof(*p), GFP_ATOMIC);
- if (!p)
- goto fatal_memory_error;
+ if (!p) {
+ prom_printf("SABRE: Error, kmalloc(pci_controller_info) failed.\n");
+ prom_halt();
+ }
iommu = kzalloc(sizeof(*iommu), GFP_ATOMIC);
- if (!iommu)
- goto fatal_memory_error;
+ if (!iommu) {
+ prom_printf("SABRE: Error, kmalloc(pci_iommu) failed.\n");
+ prom_halt();
+ }
pbm = &p->pbm_A;
pbm->iommu = iommu;
@@ -850,16 +847,10 @@ void sabre_init(struct device_node *dp, char *model_name)
prom_halt();
}
- if (sabre_iommu_init(pbm, tsbsize, vdma[0], dma_mask))
- goto fatal_memory_error;
+ sabre_iommu_init(pbm, tsbsize, vdma[0], dma_mask);
/*
* Look for APB underneath.
*/
sabre_pbm_init(p, pbm, dp);
- return;
-
-fatal_memory_error:
- prom_printf("SABRE: Fatal memory allocation error.\n");
- prom_halt();
}
diff --git a/trunk/arch/sparc64/kernel/pci_schizo.c b/trunk/arch/sparc64/kernel/pci_schizo.c
index 3c30bfa1f3a3..ae76898bbe2b 100644
--- a/trunk/arch/sparc64/kernel/pci_schizo.c
+++ b/trunk/arch/sparc64/kernel/pci_schizo.c
@@ -1148,14 +1148,14 @@ static void schizo_pbm_strbuf_init(struct pci_pbm_info *pbm)
#define SCHIZO_IOMMU_FLUSH (0x00210UL)
#define SCHIZO_IOMMU_CTXFLUSH (0x00218UL)
-static int schizo_pbm_iommu_init(struct pci_pbm_info *pbm)
+static void schizo_pbm_iommu_init(struct pci_pbm_info *pbm)
{
struct iommu *iommu = pbm->iommu;
unsigned long i, tagbase, database;
struct property *prop;
u32 vdma[2], dma_mask;
- int tsbsize, err;
u64 control;
+ int tsbsize;
prop = of_find_property(pbm->prom_node, "virtual-dma", NULL);
if (prop) {
@@ -1195,7 +1195,6 @@ static int schizo_pbm_iommu_init(struct pci_pbm_info *pbm)
iommu->iommu_control = pbm->pbm_regs + SCHIZO_IOMMU_CONTROL;
iommu->iommu_tsbbase = pbm->pbm_regs + SCHIZO_IOMMU_TSBBASE;
iommu->iommu_flush = pbm->pbm_regs + SCHIZO_IOMMU_FLUSH;
- iommu->iommu_tags = iommu->iommu_flush + (0xa580UL - 0x0210UL);
iommu->iommu_ctxflush = pbm->pbm_regs + SCHIZO_IOMMU_CTXFLUSH;
/* We use the main control/status register of SCHIZO as the write
@@ -1220,9 +1219,7 @@ static int schizo_pbm_iommu_init(struct pci_pbm_info *pbm)
/* Leave diag mode enabled for full-flushing done
* in pci_iommu.c
*/
- err = iommu_table_init(iommu, tsbsize * 8 * 1024, vdma[0], dma_mask);
- if (err)
- return err;
+ pci_iommu_table_init(iommu, tsbsize * 8 * 1024, vdma[0], dma_mask);
schizo_write(iommu->iommu_tsbbase, __pa(iommu->page_table));
@@ -1239,8 +1236,6 @@ static int schizo_pbm_iommu_init(struct pci_pbm_info *pbm)
control |= SCHIZO_IOMMU_CTRL_ENAB;
schizo_write(iommu->iommu_control, control);
-
- return 0;
}
#define SCHIZO_PCI_IRQ_RETRY (0x1a00UL)
@@ -1333,14 +1328,14 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm)
}
}
-static int schizo_pbm_init(struct pci_controller_info *p,
- struct device_node *dp, u32 portid,
- int chip_type)
+static void schizo_pbm_init(struct pci_controller_info *p,
+ struct device_node *dp, u32 portid,
+ int chip_type)
{
const struct linux_prom64_registers *regs;
struct pci_pbm_info *pbm;
const char *chipset_name;
- int is_pbm_a, err;
+ int is_pbm_a;
switch (chip_type) {
case PBM_CHIP_TYPE_TOMATILLO:
@@ -1411,13 +1406,8 @@ static int schizo_pbm_init(struct pci_controller_info *p,
pci_get_pbm_props(pbm);
- err = schizo_pbm_iommu_init(pbm);
- if (err)
- return err;
-
+ schizo_pbm_iommu_init(pbm);
schizo_pbm_strbuf_init(pbm);
-
- return 0;
}
static inline int portid_compare(u32 x, u32 y, int chip_type)
@@ -1441,38 +1431,34 @@ static void __schizo_init(struct device_node *dp, char *model_name, int chip_typ
for (pbm = pci_pbm_root; pbm; pbm = pbm->next) {
if (portid_compare(pbm->portid, portid, chip_type)) {
- if (schizo_pbm_init(pbm->parent, dp,
- portid, chip_type))
- goto fatal_memory_error;
+ schizo_pbm_init(pbm->parent, dp, portid, chip_type);
return;
}
}
p = kzalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
if (!p)
- goto fatal_memory_error;
+ goto memfail;
iommu = kzalloc(sizeof(struct iommu), GFP_ATOMIC);
if (!iommu)
- goto fatal_memory_error;
+ goto memfail;
p->pbm_A.iommu = iommu;
iommu = kzalloc(sizeof(struct iommu), GFP_ATOMIC);
if (!iommu)
- goto fatal_memory_error;
+ goto memfail;
p->pbm_B.iommu = iommu;
/* Like PSYCHO we have a 2GB aligned area for memory space. */
pci_memspace_mask = 0x7fffffffUL;
- if (schizo_pbm_init(p, dp, portid, chip_type))
- goto fatal_memory_error;
-
+ schizo_pbm_init(p, dp, portid, chip_type);
return;
-fatal_memory_error:
+memfail:
prom_printf("SCHIZO: Fatal memory allocation error.\n");
prom_halt();
}
diff --git a/trunk/arch/sparc64/kernel/pci_sun4v.c b/trunk/arch/sparc64/kernel/pci_sun4v.c
index 466f4aa8fc82..639cf06ca372 100644
--- a/trunk/arch/sparc64/kernel/pci_sun4v.c
+++ b/trunk/arch/sparc64/kernel/pci_sun4v.c
@@ -33,30 +33,30 @@ static unsigned long vpci_minor = 1;
#define PGLIST_NENTS (PAGE_SIZE / sizeof(u64))
struct iommu_batch {
- struct device *dev; /* Device mapping is for. */
+ struct pci_dev *pdev; /* Device mapping is for. */
unsigned long prot; /* IOMMU page protections */
unsigned long entry; /* Index into IOTSB. */
u64 *pglist; /* List of physical pages */
unsigned long npages; /* Number of pages in list. */
};
-static DEFINE_PER_CPU(struct iommu_batch, iommu_batch);
+static DEFINE_PER_CPU(struct iommu_batch, pci_iommu_batch);
/* Interrupts must be disabled. */
-static inline void iommu_batch_start(struct device *dev, unsigned long prot, unsigned long entry)
+static inline void pci_iommu_batch_start(struct pci_dev *pdev, unsigned long prot, unsigned long entry)
{
- struct iommu_batch *p = &__get_cpu_var(iommu_batch);
+ struct iommu_batch *p = &__get_cpu_var(pci_iommu_batch);
- p->dev = dev;
+ p->pdev = pdev;
p->prot = prot;
p->entry = entry;
p->npages = 0;
}
/* Interrupts must be disabled. */
-static long iommu_batch_flush(struct iommu_batch *p)
+static long pci_iommu_batch_flush(struct iommu_batch *p)
{
- struct pci_pbm_info *pbm = p->dev->archdata.host_controller;
+ struct pci_pbm_info *pbm = p->pdev->dev.archdata.host_controller;
unsigned long devhandle = pbm->devhandle;
unsigned long prot = p->prot;
unsigned long entry = p->entry;
@@ -70,7 +70,7 @@ static long iommu_batch_flush(struct iommu_batch *p)
npages, prot, __pa(pglist));
if (unlikely(num < 0)) {
if (printk_ratelimit())
- printk("iommu_batch_flush: IOMMU map of "
+ printk("pci_iommu_batch_flush: IOMMU map of "
"[%08lx:%08lx:%lx:%lx:%lx] failed with "
"status %ld\n",
devhandle, HV_PCI_TSBID(0, entry),
@@ -90,30 +90,30 @@ static long iommu_batch_flush(struct iommu_batch *p)
}
/* Interrupts must be disabled. */
-static inline long iommu_batch_add(u64 phys_page)
+static inline long pci_iommu_batch_add(u64 phys_page)
{
- struct iommu_batch *p = &__get_cpu_var(iommu_batch);
+ struct iommu_batch *p = &__get_cpu_var(pci_iommu_batch);
BUG_ON(p->npages >= PGLIST_NENTS);
p->pglist[p->npages++] = phys_page;
if (p->npages == PGLIST_NENTS)
- return iommu_batch_flush(p);
+ return pci_iommu_batch_flush(p);
return 0;
}
/* Interrupts must be disabled. */
-static inline long iommu_batch_end(void)
+static inline long pci_iommu_batch_end(void)
{
- struct iommu_batch *p = &__get_cpu_var(iommu_batch);
+ struct iommu_batch *p = &__get_cpu_var(pci_iommu_batch);
BUG_ON(p->npages >= PGLIST_NENTS);
- return iommu_batch_flush(p);
+ return pci_iommu_batch_flush(p);
}
-static long arena_alloc(struct iommu_arena *arena, unsigned long npages)
+static long pci_arena_alloc(struct iommu_arena *arena, unsigned long npages)
{
unsigned long n, i, start, end, limit;
int pass;
@@ -152,8 +152,7 @@ static long arena_alloc(struct iommu_arena *arena, unsigned long npages)
return n;
}
-static void arena_free(struct iommu_arena *arena, unsigned long base,
- unsigned long npages)
+static void pci_arena_free(struct iommu_arena *arena, unsigned long base, unsigned long npages)
{
unsigned long i;
@@ -161,8 +160,7 @@ static void arena_free(struct iommu_arena *arena, unsigned long base,
__clear_bit(i, arena->map);
}
-static void *dma_4v_alloc_coherent(struct device *dev, size_t size,
- dma_addr_t *dma_addrp, gfp_t gfp)
+static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp, gfp_t gfp)
{
struct iommu *iommu;
unsigned long flags, order, first_page, npages, n;
@@ -182,10 +180,10 @@ static void *dma_4v_alloc_coherent(struct device *dev, size_t size,
memset((char *)first_page, 0, PAGE_SIZE << order);
- iommu = dev->archdata.iommu;
+ iommu = pdev->dev.archdata.iommu;
spin_lock_irqsave(&iommu->lock, flags);
- entry = arena_alloc(&iommu->arena, npages);
+ entry = pci_arena_alloc(&iommu->arena, npages);
spin_unlock_irqrestore(&iommu->lock, flags);
if (unlikely(entry < 0L))
@@ -198,18 +196,18 @@ static void *dma_4v_alloc_coherent(struct device *dev, size_t size,
local_irq_save(flags);
- iommu_batch_start(dev,
- (HV_PCI_MAP_ATTR_READ |
- HV_PCI_MAP_ATTR_WRITE),
- entry);
+ pci_iommu_batch_start(pdev,
+ (HV_PCI_MAP_ATTR_READ |
+ HV_PCI_MAP_ATTR_WRITE),
+ entry);
for (n = 0; n < npages; n++) {
- long err = iommu_batch_add(first_page + (n * PAGE_SIZE));
+ long err = pci_iommu_batch_add(first_page + (n * PAGE_SIZE));
if (unlikely(err < 0L))
goto iommu_map_fail;
}
- if (unlikely(iommu_batch_end() < 0L))
+ if (unlikely(pci_iommu_batch_end() < 0L))
goto iommu_map_fail;
local_irq_restore(flags);
@@ -219,7 +217,7 @@ static void *dma_4v_alloc_coherent(struct device *dev, size_t size,
iommu_map_fail:
/* Interrupts are disabled. */
spin_lock(&iommu->lock);
- arena_free(&iommu->arena, entry, npages);
+ pci_arena_free(&iommu->arena, entry, npages);
spin_unlock_irqrestore(&iommu->lock, flags);
arena_alloc_fail:
@@ -227,8 +225,7 @@ static void *dma_4v_alloc_coherent(struct device *dev, size_t size,
return NULL;
}
-static void dma_4v_free_coherent(struct device *dev, size_t size, void *cpu,
- dma_addr_t dvma)
+static void pci_4v_free_consistent(struct pci_dev *pdev, size_t size, void *cpu, dma_addr_t dvma)
{
struct pci_pbm_info *pbm;
struct iommu *iommu;
@@ -236,14 +233,14 @@ static void dma_4v_free_coherent(struct device *dev, size_t size, void *cpu,
u32 devhandle;
npages = IO_PAGE_ALIGN(size) >> IO_PAGE_SHIFT;
- iommu = dev->archdata.iommu;
- pbm = dev->archdata.host_controller;
+ iommu = pdev->dev.archdata.iommu;
+ pbm = pdev->dev.archdata.host_controller;
devhandle = pbm->devhandle;
entry = ((dvma - iommu->page_table_map_base) >> IO_PAGE_SHIFT);
spin_lock_irqsave(&iommu->lock, flags);
- arena_free(&iommu->arena, entry, npages);
+ pci_arena_free(&iommu->arena, entry, npages);
do {
unsigned long num;
@@ -261,8 +258,7 @@ static void dma_4v_free_coherent(struct device *dev, size_t size, void *cpu,
free_pages((unsigned long)cpu, order);
}
-static dma_addr_t dma_4v_map_single(struct device *dev, void *ptr, size_t sz,
- enum dma_data_direction direction)
+static dma_addr_t pci_4v_map_single(struct pci_dev *pdev, void *ptr, size_t sz, int direction)
{
struct iommu *iommu;
unsigned long flags, npages, oaddr;
@@ -271,9 +267,9 @@ static dma_addr_t dma_4v_map_single(struct device *dev, void *ptr, size_t sz,
unsigned long prot;
long entry;
- iommu = dev->archdata.iommu;
+ iommu = pdev->dev.archdata.iommu;
- if (unlikely(direction == DMA_NONE))
+ if (unlikely(direction == PCI_DMA_NONE))
goto bad;
oaddr = (unsigned long)ptr;
@@ -281,7 +277,7 @@ static dma_addr_t dma_4v_map_single(struct device *dev, void *ptr, size_t sz,
npages >>= IO_PAGE_SHIFT;
spin_lock_irqsave(&iommu->lock, flags);
- entry = arena_alloc(&iommu->arena, npages);
+ entry = pci_arena_alloc(&iommu->arena, npages);
spin_unlock_irqrestore(&iommu->lock, flags);
if (unlikely(entry < 0L))
@@ -292,19 +288,19 @@ static dma_addr_t dma_4v_map_single(struct device *dev, void *ptr, size_t sz,
ret = bus_addr | (oaddr & ~IO_PAGE_MASK);
base_paddr = __pa(oaddr & IO_PAGE_MASK);
prot = HV_PCI_MAP_ATTR_READ;
- if (direction != DMA_TO_DEVICE)
+ if (direction != PCI_DMA_TODEVICE)
prot |= HV_PCI_MAP_ATTR_WRITE;
local_irq_save(flags);
- iommu_batch_start(dev, prot, entry);
+ pci_iommu_batch_start(pdev, prot, entry);
for (i = 0; i < npages; i++, base_paddr += IO_PAGE_SIZE) {
- long err = iommu_batch_add(base_paddr);
+ long err = pci_iommu_batch_add(base_paddr);
if (unlikely(err < 0L))
goto iommu_map_fail;
}
- if (unlikely(iommu_batch_end() < 0L))
+ if (unlikely(pci_iommu_batch_end() < 0L))
goto iommu_map_fail;
local_irq_restore(flags);
@@ -314,19 +310,18 @@ static dma_addr_t dma_4v_map_single(struct device *dev, void *ptr, size_t sz,
bad:
if (printk_ratelimit())
WARN_ON(1);
- return DMA_ERROR_CODE;
+ return PCI_DMA_ERROR_CODE;
iommu_map_fail:
/* Interrupts are disabled. */
spin_lock(&iommu->lock);
- arena_free(&iommu->arena, entry, npages);
+ pci_arena_free(&iommu->arena, entry, npages);
spin_unlock_irqrestore(&iommu->lock, flags);
- return DMA_ERROR_CODE;
+ return PCI_DMA_ERROR_CODE;
}
-static void dma_4v_unmap_single(struct device *dev, dma_addr_t bus_addr,
- size_t sz, enum dma_data_direction direction)
+static void pci_4v_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction)
{
struct pci_pbm_info *pbm;
struct iommu *iommu;
@@ -334,14 +329,14 @@ static void dma_4v_unmap_single(struct device *dev, dma_addr_t bus_addr,
long entry;
u32 devhandle;
- if (unlikely(direction == DMA_NONE)) {
+ if (unlikely(direction == PCI_DMA_NONE)) {
if (printk_ratelimit())
WARN_ON(1);
return;
}
- iommu = dev->archdata.iommu;
- pbm = dev->archdata.host_controller;
+ iommu = pdev->dev.archdata.iommu;
+ pbm = pdev->dev.archdata.host_controller;
devhandle = pbm->devhandle;
npages = IO_PAGE_ALIGN(bus_addr + sz) - (bus_addr & IO_PAGE_MASK);
@@ -351,7 +346,7 @@ static void dma_4v_unmap_single(struct device *dev, dma_addr_t bus_addr,
spin_lock_irqsave(&iommu->lock, flags);
entry = (bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT;
- arena_free(&iommu->arena, entry, npages);
+ pci_arena_free(&iommu->arena, entry, npages);
do {
unsigned long num;
@@ -368,7 +363,7 @@ static void dma_4v_unmap_single(struct device *dev, dma_addr_t bus_addr,
#define SG_ENT_PHYS_ADDRESS(SG) \
(__pa(page_address((SG)->page)) + (SG)->offset)
-static inline long fill_sg(long entry, struct device *dev,
+static inline long fill_sg(long entry, struct pci_dev *pdev,
struct scatterlist *sg,
int nused, int nelems, unsigned long prot)
{
@@ -379,7 +374,7 @@ static inline long fill_sg(long entry, struct device *dev,
local_irq_save(flags);
- iommu_batch_start(dev, prot, entry);
+ pci_iommu_batch_start(pdev, prot, entry);
for (i = 0; i < nused; i++) {
unsigned long pteval = ~0UL;
@@ -420,7 +415,7 @@ static inline long fill_sg(long entry, struct device *dev,
while (len > 0) {
long err;
- err = iommu_batch_add(pteval);
+ err = pci_iommu_batch_add(pteval);
if (unlikely(err < 0L))
goto iommu_map_failed;
@@ -451,7 +446,7 @@ static inline long fill_sg(long entry, struct device *dev,
dma_sg++;
}
- if (unlikely(iommu_batch_end() < 0L))
+ if (unlikely(pci_iommu_batch_end() < 0L))
goto iommu_map_failed;
local_irq_restore(flags);
@@ -462,8 +457,7 @@ static inline long fill_sg(long entry, struct device *dev,
return -1L;
}
-static int dma_4v_map_sg(struct device *dev, struct scatterlist *sglist,
- int nelems, enum dma_data_direction direction)
+static int pci_4v_map_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
{
struct iommu *iommu;
unsigned long flags, npages, prot;
@@ -475,19 +469,18 @@ static int dma_4v_map_sg(struct device *dev, struct scatterlist *sglist,
/* Fast path single entry scatterlists. */
if (nelems == 1) {
sglist->dma_address =
- dma_4v_map_single(dev,
- (page_address(sglist->page) +
- sglist->offset),
+ pci_4v_map_single(pdev,
+ (page_address(sglist->page) + sglist->offset),
sglist->length, direction);
- if (unlikely(sglist->dma_address == DMA_ERROR_CODE))
+ if (unlikely(sglist->dma_address == PCI_DMA_ERROR_CODE))
return 0;
sglist->dma_length = sglist->length;
return 1;
}
- iommu = dev->archdata.iommu;
+ iommu = pdev->dev.archdata.iommu;
- if (unlikely(direction == DMA_NONE))
+ if (unlikely(direction == PCI_DMA_NONE))
goto bad;
/* Step 1: Prepare scatter list. */
@@ -495,7 +488,7 @@ static int dma_4v_map_sg(struct device *dev, struct scatterlist *sglist,
/* Step 2: Allocate a cluster and context, if necessary. */
spin_lock_irqsave(&iommu->lock, flags);
- entry = arena_alloc(&iommu->arena, npages);
+ entry = pci_arena_alloc(&iommu->arena, npages);
spin_unlock_irqrestore(&iommu->lock, flags);
if (unlikely(entry < 0L))
@@ -517,10 +510,10 @@ static int dma_4v_map_sg(struct device *dev, struct scatterlist *sglist,
/* Step 4: Create the mappings. */
prot = HV_PCI_MAP_ATTR_READ;
- if (direction != DMA_TO_DEVICE)
+ if (direction != PCI_DMA_TODEVICE)
prot |= HV_PCI_MAP_ATTR_WRITE;
- err = fill_sg(entry, dev, sglist, used, nelems, prot);
+ err = fill_sg(entry, pdev, sglist, used, nelems, prot);
if (unlikely(err < 0L))
goto iommu_map_failed;
@@ -533,14 +526,13 @@ static int dma_4v_map_sg(struct device *dev, struct scatterlist *sglist,
iommu_map_failed:
spin_lock_irqsave(&iommu->lock, flags);
- arena_free(&iommu->arena, entry, npages);
+ pci_arena_free(&iommu->arena, entry, npages);
spin_unlock_irqrestore(&iommu->lock, flags);
return 0;
}
-static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist,
- int nelems, enum dma_data_direction direction)
+static void pci_4v_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
{
struct pci_pbm_info *pbm;
struct iommu *iommu;
@@ -548,13 +540,13 @@ static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist,
long entry;
u32 devhandle, bus_addr;
- if (unlikely(direction == DMA_NONE)) {
+ if (unlikely(direction == PCI_DMA_NONE)) {
if (printk_ratelimit())
WARN_ON(1);
}
- iommu = dev->archdata.iommu;
- pbm = dev->archdata.host_controller;
+ iommu = pdev->dev.archdata.iommu;
+ pbm = pdev->dev.archdata.host_controller;
devhandle = pbm->devhandle;
bus_addr = sglist->dma_address & IO_PAGE_MASK;
@@ -570,7 +562,7 @@ static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist,
spin_lock_irqsave(&iommu->lock, flags);
- arena_free(&iommu->arena, entry, npages);
+ pci_arena_free(&iommu->arena, entry, npages);
do {
unsigned long num;
@@ -584,29 +576,25 @@ static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist,
spin_unlock_irqrestore(&iommu->lock, flags);
}
-static void dma_4v_sync_single_for_cpu(struct device *dev,
- dma_addr_t bus_addr, size_t sz,
- enum dma_data_direction direction)
+static void pci_4v_dma_sync_single_for_cpu(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction)
{
/* Nothing to do... */
}
-static void dma_4v_sync_sg_for_cpu(struct device *dev,
- struct scatterlist *sglist, int nelems,
- enum dma_data_direction direction)
+static void pci_4v_dma_sync_sg_for_cpu(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
{
/* Nothing to do... */
}
-const struct dma_ops sun4v_dma_ops = {
- .alloc_coherent = dma_4v_alloc_coherent,
- .free_coherent = dma_4v_free_coherent,
- .map_single = dma_4v_map_single,
- .unmap_single = dma_4v_unmap_single,
- .map_sg = dma_4v_map_sg,
- .unmap_sg = dma_4v_unmap_sg,
- .sync_single_for_cpu = dma_4v_sync_single_for_cpu,
- .sync_sg_for_cpu = dma_4v_sync_sg_for_cpu,
+const struct pci_iommu_ops pci_sun4v_iommu_ops = {
+ .alloc_consistent = pci_4v_alloc_consistent,
+ .free_consistent = pci_4v_free_consistent,
+ .map_single = pci_4v_map_single,
+ .unmap_single = pci_4v_unmap_single,
+ .map_sg = pci_4v_map_sg,
+ .unmap_sg = pci_4v_unmap_sg,
+ .dma_sync_single_for_cpu = pci_4v_dma_sync_single_for_cpu,
+ .dma_sync_sg_for_cpu = pci_4v_dma_sync_sg_for_cpu,
};
static void pci_sun4v_scan_bus(struct pci_pbm_info *pbm)
@@ -1198,8 +1186,6 @@ void __init sun4v_pci_init(struct device_node *dp, char *model_name)
}
printk("SUN4V_PCI: Registered hvapi major[%lu] minor[%lu]\n",
vpci_major, vpci_minor);
-
- dma_ops = &sun4v_dma_ops;
}
prop = of_find_property(dp, "reg", NULL);
@@ -1220,7 +1206,7 @@ void __init sun4v_pci_init(struct device_node *dp, char *model_name)
if (!page)
goto fatal_memory_error;
- per_cpu(iommu_batch, i).pglist = (u64 *) page;
+ per_cpu(pci_iommu_batch, i).pglist = (u64 *) page;
}
p = kzalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
diff --git a/trunk/arch/sparc64/kernel/process.c b/trunk/arch/sparc64/kernel/process.c
index ca7cdfd55f72..fd7899ba1d70 100644
--- a/trunk/arch/sparc64/kernel/process.c
+++ b/trunk/arch/sparc64/kernel/process.c
@@ -18,7 +18,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/sparc64/kernel/sbus.c b/trunk/arch/sparc64/kernel/sbus.c
index d1fb13ba02b5..a1fd9bcc0b87 100644
--- a/trunk/arch/sparc64/kernel/sbus.c
+++ b/trunk/arch/sparc64/kernel/sbus.c
@@ -26,6 +26,11 @@
#define MAP_BASE ((u32)0xc0000000)
+struct sbus_info {
+ struct iommu iommu;
+ struct strbuf strbuf;
+};
+
/* Offsets from iommu_regs */
#define SYSIO_IOMMUREG_BASE 0x2400UL
#define IOMMU_CONTROL (0x2400UL - 0x2400UL) /* IOMMU control register */
@@ -39,6 +44,19 @@
#define IOMMU_DRAM_VALID (1UL << 30UL)
+static void __iommu_flushall(struct iommu *iommu)
+{
+ unsigned long tag;
+ int entry;
+
+ tag = iommu->iommu_control + (IOMMU_TAGDIAG - IOMMU_CONTROL);
+ for (entry = 0; entry < 16; entry++) {
+ upa_writeq(0, tag);
+ tag += 8UL;
+ }
+ upa_readq(iommu->write_complete_reg);
+}
+
/* Offsets from strbuf_regs */
#define SYSIO_STRBUFREG_BASE 0x2800UL
#define STRBUF_CONTROL (0x2800UL - 0x2800UL) /* Control */
@@ -51,10 +69,511 @@
#define STRBUF_TAG_VALID 0x02UL
+static void sbus_strbuf_flush(struct iommu *iommu, struct strbuf *strbuf, u32 base, unsigned long npages, int direction)
+{
+ unsigned long n;
+ int limit;
+
+ n = npages;
+ while (n--)
+ upa_writeq(base + (n << IO_PAGE_SHIFT), strbuf->strbuf_pflush);
+
+ /* If the device could not have possibly put dirty data into
+ * the streaming cache, no flush-flag synchronization needs
+ * to be performed.
+ */
+ if (direction == SBUS_DMA_TODEVICE)
+ return;
+
+ *(strbuf->strbuf_flushflag) = 0UL;
+
+ /* Whoopee cushion! */
+ upa_writeq(strbuf->strbuf_flushflag_pa, strbuf->strbuf_fsync);
+ upa_readq(iommu->write_complete_reg);
+
+ limit = 100000;
+ while (*(strbuf->strbuf_flushflag) == 0UL) {
+ limit--;
+ if (!limit)
+ break;
+ udelay(1);
+ rmb();
+ }
+ if (!limit)
+ printk(KERN_WARNING "sbus_strbuf_flush: flushflag timeout "
+ "vaddr[%08x] npages[%ld]\n",
+ base, npages);
+}
+
+/* Based largely upon the ppc64 iommu allocator. */
+static long sbus_arena_alloc(struct iommu *iommu, unsigned long npages)
+{
+ struct iommu_arena *arena = &iommu->arena;
+ unsigned long n, i, start, end, limit;
+ int pass;
+
+ limit = arena->limit;
+ start = arena->hint;
+ pass = 0;
+
+again:
+ n = find_next_zero_bit(arena->map, limit, start);
+ end = n + npages;
+ if (unlikely(end >= limit)) {
+ if (likely(pass < 1)) {
+ limit = start;
+ start = 0;
+ __iommu_flushall(iommu);
+ pass++;
+ goto again;
+ } else {
+ /* Scanned the whole thing, give up. */
+ return -1;
+ }
+ }
+
+ for (i = n; i < end; i++) {
+ if (test_bit(i, arena->map)) {
+ start = i + 1;
+ goto again;
+ }
+ }
+
+ for (i = n; i < end; i++)
+ __set_bit(i, arena->map);
+
+ arena->hint = end;
+
+ return n;
+}
+
+static void sbus_arena_free(struct iommu_arena *arena, unsigned long base, unsigned long npages)
+{
+ unsigned long i;
+
+ for (i = base; i < (base + npages); i++)
+ __clear_bit(i, arena->map);
+}
+
+static void sbus_iommu_table_init(struct iommu *iommu, unsigned int tsbsize)
+{
+ unsigned long tsbbase, order, sz, num_tsb_entries;
+
+ num_tsb_entries = tsbsize / sizeof(iopte_t);
+
+ /* Setup initial software IOMMU state. */
+ spin_lock_init(&iommu->lock);
+ iommu->page_table_map_base = MAP_BASE;
+
+ /* Allocate and initialize the free area map. */
+ sz = num_tsb_entries / 8;
+ sz = (sz + 7UL) & ~7UL;
+ iommu->arena.map = kzalloc(sz, GFP_KERNEL);
+ if (!iommu->arena.map) {
+ prom_printf("SBUS_IOMMU: Error, kmalloc(arena.map) failed.\n");
+ prom_halt();
+ }
+ iommu->arena.limit = num_tsb_entries;
+
+ /* Now allocate and setup the IOMMU page table itself. */
+ order = get_order(tsbsize);
+ tsbbase = __get_free_pages(GFP_KERNEL, order);
+ if (!tsbbase) {
+ prom_printf("IOMMU: Error, gfp(tsb) failed.\n");
+ prom_halt();
+ }
+ iommu->page_table = (iopte_t *)tsbbase;
+ memset(iommu->page_table, 0, tsbsize);
+}
+
+static inline iopte_t *alloc_npages(struct iommu *iommu, unsigned long npages)
+{
+ long entry;
+
+ entry = sbus_arena_alloc(iommu, npages);
+ if (unlikely(entry < 0))
+ return NULL;
+
+ return iommu->page_table + entry;
+}
+
+static inline void free_npages(struct iommu *iommu, dma_addr_t base, unsigned long npages)
+{
+ sbus_arena_free(&iommu->arena, base >> IO_PAGE_SHIFT, npages);
+}
+
+void *sbus_alloc_consistent(struct sbus_dev *sdev, size_t size, dma_addr_t *dvma_addr)
+{
+ struct sbus_info *info;
+ struct iommu *iommu;
+ iopte_t *iopte;
+ unsigned long flags, order, first_page;
+ void *ret;
+ int npages;
+
+ size = IO_PAGE_ALIGN(size);
+ order = get_order(size);
+ if (order >= 10)
+ return NULL;
+
+ first_page = __get_free_pages(GFP_KERNEL|__GFP_COMP, order);
+ if (first_page == 0UL)
+ return NULL;
+ memset((char *)first_page, 0, PAGE_SIZE << order);
+
+ info = sdev->bus->iommu;
+ iommu = &info->iommu;
+
+ spin_lock_irqsave(&iommu->lock, flags);
+ iopte = alloc_npages(iommu, size >> IO_PAGE_SHIFT);
+ spin_unlock_irqrestore(&iommu->lock, flags);
+
+ if (unlikely(iopte == NULL)) {
+ free_pages(first_page, order);
+ return NULL;
+ }
+
+ *dvma_addr = (iommu->page_table_map_base +
+ ((iopte - iommu->page_table) << IO_PAGE_SHIFT));
+ ret = (void *) first_page;
+ npages = size >> IO_PAGE_SHIFT;
+ first_page = __pa(first_page);
+ while (npages--) {
+ iopte_val(*iopte) = (IOPTE_VALID | IOPTE_CACHE |
+ IOPTE_WRITE |
+ (first_page & IOPTE_PAGE));
+ iopte++;
+ first_page += IO_PAGE_SIZE;
+ }
+
+ return ret;
+}
+
+void sbus_free_consistent(struct sbus_dev *sdev, size_t size, void *cpu, dma_addr_t dvma)
+{
+ struct sbus_info *info;
+ struct iommu *iommu;
+ iopte_t *iopte;
+ unsigned long flags, order, npages;
+
+ npages = IO_PAGE_ALIGN(size) >> IO_PAGE_SHIFT;
+ info = sdev->bus->iommu;
+ iommu = &info->iommu;
+ iopte = iommu->page_table +
+ ((dvma - iommu->page_table_map_base) >> IO_PAGE_SHIFT);
+
+ spin_lock_irqsave(&iommu->lock, flags);
+
+ free_npages(iommu, dvma - iommu->page_table_map_base, npages);
+
+ spin_unlock_irqrestore(&iommu->lock, flags);
+
+ order = get_order(size);
+ if (order < 10)
+ free_pages((unsigned long)cpu, order);
+}
+
+dma_addr_t sbus_map_single(struct sbus_dev *sdev, void *ptr, size_t sz, int direction)
+{
+ struct sbus_info *info;
+ struct iommu *iommu;
+ iopte_t *base;
+ unsigned long flags, npages, oaddr;
+ unsigned long i, base_paddr;
+ u32 bus_addr, ret;
+ unsigned long iopte_protection;
+
+ info = sdev->bus->iommu;
+ iommu = &info->iommu;
+
+ if (unlikely(direction == SBUS_DMA_NONE))
+ BUG();
+
+ oaddr = (unsigned long)ptr;
+ npages = IO_PAGE_ALIGN(oaddr + sz) - (oaddr & IO_PAGE_MASK);
+ npages >>= IO_PAGE_SHIFT;
+
+ spin_lock_irqsave(&iommu->lock, flags);
+ base = alloc_npages(iommu, npages);
+ spin_unlock_irqrestore(&iommu->lock, flags);
+
+ if (unlikely(!base))
+ BUG();
+
+ bus_addr = (iommu->page_table_map_base +
+ ((base - iommu->page_table) << IO_PAGE_SHIFT));
+ ret = bus_addr | (oaddr & ~IO_PAGE_MASK);
+ base_paddr = __pa(oaddr & IO_PAGE_MASK);
+
+ iopte_protection = IOPTE_VALID | IOPTE_STBUF | IOPTE_CACHE;
+ if (direction != SBUS_DMA_TODEVICE)
+ iopte_protection |= IOPTE_WRITE;
+
+ for (i = 0; i < npages; i++, base++, base_paddr += IO_PAGE_SIZE)
+ iopte_val(*base) = iopte_protection | base_paddr;
+
+ return ret;
+}
+
+void sbus_unmap_single(struct sbus_dev *sdev, dma_addr_t bus_addr, size_t sz, int direction)
+{
+ struct sbus_info *info = sdev->bus->iommu;
+ struct iommu *iommu = &info->iommu;
+ struct strbuf *strbuf = &info->strbuf;
+ iopte_t *base;
+ unsigned long flags, npages, i;
+
+ if (unlikely(direction == SBUS_DMA_NONE))
+ BUG();
+
+ npages = IO_PAGE_ALIGN(bus_addr + sz) - (bus_addr & IO_PAGE_MASK);
+ npages >>= IO_PAGE_SHIFT;
+ base = iommu->page_table +
+ ((bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT);
+
+ bus_addr &= IO_PAGE_MASK;
+
+ spin_lock_irqsave(&iommu->lock, flags);
+ sbus_strbuf_flush(iommu, strbuf, bus_addr, npages, direction);
+ for (i = 0; i < npages; i++)
+ iopte_val(base[i]) = 0UL;
+ free_npages(iommu, bus_addr - iommu->page_table_map_base, npages);
+ spin_unlock_irqrestore(&iommu->lock, flags);
+}
+
+#define SG_ENT_PHYS_ADDRESS(SG) \
+ (__pa(page_address((SG)->page)) + (SG)->offset)
+
+static inline void fill_sg(iopte_t *iopte, struct scatterlist *sg,
+ int nused, int nelems, unsigned long iopte_protection)
+{
+ struct scatterlist *dma_sg = sg;
+ struct scatterlist *sg_end = sg + nelems;
+ int i;
+
+ for (i = 0; i < nused; i++) {
+ unsigned long pteval = ~0UL;
+ u32 dma_npages;
+
+ dma_npages = ((dma_sg->dma_address & (IO_PAGE_SIZE - 1UL)) +
+ dma_sg->dma_length +
+ ((IO_PAGE_SIZE - 1UL))) >> IO_PAGE_SHIFT;
+ do {
+ unsigned long offset;
+ signed int len;
+
+ /* If we are here, we know we have at least one
+ * more page to map. So walk forward until we
+ * hit a page crossing, and begin creating new
+ * mappings from that spot.
+ */
+ for (;;) {
+ unsigned long tmp;
+
+ tmp = SG_ENT_PHYS_ADDRESS(sg);
+ len = sg->length;
+ if (((tmp ^ pteval) >> IO_PAGE_SHIFT) != 0UL) {
+ pteval = tmp & IO_PAGE_MASK;
+ offset = tmp & (IO_PAGE_SIZE - 1UL);
+ break;
+ }
+ if (((tmp ^ (tmp + len - 1UL)) >> IO_PAGE_SHIFT) != 0UL) {
+ pteval = (tmp + IO_PAGE_SIZE) & IO_PAGE_MASK;
+ offset = 0UL;
+ len -= (IO_PAGE_SIZE - (tmp & (IO_PAGE_SIZE - 1UL)));
+ break;
+ }
+ sg++;
+ }
+
+ pteval = iopte_protection | (pteval & IOPTE_PAGE);
+ while (len > 0) {
+ *iopte++ = __iopte(pteval);
+ pteval += IO_PAGE_SIZE;
+ len -= (IO_PAGE_SIZE - offset);
+ offset = 0;
+ dma_npages--;
+ }
+
+ pteval = (pteval & IOPTE_PAGE) + len;
+ sg++;
+
+ /* Skip over any tail mappings we've fully mapped,
+ * adjusting pteval along the way. Stop when we
+ * detect a page crossing event.
+ */
+ while (sg < sg_end &&
+ (pteval << (64 - IO_PAGE_SHIFT)) != 0UL &&
+ (pteval == SG_ENT_PHYS_ADDRESS(sg)) &&
+ ((pteval ^
+ (SG_ENT_PHYS_ADDRESS(sg) + sg->length - 1UL)) >> IO_PAGE_SHIFT) == 0UL) {
+ pteval += sg->length;
+ sg++;
+ }
+ if ((pteval << (64 - IO_PAGE_SHIFT)) == 0UL)
+ pteval = ~0UL;
+ } while (dma_npages != 0);
+ dma_sg++;
+ }
+}
+
+int sbus_map_sg(struct sbus_dev *sdev, struct scatterlist *sglist, int nelems, int direction)
+{
+ struct sbus_info *info;
+ struct iommu *iommu;
+ unsigned long flags, npages, iopte_protection;
+ iopte_t *base;
+ u32 dma_base;
+ struct scatterlist *sgtmp;
+ int used;
+
+ /* Fast path single entry scatterlists. */
+ if (nelems == 1) {
+ sglist->dma_address =
+ sbus_map_single(sdev,
+ (page_address(sglist->page) + sglist->offset),
+ sglist->length, direction);
+ sglist->dma_length = sglist->length;
+ return 1;
+ }
+
+ info = sdev->bus->iommu;
+ iommu = &info->iommu;
+
+ if (unlikely(direction == SBUS_DMA_NONE))
+ BUG();
+
+ npages = prepare_sg(sglist, nelems);
+
+ spin_lock_irqsave(&iommu->lock, flags);
+ base = alloc_npages(iommu, npages);
+ spin_unlock_irqrestore(&iommu->lock, flags);
+
+ if (unlikely(base == NULL))
+ BUG();
+
+ dma_base = iommu->page_table_map_base +
+ ((base - iommu->page_table) << IO_PAGE_SHIFT);
+
+ /* Normalize DVMA addresses. */
+ used = nelems;
+
+ sgtmp = sglist;
+ while (used && sgtmp->dma_length) {
+ sgtmp->dma_address += dma_base;
+ sgtmp++;
+ used--;
+ }
+ used = nelems - used;
+
+ iopte_protection = IOPTE_VALID | IOPTE_STBUF | IOPTE_CACHE;
+ if (direction != SBUS_DMA_TODEVICE)
+ iopte_protection |= IOPTE_WRITE;
+
+ fill_sg(base, sglist, used, nelems, iopte_protection);
+
+#ifdef VERIFY_SG
+ verify_sglist(sglist, nelems, base, npages);
+#endif
+
+ return used;
+}
+
+void sbus_unmap_sg(struct sbus_dev *sdev, struct scatterlist *sglist, int nelems, int direction)
+{
+ struct sbus_info *info;
+ struct iommu *iommu;
+ struct strbuf *strbuf;
+ iopte_t *base;
+ unsigned long flags, i, npages;
+ u32 bus_addr;
+
+ if (unlikely(direction == SBUS_DMA_NONE))
+ BUG();
+
+ info = sdev->bus->iommu;
+ iommu = &info->iommu;
+ strbuf = &info->strbuf;
+
+ bus_addr = sglist->dma_address & IO_PAGE_MASK;
+
+ for (i = 1; i < nelems; i++)
+ if (sglist[i].dma_length == 0)
+ break;
+ i--;
+ npages = (IO_PAGE_ALIGN(sglist[i].dma_address + sglist[i].dma_length) -
+ bus_addr) >> IO_PAGE_SHIFT;
+
+ base = iommu->page_table +
+ ((bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT);
+
+ spin_lock_irqsave(&iommu->lock, flags);
+ sbus_strbuf_flush(iommu, strbuf, bus_addr, npages, direction);
+ for (i = 0; i < npages; i++)
+ iopte_val(base[i]) = 0UL;
+ free_npages(iommu, bus_addr - iommu->page_table_map_base, npages);
+ spin_unlock_irqrestore(&iommu->lock, flags);
+}
+
+void sbus_dma_sync_single_for_cpu(struct sbus_dev *sdev, dma_addr_t bus_addr, size_t sz, int direction)
+{
+ struct sbus_info *info;
+ struct iommu *iommu;
+ struct strbuf *strbuf;
+ unsigned long flags, npages;
+
+ info = sdev->bus->iommu;
+ iommu = &info->iommu;
+ strbuf = &info->strbuf;
+
+ npages = IO_PAGE_ALIGN(bus_addr + sz) - (bus_addr & IO_PAGE_MASK);
+ npages >>= IO_PAGE_SHIFT;
+ bus_addr &= IO_PAGE_MASK;
+
+ spin_lock_irqsave(&iommu->lock, flags);
+ sbus_strbuf_flush(iommu, strbuf, bus_addr, npages, direction);
+ spin_unlock_irqrestore(&iommu->lock, flags);
+}
+
+void sbus_dma_sync_single_for_device(struct sbus_dev *sdev, dma_addr_t base, size_t size, int direction)
+{
+}
+
+void sbus_dma_sync_sg_for_cpu(struct sbus_dev *sdev, struct scatterlist *sglist, int nelems, int direction)
+{
+ struct sbus_info *info;
+ struct iommu *iommu;
+ struct strbuf *strbuf;
+ unsigned long flags, npages, i;
+ u32 bus_addr;
+
+ info = sdev->bus->iommu;
+ iommu = &info->iommu;
+ strbuf = &info->strbuf;
+
+ bus_addr = sglist[0].dma_address & IO_PAGE_MASK;
+ for (i = 0; i < nelems; i++) {
+ if (!sglist[i].dma_length)
+ break;
+ }
+ i--;
+ npages = (IO_PAGE_ALIGN(sglist[i].dma_address + sglist[i].dma_length)
+ - bus_addr) >> IO_PAGE_SHIFT;
+
+ spin_lock_irqsave(&iommu->lock, flags);
+ sbus_strbuf_flush(iommu, strbuf, bus_addr, npages, direction);
+ spin_unlock_irqrestore(&iommu->lock, flags);
+}
+
+void sbus_dma_sync_sg_for_device(struct sbus_dev *sdev, struct scatterlist *sg, int nents, int direction)
+{
+}
+
/* Enable 64-bit DVMA mode for the given device. */
void sbus_set_sbus64(struct sbus_dev *sdev, int bursts)
{
- struct iommu *iommu = sdev->ofdev.dev.archdata.iommu;
+ struct sbus_info *info = sdev->bus->iommu;
+ struct iommu *iommu = &info->iommu;
int slot = sdev->slot;
unsigned long cfg_reg;
u64 val;
@@ -194,7 +713,8 @@ static unsigned long sysio_imap_to_iclr(unsigned long imap)
unsigned int sbus_build_irq(void *buscookie, unsigned int ino)
{
struct sbus_bus *sbus = (struct sbus_bus *)buscookie;
- struct iommu *iommu = sbus->ofdev.dev.archdata.iommu;
+ struct sbus_info *info = sbus->iommu;
+ struct iommu *iommu = &info->iommu;
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
unsigned long imap, iclr;
int sbus_level = 0;
@@ -256,7 +776,8 @@ unsigned int sbus_build_irq(void *buscookie, unsigned int ino)
static irqreturn_t sysio_ue_handler(int irq, void *dev_id)
{
struct sbus_bus *sbus = dev_id;
- struct iommu *iommu = sbus->ofdev.dev.archdata.iommu;
+ struct sbus_info *info = sbus->iommu;
+ struct iommu *iommu = &info->iommu;
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
unsigned long afsr_reg, afar_reg;
unsigned long afsr, afar, error_bits;
@@ -328,7 +849,8 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id)
static irqreturn_t sysio_ce_handler(int irq, void *dev_id)
{
struct sbus_bus *sbus = dev_id;
- struct iommu *iommu = sbus->ofdev.dev.archdata.iommu;
+ struct sbus_info *info = sbus->iommu;
+ struct iommu *iommu = &info->iommu;
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
unsigned long afsr_reg, afar_reg;
unsigned long afsr, afar, error_bits;
@@ -405,7 +927,8 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id)
static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id)
{
struct sbus_bus *sbus = dev_id;
- struct iommu *iommu = sbus->ofdev.dev.archdata.iommu;
+ struct sbus_info *info = sbus->iommu;
+ struct iommu *iommu = &info->iommu;
unsigned long afsr_reg, afar_reg, reg_base;
unsigned long afsr, afar, error_bits;
int reported;
@@ -472,7 +995,8 @@ static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id)
static void __init sysio_register_error_handlers(struct sbus_bus *sbus)
{
- struct iommu *iommu = sbus->ofdev.dev.archdata.iommu;
+ struct sbus_info *info = sbus->iommu;
+ struct iommu *iommu = &info->iommu;
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
unsigned int irq;
u64 control;
@@ -517,6 +1041,7 @@ static void __init sbus_iommu_init(int __node, struct sbus_bus *sbus)
{
const struct linux_prom64_registers *pr;
struct device_node *dp;
+ struct sbus_info *info;
struct iommu *iommu;
struct strbuf *strbuf;
unsigned long regs, reg_base;
@@ -529,28 +1054,25 @@ static void __init sbus_iommu_init(int __node, struct sbus_bus *sbus)
pr = of_get_property(dp, "reg", NULL);
if (!pr) {
- prom_printf("sbus_iommu_init: Cannot map SYSIO "
- "control registers.\n");
+ prom_printf("sbus_iommu_init: Cannot map SYSIO control registers.\n");
prom_halt();
}
regs = pr->phys_addr;
- iommu = kzalloc(sizeof(*iommu), GFP_ATOMIC);
- if (!iommu)
- goto fatal_memory_error;
- strbuf = kzalloc(sizeof(*strbuf), GFP_ATOMIC);
- if (!strbuf)
- goto fatal_memory_error;
+ info = kzalloc(sizeof(*info), GFP_ATOMIC);
+ if (info == NULL) {
+ prom_printf("sbus_iommu_init: Fatal error, "
+ "kmalloc(info) failed\n");
+ prom_halt();
+ }
- sbus->ofdev.dev.archdata.iommu = iommu;
- sbus->ofdev.dev.archdata.stc = strbuf;
+ iommu = &info->iommu;
+ strbuf = &info->strbuf;
reg_base = regs + SYSIO_IOMMUREG_BASE;
iommu->iommu_control = reg_base + IOMMU_CONTROL;
iommu->iommu_tsbbase = reg_base + IOMMU_TSBBASE;
iommu->iommu_flush = reg_base + IOMMU_FLUSH;
- iommu->iommu_tags = iommu->iommu_control +
- (IOMMU_TAGDIAG - IOMMU_CONTROL);
reg_base = regs + SYSIO_STRBUFREG_BASE;
strbuf->strbuf_control = reg_base + STRBUF_CONTROL;
@@ -571,12 +1093,14 @@ static void __init sbus_iommu_init(int __node, struct sbus_bus *sbus)
*/
iommu->write_complete_reg = regs + 0x2000UL;
+ /* Link into SYSIO software state. */
+ sbus->iommu = info;
+
printk("SYSIO: UPA portID %x, at %016lx\n",
sbus->portid, regs);
/* Setup for TSB_SIZE=7, TBW_SIZE=0, MMU_DE=1, MMU_EN=1 */
- if (iommu_table_init(iommu, IO_TSB_SIZE, MAP_BASE, 0xffffffff))
- goto fatal_memory_error;
+ sbus_iommu_table_init(iommu, IO_TSB_SIZE);
control = upa_readq(iommu->iommu_control);
control = ((7UL << 16UL) |
@@ -633,10 +1157,6 @@ static void __init sbus_iommu_init(int __node, struct sbus_bus *sbus)
starfire_hookup(sbus->portid);
sysio_register_error_handlers(sbus);
- return;
-
-fatal_memory_error:
- prom_printf("sbus_iommu_init: Fatal memory allocation error.\n");
}
void sbus_fill_device_irq(struct sbus_dev *sdev)
diff --git a/trunk/arch/sparc64/kernel/time.c b/trunk/arch/sparc64/kernel/time.c
index 69cad1b653c1..49063ca2efcd 100644
--- a/trunk/arch/sparc64/kernel/time.c
+++ b/trunk/arch/sparc64/kernel/time.c
@@ -1460,74 +1460,6 @@ static int cmos_set_rtc_time(struct rtc_time *rtc_tm)
}
#endif /* CONFIG_PCI */
-static void mostek_get_rtc_time(struct rtc_time *rtc_tm)
-{
- void __iomem *regs = mstk48t02_regs;
- u8 tmp;
-
- spin_lock_irq(&mostek_lock);
-
- tmp = mostek_read(regs + MOSTEK_CREG);
- tmp |= MSTK_CREG_READ;
- mostek_write(regs + MOSTEK_CREG, tmp);
-
- rtc_tm->tm_sec = MSTK_REG_SEC(regs);
- rtc_tm->tm_min = MSTK_REG_MIN(regs);
- rtc_tm->tm_hour = MSTK_REG_HOUR(regs);
- rtc_tm->tm_mday = MSTK_REG_DOM(regs);
- rtc_tm->tm_mon = MSTK_REG_MONTH(regs);
- rtc_tm->tm_year = MSTK_CVT_YEAR( MSTK_REG_YEAR(regs) );
- rtc_tm->tm_wday = MSTK_REG_DOW(regs);
-
- tmp = mostek_read(regs + MOSTEK_CREG);
- tmp &= ~MSTK_CREG_READ;
- mostek_write(regs + MOSTEK_CREG, tmp);
-
- spin_unlock_irq(&mostek_lock);
-
- rtc_tm->tm_mon--;
- rtc_tm->tm_wday--;
- rtc_tm->tm_year -= 1900;
-}
-
-static int mostek_set_rtc_time(struct rtc_time *rtc_tm)
-{
- unsigned char mon, day, hrs, min, sec, wday;
- void __iomem *regs = mstk48t02_regs;
- unsigned int yrs;
- u8 tmp;
-
- yrs = rtc_tm->tm_year + 1900;
- mon = rtc_tm->tm_mon + 1;
- day = rtc_tm->tm_mday;
- wday = rtc_tm->tm_wday + 1;
- hrs = rtc_tm->tm_hour;
- min = rtc_tm->tm_min;
- sec = rtc_tm->tm_sec;
-
- spin_lock_irq(&mostek_lock);
-
- tmp = mostek_read(regs + MOSTEK_CREG);
- tmp |= MSTK_CREG_WRITE;
- mostek_write(regs + MOSTEK_CREG, tmp);
-
- MSTK_SET_REG_SEC(regs, sec);
- MSTK_SET_REG_MIN(regs, min);
- MSTK_SET_REG_HOUR(regs, hrs);
- MSTK_SET_REG_DOW(regs, wday);
- MSTK_SET_REG_DOM(regs, day);
- MSTK_SET_REG_MONTH(regs, mon);
- MSTK_SET_REG_YEAR(regs, yrs - MSTK_YEAR_ZERO);
-
- tmp = mostek_read(regs + MOSTEK_CREG);
- tmp &= ~MSTK_CREG_WRITE;
- mostek_write(regs + MOSTEK_CREG, tmp);
-
- spin_unlock_irq(&mostek_lock);
-
- return 0;
-}
-
struct mini_rtc_ops {
void (*get_rtc_time)(struct rtc_time *);
int (*set_rtc_time)(struct rtc_time *);
@@ -1555,11 +1487,6 @@ static struct mini_rtc_ops cmos_rtc_ops = {
};
#endif /* CONFIG_PCI */
-static struct mini_rtc_ops mostek_rtc_ops = {
- .get_rtc_time = mostek_get_rtc_time,
- .set_rtc_time = mostek_set_rtc_time,
-};
-
static struct mini_rtc_ops *mini_rtc_ops;
static inline void mini_get_rtc_time(struct rtc_time *time)
@@ -1688,8 +1615,6 @@ static int __init rtc_mini_init(void)
else if (ds1287_regs)
mini_rtc_ops = &cmos_rtc_ops;
#endif /* CONFIG_PCI */
- else if (mstk48t02_regs)
- mini_rtc_ops = &mostek_rtc_ops;
else
return -ENODEV;
diff --git a/trunk/arch/sparc64/kernel/traps.c b/trunk/arch/sparc64/kernel/traps.c
index 6ef42b8e53d8..6ef2d299fb10 100644
--- a/trunk/arch/sparc64/kernel/traps.c
+++ b/trunk/arch/sparc64/kernel/traps.c
@@ -2134,20 +2134,12 @@ static void user_instruction_dump (unsigned int __user *pc)
void show_stack(struct task_struct *tsk, unsigned long *_ksp)
{
unsigned long pc, fp, thread_base, ksp;
- struct thread_info *tp;
+ void *tp = task_stack_page(tsk);
struct reg_window *rw;
int count = 0;
ksp = (unsigned long) _ksp;
- if (!tsk)
- tsk = current;
- tp = task_thread_info(tsk);
- if (ksp == 0UL) {
- if (tsk == current)
- asm("mov %%fp, %0" : "=r" (ksp));
- else
- ksp = tp->ksp;
- }
+
if (tp == current_thread_info())
flushw_all();
@@ -2176,7 +2168,11 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
void dump_stack(void)
{
- show_stack(current, NULL);
+ unsigned long *ksp;
+
+ __asm__ __volatile__("mov %%fp, %0"
+ : "=r" (ksp));
+ show_stack(current, ksp);
}
EXPORT_SYMBOL(dump_stack);
diff --git a/trunk/arch/sparc64/mm/fault.c b/trunk/arch/sparc64/mm/fault.c
index 9f7740eee8d2..17123e9ecf78 100644
--- a/trunk/arch/sparc64/mm/fault.c
+++ b/trunk/arch/sparc64/mm/fault.c
@@ -112,12 +112,15 @@ static void __kprobes unhandled_fault(unsigned long address,
static void bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr)
{
+ unsigned long *ksp;
+
printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n",
regs->tpc);
printk(KERN_CRIT "OOPS: RPC [%016lx]\n", regs->u_regs[15]);
print_symbol("RPC: <%s>\n", regs->u_regs[15]);
printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr);
- dump_stack();
+ __asm__("mov %%sp, %0" : "=r" (ksp));
+ show_stack(current, ksp);
unhandled_fault(regs->tpc, current, regs);
}
diff --git a/trunk/arch/um/drivers/mmapper_kern.c b/trunk/arch/um/drivers/mmapper_kern.c
index 867666a02339..e41a08f04694 100644
--- a/trunk/arch/um/drivers/mmapper_kern.c
+++ b/trunk/arch/um/drivers/mmapper_kern.c
@@ -12,7 +12,6 @@
#include
#include
#include
-#include
#include
#include
#include "mem_user.h"
diff --git a/trunk/arch/um/kernel/exec.c b/trunk/arch/um/kernel/exec.c
index ce6828fd396f..356e50f5aaed 100644
--- a/trunk/arch/um/kernel/exec.c
+++ b/trunk/arch/um/kernel/exec.c
@@ -6,7 +6,6 @@
#include "linux/slab.h"
#include "linux/smp_lock.h"
#include "linux/ptrace.h"
-#include "linux/fs.h"
#include "asm/ptrace.h"
#include "asm/pgtable.h"
#include "asm/tlbflush.h"
diff --git a/trunk/arch/um/kernel/init_task.c b/trunk/arch/um/kernel/init_task.c
index cba516e6c99a..d4f1d1ab252b 100644
--- a/trunk/arch/um/kernel/init_task.c
+++ b/trunk/arch/um/kernel/init_task.c
@@ -4,7 +4,6 @@
*/
#include "linux/mm.h"
-#include "linux/fs.h"
#include "linux/module.h"
#include "linux/sched.h"
#include "linux/init_task.h"
diff --git a/trunk/arch/um/kernel/syscall.c b/trunk/arch/um/kernel/syscall.c
index 7b3b67333ff3..237c4eab7cfd 100644
--- a/trunk/arch/um/kernel/syscall.c
+++ b/trunk/arch/um/kernel/syscall.c
@@ -7,7 +7,6 @@
#include "linux/file.h"
#include "linux/smp_lock.h"
#include "linux/mm.h"
-#include "linux/fs.h"
#include "linux/utsname.h"
#include "linux/msg.h"
#include "linux/shm.h"
diff --git a/trunk/arch/x86_64/defconfig b/trunk/arch/x86_64/defconfig
index e64f65c9d901..b7c4cd04bfc3 100644
--- a/trunk/arch/x86_64/defconfig
+++ b/trunk/arch/x86_64/defconfig
@@ -199,7 +199,7 @@ CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_PM=y
# CONFIG_PM_LEGACY is not set
# CONFIG_PM_DEBUG is not set
-CONFIG_HIBERNATION=y
+CONFIG_SOFTWARE_SUSPEND=y
CONFIG_PM_STD_PARTITION=""
CONFIG_SUSPEND_SMP=y
diff --git a/trunk/arch/x86_64/ia32/ptrace32.c b/trunk/arch/x86_64/ia32/ptrace32.c
index 4a233ad6269c..4de3a54318f4 100644
--- a/trunk/arch/x86_64/ia32/ptrace32.c
+++ b/trunk/arch/x86_64/ia32/ptrace32.c
@@ -15,7 +15,6 @@
#include
#include
#include
-#include
#include