pandora-kernel.git
16 years agosysfs: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binar...
Zhang Rui [Sat, 9 Jun 2007 05:57:22 +0000 (13:57 +0800)]
sysfs: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binary attributes

Well, first of all, I don't want to change so many files either.

What I do:
Adding a new parameter "struct bin_attribute *" in the
.read/.write methods for the sysfs binary attributes.

In fact, only the four lines change in fs/sysfs/bin.c and
include/linux/sysfs.h do the real work.
But I have to update all the files that use binary attributes
to make them compatible with the new .read and .write methods.
I'm not sure if I missed any. :(

Why I do this:
For a sysfs attribute, we can get a pointer pointing to the
struct attribute in the .show/.store method,
while we can't do this for the binary attributes.
I don't know why this is different, but this does make it not
so handy to use the binary attributes as the regular ones.
So I think this patch is reasonable. :)

Who benefits from it:
The patch that exposes ACPI tables in sysfs
requires such an improvement.
All the table binary attributes share the same .read method.
Parameter "struct bin_attribute *" is used to get
the table signature and instance number which are used to
distinguish different ACPI table binary attributes.

Without this parameter, we need to offer different .read methods
for different ACPI table binary attributes.
This is impossible as there are various ACPI tables on different
platforms, and we don't know what they are until they are loaded.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: make directory dentries and inodes reclaimable
Tejun Heo [Wed, 13 Jun 2007 19:27:25 +0000 (04:27 +0900)]
sysfs: make directory dentries and inodes reclaimable

This patch makes dentries and inodes for sysfs directories
reclaimable.

* sysfs_notify() is modified to walk sysfs_dirent tree instead of
  dentry tree.

* sysfs_update_file() and sysfs_chmod_file() use sysfs_get_dentry() to
  grab the victim dentry.

* sysfs_rename_dir() and sysfs_move_dir() grab all dentries using
  sysfs_get_dentry() on startup.

* Dentries for all shadowed directories are pinned in memory to serve
  as lookup start point.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: implement sysfs_get_dentry()
Tejun Heo [Wed, 13 Jun 2007 19:27:25 +0000 (04:27 +0900)]
sysfs: implement sysfs_get_dentry()

Some sysfs operations require dentry and inode.  sysfs_get_dentry()
looks up and gets dentry for the specified sysfs_dirent.  It finds the
first ancestor with dentry attached and starts looking up dentries
from there.

Looking up from the nearest ancestor is necessary to support shadowed
directories because we can't reliably lookup dentry for one of the
shadows.  Dentries for each shadow will be pinned in memory such that
they can serve as the starting point for dentry lookup.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: move sysfs_drop_dentry() to dir.c and make it static
Tejun Heo [Wed, 13 Jun 2007 19:27:24 +0000 (04:27 +0900)]
sysfs: move sysfs_drop_dentry() to dir.c and make it static

After add/remove path restructuring, the only user of
sysfs_drop_dentry() is sysfs_addrm_finish().  Move sysfs_drop_dentry()
to dir.c and make it static.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: restructure add/remove paths and fix inode update
Tejun Heo [Wed, 13 Jun 2007 19:27:24 +0000 (04:27 +0900)]
sysfs: restructure add/remove paths and fix inode update

The original add/remove code had the following problems.

* parent's timestamps are updated on dentry instantiation.  this is
  incorrect with reclaimable files.

* updating parent's timestamps isn't synchronized.

* parent nlink update assumes the inode is accessible which won't be
  true once directory dentries are made reclaimable.

This patch restructures add/remove paths to resolve the above
problems.  Add/removal are done in the following steps.

1. sysfs_addrm_start() : acquire locks including sysfs_mutex and other
   resources.

2-a. sysfs_add_one() : add new sd.  linking the new sd into the
     children list is caller's responsibility.

2-b. sysfs_remove_one() : remove a sd.  unlinking the sd from the
     children list is caller's responsibility.

3. sysfs_addrm_finish() : release all resources and clean up.

Steps 2-a and/or 2-b can be repeated multiple times.

Parent's inode is looked up during sysfs_addrm_start().  If available
(always at the moment), it's pinned and nlink is updated as sd's are
added and removed.  Timestamps are updated during finish if any sd has
been added or removed.  If parent's inode is not available during
start, sysfs_mutex ensures that parent inode is not created till
add/remove is complete.

All the complexity is contained inside the helper functions.
Especially, dentry/inode handling is properly hidden from the rest of
sysfs which now mostly operate on sysfs_dirents.  As an added bonus,
codes which use these helpers to add and remove sysfs_dirents are now
more structured and simpler.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: use sysfs_mutex to protect the sysfs_dirent tree
Tejun Heo [Wed, 13 Jun 2007 19:27:23 +0000 (04:27 +0900)]
sysfs: use sysfs_mutex to protect the sysfs_dirent tree

As kobj sysfs dentries and inodes are gonna be made reclaimable,
i_mutex can't be used to protect sysfs_dirent tree.  Use sysfs_mutex
globally instead.  As the whole tree is protected with sysfs_mutex,
there is no reason to keep sysfs_rename_sem.  Drop it.

While at it, add docbook comments to functions which require
sysfs_mutex locking.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: consolidate sysfs spinlocks
Tejun Heo [Wed, 13 Jun 2007 19:27:23 +0000 (04:27 +0900)]
sysfs: consolidate sysfs spinlocks

Replace sysfs_lock and kobj_sysfs_assoc_lock with sysfs_assoc_lock.
sysfs_lock was originally to be used to protect sysfs_dirent tree but
mutex seems better choice, so there is no reason to keep sysfs_lock
separate.  Merge the two spinlocks into one.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: make kobj point to sysfs_dirent instead of dentry
Tejun Heo [Wed, 13 Jun 2007 19:27:22 +0000 (04:27 +0900)]
sysfs: make kobj point to sysfs_dirent instead of dentry

As kobj sysfs dentries and inodes are gonna be made reclaimable,
dentry can't be used as naming token for sysfs file/directory, replace
kobj->dentry with kobj->sd.  The only external interface change is
shadow directory handling.  All other changes are contained in kobj
and sysfs.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: implement sysfs_find_dirent() and sysfs_get_dirent()
Tejun Heo [Wed, 13 Jun 2007 19:27:22 +0000 (04:27 +0900)]
sysfs: implement sysfs_find_dirent() and sysfs_get_dirent()

Implement sysfs_find_dirent() and sysfs_get_dirent().
sysfs_dirent_exist() is replaced by sysfs_find_dirent().  These will
be used to make directory entries reclamiable.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: implement SYSFS_FLAG_REMOVED flag
Tejun Heo [Wed, 13 Jun 2007 19:27:22 +0000 (04:27 +0900)]
sysfs: implement SYSFS_FLAG_REMOVED flag

Implement SYSFS_FLAG_REMOVED flag which currently is used only to
improve sanity check in sysfs_deactivate().  The flag will be used to
make directory entries reclamiable.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: rename sysfs_dirent->s_type to s_flags and make room for flags
Tejun Heo [Wed, 13 Jun 2007 19:27:21 +0000 (04:27 +0900)]
sysfs: rename sysfs_dirent->s_type to s_flags and make room for flags

Rename sysfs_dirent->s_type to s_flags, pack type into lower eight
bits and reserve the rest for flags.  sysfs_type() can used to access
the type.  All existing sd->s_type accesses are converted to use
sysfs_type().  While at it, type test is changed to equality test
instead of bit-and test where appropriate.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: make sysfs_drop_dentry() access inodes using ilookup()
Tejun Heo [Wed, 13 Jun 2007 19:27:21 +0000 (04:27 +0900)]
sysfs: make sysfs_drop_dentry() access inodes using ilookup()

