sfrench/cifs-2.6.git
16 years agohisax_fcpcipnp: move request_irq later in probe
Kyle McMartin [Tue, 4 Mar 2008 22:29:26 +0000 (14:29 -0800)]
hisax_fcpcipnp: move request_irq later in probe

After a quick glance at the code, we're getting the DEBUG_SHIRQ spurious
interrupt before we have the adapter template filled in.  Real interrupts
appear to be turned on by fcpci*_init(), so move request_irq until just before
that.

Signed-off-by: Kyle McMartin <kmcmartin@redhat.com>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoeCryptfs: make ecryptfs_prepare_write decrypt the page
Michael Halcrow [Tue, 4 Mar 2008 22:29:24 +0000 (14:29 -0800)]
eCryptfs: make ecryptfs_prepare_write decrypt the page

When the page is not up to date, ecryptfs_prepare_write() should be
acting much like ecryptfs_readpage(). This includes the painfully
obvious step of actually decrypting the page contents read from the
lower encrypted file.

Note that this patch resolves a bug in eCryptfs in 2.6.24 that one can
produce with these steps:

# mount -t ecryptfs /secret /secret
# echo "abc" > /secret/file.txt
# umount /secret
# mount -t ecryptfs /secret /secret
# echo "def" >> /secret/file.txt
# cat /secret/file.txt

Without this patch, the resulting data returned from cat is likely to
be something other than "abc\ndef\n".

(Thanks to Benedikt Driessen for reporting this.)

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: Benedikt Driessen <bdriessen@escrypt.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocris: correct syscall numbers in unistd.h for timerfd_settime and timerfd_gettime
Jesper Nilsson [Tue, 4 Mar 2008 22:29:23 +0000 (14:29 -0800)]
cris: correct syscall numbers in unistd.h for timerfd_settime and timerfd_gettime

Last commit for unistd was not correct, it only had a partial update of
syscall numbers for __NR_timerfd_settime and __NR_timerfd_gettime.  Also,
NR_syscalls was not incremented for the new syscalls.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocris: correct usage of __user for copy to and from user space in lib/usercopy and...
Jesper Nilsson [Tue, 4 Mar 2008 22:29:23 +0000 (14:29 -0800)]
cris: correct usage of __user for copy to and from user space in lib/usercopy and uaccess.h

Function __copy_user_zeroing in arch/lib/usercopy.c had the wrong parameter
set as __user, and in include/asm-cris/uaccess.h, it was not set at all for
some of the calling functions.

This will cut the number of warnings quite dramatically when using sparse.

While we're here, remove useless CVS log and correct confusing typo.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoACPI: thinkpad-acpi: fix hotkey_get_tablet_mode
Henrique de Moraes Holschuh [Tue, 4 Mar 2008 22:29:21 +0000 (14:29 -0800)]
ACPI: thinkpad-acpi: fix hotkey_get_tablet_mode

I used the wrong return convention on hotkey_get_tablet_mode(), breaking a lot
of stuff.  Bad Henrique!

Fix it to return the status in the parameter-by-reference, and IO status on
the function return value.  Duh.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Lukas Hejtmanek <xhejtman@ics.muni.cz>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofs/reiserfs/super.c: correct use of ! and &
Julia Lawall [Tue, 4 Mar 2008 22:29:20 +0000 (14:29 -0800)]
fs/reiserfs/super.c: correct use of ! and &

In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337 ("wmi: (!x & y)
strikes again"), a bug was fixed that involved converting !x & y to !(x
& y).  The code below shows the same pattern, and thus should perhaps be
fixed in the same way.

This is not tested and clearly changes the semantics, so it is only
something to consider.

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