sysfs_drop_dentry() used to go through sd->s_dentry and
sd->s_parent->s_dentry to access the inodes.  This is incorrect
because inode can be cached without dentry.

This patch makes sysfs_drop_dentry() access inodes using ilookup() on
sd->s_ino.  This is both correct and simpler.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: Fix oops in sysfs_drop_dentry on x86_64
Rafael J. Wysocki [Wed, 13 Jun 2007 18:45:18 +0000 (03:45 +0900)]
sysfs: Fix oops in sysfs_drop_dentry on x86_64

Fix oops on x86_64 caused by the dereference of dir in
sysfs_drop_dentry() made before checking if dir is not NULL
(cf. http://marc.info/?l=linux-kernel&m=118151626704924&w=2).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: use singly-linked list for sysfs_dirent tree
Tejun Heo [Wed, 13 Jun 2007 18:45:18 +0000 (03:45 +0900)]
sysfs: use singly-linked list for sysfs_dirent tree

Make sysfs_dirent use singly linked list for its tree structure.
sysfs_link_sibling() and sysfs_unlink_sibling() functions are added to
handle simpler cases.  It adds some complexity and cpu cycle overhead
but reduced memory footprint is worthwhile on big machines.

This change reduces the sizeof sysfs_dirent from 104 to 88 on 64bit
and from 60 to 52 on 32bit.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: slim down sysfs_dirent->s_active
Tejun Heo [Wed, 13 Jun 2007 18:45:18 +0000 (03:45 +0900)]
sysfs: slim down sysfs_dirent->s_active

Make sysfs_dirent->s_active an atomic_t instead of rwsem.  This
reduces the size of sysfs_dirent from 136 to 104 on 64bit and from 76
to 60 on 32bit with lock debugging turned off.  With lock debugging
turned on the reduction is much larger.

s_active starts at zero and each active reference increments s_active.
Putting a reference decrements s_active.  Deactivation subtracts
SD_DEACTIVATED_BIAS which is currently INT_MIN and assumed to be small
enough to make s_active negative.  If s_active is negative,
sysfs_get() no longer grants new references.  Deactivation succeeds
immediately if there is no active user; otherwise, it waits using a
completion for the last put.

Due to the removal of lockdep tricks, this change makes things less
trickier in release_sysfs_dirent().  As all the complexity is
contained in three s_active functions, I think it's more readable this
way.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: move s_active functions to fs/sysfs/dir.c
Tejun Heo [Wed, 13 Jun 2007 18:45:18 +0000 (03:45 +0900)]
sysfs: move s_active functions to fs/sysfs/dir.c

These functions are about to receive more complexity and doesn't
really need to be inlined in the first place.  Move them from
fs/sysfs/sysfs.h to fs/sysfs/dir.c.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: fix root sysfs_dirent -> root dentry association
Tejun Heo [Wed, 13 Jun 2007 18:45:18 +0000 (03:45 +0900)]
sysfs: fix root sysfs_dirent -> root dentry association

The root sysfs_dirent didn't point to the root dentry fix it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: use iget_locked() instead of new_inode()
Tejun Heo [Wed, 13 Jun 2007 18:45:17 +0000 (03:45 +0900)]
sysfs: use iget_locked() instead of new_inode()

After dentry is reclaimed, sysfs always used to allocate new dentry
and inode if the file is accessed again.  This causes problem with
operations which only pin the inode.  For example, if inotify watch is
added to a sysfs file and the dentry for the file is reclaimed, the
next update event creates new dentry and new inode making the inotify
watch miss all the events from there on.

This patch fixes it by using iget_locked() instead of new_inode().
sysfs_new_inode() is renamed to sysfs_get_inode() and inode is
initialized iff the inode is newly allocated.  sysfs_instantiate() is
responsible for unlocking new inodes.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: reorganize sysfs_new_indoe() and sysfs_create()
Tejun Heo [Wed, 13 Jun 2007 18:45:17 +0000 (03:45 +0900)]
sysfs: reorganize sysfs_new_indoe() and sysfs_create()

Reorganize/clean up sysfs_new_inode() and sysfs_create().

* sysfs_init_inode() is separated out from sysfs_new_inode() and is
  responsible for basic initialization.
* sysfs_instantiate() replaces the last step of sysfs_create() and is
  responsible for dentry instantitaion.
* type-specific initialization is moved out to the callers.
* mode is specified only once when creating a sysfs_dirent.
* spurious list_del_init(&sd->s_sibling) dropped from create_dir()

This change is to

* prepare for inode allocation fix.
* separate alloc and init code for synchronization update.
* make dentry/inode initialization more flexible for later changes.

This patch doesn't introduce visible behavior change.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: fix parent refcounting during rename and move
Tejun Heo [Wed, 13 Jun 2007 18:45:17 +0000 (03:45 +0900)]
sysfs: fix parent refcounting during rename and move

Parent reference wasn't properly transferred during rename and move.
Fix it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: make sysfs_alloc_ino() static
Tejun Heo [Wed, 13 Jun 2007 18:45:17 +0000 (03:45 +0900)]
sysfs: make sysfs_alloc_ino() static

sysfs_alloc_ino() isn't used out side of fs/sysfs/dir.c.  Make it
static.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver-core: make devt_attr and uevent_attr static
Tejun Heo [Wed, 13 Jun 2007 18:45:17 +0000 (03:45 +0900)]
driver-core: make devt_attr and uevent_attr static

devt_attr and uevent_attr are either allocated dynamically with or
embedded in device and class_device as they needed their owner field
set to the module implementing the driver.  Now that sysfs implements
immediate disconnect and owner field removed from struct attribute,
there is no reason to do this.  Remove these attributes from
[class_]device and use static attribute structures instead.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: kill unnecessary attribute->owner
Tejun Heo [Wed, 13 Jun 2007 18:45:17 +0000 (03:45 +0900)]
sysfs: kill unnecessary attribute->owner

sysfs is now completely out of driver/module lifetime game.  After
deletion, a sysfs node doesn't access anything outside sysfs proper,
so there's no reason to hold onto the attribute owners.  Note that
often the wrong modules were accounted for as owners leading to
accessing removed modules.

This patch kills now unnecessary attribute->owner.  Note that with
this change, userland holding a sysfs node does not prevent the
backing module from being unloaded.

For more info regarding lifetime rule cleanup, please read the
following message.

  http://article.gmane.org/gmane.linux.kernel/510293

(tweaked by Greg to not delete the field just yet, to make it easier to
merge things properly.)

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: reimplement sysfs_drop_dentry()
Tejun Heo [Wed, 13 Jun 2007 18:45:16 +0000 (03:45 +0900)]
sysfs: reimplement sysfs_drop_dentry()

This patch reimplements sysfs_drop_dentry() such that remove_dir() can
use it to drop dentry instead of using a separate mechanism.  With
this change, making directories reclaimable is much easier.

This patch used to contain fixes for two race conditions around
sd->s_dentry but that part has been separated out and included into
mainline early as commit 6aa054aadfea613a437ad0b15d38eca2b963fc0a and
dd14cbc994709a1c5a64ed3621f583c49a27e521.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: separate out sysfs_attach_dentry()
Tejun Heo [Wed, 13 Jun 2007 18:45:16 +0000 (03:45 +0900)]
sysfs: separate out sysfs_attach_dentry()

Consolidate sd <-> dentry association into sysfs_attach_dentry() and
call it after dentry and inode are properly set up.  This is in
preparation of sysfs_drop_dentry() updates.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: kill attribute file orphaning
Tejun Heo [Wed, 13 Jun 2007 18:45:16 +0000 (03:45 +0900)]
sysfs: kill attribute file orphaning

Now that sysfs_dirent can be disconnected from kobject on deletion,
there is no need to orphan each attribute files.  All [bin_]attribute
nodes are automatically orphaned when the parent node is deleted.
Kill attribute file orphaning.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: implement sysfs_dirent active reference and immediate disconnect
Tejun Heo [Wed, 13 Jun 2007 18:45:16 +0000 (03:45 +0900)]
sysfs: implement sysfs_dirent active reference and immediate disconnect

sysfs: implement sysfs_dirent active reference and immediate disconnect

Opening a sysfs node references its associated kobject, so userland
can arbitrarily prolong lifetime of a kobject which complicates
lifetime rules in drivers.  This patch implements active reference and
makes the association between kobject and sysfs immediately breakable.

Now each sysfs_dirent has two reference counts - s_count and s_active.
s_count is a regular reference count which guarantees that the
containing sysfs_dirent is accessible.  As long as s_count reference
is held, all sysfs internal fields in sysfs_dirent are accessible
including s_parent and s_name.

The newly added s_active is active reference count.  This is acquired
by invoking sysfs_get_active() and it's the caller's responsibility to
ensure sysfs_dirent itself is accessible (should be holding s_count
one way or the other).  Dereferencing sysfs_dirent to access objects
out of sysfs proper requires active reference.  This includes access
to the associated kobjects, attributes and ops.

The active references can be drained and denied by calling
sysfs_deactivate().  All active sysfs_dirents must be deactivated
after deletion but before the default reference is dropped.  This
enables immediate disconnect of sysfs nodes.  Once a sysfs_dirent is
deleted, it won't access any entity external to sysfs proper.

Because attr/bin_attr ops access both the node itself and its parent
for kobject, they need to hold active references to both.
sysfs_get/put_active_two() helpers are provided to help grabbing both
references.  Parent's is acquired first and released last.

Unlike other operations, mmapped area lingers on after mmap() is
finished and the module implement implementing it and kobj need to
stay referenced till all the mapped pages are gone.  This is
accomplished by holding one set of active references to the bin_attr
and its parent if there have been any mmap during lifetime of an
openfile.  The references are dropped when the openfile is released.

This change makes sysfs lifetime rules independent from both kobject's
and module's.  It not only fixes several race conditions caused by
sysfs not holding onto the proper module when referencing kobject, but
also helps fixing and simplifying lifetime management in driver model
and drivers by taking sysfs out of the equation.

Please read the following message for more info.

  http://article.gmane.org/gmane.linux.kernel/510293

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: implement bin_buffer
Tejun Heo [Wed, 13 Jun 2007 18:45:16 +0000 (03:45 +0900)]
sysfs: implement bin_buffer

Implement bin_buffer which contains a mutex and pointer to PAGE_SIZE
buffer to properly synchronize accesses to per-openfile buffer and
prepare for immediate-kobj-disconnect.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: reimplement symlink using sysfs_dirent tree
Tejun Heo [Wed, 13 Jun 2007 18:45:15 +0000 (03:45 +0900)]
sysfs: reimplement symlink using sysfs_dirent tree

sysfs symlink is implemented by referencing dentry and kobject from
sysfs_dirent - symlink entry references kobject, dentry is used to
walk the tree.  This complicates object lifetimes rules and is
dangerous - for example, there is no way to tell to which module the
target of a symlink belongs and referencing that kobject can make it
linger after the module is gone.

This patch reimplements symlink using only sysfs_dirent tree.  sd for
a symlink points and holds reference to the target sysfs_dirent and
all walking is done using sysfs_dirent tree.  Simpler and safer.

Please read the following message for more info.

  http://article.gmane.org/gmane.linux.kernel/510293

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: implement kobj_sysfs_assoc_lock
Tejun Heo [Wed, 13 Jun 2007 18:45:15 +0000 (03:45 +0900)]
sysfs: implement kobj_sysfs_assoc_lock

kobj->dentry can go away anytime unless the user controls when the
associated sysfs node is deleted.  This patch implements
kobj_sysfs_assoc_lock which protects kobj->dentry.  This will be used
to maintain kobj based API when converting sysfs to use sysfs_dirent
tree instead of dentry/kobject.

Note that this lock belongs to kobject/driver-model not sysfs.  Once
sysfs is converted to not use kobject in its interface, this can be
removed from sysfs.

This is in preparation of object reference simplification.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: make sysfs_dirent->s_element a union
Tejun Heo [Wed, 13 Jun 2007 18:45:15 +0000 (03:45 +0900)]
sysfs: make sysfs_dirent->s_element a union

Make sd->s_element a union of sysfs_elem_{dir|symlink|attr|bin_attr}
and rename it to s_elem.  This is to achieve...

* some level of type checking : changing symlink to point to
  sysfs_dirent instead of kobject is much safer and less painful now.
* easier / standardized dereferencing
* allow sysfs_elem_* to contain more than one entry

Where possible, pointer is obtained by directly deferencing from sd
instead of going through other entities.  This reduces dependencies to
dentry, inode and kobject.  to_attr() and to_bin_attr() are unused now
and removed.

This is in preparation of object reference simplification.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: add sysfs_dirent->s_name
Tejun Heo [Wed, 13 Jun 2007 18:45:15 +0000 (03:45 +0900)]
sysfs: add sysfs_dirent->s_name

Add s_name to sysfs_dirent.  This is to further reduce dependency to
the associated dentry.  Name is copied for directories and symlinks
but not for attributes.

Where possible, name dereferences are converted to use sd->s_name.
sysfs_symlink->link_name and sysfs_get_name() are unused now and
removed.

This change allows symlink to be implemented using sysfs_dirent tree
proper, which is the last remaining dentry-dependent sysfs walk.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: add sysfs_dirent->s_parent
Tejun Heo [Wed, 13 Jun 2007 18:45:14 +0000 (03:45 +0900)]
sysfs: add sysfs_dirent->s_parent

Add sysfs_dirent->s_parent.  With this patch, each sd points to and
holds a reference to its parent.  This allows walking sysfs tree
without referencing sd->s_dentry which can go away anytime if the user
doesn't control when it's deleted.

sd->s_parent is initialized and parent is referenced in
sysfs_attach_dirent().  Reference to parent is released when the sd is
released, so as long as reference to a sd is held, s_parent can be
followed.

dentry walk in sysfs_readdir() is convereted to s_parent walk.

This will be used to reimplement symlink such that it uses only
sysfs_dirent tree.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: consolidate sysfs_dirent creation functions
Tejun Heo [Wed, 13 Jun 2007 18:45:14 +0000 (03:45 +0900)]
sysfs: consolidate sysfs_dirent creation functions

Currently there are four functions to create sysfs_dirent -
__sysfs_new_dirent(), sysfs_new_dirent(), __sysfs_make_dirent() and
sysfs_make_dirent().  Other than sysfs_make_dirent(), no function has
two users if calls to implement other functions are excluded.

This patch consolidates sysfs_dirent creation functions into the
following two.

* sysfs_new_dirent() : allocate and initialize
* sysfs_attach_dirent() : attach to sysfs_dirent hierarchy and/or
  associate with dentry

This simplifies interface and gives callers more flexibility.  This is
in preparation of object reference simplification.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: flatten and fix sysfs_rename_dir() error handling
Tejun Heo [Wed, 13 Jun 2007 18:45:14 +0000 (03:45 +0900)]
sysfs: flatten and fix sysfs_rename_dir() error handling

Error handling in sysfs_rename_dir() was broken.

* When lookup_one_len() fails, 0 is returned.

* If parent inode check fails, returns with inode mutex and rename
  rwsem held.

This patch fixes the above bugs and flattens error handling such that
it's more readable and easier to modify.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: flatten cleanup paths in sysfs_add_link() and create_dir()
Tejun Heo [Wed, 13 Jun 2007 18:45:14 +0000 (03:45 +0900)]
sysfs: flatten cleanup paths in sysfs_add_link() and create_dir()

Flatten cleanup paths in sysfs_add_link() and create_dir() to improve
readability and ease further changes to these functions.  This is in
preparation of object reference simplification.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: fix error handling in binattr write()
Tejun Heo [Wed, 13 Jun 2007 18:45:13 +0000 (03:45 +0900)]
sysfs: fix error handling in binattr write()

Error handling in fs/sysfs/bin.c:write() was wrong because size_t
count is used to receive return value from flush_write() which is
negative on failure.

This patch updates write() such that int variable is used instead.
read() is updated the same way for consistency.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: make sysfs_put() ignore NULL sd
Tejun Heo [Wed, 13 Jun 2007 18:45:13 +0000 (03:45 +0900)]
sysfs: make sysfs_put() ignore NULL sd

Make sysfs_put() ignore NULL sd instead of oopsing.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: allocate inode number using ida
Tejun Heo [Wed, 13 Jun 2007 18:45:13 +0000 (03:45 +0900)]
sysfs: allocate inode number using ida

sysfs used simple incrementing allocator which is not guaranteed to be
unique.  This patch makes sysfs use ida to give each sd a unique and
packed inode number.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: move release_sysfs_dirent() to dir.c
Tejun Heo [Wed, 13 Jun 2007 18:45:13 +0000 (03:45 +0900)]
sysfs: move release_sysfs_dirent() to dir.c

There is no reason this function should be inlined and soon to follow
sysfs object reference simplification will make it heavier.  Move it
to dir.c.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoida: implement idr based id allocator
Tejun Heo [Wed, 13 Jun 2007 18:45:13 +0000 (03:45 +0900)]
ida: implement idr based id allocator

Implement idr based id allocator.  ida is used the same way idr is
used but lacks id -> ptr translation and thus consumes much less
memory.  struct ida_bitmap is attached as leaf nodes to idr tree which
is managed by the idr code.  Each ida_bitmap is 128bytes long and
contains slightly less than a thousand slots.

ida is more aggressive with releasing extra resources acquired using
ida_pre_get().  After every successful id allocation, ida frees one
reserved idr_layer if possible.  Reserved ida_bitmap is not freed
automatically but only one ida_bitmap is reserved and it's almost
always used right away.  Under most circumstances, ida won't hold on
to memory for too long which isn't actively used.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoidr: separate out idr_mark_full()
Tejun Heo [Wed, 13 Jun 2007 18:45:12 +0000 (03:45 +0900)]
idr: separate out idr_mark_full()

Separate out idr_mark_full() from sub_alloc() and make marking the
allocated slot full the responsibility of idr_get_new_above_int().

Allocation part of idr_get_new_above_int() is renamed to
idr_get_empty_slot().  New idr_get_new_above_int() allocates a slot
using the function, install the user pointer and marks it full using
idr_mark_full().

This change doesn't introduce any behavior change.  This will be
used by ida.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoidr: fix obscure bug in allocation path
Tejun Heo [Wed, 13 Jun 2007 18:45:12 +0000 (03:45 +0900)]
idr: fix obscure bug in allocation path

In sub_alloc(), when bitmap search fails, it goes up one level to
continue search.  This is done by updating the id cursor and searching
the upper level again.  If the cursor was at the end of the upper
level, we need to go further than that.

This wasn't implemented and when that happens the part of the cursor
which indexes into the upper level wraps and sub_alloc() ends up
searching the wrong bitmap.  It allocates id which doesn't match the
actual slot.

This patch fixes this by restarting from the top if the search needs
to go higher than one level.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: coding style cleanup
Cornelia Huck [Mon, 9 Jul 2007 18:39:18 +0000 (11:39 -0700)]
Driver core: coding style cleanup

This converts code of the form

if ((error = some_func()))
goto fixup;
to
error = some_func();
if (error)
goto fixup;

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: do not use saved_state from struct dev_pm_info on ARM
Rafael J. Wysocki [Mon, 9 Jul 2007 18:39:19 +0000 (11:39 -0700)]
PM: do not use saved_state from struct dev_pm_info on ARM

The saved_state member of 'struct dev_pm_info' that's going to be removed
is used in arch/arm/common/locomo.c, arch/arm/common/sa1111.c and
arch/arm/mach-sa1100/neponset.c.  Change the code in there to use local
variables for saving the state of devices during suspend.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Greg KH <greg@kroah.com>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Do not check parent state in suspend and resume core code
Rafael J. Wysocki [Sun, 17 Jun 2007 17:50:51 +0000 (19:50 +0200)]
PM: Do not check parent state in suspend and resume core code

The checks if the device's parent is in the right state done in
drivers/base/power/suspend.c and drivers/base/power/resume.c serve no particular
purpose, since if the parent is in a wrong power state, the device's suspend or
resume callbacks are supposed to return an error anyway.  Moreover, they are
also useless from the sanity checking point of view, because they rely on the
code being checked to set dev->parent->power.power_state.event appropriately,
which need not happen if that code is buggy.  For these reasons they can be
removed.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Remove power_state.event checks from suspend core code
Rafael J. Wysocki [Sun, 17 Jun 2007 17:49:20 +0000 (19:49 +0200)]
PM: Remove power_state.event checks from suspend core code

The suspend routines should be called for every device during a system sleep
transition, regardless of the device's state, so that drivers can regard these
method calls as notifications that the system is about to go to sleep, rather
than as directives to put their devices into the 'off' state.

This is documented in Documentation/power/devices.txt and is already done in
the core resume code, so it seems reasonable to make the core suspend code
behave accordingly.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Remove prev_state from struct dev_pm_info
Rafael J. Wysocki [Sun, 17 Jun 2007 17:48:06 +0000 (19:48 +0200)]
PM: Remove prev_state from struct dev_pm_info

The prev_state member of struct dev_pm_info (defined in include/linux/pm.h) is
only used during a resume to check if the device's state before the suspend was
'off', in which case the device is not resumed.  However, in such cases the
decision whether or not to resume the device should be made on the driver level
and the resume callbacks from the device's bus and class should be executed
anyway (the may be needed for some things other than just powering on the
device).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: fix devres_release_all() return value
Adrian Bunk [Sun, 17 Jun 2007 23:42:54 +0000 (01:42 +0200)]
Driver core: fix devres_release_all() return value

Every file should include the headers containing the prototypes for
it's global functions.

Since the GNU C compiler is now able to detect that the function
prototype of devres_release_all() in the header and the actual function
disagree regarding the return value, this patch also fixes this bug.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: fix kernel doc of device_release_driver
Stefan Richter [Sun, 17 Jun 2007 09:02:12 +0000 (11:02 +0200)]
driver core: fix kernel doc of device_release_driver

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: properly get driver in device_release_driver
Stefan Richter [Sun, 17 Jun 2007 09:01:18 +0000 (11:01 +0200)]
driver core: properly get driver in device_release_driver

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: include linux/mutex.h from attribute_container.c
Michael S. Tsirkin [Sun, 10 Jun 2007 19:39:12 +0000 (22:39 +0300)]
Driver core: include linux/mutex.h from attribute_container.c

attribute_container.c uses DEFINE_MUTEX, so while
linux/mutex.h seems to be pulled in indirectly
by one of the headers it includes, the right thing
is to include linux/mutex.h directly.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
16 years agoPM: Simplify suspend_device
Rafael J. Wysocki [Wed, 13 Jun 2007 14:19:27 +0000 (16:19 +0200)]
PM: Simplify suspend_device

Reduce code duplication in drivers/base/suspend.c by introducing a separate
function for printing diagnostic messages.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Remove saved_state from struct dev_pm_info
Rafael J. Wysocki [Wed, 13 Jun 2007 13:55:34 +0000 (15:55 +0200)]
PM: Remove saved_state from struct dev_pm_info

The saved_state member of struct dev_pm_info, defined in include/linux/pm.h, is
not used anywhere, so it can be removed.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Remove pm_parent from struct dev_pm_info
Rafael J. Wysocki [Wed, 13 Jun 2007 13:53:34 +0000 (15:53 +0200)]
PM: Remove pm_parent from struct dev_pm_info

The pm_parent member of struct dev_pm_info (defined in include/linux/pm.h) is
only used to check if the device's parent is in the right state while the
device is being suspended or resumed.  However, this can be done just as well
with the help of the parent pointer in struct device, so pm_parent can be
removed along with some code that handles it.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPower Management: use mutexes instead of semaphores
Matthias Kaehlcke [Wed, 23 May 2007 21:19:41 +0000 (14:19 -0700)]
Power Management: use mutexes instead of semaphores

The Power Management code uses semaphores as mutexes.  Use the mutex API
instead of the (binary) semaphores.

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysdev: use mutex instead of semaphore
Matthias Kaehlcke [Wed, 23 May 2007 21:19:42 +0000 (14:19 -0700)]
sysdev: use mutex instead of semaphore

The sysdev code use a semaphore as mutex.  Use the mutex API instead of the
(binary) semaphore.

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: add missing kset uevent
Kay Sievers [Sat, 26 May 2007 09:21:36 +0000 (11:21 +0200)]
Driver core: add missing kset uevent

We get uevents for a bus/class going away, but not one registering.
Add the missing uevent in kset_register(), which will send an
event for a new bus/class. Suppress all unwanted uevents for bus
subdirectories like /bus/*/devices/, /bus/*/drivers/.

Now we get for module usbcore:
  add      /module/usbcore (module)
  add      /bus/usb (bus)
  add      /class/usb_host (class)
  add      /bus/usb/drivers/hub (drivers)
  add      /bus/usb/drivers/usb (drivers)
  remove   /bus/usb/drivers/usb (drivers)
  remove   /bus/usb/drivers/hub (drivers)
  remove   /class/usb_host (class)
  remove   /bus/usb (bus)
  remove   /module/usbcore (module)

instead of:
  add      /module/usbcore (module)
  add      /bus/usb/drivers/hub (drivers)
  add      /bus/usb/drivers/usb (drivers)
  remove   /bus/usb/drivers/usb (drivers)
  remove   /bus/usb/drivers/hub (drivers)
  remove   /class/usb_host (class)
  remove   /bus/usb/drivers (bus)
  remove   /bus/usb/devices (bus)
  remove   /bus/usb (bus)
  remove   /module/usbcore (module)

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDMI-based module autoloading
Lennart Poettering [Tue, 8 May 2007 20:07:02 +0000 (22:07 +0200)]
DMI-based module autoloading

The patch below adds DMI/SMBIOS based module autoloading to the Linux
kernel. The idea is to load laptop drivers automatically (and other
drivers which cannot be autoloaded otherwise), based on the DMI system
identification information of the BIOS.

Right now most distros manually try to load all available laptop
drivers on bootup in the hope that at least one of them loads
successfully. This patch does away with all that, and uses udev to
automatically load matching drivers on the right machines.

Basically the patch just exports the DMI information that has been
parsed by the kernel anyway to userspace via a sysfs device
/sys/class/dmi/id and makes sure that proper modalias attributes are
available. Besides adding the "modalias" attribute it also adds
attributes for a few other DMI fields which might be useful for
writing udev rules.

This patch is not an attempt to export the entire DMI/SMBIOS data to
userspace. We already have "dmidecode" which parses the complete DMI
info from userspace. The purpose of this patch is machine model
identification and good udev integration.

To take advantage of DMI based module autoloading, a driver should
export one or more MODULE_ALIAS fields similar to these:

MODULE_ALIAS("dmi:*:svnMICRO-STARINT'LCO.,LTD:pnMS-1013:pvr0131*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
MODULE_ALIAS("dmi:*:svnMicro-StarInternational:pnMS-1058:pvr0581:rvnMSI:rnMS-1058:*:ct10:*");
MODULE_ALIAS("dmi:*:svnMicro-StarInternational:pnMS-1412:*:rvnMSI:rnMS-1412:*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
MODULE_ALIAS("dmi:*:svnNOTEBOOK:pnSAM2000:pvr0131*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");

These lines are specific to my msi-laptop.c driver. They are basically
just a concatenation of a few carefully selected DMI fields with all
potentially bad characters stripped.

Besides laptop drivers, modules like "hdaps", the i2c modules
and the hwmon modules are good candidates for "dmi:" MODULE_ALIAS
lines.

Besides merely exporting the DMI data via sysfs the patch adds
support for a few more DMI fields. Especially the CHASSIS fields are
very useful to identify different laptop modules. The patch also adds
working MODULE_ALIAS lines to my msi-laptop.c driver.

I'd like to thank Kay Sievers for helping me to clean up this patch
for posting it on lkml.

Patch is against Linus' current GIT HEAD. Should probably apply to
older kernels as well without modification.

Signed-off-by: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodebugfs: add rename for debugfs files
Jan Kara [Wed, 9 May 2007 11:19:52 +0000 (13:19 +0200)]
debugfs: add rename for debugfs files

Implement debugfs_rename() to allow renaming files/directories in debugfs.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoRules on how to use sysfs in userspace programs
Kay Sievers [Fri, 8 Jun 2007 20:36:37 +0000 (13:36 -0700)]
Rules on how to use sysfs in userspace programs

Here's a document to help clear things up.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agolots-of-architectures: enable arbitary speed tty support
Alan Cox [Wed, 11 Jul 2007 00:22:27 +0000 (17:22 -0700)]
lots-of-architectures: enable arbitary speed tty support

Add the termios2 structure ready for enabling on most platforms.  One or
two like Sparc are plain weird so have been left alone.  Most can use the
same structure as ktermios for termios2 (ie the newer ioctl uses the
structure matching the current kernel structure)

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Bryan Wu <bryan.wu@analog.com>
Cc: Ian Molton <spyro@f2s.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Mikael Starvik <starvik@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Matthew Wilcox <willy@debian.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Cc: Richard Curnow <rc@rc0.org.uk>
Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp>
Cc: Chris Zankel <chris@zankel.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMake common helpers for seq_files that work with list_heads
Pavel Emelianov [Wed, 11 Jul 2007 00:22:26 +0000 (17:22 -0700)]
Make common helpers for seq_files that work with list_heads

Many places in kernel use seq_file API to iterate over a regular list_head.
The code for such iteration is identical in all the places, so it's worth
introducing a common helpers.

This makes code about 300 lines smaller:

The first version of this patch made the helper functions static inline
in the seq_file.h header. This patch moves them to the fs/seq_file.c as
Andrew proposed. The vmlinux .text section sizes are as follows:

2.6.22-rc1-mm1:              0x001794d5
with the previous version:   0x00179505
with this patch:             0x00179135

The config file used was make allnoconfig with the "y" inclusion of all
the possible options to make the files modified by the patch compile plus
drivers I have on the test node.

This patch:

Many places in kernel use seq_file API to iterate over a regular list_head.
The code for such iteration is identical in all the places, so it's worth
introducing a common helpers.

Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosx: switch subven and subid values
Jiri Slaby [Wed, 11 Jul 2007 00:22:25 +0000 (17:22 -0700)]
sx: switch subven and subid values

sx.c is failing to locate Graham's card.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Graham Murray <gmurray@webwayone.co.uk>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoAdd LZO1X algorithm to the kernel
Richard Purdie [Wed, 11 Jul 2007 00:22:24 +0000 (17:22 -0700)]
Add LZO1X algorithm to the kernel

This is a hybrid version of the patch to add the LZO1X compression
algorithm to the kernel.  Nitin and myself have merged the best parts of
the various patches to form this version which we're both happy with (and
are jointly signing off).

The performance of this version is equivalent to the original minilzo code
it was based on.  Bytecode comparisons have also been made on ARM, i386 and
x86_64 with favourable results.

There are several users of LZO lined up including jffs2, crypto and reiser4
since its much faster than zlib.

Signed-off-by: Nitin Gupta <nitingupta910@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@openedhand.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
Linus Torvalds [Tue, 10 Jul 2007 21:57:52 +0000 (14:57 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/drzeus/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
  mmc: at91_mci: fix hanging and rework to match flowcharts
  mmc: at91_mci typo
  sdhci: Fix "Unexpected interrupt" handling
  mmc: fix silly copy-and-paste error
  mmc: move layer init and workqueue to core file
  mmc: refactor host class handling
  mmc: refactor bus operations
  sdhci: add ene controller id
  mmc: bounce requests for simple hosts

16 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Tue, 10 Jul 2007 21:56:22 +0000 (14:56 -0700)]
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (40 commits)
  bonding/bond_main.c: make 2 functions static
  ps3: gigabit ethernet driver for PS3, take3
  [netdrvr] Fix dependencies for ax88796 ne2k clone driver
  eHEA: Capability flag for DLPAR support
  Remove sk98lin ethernet driver.
  sunhme.c:quattro_pci_find() must be __devinit
  bonding / ipv6: no addrconf for slaves separately from master
  atl1: remove write-only var in tx handler
  macmace: use "unsigned long flags;"
  Cleanup usbnet_probe() return value handling
  netxen: deinline and sparse fix
  eeprom_93cx6: shorten pulse timing to match spec (bis)
  phylib: Add Marvell 88E1112 phy id
  phylib: cleanup marvell.c a bit
  AX88796 network driver
  IOC3: Switch to pci refcounting safe APIs
  e100: Fix Tyan motherboard e100 not receiving IPMI commands
  QE Ethernet driver writes to wrong register to mask interrupts
  rrunner.c:rr_init() must be __devinit
  tokenring/3c359.c:xl_init() must be __devinit
  ...

16 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Tue, 10 Jul 2007 21:50:16 +0000 (14:50 -0700)]
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (32 commits)
  [libata] sata_mv: print out additional chip info during probe
  [libata] Use ATA_UDMAx standard masks when filling driver's udma_mask info
  [libata] AHCI: Add support for Marvell AHCI-like chips (initially 6145)
  [libata] Clean up driver udma_mask initializers
  libata: Support chips with 64K PRD quirk
  Add a PCI ID for santa rosa's PATA controller.
  sata_sil24: sil24_interrupt() micro-optimisation
  Add irq_flags to struct pata_platform_info
  sata_promise: cleanups
  [libata] pata_ixp4xx: kill unused var
  ata_piix: fix pio/mwdma programming
  [libata] ahci: minor internal cleanups
  [ATA] Add named constant for ATAPI command DEVICE RESET
  [libata] sata_sx4, sata_via: minor documentation updates
  [libata] ahci: minor internal cleanups
  [libata] ahci: Factor out SATA port init into a separate function
  [libata] pata_sil680: minor cleanups from benh
  [libata] sata_sx4: named constant cleanup
  [libata] pata_ixp4xx: convert to new EH
  [libata] pdc_adma: Reorder initializers with a couple structs
  ...

16 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Tue, 10 Jul 2007 21:48:43 +0000 (14:48 -0700)]
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (62 commits)
  [MIPS] PNX8550: Cleanup proc code.
  [MIPS] WRPPMC: Fix build.
  [MIPS] Yosemite: Fix modpost warnings.
  [MIPS] Change names of local variables to silence sparse
  [MIPS] SB1: Fix modpost warning.
  [MIPS] PNX: Fix modpost warnings.
  [MIPS] Alchemy: Fix modpost warnings.
  [MIPS] Non-FPAFF: Fix warning.
  [MIPS] DEC: Fix modpost warning.
  [MIPS] MIPSsim: Enable MIPSsim virtual network driver.
  [MIPS] Delete Ocelot 3 support.
  [MIPS] remove LASAT Networks platforms support
  [MIPS] Early check for SMTC kernel on non-MT processor
  [MIPS] Add debugfs files to show fpuemu statistics
  [MIPS] Add some debugfs files to debug unaligned accesses
  [MIPS] rbtx4938: Fix secondary PCIC and glue internal NICs
  [MIPS] tc35815: Load MAC address via platform_device
  [MIPS] Move FPU affinity code into separate file.
  [MIPS] Make ioremap() work on TX39/49 special unmapped segment
  [MIPS] rbtx4938: Update and minimize defconfig
  ...

16 years agoMerge git://git.infradead.org/~dwmw2/battery-2.6
Linus Torvalds [Tue, 10 Jul 2007 21:47:59 +0000 (14:47 -0700)]
Merge git://git.infradead.org/~dwmw2/battery-2.6

* git://git.infradead.org/~dwmw2/battery-2.6:
  [BATTERY] ds2760 W1 slave
  [BATTERY] One Laptop Per Child power/battery driver
  [BATTERY] Apple PMU driver
  [BATTERY] 1-Wire ds2760 chip battery driver
  [BATTERY] APM emulation driver for class batteries
  [BATTERY] pda_power platform driver
  [BATTERY] Universal power supply class (was: battery class)

16 years agoMerge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Tue, 10 Jul 2007 21:46:09 +0000 (14:46 -0700)]
Merge branch 'for-linus' of git://git390.osdl.marist.edu/linux-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] vmlogrdr function annotation.
  [S390] s390: rename CPU_IDLE to S390_CPU_IDLE
  [S390] cio: Remove prototype for non-existing function cmf_reset().
  [S390] zcrypt: fix request timeout handling
  [S390] system call optimization.
  [S390] dasd: Avoid compile warnings on !CONFIG_DASD_PROFILE
  [S390] Remove volatile from atomic_t
  [S390] Program check in diag 210 under 31 bit
  [S390] Bogomips calculation for 64 bit.
  [S390] smp: Merge smp_count_cpus() and smp_get_save_areas().
  [S390] zcore: Fix __user annotation.
  [S390] fixed cdl-format detection.
  [S390] sclp: Test facility list before executing a service call.
  [S390] sclp: introduce some new interfaces.
  [S390] Fixed comment typo.
  [S390] vmcp cleanup

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
Linus Torvalds [Tue, 10 Jul 2007 20:56:13 +0000 (13:56 -0700)]
Merge git://git./linux/kernel/git/steve/gfs2-2.6-nmw

* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw: (57 commits)
  [GFS2] Accept old format NFS filehandles
  [GFS2] Small fixes to logging code
  [DLM] dump more lock values
  [GFS2] Remove i_mode passing from NFS File Handle
  [GFS2] Obtaining no_formal_ino from directory entry
  [GFS2] git-gfs2-nmw-build-fix
  [GFS2] System won't suspend with GFS2 file system mounted
  [GFS2] remounting w/o acl option leaves acls enabled
  [GFS2] inode size inconsistency
  [DLM] Telnet to port 21064 can stop all lockspaces
  [GFS2] Fix gfs2_block_truncate_page err return
  [GFS2] Addendum to the journaled file/unmount patch
  [GFS2] Simplify multiple glock aquisition
  [GFS2] assertion failure after writing to journaled file, umount
  [GFS2] Use zero_user_page() in stuffed_readpage()
  [GFS2] Remove bogus '\0' in rgrp.c
  [GFS2] Journaled file write/unstuff bug
  [DLM] don't require FS flag on all nodes
  [GFS2] Fix deallocation issues
  [GFS2] return conflicts for GETLK
  ...

16 years agoMerge branch 'splice-2.6.23' of git://git.kernel.dk/data/git/linux-2.6-block
Linus Torvalds [Tue, 10 Jul 2007 20:51:06 +0000 (13:51 -0700)]
Merge branch 'splice-2.6.23' of git://git.kernel.dk/data/git/linux-2.6-block