// <smpl>
@@ expression E1,E2; @@
(
  !E1 & !E2
|
- !E1 & E2
+ !(E1 & E2)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Jan Kara <jack@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodrivers/serial/m32r_sio.c: correct use of ! and &
Julia Lawall [Tue, 4 Mar 2008 22:29:19 +0000 (14:29 -0800)]
drivers/serial/m32r_sio.c: correct use of ! and &

In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337 ("wmi: (!x & y)
strikes again"), a bug was fixed that involved converting !x & y to !(x
& y).  The code below shows the same pattern, and thus should perhaps be
fixed in the same way.

This is not tested and clearly changes the semantics, so it is only
something to consider.

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

// <smpl>
@@ expression E1,E2; @@
(
  !E1 & !E2
|
- !E1 & E2
+ !(E1 & E2)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodrivers/isdn: correct use of ! and &
Julia Lawall [Tue, 4 Mar 2008 22:29:18 +0000 (14:29 -0800)]
drivers/isdn: correct use of ! and &

In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337 ("wmi: (!x & y)
strikes again"), a bug was fixed that involved converting !x & y to !(x
& y).  The code below shows the same pattern, and thus should perhaps be
fixed in the same way.

This is not tested and clearly changes the semantics, so it is only
something to consider.

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

// <smpl>
@@ expression E1,E2; @@
(
  !E1 & !E2
|
- !E1 & E2
+ !(E1 & E2)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agodrivers/char/isicom.c: correct use of ! and &
Julia Lawall [Tue, 4 Mar 2008 22:29:17 +0000 (14:29 -0800)]
drivers/char/isicom.c: correct use of ! and &

In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337 ("wmi: (!x & y)
strikes again"), a bug was fixed that involved converting !x & y to !(x
& y).  The code below shows the same pattern, and thus should perhaps be
fixed in the same way.

This is not tested and clearly changes the semantics, so it is only
something to consider.

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

// <smpl>
@@ expression E1,E2; @@
(
  !E1 & !E2
|
- !E1 & E2
+ !(E1 & E2)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: fix oops on NULL lru list
Hugh Dickins [Tue, 4 Mar 2008 22:29:16 +0000 (14:29 -0800)]
memcg: fix oops on NULL lru list

While testing force_empty, during an exit_mmap, __mem_cgroup_remove_list
called from mem_cgroup_uncharge_page oopsed on a NULL pointer in the lru list.
 I couldn't see what racing tasks on other cpus were doing, but surmise that
another must have been in mem_cgroup_charge_common on the same page, between
its unlock_page_cgroup and spin_lock_irqsave near done (thanks to that kzalloc
which I'd almost changed to a kmalloc).

Normally such a race cannot happen, the ref_cnt prevents it, the final
uncharge cannot race with the initial charge.  But force_empty buggers the
ref_cnt, that's what it's all about; and thereafter forced pages are
vulnerable to races such as this (just think of a shared page also mapped into
an mm of another mem_cgroup than that just emptied).  And remain vulnerable
until they're freed indefinitely later.

This patch just fixes the oops by moving the unlock_page_cgroups down below
adding to and removing from the list (only possible given the previous patch);
and while we're at it, we might as well make it an invariant that
page->page_cgroup is always set while pc is on lru.

But this behaviour of force_empty seems highly unsatisfactory to me: why have
a ref_cnt if we always have to cope with it being violated (as in the earlier
page migration patch).  We may prefer force_empty to move pages to an orphan
mem_cgroup (could be the root, but better not), from which other cgroups could
recover them; we might need to reverse the locking again; but no time now for
such concerns.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: simplify force_empty and move_lists
Hirokazu Takahashi [Tue, 4 Mar 2008 22:29:15 +0000 (14:29 -0800)]
memcg: simplify force_empty and move_lists

As for force_empty, though this may not be the main topic here,
mem_cgroup_force_empty_list() can be implemented simpler.  It is possible to
make the function just call mem_cgroup_uncharge_page() instead of releasing
page_cgroups by itself.  The tip is to call get_page() before invoking
mem_cgroup_uncharge_page(), so the page won't be released during this
function.

Kamezawa-san points out that by the time mem_cgroup_uncharge_page() uncharges,
the page might have been reassigned to an lru of a different mem_cgroup, and
now be emptied from that; but Hugh claims that's okay, the end state is the
same as when it hasn't gone to another list.

And once force_empty stops taking lock_page_cgroup within mz->lru_lock,
mem_cgroup_move_lists() can be simplified to take mz->lru_lock directly while
holding page_cgroup lock (but still has to use try_lock_page_cgroup).

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: fix mem_cgroup_move_lists locking
Hugh Dickins [Tue, 4 Mar 2008 22:29:13 +0000 (14:29 -0800)]
memcg: fix mem_cgroup_move_lists locking

Ever since the VM_BUG_ON(page_get_page_cgroup(page)) (now Bad page state) went
into page freeing, I've hit it from time to time in testing on some machines,
sometimes only after many days.  Recently found a machine which could usually
produce it within a few hours, which got me there at last.

The culprit is mem_cgroup_move_lists, whose locking is inadequate; and the
arrangement of structures was such that you got page_cgroups from the lru list
neatly put on to SLUB's freelist.  Kamezawa-san identified the same hole
independently.

The main problem was that it was missing the lock_page_cgroup it needs to
safely page_get_page_cgroup; but it's tricky to go beyond that too, and I
couldn't do it with SLAB_DESTROY_BY_RCU as I'd expected.  See the code for
comments on the constraints.

This patch immediately gets replaced by a simpler one from Hirokazu-san; but
is it just foolish pride that tells me to put this one on record, in case we
need to come back to it later?

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: css_put after remove_list
Hugh Dickins [Tue, 4 Mar 2008 22:29:12 +0000 (14:29 -0800)]
memcg: css_put after remove_list

mem_cgroup_uncharge_page does css_put on the mem_cgroup before uncharging from
it, and before removing page_cgroup from one of its lru lists: isn't there a
danger that struct mem_cgroup memory could be freed and reused before
completing that, so corrupting something?  Never seen it, and for all I know
there may be other constraints which make it impossible; but let's be
defensive and reverse the ordering there.

mem_cgroup_force_empty_list is safe because there's an extra css_get around
all its works; but even so, change its ordering the same way round, to help
get in the habit of doing it like this.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: remove clear_page_cgroup and atomics
Hugh Dickins [Tue, 4 Mar 2008 22:29:11 +0000 (14:29 -0800)]
memcg: remove clear_page_cgroup and atomics

Remove clear_page_cgroup: it's an unhelpful helper, see for example how
mem_cgroup_uncharge_page had to unlock_page_cgroup just in order to call it
(serious races from that?  I'm not sure).

Once that's gone, you can see it's pointless for page_cgroup's ref_cnt to be
atomic: it's always manipulated under lock_page_cgroup, except where
force_empty unilaterally reset it to 0 (and how does uncharge's
atomic_dec_and_test protect against that?).

Simplify this page_cgroup locking: if you've got the lock and the pc is
attached, then the ref_cnt must be positive: VM_BUG_ONs to check that, and to
check that pc->page matches page (we're on the way to finding why sometimes it
doesn't, but this patch doesn't fix that).

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: memcontrol uninlined and static
Hugh Dickins [Tue, 4 Mar 2008 22:29:10 +0000 (14:29 -0800)]
memcg: memcontrol uninlined and static

More cleanup to memcontrol.c, this time changing some of the code generated.
Let the compiler decide what to inline (except for page_cgroup_locked which is
only used when CONFIG_DEBUG_VM): the __always_inline on lock_page_cgroup etc.
was quite a waste since bit_spin_lock etc.  are inlines in a header file; made
mem_cgroup_force_empty and mem_cgroup_write_strategy static.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: memcontrol whitespace cleanups
Hugh Dickins [Tue, 4 Mar 2008 22:29:09 +0000 (14:29 -0800)]
memcg: memcontrol whitespace cleanups

Sorry, before getting down to more important changes, I'd like to do some
cleanup in memcontrol.c.  This patch doesn't change the code generated, but
cleans up whitespace, moves up a double declaration, removes an unused enum,
removes void returns, removes misleading comments, that kind of thing.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: remove mem_cgroup_uncharge
Hugh Dickins [Tue, 4 Mar 2008 22:29:08 +0000 (14:29 -0800)]
memcg: remove mem_cgroup_uncharge

Nothing uses mem_cgroup_uncharge apart from mem_cgroup_uncharge_page, (a
trivial wrapper around it) and mem_cgroup_end_migration (which does the same
as mem_cgroup_uncharge_page).  And it often ends up having to lock just to let
its caller unlock.  Remove it (but leave the silly locking until a later
patch).

Moved mem_cgroup_cache_charge next to mem_cgroup_charge in memcontrol.h.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: mem_cgroup_charge never NULL
Hugh Dickins [Tue, 4 Mar 2008 22:29:08 +0000 (14:29 -0800)]
memcg: mem_cgroup_charge never NULL

My memcgroup patch to fix hang with shmem/tmpfs added NULL page handling to
mem_cgroup_charge_common.  It seemed convenient at the time, but hard to
justify now: there's a perfectly appropriate swappage to charge and uncharge
instead, this is not on any hot path through shmem_getpage, and no performance
hit was observed from the slight extra overhead.

So revert that NULL page handling from mem_cgroup_charge_common; and make it
clearer by bringing page_cgroup_assign_new_page_cgroup into its body - that
was a helper I found more of a hindrance to understanding.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: bad page if page_cgroup when free
Hugh Dickins [Tue, 4 Mar 2008 22:29:07 +0000 (14:29 -0800)]
memcg: bad page if page_cgroup when free

Replace free_hot_cold_page's VM_BUG_ON(page_get_page_cgroup(page)) by a "Bad
page state" and clear: most users don't have CONFIG_DEBUG_VM on, and if it
were set here, it'd likely cause corruption when the page is reused.

Don't use page_assign_page_cgroup to clear it: that should be private to
memcontrol.c, and always called with the lock taken; and memmap_init_zone
doesn't need it either - like page->mapping and other pointers throughout the
kernel, Linux assumes pointers in zeroed structures are NULL pointers.

Instead use page_reset_bad_cgroup, added to memcontrol.h for this only.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: fix VM_BUG_ON from page migration
Hugh Dickins [Tue, 4 Mar 2008 22:29:06 +0000 (14:29 -0800)]
memcg: fix VM_BUG_ON from page migration

Page migration gave me free_hot_cold_page's VM_BUG_ON page->page_cgroup.
remove_migration_pte was calling mem_cgroup_charge on the new page whenever it
found a swap pte, before it had determined it to be a migration entry.  That
left a surplus reference count on the page_cgroup, so it was still attached
when the page was later freed.

Move that mem_cgroup_charge down to where we're sure it's a migration entry.
We were already under i_mmap_lock or anon_vma->lock, so its GFP_KERNEL was
already inappropriate: change that to GFP_ATOMIC.

It's essential that remove_migration_pte removes all the migration entries,
other crashes follow if not.  So proceed even when the charge fails: normally
it cannot, but after a mem_cgroup_force_empty it might - comment in the code.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: when do_swap's do_wp_page fails
Hugh Dickins [Tue, 4 Mar 2008 22:29:04 +0000 (14:29 -0800)]
memcg: when do_swap's do_wp_page fails

Don't uncharge when do_swap_page's call to do_wp_page fails: the page which
was charged for is there in the pagetable, and will be correctly uncharged
when that area is unmapped - it was only its COWing which failed.

And while we're here, remove earlier XXX comment: yes, OR in do_wp_page's
return value (maybe VM_FAULT_WRITE) with do_swap_page's there; but if it
fails, mask out success bits, which might confuse some arches e.g.  sparc.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: page_cache_release not __free_page
Hugh Dickins [Tue, 4 Mar 2008 22:29:04 +0000 (14:29 -0800)]
memcg: page_cache_release not __free_page

There's nothing wrong with mem_cgroup_charge failure in do_wp_page and
do_anonymous page using __free_page, but it does look odd when nearby code
uses page_cache_release: use that instead (while turning a blind eye to
ancient inconsistencies of page_cache_release versus put_page).

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: move_lists on page not page_cgroup
Hugh Dickins [Tue, 4 Mar 2008 22:29:03 +0000 (14:29 -0800)]
memcg: move_lists on page not page_cgroup

Each caller of mem_cgroup_move_lists is having to use page_get_page_cgroup:
it's more convenient if it acts upon the page itself not the page_cgroup; and
in a later patch this becomes important to handle within memcontrol.c.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemcg: mm_match_cgroup not vm_match_cgroup
Hugh Dickins [Tue, 4 Mar 2008 22:29:01 +0000 (14:29 -0800)]
memcg: mm_match_cgroup not vm_match_cgroup

vm_match_cgroup is a perverse name for a macro to match mm with cgroup: rename
it mm_match_cgroup, matching mm_init_cgroup and mm_free_cgroup.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomarkers: add an if(0) to __mark_check_format()
Mathieu Desnoyers [Tue, 4 Mar 2008 22:29:00 +0000 (14:29 -0800)]
markers: add an if(0) to __mark_check_format()

Wrap __mark_check_format() into an if(0) to make sure that parameters such as

trace_mark(mm_page_alloc, "order %u pfn %lu", order, page?page_to_pfn(page):0);

(where page_to_pfn() has side-effects) won't generate code because of the
__mark_check_format().

Thanks to Jan Kiszka for reporting this.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "Frank Ch. Eigler" <fche@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomarkers: don't risk NULL deref in marker
Jesper Juhl [Tue, 4 Mar 2008 22:29:00 +0000 (14:29 -0800)]
markers: don't risk NULL deref in marker

get_marker() may return NULL, so test for it.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago.gitignore: ignore emacs backup and temporary files.
Chris Dearman [Tue, 4 Mar 2008 22:28:59 +0000 (14:28 -0800)]
.gitignore: ignore emacs backup and temporary files.

Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoalpha: remove unused DEBUG_FORCEDAC define in IOMMU
FUJITA Tomonori [Tue, 4 Mar 2008 22:28:58 +0000 (14:28 -0800)]
alpha: remove unused DEBUG_FORCEDAC define in IOMMU

This just removes unused DEBUG_FORCEDAC define in the IOMMU code.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoalpha: make IOMMU respect the segment boundary limits
FUJITA Tomonori [Tue, 4 Mar 2008 22:28:57 +0000 (14:28 -0800)]
alpha: make IOMMU respect the segment boundary limits

This patch makes the IOMMU code not allocate a memory area spanning LLD's
segment boundary.

is_span_boundary() judges whether a memory area spans LLD's segment boundary.
If iommu_arena_find_pages() finds such a area, it tries to find the next
available memory area.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoalpha: IOMMU had better access to the free space bitmap at only one place
FUJITA Tomonori [Tue, 4 Mar 2008 22:28:57 +0000 (14:28 -0800)]
alpha: IOMMU had better access to the free space bitmap at only one place

iommu_arena_find_pages duplicates the code to access to the bitmap for free
space management.  This patch convert the IOMMU code to have only one place to
access the bitmap, in the popular way that other IOMMUs (e.g.  POWER and
SPARC) do.

This patch is preparation for modifications to fix the IOMMU segment boundary
problem.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoalpha: convert IOMMU to use ALIGN()
FUJITA Tomonori [Tue, 4 Mar 2008 22:28:54 +0000 (14:28 -0800)]
alpha: convert IOMMU to use ALIGN()

This patch is preparation for modifications to fix the IOMMU segment boundary
problem.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoinclude falloc.h in header-y
Eric Sandeen [Tue, 4 Mar 2008 22:28:53 +0000 (14:28 -0800)]
include falloc.h in header-y

Include falloc.h in header-y; it defines a flag for the fallocate sysctl.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoCRIS: Import string.c (memcpy) from newlib: fixes compile error with gcc 4
Jesper Nilsson [Tue, 4 Mar 2008 22:28:52 +0000 (14:28 -0800)]
CRIS: Import string.c (memcpy) from newlib: fixes compile error with gcc 4

Adrian Bunk reported another compile error with a SVN head GCC:

...
  CC      arch/cris/arch-v10/lib/string.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/string.c:138:
error: lvalue required as increment operand
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/string.c:138:
error: lvalue required as increment operand
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/cris/arch-v10/lib/string.c:139:
error: lvalue required as increment operand
...

This is due to the use of the construct:

*((long*)dst)++ = lc;

Which isn't legal since casts don't return an lvalue.

The solution is to import the implementation from newlib,
which is continually autotested together with GCC mainline,
and uses the construct:

*(long *) dst = lc; dst += 4;

Since this is an import of a file from newlib, I'm not touching
the formatting or correcting any checkpatch errors.

As for the earlier fix for memset.c, even if the two files for
CRIS v10 and CRIS v32 are identical at the moment, it might
be possible to tweak the CRIS v32 version.
Thus, I'm not yet folding them into the same file, at least not
until we've done some research on it.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoipwireless: fix potential tty == NULL dereference
David Sterba [Tue, 4 Mar 2008 22:28:50 +0000 (14:28 -0800)]
ipwireless: fix potential tty == NULL dereference

The Coverity checker spotted the following inconsequent NULL checking in
drivers/char/pcmcia/ipwireless/network.c:ipwireless_network_packet_received()

if (tty && channel_idx == IPW_CHANNEL_RAS
&& (network->ras_control_lines &
IPW_CONTROL_LINE_DCD) != 0
&& ipwireless_tty_is_modem(tty)) {
...
else
ipwireless_tty_received(tty, data, length);

Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosm501: add support for the SM502 programmable PLL
Ville Syrjala [Tue, 4 Mar 2008 22:28:50 +0000 (14:28 -0800)]
sm501: add support for the SM502 programmable PLL

SM502 has a programmable PLL which can provide the panel pixel clock instead
of the 288MHz and 336MHz PLLs.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosm501: remove a duplicated table
Ville Syrjala [Tue, 4 Mar 2008 22:28:49 +0000 (14:28 -0800)]
sm501: remove a duplicated table

misc_div is a subset of px_div so eliminate the smaller table.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosm501fb: fix timing limits
Ville Syrjala [Tue, 4 Mar 2008 22:28:49 +0000 (14:28 -0800)]
sm501fb: fix timing limits

Vertical sync height register can only hold 6 bits.  Fix the hsync start test
to use > instead of >=.  Also add a few clarifying comments.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosm501fb: set transp.offset to 0 in 8bpp and 16bpp modes
Ville Syrjala [Tue, 4 Mar 2008 22:28:48 +0000 (14:28 -0800)]
sm501fb: set transp.offset to 0 in 8bpp and 16bpp modes

Even though it may not be strictly necessary transp.offset should probably be
0 when alpha channel is not available.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosm501fb: RGB offsets are reversed in 16bpp modes
Ville Syrjala [Tue, 4 Mar 2008 22:28:47 +0000 (14:28 -0800)]
sm501fb: RGB offsets are reversed in 16bpp modes

The RGB offsets were reversed in 16bpp modes.  Simply trying to reverse the
offsets when endianness differs is clearly the wrong thing to do but that is
an issue for another patch.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosm501fb: direct color visual does not work
Ville Syrjala [Tue, 4 Mar 2008 22:28:46 +0000 (14:28 -0800)]
sm501fb: direct color visual does not work

The sm501fb palette code clearly does not handle direct color so change the
driver to use true color visual for 16bpp.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Acked-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agondelay(): switch to C function to avoid 64-bit division
Andrew Morton [Tue, 4 Mar 2008 22:28:45 +0000 (14:28 -0800)]
ndelay(): switch to C function to avoid 64-bit division

We should be able to do ndelay(some_u64), but that can cause a call to
__divdi3() to be emitted because the ndelay() macros does a divide.

Fix it by switching to static inline which will force the u64 arg to be
treated as an unsigned long.  udelay() takes an unsigned long arg.

[bunk@kernel.org: reported m68k build breakage]
Cc: Adrian Bunk <bunk@kernel.org>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: Martin Michlmayr <tbm@cyrius.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agods1wm: report bus reset error
Anton Vorontsov [Tue, 4 Mar 2008 22:28:44 +0000 (14:28 -0800)]
ds1wm: report bus reset error

The patch replaces dev_dbg() by dev_err(), so the user could actually see the
error, instead of wondering why w1 doesn't work.  The root cause of the bus
reset error isn't yet debugged though, but this sometimes happens on iPaq
H5555.

And while I'm at it, some cosmetic cleanups also made (few lines were using
spaces instead of tabs).

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agods1wm: should check for IS_ERR(clk) instead of NULL
Anton Vorontsov [Tue, 4 Mar 2008 22:28:43 +0000 (14:28 -0800)]
ds1wm: should check for IS_ERR(clk) instead of NULL

On the error condition clk_get() returns ERR_PTR(..), so checking for NULL
doesn't work.  ds1wm module causes a kernel oops when ds1wm clock isn't
registered.

This patch converts NULL check to IS_ERR(), plus uses PTR_ERR()
for the return code.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agopowerpc: mpc5200: fix build error on mpc52xx_psc_spi device driver
Grant Likely [Tue, 4 Mar 2008 22:28:42 +0000 (14:28 -0800)]
powerpc: mpc5200: fix build error on mpc52xx_psc_spi device driver

Commit id 94f389485e27641348c1951ab8d65157122a8939 (Separate MPC52xx PSC FIOF
regsiters from the rest of PSC) split the PSC fifo registers away from the
core PSC regs.  Doing so broke the mpc52xx_psc_spi driver.

This patch teaches the mpc52xx_psc_spi driver about the new PSC fifo
register definitions.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: David Brownell <david-b@pacbell.net>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agopktcdvd: reduce stack consumption
Peter Osterlund [Tue, 4 Mar 2008 22:28:41 +0000 (14:28 -0800)]
pktcdvd: reduce stack consumption

On my system, pkt_open() consumes 584 bytes because the compiler decides to
inline lots of functions that would not normally be part of long call chains.
The following patch fixes that problem on my system.

Signed-off-by: Peter Osterlund <petero2@telia.com>
Cc: Nix <nix@esperi.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoadd noinline_for_stack
Andrew Morton [Tue, 4 Mar 2008 22:28:40 +0000 (14:28 -0800)]
add noinline_for_stack

People are adding `noinline' in various places to prevent excess stack
consumption due to gcc inlining.  But once this is done, it is quite unobvious
why the `noinline' is present in the code.  We can comment each and every
site, or we can use noinline_for_stack.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotridentfb: resource management fixes in probe function
Krzysztof Helt [Tue, 4 Mar 2008 22:28:39 +0000 (14:28 -0800)]
tridentfb: resource management fixes in probe function

Correct error paths in probe function.

The probe function enables mmio mode so it important to disable the mmio
mode before exiting the probe function.  Otherwise, the console is left in
unusable state (garbled fonts at least, lock up at worst).

[akpm@linux-foundation.org: cleanups]
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMemory controller: rename to Memory Resource Controller
Balbir Singh [Tue, 4 Mar 2008 22:28:39 +0000 (14:28 -0800)]
Memory controller: rename to Memory Resource Controller

Rename Memory Controller to Memory Resource Controller.  Reflect the same
changes in the CONFIG definition for the Memory Resource Controller.  Group
together the config options for Resource Counters and Memory Resource
Controller.

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoKprobes: move kprobe examples to samples/
Ananth N Mavinakayanahalli [Tue, 4 Mar 2008 22:28:38 +0000 (14:28 -0800)]
Kprobes: move kprobe examples to samples/

Move kprobes examples from Documentation/kprobes.txt to under samples/.
Patch originally by Randy Dunlap.

o Updated the patch to apply on 2.6.25-rc3
o Modified examples code to build on multiple architectures. Currently,
  the kprobe and jprobe examples code works for x86 and powerpc
o Cleaned up unneeded #includes
o Cleaned up Kconfig per Sam Ravnborg's suggestions to fix build break
  on archs that don't have kretprobes
o Implemented suggestions by Mathieu Desnoyers on CONFIG_KRETPROBES
o Included Andrew Morton's cleanup based on x86-git
o Modified kretprobe_example to act as a arch-agnostic module to
  determine routine execution times:
Use 'modprobe kretprobe_example func=<func_name>' to determine
execution time of func_name in nanoseconds.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoKprobes: indicate kretprobe support in Kconfig
Ananth N Mavinakayanahalli [Tue, 4 Mar 2008 22:28:37 +0000 (14:28 -0800)]
Kprobes: indicate kretprobe support in Kconfig

Add CONFIG_HAVE_KRETPROBES to the arch/<arch>/Kconfig file for relevant
architectures with kprobes support.  This facilitates easy handling of
in-kernel modules (like samples/kprobes/kretprobe_example.c) that depend on
kretprobes being present in the kernel.

Thanks to Sam Ravnborg for helping make the patch more lean.

Per Mathieu's suggestion, added CONFIG_KRETPROBES and fixed up dependencies.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoVT notifier fix for VT switch
Samuel Thibault [Tue, 4 Mar 2008 22:28:36 +0000 (14:28 -0800)]
VT notifier fix for VT switch

VT notifier callbacks need to be aware of console switches.  This is already
partially done from console_callback(), but at that time fg_console, cursor
positions, etc.  are not yet updated and hence screen readers fetch the old
values.

This adds an update notify after all of the values are updated in
redraw_screen(vc, 1).

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoalloc_percpu() fails to allocate percpu data
Eric Dumazet [Tue, 4 Mar 2008 22:28:35 +0000 (14:28 -0800)]
alloc_percpu() fails to allocate percpu data

Some oprofile results obtained while using tbench on a 2x2 cpu machine were
very surprising.

For example, loopback_xmit() function was using high number of cpu cycles
to perform the statistic updates, supposed to be real cheap since they use
percpu data

        pcpu_lstats = netdev_priv(dev);
        lb_stats = per_cpu_ptr(pcpu_lstats, smp_processor_id());
        lb_stats->packets++;  /* HERE : serious contention */
        lb_stats->bytes += skb->len;

struct pcpu_lstats is a small structure containing two longs.  It appears
that on my 32bits platform, alloc_percpu(8) allocates a single cache line,
instead of giving to each cpu a separate cache line.

Using the following patch gave me impressive boost in various benchmarks
( 6 % in tbench)
(all percpu_counters hit this bug too)

Long term fix (ie >= 2.6.26) would be to let each CPU allocate their own
block of memory, so that we dont need to roudup sizes to L1_CACHE_BYTES, or
merging the SGI stuff of course...

Note : SLUB vs SLAB is important here to *show* the improvement, since they
dont have the same minimum allocation sizes (8 bytes vs 32 bytes).  This
could very well explain regressions some guys reported when they switched
to SLUB.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agovfs: fix NULL pointer dereference in fsync_buffers_list()
Jan Kara [Tue, 4 Mar 2008 22:28:33 +0000 (14:28 -0800)]
vfs: fix NULL pointer dereference in fsync_buffers_list()

Fix NULL pointer dereference in fsync_buffers_list() introduced by recent fix
of races in private_list handling.  Since bh->b_assoc_map has been cleared in
__remove_assoc_queue() we should really use original value stored in the
'mapping' variable.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agozlc_setup(): handle jiffies wraparound
KOSAKI Motohiro [Tue, 4 Mar 2008 22:28:32 +0000 (14:28 -0800)]
zlc_setup(): handle jiffies wraparound

jiffies subtraction may cause an overflow problem.  It should be using
time_after().

[akpm@linux-foundation.org: include jiffies.h]
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Cc: Paul Jackson <pj@sgi.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoFix "Malformed early option 'loglevel'"
Alex Riesen [Tue, 4 Mar 2008 22:28:31 +0000 (14:28 -0800)]
Fix "Malformed early option 'loglevel'"

Keith Mannthey said:

  The parameter hotadd_percent is setup right but there is a "Malformed
  early option 'numa'" message.

Rusty Russell said:

  This happens when the function registered with early_param() returns
  non-zero.  __setup() functions return 1 if OK, module_param() and
  early_param() return 0 or a -ve error code.

For instance:

Linux version 2.6.25-rc3-t (raa@steel) (gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #22 SMP PREEMPT Tue Feb 26
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000003fff0000 (usable)
 BIOS-e820: 000000003fff0000 - 000000003fff3000 (ACPI NVS)
 BIOS-e820: 000000003fff3000 - 0000000040000000 (ACPI data)
 BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved)
Malformed early option 'loglevel'
127MB HIGHMEM available.
896MB LOWMEM available.

Command line:

BOOT_IMAGE=2.6.25-t ro root=809 ro console=ttyS0,57600n8 console=tty0 loglevel=5

Acked-by: Yinghai Lu <yhlu.kernel@gmai.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Keith Mannthey <kmannth@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocore dump: user_regset writeback
Roland McGrath [Tue, 4 Mar 2008 22:28:30 +0000 (14:28 -0800)]
core dump: user_regset writeback

This makes the user_regset-based core dump code call user_regset writeback
hooks when available.  This is necessary groundwork to allow IA64 to set
CORE_DUMP_USE_REGSET.

Cc: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoAdd memory resource controller maintainers
akpm@linux-foundation.org [Tue, 4 Mar 2008 22:28:29 +0000 (14:28 -0800)]
Add memory resource controller maintainers

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Paul Menage <menage@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoControl Groups: add Paul Menage as maintainer
Paul Menage [Tue, 4 Mar 2008 22:28:28 +0000 (14:28 -0800)]
Control Groups: add Paul Menage as maintainer

Control Groups: Add Paul Menage as maintainer

Signed-off-by: Paul Menage <menage@google.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agogpio: <linux/gpio.h> and "no GPIO support here" stubs
David Brownell [Tue, 4 Mar 2008 22:28:27 +0000 (14:28 -0800)]
gpio: <linux/gpio.h> and "no GPIO support here" stubs

Add a <linux/gpio.h> defining fail/warn stubs for GPIO calls on platforms that
don't support the GPIO programming interface.  That includes the arch-specific
implementation glue otherwise.

This facilitates a new model for GPIO usage: drivers that can use GPIOs if
they're available, but don't require them.  One example of such a driver is
NAND driver for various FreeScale chips.  On platforms update with GPIO
support, they can be used instead of a worst-case delay to verify that the
BUSY signal is off.

(Also includes a couple minor unrelated doc updates.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agospecialix.c: fix possible double-unlock
Harvey Harrison [Tue, 4 Mar 2008 22:28:26 +0000 (14:28 -0800)]
specialix.c: fix possible double-unlock

Noticed by sparse, trivial to see:
drivers/char/specialix.c:2112:3: warning: context imbalance in 'sx_throttle' - unexpected unlock

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc: add support for the S-35390A RTC chip
Byron Bradley [Tue, 4 Mar 2008 22:28:25 +0000 (14:28 -0800)]
rtc: add support for the S-35390A RTC chip

This adds basic get/set time support for the Seiko Instruments S-35390A.
This chip communicates using I2C and is used on the QNAP TS-109/TS-209 NAS
devices.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Byron Bradley <byron.bbradley@gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: David Brownell <david-b@pacbell.net>
Tested-by: Tim Ellis <tim@ngndg.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMemory Resource Controller use strstrip while parsing arguments
Balbir Singh [Tue, 4 Mar 2008 22:28:24 +0000 (14:28 -0800)]
Memory Resource Controller use strstrip while parsing arguments

The memory controller has a requirement that while writing values, we need
to use echo -n. This patch fixes the problem and makes the UI more consistent.

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoCRIS v10: Include mm.h instead of vmstat.h in kernel/time.c
Jesper Nilsson [Tue, 4 Mar 2008 22:28:23 +0000 (14:28 -0800)]
CRIS v10: Include mm.h instead of vmstat.h in kernel/time.c

Commit 2f569afd9ced9ebec9a6eb3dbf6f83429be0a7b4
(CONFIG_HIGHPTE vs. sub-page page tables) introduced use of
inc_zone_page_state and dec_zone_page_state in include/linux/mm.h.

Those are defined in include/linux/vmstat.h, but after it includes
mm.h, making it impossible to include vmstat.h since inc_zone_page_state
and dec_zone_page_state then would be undefined.

arch/cris/arch-v10/kernel/time.c does just this, which makes the
CRIS v10 build break with the following error:

...
  CC      arch/cris/arch-v10/kernel/time.o
In file included from include/linux/vmstat.h:7,
                 from arch/cris/arch-v10/kernel/time.c:17:
include/linux/mm.h: In function 'pgtable_page_ctor':
include/linux/mm.h:902: error: implicit declaration of function 'inc_zone_page_state'
include/linux/mm.h: In function 'pgtable_page_dtor':
include/linux/mm.h:908: error: implicit declaration of function 'dec_zone_page_state'
make[2]: *** [arch/cris/arch-v10/kernel/time.o] Error 1
make[1]: *** [arch/cris/arch-v10/kernel] Error 2
make: *** [sub-make] Error 2
...

By changing kernel/time.c to include linux/mm.h, the build succeeds.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoserial: add PNP ID GVC0303 for Archtek 3334BRV ISA modem
Bjorn Helgaas [Tue, 4 Mar 2008 22:28:21 +0000 (14:28 -0800)]
serial: add PNP ID GVC0303 for Archtek 3334BRV ISA modem

Thomas Lehmann <thomas.lehmann@alumni.tu-berlin.de> verified that this
entry works.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoupdate checkpatch.pl to version 0.15
Andy Whitcroft [Tue, 4 Mar 2008 22:28:20 +0000 (14:28 -0800)]
update checkpatch.pl to version 0.15

This version brings a number of minor fixes updating the type detector and
the unary tracker.  It also brings a few small fixes for false positives.
It also reverts the --file warning.  Of note:

 - limit CVS checks to added lines
 - improved type detections
 - fixes to the unary tracker

Andy Whitcroft (13):
      Version: 0.15
      EXPORT_SYMBOL checks need to accept array variables
      export checks must match DECLARE_foo and LIST_HEAD
      possible types: cleanup debugging missing line
      values: track values through preprocessor conditional paths
      typeof is actually a type
      possible types: detect definitions which cross lines
      values: include line numbers on value debug information
      values: ensure we find correctly record pending brackets
      values: simplify the brace history stack
      CVS keyword checks should only apply to added lines
      loosen spacing for comments
      allow braces for single statement blocks with multiline conditionals

Harvey Harrison (1):
      checkpatch: remove fastcall

Ingo Molnar (1):
      checkpatch.pl: revert wrong --file message

Uwe Kleine-Koenig (1):
      fix typo "goot" -> "good"

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Joel Schopp <jschopp@austin.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup: fix default notify_on_release setting
Li Zefan [Tue, 4 Mar 2008 22:28:19 +0000 (14:28 -0800)]
cgroup: fix default notify_on_release setting

The documentation says the default value of notify_on_release of a child
cgroup is inherited from its parent, which is reasonable, but the
implementation just sets the flag disabled.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agob43legacy: Fix module init message
Michael Buesch [Tue, 4 Mar 2008 19:31:13 +0000 (20:31 +0100)]
b43legacy: Fix module init message

This fixes the module init message to tell that the legacy
driver loaded. This makes it less confusing, in case both drivers are loaded.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agorndis_wlan: fix broken data copy
Jussi Kivilinna [Tue, 4 Mar 2008 18:05:27 +0000 (20:05 +0200)]
rndis_wlan: fix broken data copy

Replace broken code that attempted to copy 6 byte array to 64-bit
integer. Due to missing cast to 64-bit integer, left shift operation
were 32-bit and lead to bytes been copied over each other. New code
uses simple memcpy, for greater readability and efficiency.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: compare the current command with response
Sebastian Siewior [Tue, 4 Mar 2008 17:22:27 +0000 (18:22 +0100)]
libertas: compare the current command with response

instead of with itself.

Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: fix sanity check on sequence number in command response
David Woodhouse [Mon, 3 Mar 2008 11:20:12 +0000 (12:20 +0100)]
libertas: fix sanity check on sequence number in command response

Slightly more useful if we compare it against the sequence number of the
command we have outstanding, rather than comparing the reply with itself.

Doh. Pointed out by Sebastian Siewior

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agop54: fix eeprom parser length sanity checks
Johannes Berg [Fri, 29 Feb 2008 22:28:25 +0000 (23:28 +0100)]
p54: fix eeprom parser length sanity checks

When I called p54_parse_eeprom() on a hand-coded structure
I managed to make a small mistake with wrap->len which caused
a segfault a few lines down when trying to read entry->len.
This patch changes the validation code to avoid such problems.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agop54: fix EEPROM structure endianness
Johannes Berg [Fri, 29 Feb 2008 12:56:33 +0000 (13:56 +0100)]
p54: fix EEPROM structure endianness

Since the EEPROM structure is read from hardware, it is
always little endian, annotate that in the struct and
make sure to convert where applicable.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Michael Wu <flamingice@sourmilk.net>
Tested-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agossb: Add pcibios_enable_device() return value check
Yoichi Yuasa [Fri, 29 Feb 2008 10:09:31 +0000 (11:09 +0100)]
ssb: Add pcibios_enable_device() return value check

This patch has added pcibios_enable_device() return value check.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agorc80211-pid: fix rate adjustment
Stefano Brivio [Sun, 2 Mar 2008 10:33:10 +0000 (11:33 +0100)]
rc80211-pid: fix rate adjustment

Merge rate_control_pid_shift_adjust() to rate_control_pid_adjust_rate()
in order to make the learning algorithm aware of constraints on rates. Also
add some comments and rename variables.

This fixes a bug which prevented 802.11b/g non-AP STAs from working with
802.11b only AP STAs.

This patch was originally destined for 2.6.26, and is being backported
to fix a user reported problem in post-2.6.24 kernels.

Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agopci: hotplug: pciehp: fix error code path in hpc_power_off_slot
Kenji Kaneshige [Tue, 4 Mar 2008 21:01:14 +0000 (13:01 -0800)]
pci: hotplug: pciehp: fix error code path in hpc_power_off_slot

Fix the error code path in hpc_power_off_slot().

The Bad DLLP Mask bit must be restored before return.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Add DECLARE_PCI_DEVICE_TABLE macro
Jonas Bonn [Fri, 22 Feb 2008 10:02:21 +0000 (11:02 +0100)]
PCI: Add DECLARE_PCI_DEVICE_TABLE macro

The definitions of struct pci_device_id arrays should generally follow
the same pattern across the entire kernel.  This macro defines this
array as const and puts it into the __devinitconst section.

There are currently many definitions scattered about the kernel that
omit the __devinitdata modifier despite the documentation stating that
it should always be there.  These definitions really also should have
been const, which wasn't possible before but has become so with the
addition of the __devinitconst attribute.

Furthermore, there are definitions that use "const" and __devinitdata,
which is explicitly wrong but the compiler doesn't catch section
mismatches if there's only one such one case in the module (which is
often the case).

Adding the __devinitconst modifier where there was nothing before buys
us memory.  Adding the const modifier gives the compiler a chance to do
its thing.  Changing __devinitdata to __devinitconst where it was wrong
actually fixes some compiler errors in older (mid-release) kernels that
were patched over by "removing" the section attribute altogether (which
wastes memory).

This macro makes it pretty difficult to get this definition wrong in
the future...

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: fix up error messages for pci_bus registering
Greg Kroah-Hartman [Mon, 3 Mar 2008 22:47:13 +0000 (14:47 -0800)]
PCI: fix up error messages for pci_bus registering

Due to the class_device cleanup of pci_bus, the error messages when
things go wrong are incorrect.  So fix this up to properly report what
is really happening, if things go wrong.

Thanks to Kay for pointing out the issue.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: fix section mismatch warning in pci_scan_child_bus
Sam Ravnborg [Sun, 17 Feb 2008 09:45:28 +0000 (10:45 +0100)]
PCI: fix section mismatch warning in pci_scan_child_bus

Fix following warning:
WARNING: vmlinux.o(.text+0x47bdb1): Section mismatch in reference from the function pci_scan_child_bus() to the function .devinit.text:pcibios_fixup_bus()

We had plenty of functions that could be annotated __devinit but due to
the former restriction that exported symbols could not be annotated
they were not so.  So annotate these function and fix the references
from the pci/hotplug/* code to silence the resuting warnings.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: consolidate duplicated MSI enable functions
Bjorn Helgaas [Fri, 29 Feb 2008 23:04:39 +0000 (16:04 -0700)]
PCI: consolidate duplicated MSI enable functions

Two recent patches added basically the same code to turn on
HT MSI mapping:

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6bae1d96c6d7dde078994f6cb98235fd46f8736b
    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9dc625e72309e1c919ea3e7f51d0ffca96123787

There's no need to have both, so this patch removes one copy.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: use dev_printk in quirk messages
Bjorn Helgaas [Fri, 29 Feb 2008 23:12:18 +0000 (16:12 -0700)]
PCI: use dev_printk in quirk messages

Convert quirk printks to dev_printk().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi_sio - really enable EM1010PC
Sven Andersen [Tue, 4 Mar 2008 21:09:11 +0000 (22:09 +0100)]
USB: ftdi_sio - really enable EM1010PC

Add EM1010PC to ftdi_sio.c

Signed-off-by: Sven Andersen <s.andersen@cryonet.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove incorrect struct class_device from the printer gadget
Tony Jones [Thu, 21 Feb 2008 23:13:36 +0000 (00:13 +0100)]
USB: remove incorrect struct class_device from the printer gadget

This field does nothing, and should not be allowed to stick around
incase someone gets any other ideas...

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: pxa2xx_udc: fix misuse of clock enable/disable calls
Dmitry Baryshkov [Sat, 23 Feb 2008 01:17:19 +0000 (17:17 -0800)]
USB: pxa2xx_udc: fix misuse of clock enable/disable calls

Fix pxa2xx_udc to balance calls to clk_enable/clk_disable.

[db: remove inline #ifdefs for IXP non-support of <linux/clk.h> calls]

Signed-off-by: Dmitry Baryshkov dbaryshkov@gmail.com
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi_sio: Workaround for broken Matrix Orbital serial port
Kevin Vance [Sat, 1 Mar 2008 18:49:59 +0000 (13:49 -0500)]
USB: ftdi_sio: Workaround for broken Matrix Orbital serial port

Workaround for the FT232RL-based, Matrix Orbital VK204-25-USB serial port
added to the ftdi_sio driver.

The device has an invalid endpoint descriptor, which must be modified
before it can be used.

Signed-off-by: Kevin Vance <kvance@kvance.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Add support for AXESSTEL MV110H CDMA modem
Daniel Kozák [Tue, 4 Mar 2008 17:54:53 +0000 (18:54 +0100)]
USB: Add support for AXESSTEL MV110H CDMA modem

Add entry for Axesstel MV110H CDMA modem (ID: 1726:1000) to option driver

Signed-off-by: Daniel Kozák <kozzi11@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb-storage: update earlier scatter-gather bug fix
Alan Stern [Fri, 22 Feb 2008 22:00:06 +0000 (17:00 -0500)]
usb-storage: update earlier scatter-gather bug fix

This patch (as1037) makes a small update to the earlier as1035 patch.
The minimum-length computation shouldn't be done in
usb_stor_access_xfer_buf(), since that routine can be called multiple
times for a single transfer.  It should be done in
usb_stor_set_xfer_buf() instead, which gets called only once.

The way it is now isn't really _wrong_, but it isn't really _right_
either.  Moving the statement will be an improvement.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: isp116x: fix enumeration on boot
Anti Sullin [Mon, 3 Mar 2008 13:39:54 +0000 (15:39 +0200)]
USB: isp116x: fix enumeration on boot

This patch removes the buffering of the status register.
USB core behavior has changed a bit and this buffering was not refreshed
at the right time.  The core got buffered old value of HCRHPORT and it
did not detect any devices on boot.

Signed-off-by: Anti Sullin <anti.sullin@artecdesign.ee>
Acked by: Olav Kongas <ok@artecdesign.ee>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci: handle large bulk URBs correctly (again)
Misha Zhilin [Thu, 28 Feb 2008 02:05:24 +0000 (18:05 -0800)]
USB: ehci: handle large bulk URBs correctly (again)

USB: ehci: Fixes completion for multi-qtd URB the short read case

When use of urb->status in the EHCI driver was reworked last August
(commit 14c04c0f88f228fee1f412be91d6edcb935c78aa), a bug was inserted
in the handling of early completion for bulk transactions that need
more than one qTD (e.g. more than 20KB in one URB).

This patch resolves that problem by ensuring that the early completion
status is preserved until the URB is handed back to its submitter,
instead of resetting it after each qTD.

Signed-off-by: Misha Zhilin <misha@epiphan.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: spruce up the device blacklist
Alan Stern [Wed, 27 Feb 2008 20:43:47 +0000 (15:43 -0500)]
USB: spruce up the device blacklist

This patch (as1040) fixes up the blacklist of USB device quirks.  A
couple of lines are broken to comply with the 80-column rule, and
entries are sorted into the proper numerical order.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix comment of struct usb_interface
Lei Ming [Mon, 25 Feb 2008 10:07:28 +0000 (18:07 +0800)]
USB: fix comment of struct usb_interface

update the comment for the removed "driver" field  and  being
out-of-order of  @cur_altsetting and @num_altsetting.

Signed-off-by: Lei Ming <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: update Kconfig entry for USB_SUSPEND
Alan Stern [Mon, 25 Feb 2008 16:43:32 +0000 (11:43 -0500)]
USB: update Kconfig entry for USB_SUSPEND

This patch (as1039) updates the Kconfig entry for USB_SUSPEND.  The
out-of-date reference to "power/state" is fixed, autosuspend is
mentioned, and the dependency on EXPERIMENTAL is removed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: Add support for the mos7820/7840-based B&B USB/RS485 converter to mos7840.c
David Ludlow [Mon, 25 Feb 2008 22:30:52 +0000 (17:30 -0500)]
usb: Add support for the mos7820/7840-based B&B USB/RS485 converter to mos7840.c

Add support for the mos7820/7840-based B&B USOPTL4_2/USOPTL4_4 USB/RS485
converter to mos7840.c

Signed-off-by: Dave Ludlow <dave.ludlow@bay.ws>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodebugfs: fix sparse warnings
Harvey Harrison [Thu, 14 Feb 2008 01:08:16 +0000 (17:08 -0800)]
debugfs: fix sparse warnings

extern does not belong in C files, move declaration to linux/debugfs.h
fs/debugfs/file.c:42:30: warning: symbol 'debugfs_file_operations' was not declared. Should it be static?
fs/debugfs/file.c:54:31: warning: symbol 'debugfs_link_operations' was not declared. Should it be static?

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: Fix cleanup when failing device_add().
Cornelia Huck [Wed, 27 Feb 2008 14:38:23 +0000 (15:38 +0100)]
Driver core: Fix cleanup when failing device_add().

Driver core: Fix cleanup when failing device_add().

 - Don't call cleanup_device_parent() if we didn't call setup_parent().
 - dev->kobj.parent may be NULL when cleanup_device_parent() is called,
   so we need to handle glue_dir == NULL in cleanup_glue_dir().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: Remove dpm_sysfs_remove() from error path of device_add()
Rafael J. Wysocki [Mon, 3 Mar 2008 22:46:51 +0000 (23:46 +0100)]
driver core: Remove dpm_sysfs_remove() from error path of device_add()

Since device_pm_remove(dev) calls dpm_sysfs_remove(dev), it's
incorrect to call the latter after the former in the device_add()
error path.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: fix new mutex-locking bug in the PM core
Alan Stern [Fri, 29 Feb 2008 16:50:22 +0000 (11:50 -0500)]
PM: fix new mutex-locking bug in the PM core

This patch (as1041) fixes a bug introduced by the
acquire-all-device-semaphores reversion.  The error pathway of
dpm_suspend() fails to reacquire a mutex it should be holding.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Do not acquire device semaphores upfront during suspend
Rafael J. Wysocki [Sun, 24 Feb 2008 23:35:04 +0000 (00:35 +0100)]
PM: Do not acquire device semaphores upfront during suspend

Remove the code that acquires all device semaphores from the suspend
code path as it causes multiple problems to appear (most notably,
http://bugzilla.kernel.org/show_bug.cgi?id=10030) and revert the
change introduced by commit 4145ed6dc597a9bea5f6ae8c574653b2de10620f
depending on the code being removed.

Remove pm_sleep_lock()/pm_sleep_unlock() from device_add() to avoid
the issue reported at http://bugzilla.kernel.org/show_bug.cgi?id=9874.

It should fix the regreesions reported at:
http://bugzilla.kernel.org/show_bug.cgi?id=9874
http://bugzilla.kernel.org/show_bug.cgi?id=10030

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agokobject: properly initialize ksets
Greg Kroah-Hartman [Tue, 26 Feb 2008 17:36:38 +0000 (09:36 -0800)]
kobject: properly initialize ksets

kset_initialize was calling kobject_init_internal() which didn't
initialize the kobject as well as kobject_init() was.  So have
kobject_init() call kobject_init_internal() and move the logic to
initalize the kobject there.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: CONFIG_SYSFS_DEPRECATED fix
Ingo Molnar [Tue, 4 Mar 2008 13:54:47 +0000 (14:54 +0100)]
sysfs: CONFIG_SYSFS_DEPRECATED fix

CONFIG_SYSFS_DEPRECATED=y changed its meaning recently and causes
regressions in working setups that had SYSFS_DEPRECATED disabled.

so rename it to SYSFS_DEPRECATED_V2 so that testers pick up the new
default via 'make oldconfig', even if their old .config's disabled
CONFIG_SYSFS_DEPRECATED ...

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED
Greg Kroah-Hartman [Mon, 3 Mar 2008 22:47:13 +0000 (14:47 -0800)]
driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED

As things get moved into this config option, the hard date of 2006 does
not work anymore, so update the text to be more descriptive.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>