* 'splice-2.6.23' of git://git.kernel.dk/data/git/linux-2.6-block:
  pipe: add documentation and comments
  pipe: change the ->pin() operation to ->confirm()
  Remove remnants of sendfile()
  xip sendfile removal
  splice: completely document external interface with kerneldoc
  sendfile: remove bad_sendfile() from bad_file_ops
  shmem: convert to using splice instead of sendfile()
  relay: use splice_to_pipe() instead of open-coding the pipe loop
  pipe: allow passing around of ops private pointer
  splice: divorce the splice structure/function definitions from the pipe header
  splice: relay support
  sendfile: convert nfsd to splice_direct_to_actor()
  sendfile: convert nfs to using splice_read()
  loop: convert to using splice_direct_to_actor() instead of sendfile()
  splice: add void cookie to the actor data
  sendfile: kill generic_file_sendfile()
  sendfile: remove .sendfile from filesystems that use generic_file_sendfile()
  sys_sendfile: switch to using ->splice_read, if available
  vmsplice: add vmsplice-to-user support
  splice: abstract out actor data

16 years agoMerge branch 'trivial-2.6.23' of git://git.kernel.dk/data/git/linux-2.6-block
Linus Torvalds [Tue, 10 Jul 2007 20:49:46 +0000 (13:49 -0700)]
Merge branch 'trivial-2.6.23' of git://git.kernel.dk/data/git/linux-2.6-block

* 'trivial-2.6.23' of git://git.kernel.dk/data/git/linux-2.6-block:
  Documentation/block/barrier.txt is not in sync with the actual code: - blk_queue_ordered() no longer has a gfp_mask parameter - blk_queue_ordered_locked() no longer exists - sd_prepare_flush() looks slightly different
  Use list_for_each_entry() instead of list_for_each() in the block device
  Make a "menuconfig" out of the Kconfig objects "menu, ..., endmenu",
  block/Kconfig already has its own "menuconfig" so remove these
  Use menuconfigs instead of menus, so the whole menu can be disabled at once
  cfq-iosched: fix async queue behaviour
  unexport bio_{,un}map_user
  Remove legacy CDROM drivers
  [PATCH] fix request->cmd == INT cases
  cciss: add new controller support for P700m
  [PATCH] Remove acsi.c
  [BLOCK] drop unnecessary bvec rewinding from flush_dry_bio_endio
  [PATCH] cdrom_sysctl_info fix
  blk_hw_contig_segment(): bad segment size checks
  [TRIVIAL PATCH] Kill blk_congestion_wait() stub for !CONFIG_BLOCK

16 years agobonding/bond_main.c: make 2 functions static
Adrian Bunk [Mon, 9 Jul 2007 18:51:12 +0000 (11:51 -0700)]
bonding/bond_main.c: make 2 functions static

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Chad Tindel <ctindel@users.sourceforge.net>
Cc: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agops3: gigabit ethernet driver for PS3, take3
Masakazu Mokuno [Thu, 5 Jul 2007 11:11:16 +0000 (20:11 +0900)]
ps3: gigabit ethernet driver for PS3, take3

Hi,

This is the third submission of the network driver for PS3.
The differences from the previous one are:

  - renamed source file names so that their prefix can match
    with the module name
  - added cbe-oss-dev@ozlabs.org line for MAINTAINER file
  - changed some in copyright comments

If there are no more comments, please apply for 2.6.23.

Thank you

--
Subject: PS3: Ethernet driver

From: Masakazu Mokuno <mokuno@sm.sony.co.jp>

Add Gigabit Ethernet support for the PS3 game console.  The module will
be called ps3_gelic.

CC: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[netdrvr] Fix dependencies for ax88796 ne2k clone driver
Jeff Garzik [Tue, 10 Jul 2007 18:06:48 +0000 (14:06 -0400)]
[netdrvr] Fix dependencies for ax88796 ne2k clone driver

It needs writesb(), not available on all platforms.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoeHEA: Capability flag for DLPAR support
Jan-Bernd Themann [Thu, 5 Jul 2007 07:26:25 +0000 (09:26 +0200)]
eHEA: Capability flag for DLPAR support

This patch introduces a capability flag that is used by the DLPAR userspace
tool to check which DLPAR features are supported by the eHEA driver.

Missing goto has been included.

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoRemove sk98lin ethernet driver.
Jeff Garzik [Tue, 10 Jul 2007 16:58:33 +0000 (12:58 -0400)]
Remove sk98lin ethernet driver.

Unmaintained, superceded by skge.

Prodded to deletion by Adrian Bunk.  Acked by Stephen Hemminger.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosunhme.c:quattro_pci_find() must be __devinit
Adrian Bunk [Tue, 10 Jul 2007 12:44:49 +0000 (14:44 +0200)]
sunhme.c:quattro_pci_find() must be __devinit

This patch fixes the following section mismatch:

<--  snip  -->

...
  MODPOST vmlinux
WARNING: drivers/built-in.o(.text+0x272f8b): Section mismatch: reference to .init.text:quattro_pci_find (between 'happy_meal_pci_probe' and 'happy_meal_pci_remove')
...

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agobonding / ipv6: no addrconf for slaves separately from master
Jay Vosburgh [Mon, 9 Jul 2007 17:42:47 +0000 (10:42 -0700)]
bonding / ipv6: no addrconf for slaves separately from master

At present, when a device is enslaved to bonding, if ipv6 is
active then addrconf will be initated on the slave (because it is closed
then opened during the enslavement processing).  This causes DAD and RS
packets to be sent from the slave.  These packets in turn can confuse
switches that perform ipv6 snooping, causing them to incorrectly update
their forwarding tables (if, e.g., the slave being added is an inactve
backup that won't be used right away) and direct traffic away from the
active slave to a backup slave (where the incoming packets will be
dropped).

This patch alters the behavior so that addrconf will only run on
the master device itself.  I believe this is logically correct, as it
prevents slaves from having an IPv6 identity independent from the
master.  This is consistent with the IPv4 behavior for bonding.

This is accomplished by (a) having bonding set IFF_SLAVE sooner
in the enslavement processing than currently occurs (before open, not
after), and (b) having ipv6 addrconf ignore UP and CHANGE events on
slave devices.

The eql driver also uses the IFF_SLAVE flag.  I inspected eql,
and I believe this change is reasonable for its usage of IFF_SLAVE, but
I did not test it.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoatl1: remove write-only var in tx handler
Alexey Dobriyan [Fri, 6 Jul 2007 15:05:25 +0000 (19:05 +0400)]
atl1: remove write-only var in tx handler

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agomacmace: use "unsigned long flags;"
Alexey Dobriyan [Fri, 6 Jul 2007 14:57:13 +0000 (18:57 +0400)]
macmace: use "unsigned long flags;"

Code will do local_irq_save() on it.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoCleanup usbnet_probe() return value handling
Peter Korsgaard [Mon, 2 Jul 2007 22:46:42 +0000 (00:46 +0200)]
Cleanup usbnet_probe() return value handling

usbnet_probe() handles a positive return value from the driver bind()
function as success, but will later only setup the status handler if the
return value was zero, leading to confusion. Patch adjusts this to accept
positive values as success in both checks.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agonetxen: deinline and sparse fix
Stephen Hemminger [Thu, 5 Jul 2007 23:13:55 +0000 (16:13 -0700)]
netxen: deinline and sparse fix

Get rid of dubious casts to (void *) which causes a sparse warning.
And move largeish function from inline to the one file that uses the code,
the compiler can then decide to inline it.

Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoeeprom_93cx6: shorten pulse timing to match spec (bis)
Francois Romieu [Tue, 3 Jul 2007 22:31:44 +0000 (00:31 +0200)]
eeprom_93cx6: shorten pulse timing to match spec (bis)

Based on an original idea by John W. Linville.

It is the missing part of 42d45ccd60636c28e35c2016f091783bc14ad99c

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agophylib: Add Marvell 88E1112 phy id
Olof Johansson [Tue, 3 Jul 2007 21:24:32 +0000 (16:24 -0500)]
phylib: Add Marvell 88E1112 phy id

Add 88E1112 PHY ID to the marvell driver. Seems to do fine with the
88E1111 inits.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agophylib: cleanup marvell.c a bit
Olof Johansson [Tue, 3 Jul 2007 21:23:46 +0000 (16:23 -0500)]
phylib: cleanup marvell.c a bit

Simplify the marvell driver init a bit: Make the supported devices an
array instead of explicitly registering each structure. This makes it
considerably easier to add new devices down the road.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoAX88796 network driver
Ben Dooks [Tue, 3 Jul 2007 15:53:09 +0000 (16:53 +0100)]
AX88796 network driver

Support for the Asix AX88796 network controller, an
NE2000 compatible 10/100 ethernet device with internal
PHY.

The driver supports PHY settings via either ioctl() or
the ethtool driver ops.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years ago[MIPS] PNX8550: Cleanup proc code.
Robert P. J. Day [Tue, 10 Jul 2007 10:37:56 +0000 (06:37 -0400)]
[MIPS] PNX8550: Cleanup proc code.

Here's a slightly cleaner way of creating the /proc structure for the
pnx8850.  mostly, it creates a directory with default mode 555, since the
one you're creating is mode 444, which is somewhat unusual for a directory
under /proc.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] WRPPMC: Fix build.
Ralf Baechle [Tue, 10 Jul 2007 15:56:33 +0000 (16:56 +0100)]
[MIPS] WRPPMC: Fix build.

Using another systems defines is a safe way to get your code broken by
accident when that system is removed.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Yosemite: Fix modpost warnings.
Ralf Baechle [Tue, 10 Jul 2007 15:31:19 +0000 (16:31 +0100)]
[MIPS] Yosemite: Fix modpost warnings.

  MODPOST vmlinux
WARNING: arch/mips/pmc-sierra/yosemite/built-in.o(.text+0x974): Section mismatch: reference to .init.data: (between 'prom_boot_secondary' and 'prom_cpus_done')
WARNING: arch/mips/pmc-sierra/yosemite/built-in.o(.text+0x980): Section mismatch: reference to .init.data: (between 'prom_boot_secondary' and 'prom_cpus_done')
WARNING: arch/mips/pmc-sierra/yosemite/built-in.o(.text+0x978): Section mismatch: reference to .init.data: (between 'prom_boot_secondary' and 'prom_cpus_done')
WARNING: arch/mips/pmc-sierra/yosemite/built-in.o(.text+0x984): Section mismatch: reference to .init.data: (between 'prom_boot_secondary' and 'prom_cpus_done')
WARNING: arch/mips/pmc-sierra/yosemite/built-in.o(.text+0x98c): Section mismatch: reference to .init.data: (between 'prom_boot_secondary' and 'prom_cpus_done')
WARNING: arch/mips/pmc-sierra/yosemite/built-in.o(.text+0x990): Section mismatch: reference to .init.data: (between 'prom_boot_secondary' and 'prom_cpus_done')

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Change names of local variables to silence sparse
Atsushi Nemoto [Tue, 10 Jul 2007 15:24:14 +0000 (00:24 +0900)]
[MIPS] Change names of local variables to silence sparse

This patch is an workaround for these sparse warnings:

linux/include/linux/calc64.h:25:17: warning: symbol '__quot' shadows an earlier one
linux/include/linux/calc64.h:25:17: originally declared here
linux/include/linux/calc64.h:25:17: warning: symbol '__mod' shadows an earlier one
linux/include/linux/calc64.h:25:17: originally declared here

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] SB1: Fix modpost warning.
Ralf Baechle [Tue, 10 Jul 2007 15:10:56 +0000 (16:10 +0100)]
[MIPS] SB1: Fix modpost warning.

  MODPOST vmlinux
WARNING: arch/mips/mm/built-in.o(.text+0x1978): Section mismatch: reference to .init.text:except_vec2_sb1 (between 'sb1_cache_init' and 'sb1_flush_cache_sigtramp')
WARNING: arch/mips/mm/built-in.o(.text+0x1988): Section mismatch: reference to .init.text:except_vec2_sb1 (between 'sb1_cache_init' and 'sb1_flush_cache_sigtramp')

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] PNX: Fix modpost warnings.
Ralf Baechle [Tue, 10 Jul 2007 14:04:06 +0000 (15:04 +0100)]
[MIPS] PNX: Fix modpost warnings.

  MODPOST vmlinux
WARNING: arch/mips/philips/pnx8550/common/built-in.o(.text+0xd40): Section mismatch: reference to .init.data: (after 'pnx8550_platform_init')
WARNING: arch/mips/philips/pnx8550/common/built-in.o(.text+0xd44): Section mismatch: reference to .init.data: (after 'pnx8550_platform_init')

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Alchemy: Fix modpost warnings.
Ralf Baechle [Tue, 10 Jul 2007 08:35:12 +0000 (09:35 +0100)]
[MIPS] Alchemy: Fix modpost warnings.

  MODPOST vmlinux
WARNING: arch/mips/au1000/common/built-in.o(.text+0x1750): Section mismatch: reference to .init.data: (between 'au1xxx_platform_init' and '__fixup_bigphys_addr')
WARNING: arch/mips/au1000/common/built-in.o(.text+0x1754): Section mismatch: reference to .init.data: (between 'au1xxx_platform_init' and '__fixup_bigphys_addr')

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Non-FPAFF: Fix warning.
Ralf Baechle [Tue, 10 Jul 2007 07:59:17 +0000 (08:59 +0100)]
[MIPS] Non-FPAFF: Fix warning.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] DEC: Fix modpost warning.
Ralf Baechle [Tue, 10 Jul 2007 07:14:15 +0000 (08:14 +0100)]
[MIPS] DEC: Fix modpost warning.

  LD      vmlinux
  SYSMAP  System.map
  SYSMAP  .tmp_System.map
  MODPOST vmlinux
WARNING: drivers/built-in.o(.data+0x2480): Section mismatch: reference to .init.text: (between 'sercons' and 'ds_parms')

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] MIPSsim: Enable MIPSsim virtual network driver.
Ralf Baechle [Mon, 9 Jul 2007 18:20:20 +0000 (19:20 +0100)]
[MIPS] MIPSsim: Enable MIPSsim virtual network driver.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 years ago[MIPS] Delete Ocelot 3 support.
Ralf Baechle [Mon, 9 Jul 2007 15:29:16 +0000 (16:29 +0100)]
[MIPS] Delete Ocelot 3 support.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>