]> Pileus Git - ~andy/linux/log
~andy/linux
16 years ago[BNX2X]: Spelling fixes
Eliezer Tamir [Thu, 28 Feb 2008 19:49:42 +0000 (11:49 -0800)]
[BNX2X]: Spelling fixes

Signed-off-by: Eliezer Tamir <eliezert@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPCOMP]: Disable BH on output when using shared tfm
Herbert Xu [Thu, 28 Feb 2008 19:23:17 +0000 (11:23 -0800)]
[IPCOMP]: Disable BH on output when using shared tfm

Because we use shared tfm objects in order to conserve memory,
(each tfm requires 128K of vmalloc memory), BH needs to be turned
off on output as that can occur in process context.

Previously this was done implicitly by the xfrm output code.
That was lost when it became lockless.  So we need to add the
BH disabling to IPComp directly.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireles...
David S. Miller [Thu, 28 Feb 2008 19:03:29 +0000 (11:03 -0800)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6

16 years agoSSB PCI core driver: use new SPROM data structure
Aurelien Jarno [Thu, 28 Feb 2008 14:11:26 +0000 (15:11 +0100)]
SSB PCI core driver: use new SPROM data structure

Switch the SSB PCI core driver to the new SPROM data structure now that
the old one has been removed.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoDon't build bcm43xx if SSB is static and b43 PCI-SSB bridge is enabled.
Alexey Zaytsev [Sat, 23 Feb 2008 10:33:07 +0000 (13:33 +0300)]
Don't build bcm43xx if SSB is static and b43 PCI-SSB bridge is enabled.

This may happen e.g. when the ssb is statically enables by the b44 driver,
and the b43 pci-ssb bridge is enbled by the b43/b43legacy drivers, or the
b43/b43legacy drivers are built statically.

Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoUse a separate config option for the b43 pci to ssb bridge.
Alexey Zaytsev [Sat, 23 Feb 2008 09:59:26 +0000 (12:59 +0300)]
Use a separate config option for the b43 pci to ssb bridge.

The bridge code was unnecessary enabled by the b44
driver, but it prevents the bcm43xx driver from
being loaded, as the bridge claims the same pci ids.

Now we enable the birdge only if the b43{legacy}
drivers are selected.

Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: Remove unused exports
Roland Dreier [Tue, 26 Feb 2008 14:26:56 +0000 (15:26 +0100)]
libertas: Remove unused exports

The libertas driver exports a number of symbols with no in-tree users;
remove these unused exports.  lbs_reset_device() is completely unused, with
no callers at all, so remove the function completely.

A couple of these unused exported symbols are static, which causes the
following build error on ia64 with gcc 4.2.3:

    drivers/net/wireless/libertas/main.c:1375: error: __ksymtab_lbs_remove_mesh causes a section type conflict
    drivers/net/wireless/libertas/main.c:1354: error: __ksymtab_lbs_add_mesh causes a section type conflict

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: fix kmalloc vs. net_ratelimit
Johannes Berg [Mon, 25 Feb 2008 23:39:28 +0000 (00:39 +0100)]
mac80211: fix kmalloc vs. net_ratelimit

The "goto end;" part definitely must not be rate limited.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agort2x00: Fix rt2x00lib_reset_link_tuner()
Ivo van Doorn [Mon, 25 Feb 2008 22:15:13 +0000 (23:15 +0100)]
rt2x00: Fix rt2x00lib_reset_link_tuner()

rt2x00lib_reset_link_tuner() can be called from within
the link tuner itself. This means that it should
_not_ call rt2x00lib_stop_link_tuner() since that will
cause the thread to hang.

Reorder the things that should be done during a
link tuner reset and during a link tuner start.

Also make antenna tuning the last step of the link
tuner since it could possibly reset some statistical
information which we need for average calculation.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agort2x00: Don't switch to antenna with low rssi
Ivo van Doorn [Mon, 25 Feb 2008 22:15:08 +0000 (23:15 +0100)]
rt2x00: Don't switch to antenna with low rssi

When rssi_a > rssi_b is true and the current antenna
was already antenna A, then rt2x00 incorrectly jumped
to antenna B.

Also don't configure the antenna when there has been
no change in the antenna setup.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agort2x00: Add link tuner safe RX toggle states
Ivo van Doorn [Mon, 25 Feb 2008 22:15:05 +0000 (23:15 +0100)]
rt2x00: Add link tuner safe RX toggle states

This adds 2 new states which both are used to toggle
the RX. These new states are required for usage
inside the link tuner thread, because the normal
RX toggling will stop the link tuner thread.
While it is possible that the link tuner thread itself
is the caller of the RX toggle (when using software
antenna diversity).

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agort2x00: Fix antenna diversity
Ivo van Doorn [Mon, 25 Feb 2008 22:15:01 +0000 (23:15 +0100)]
rt2x00: Fix antenna diversity

Fix 2 issues in antenna diversity selection.

1) the following statement will always return true.
if ((rssi_curr - rssi_old) > -5 || (rssi_curr - rssi_old) < 5)
It is cleaner to check if the absolute value is smaller then 5.

2) Only enable software diversity when default antenna setup
indicates support for it. Don't select it when the hardware
does not indicate support for it...

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agogelic wireless driver needs WIRELESS_EXT support
Sebastian Siewior [Sat, 23 Feb 2008 20:46:31 +0000 (21:46 +0100)]
gelic wireless driver needs WIRELESS_EXT support

|   CC      drivers/net/ps3_gelic_wireless.o
| /home/bigeasy/git/linux-2.6/drivers/net/ps3_gelic_wireless.c: In function 'gelic_wl_setup_netdev_ops':
| /home/bigeasy/git/linux-2.6/drivers/net/ps3_gelic_wireless.c:2660: error: 'struct net_device' has no member named 'wireless_data'
| /home/bigeasy/git/linux-2.6/drivers/net/ps3_gelic_wireless.c:2661: error: 'struct net_device' has no member named 'wireless_handlers'
| make[3]: *** [drivers/net/ps3_gelic_wireless.o] Error 1
| make[2]: *** [drivers/net] Error 2
| make[1]: *** [drivers] Error 2
| make[1]: *** Waiting for unfinished jobs....
| make: *** [sub-make] Error 2

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Acked-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoPS3: gelic: Link the wireless net_device structure to the corresponding device structure
Masakazu Mokuno [Fri, 22 Feb 2008 07:45:26 +0000 (16:45 +0900)]
PS3: gelic: Link the wireless net_device structure to the corresponding device structure

Link the net_device structure of the wireless part to the
corresponding device structure.

Without this, the sysfs node for this net_device would not have
'device' link.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agorndis_wlan: fix sparse warnings
Johannes Berg [Wed, 20 Feb 2008 10:47:45 +0000 (11:47 +0100)]
rndis_wlan: fix sparse warnings

It is obviously wrong to use an enum in a little endian struct,
and those other enums should be declared differently.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years ago[SCTP]: Correctly set the length of sctp_assoc_change notification
Vlad Yasevich [Thu, 14 Feb 2008 15:18:20 +0000 (10:18 -0500)]
[SCTP]: Correctly set the length of sctp_assoc_change notification

sctp_assoc_change notification may contain the data from a received
ABORT chunk.  Set the length correctly to account for that.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
16 years ago[NETFILTER]: Fix NF_QUEUE_NR() parenthesis
Patrick McHardy [Wed, 27 Feb 2008 20:21:18 +0000 (12:21 -0800)]
[NETFILTER]: Fix NF_QUEUE_NR() parenthesis

Properly add parens around the macro argument. This is not needed by
the kernel but the macro is exported to userspace, so it shouldn't
make any assumptions.

Also use NF_VERDICT_BITS instead of NF_VERDICT_QBTIS for the left-shift
since thats whats logically correct.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: xt_conntrack: fix IPv4 address comparison
Jan Engelhardt [Wed, 27 Feb 2008 20:20:41 +0000 (12:20 -0800)]
[NETFILTER]: xt_conntrack: fix IPv4 address comparison

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: xt_conntrack: fix missing boolean clamping
Jan Engelhardt [Wed, 27 Feb 2008 20:09:05 +0000 (12:09 -0800)]
[NETFILTER]: xt_conntrack: fix missing boolean clamping

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETFILTER]: nf_conntrack: fix smp_processor_id() in preemptible code warning
Patrick McHardy [Wed, 27 Feb 2008 20:07:47 +0000 (12:07 -0800)]
[NETFILTER]: nf_conntrack: fix smp_processor_id() in preemptible code warning

Since we're using RCU for the conntrack hash now, we need to avoid
getting preempted or interrupted by BHs while changing the stats.

Fixes warning reported by Tilman Schmidt <tilman@imap.cc> when using
preemptible RCU:

[   48.180297] BUG: using smp_processor_id() in preemptible [00000000] code: ntpdate/3562
[   48.180297] caller is __nf_conntrack_find+0x9b/0xeb [nf_conntrack]
[   48.180297] Pid: 3562, comm: ntpdate Not tainted 2.6.25-rc2-mm1-testing #1
[   48.180297]  [<c02015b9>] debug_smp_processor_id+0x99/0xb0
[   48.180297]  [<fac643a7>] __nf_conntrack_find+0x9b/0xeb [nf_conntrack]

Tested-by: Tilman Schmidt <tilman@imap.cc>
Tested-by: Christian Casteyde <casteyde.christian@free.fr> [Bugzilla #10097]
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV6] SYSCTL: Fix possible memory leakage in error path.
YOSHIFUJI Hideaki [Wed, 27 Feb 2008 20:06:38 +0000 (12:06 -0800)]
[IPV6] SYSCTL: Fix possible memory leakage in error path.

In error path, we do need to free memory just allocated.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoavr32: Fix OCD refcounting bug
Haavard Skinnemoen [Wed, 27 Feb 2008 13:04:29 +0000 (14:04 +0100)]
avr32: Fix OCD refcounting bug

Iff the parent has TIF_DEBUG set, _and_ clone_flags includes
CLONE_PTRACE we should set the TIF_DEBUG flag for the child and
increment the ocd refcount. Otherwise, the TIF_DEBUG flag must be
unset.

Currently, the child inherits TIF_DEBUG from the parent before
copy_thread is called, so TIF_DEBUG may be already be set before we
determine whether the child is supposed to inherit debugging
capabilities from the parent or not. This means that ocd_enable()
won't increment the refcount, because TIF_DEBUG is already set, and
that TIF_DEBUG will be set for processes that aren't being debugged.

This leads to a refcounting asymmetry, which may show up as

------------[ cut here ]------------
Badness at arch/avr32/kernel/ocd.c:73
PC is at ocd_disable+0x34/0x60
LR is at put_lock_stats+0xa/0x20

as reported by David Brownell. Happens when strace'ing a process that
forks a new child process, e.g. "strace mount -tjffs2 mtd1 /mnt", and
subsequently killing the child process (e.g. "umount /mnt".)

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
16 years ago[INET]: Don't create tunnels with '%' in name.
Pavel Emelyanov [Wed, 27 Feb 2008 07:51:04 +0000 (23:51 -0800)]
[INET]: Don't create tunnels with '%' in name.

Four tunnel drivers (ip_gre, ipip, ip6_tunnel and sit) can receive a
pre-defined name for a device from the userspace.  Since these drivers
call the register_netdevice() (rtnl_lock, is held), which does _not_
generate the device's name, this name may contain a '%' character.

Not sure how bad is this to have a device with a '%' in its name, but
all the other places either use the register_netdev(), which call the
dev_alloc_name(), or explicitly call the dev_alloc_name() before
registering, i.e. do not allow for such names.

This had to be prior to the commit 34cc7b, but I forgot to number the
patches and this one got lost, sorry.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[AF_KEY]: Fix oops by converting to proc_net_*().
David S. Miller [Wed, 27 Feb 2008 06:20:44 +0000 (22:20 -0800)]
[AF_KEY]: Fix oops by converting to proc_net_*().

To make sure the procfs visibility occurs after the ->proc_fs ops are
setup, use proc_net_fops_create() and proc_net_remove().

This also fixes an OOPS after module unload in that the name string
for remove was wrong, so it wouldn't actually be removed.  That bug
was introduced by commit 61145aa1a12401ac71bcc450a58c773dd6e2bfb9
("[KEY]: Clean up proc files creation a bit.")

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoCONNECTOR: make cn_already_initialized static
Li Zefan [Wed, 27 Feb 2008 02:25:53 +0000 (18:25 -0800)]
CONNECTOR: make cn_already_initialized static

It is used in connector.c only, so make it static.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV4]: Reset scope when changing address
Bjorn Mork [Wed, 27 Feb 2008 02:17:53 +0000 (18:17 -0800)]
[IPV4]: Reset scope when changing address

This bug did bite at least one user, who did have to resort to rebooting
the system after an "ifconfig eth0 127.0.0.1" typo.

Deleting the address and adding a new is a less intrusive workaround.
But I still beleive this is a bug that should be fixed.  Some way or
another.

Another possibility would be to remove the scope mangling based on
address.  This will always be incomplete (are 127/8 the only address
space with host scope requirements?)

We set the scope to RT_SCOPE_HOST if an IPv4 interface is configured
with a loopback address (127/8).  The scope is never reset, and will
remain set to RT_SCOPE_HOST after changing the address. This patch
resets the scope if the address is changed again, to restore normal
functionality.

Signed-off-by: Bjorn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV6]: Add missing initializations of the new nl_info.nl_net field
Benjamin Thery [Wed, 27 Feb 2008 02:10:03 +0000 (18:10 -0800)]
[IPV6]: Add missing initializations of the new nl_info.nl_net field

Add some more missing initializations of the new nl_info.nl_net field
in IPv6 stack. This field will be used when network namespaces are
fully supported.

Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[MACVLAN]: Update Kconfig to refer to iproute
Patrick McHardy [Wed, 27 Feb 2008 01:52:05 +0000 (17:52 -0800)]
[MACVLAN]: Update Kconfig to refer to iproute

Since the macvlan release I had at least 5 users asking how to configure
it since the old userspace tool doesn't work with the version in the
kernel. Add a pointer to the Kconfig help.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobluetooth: delete timer in l2cap_conn_del()
Thomas Gleixner [Wed, 27 Feb 2008 01:42:56 +0000 (17:42 -0800)]
bluetooth: delete timer in l2cap_conn_del()

Delete a possibly armed timer before kfree'ing the connection object.

Solves: http://lkml.org/lkml/2008/2/15/514

Reported-by:Quel Qun <kelk1@comcast.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SPARC64]: Loosen checks in exception table handling.
David S. Miller [Wed, 27 Feb 2008 01:30:02 +0000 (17:30 -0800)]
[SPARC64]: Loosen checks in exception table handling.

Some parts of the kernel now do things like do *_user() accesses while
set_fs(KERNEL_DS) that fault on purpose.

See, for example, the code added by changeset
a0c1e9073ef7428a14309cba010633a6cd6719ea ("futex: runtime enable pi
and robust functionality").

That trips up the ASI sanity checking we make in do_kernel_fault().

Just remove it for now.  Maybe we can add it back later with an added
conditional which looks at the current get_fs() value.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoarch/sh/drivers/dma/dma-sh.c: Correct use of ! and &
Julia Lawall [Tue, 26 Feb 2008 20:42:11 +0000 (21:42 +0100)]
arch/sh/drivers/dma/dma-sh.c: Correct use of ! and &

In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337, 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>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agoMAINTAINERS: neteffect update
Roland Dreier [Thu, 21 Feb 2008 15:02:41 +0000 (09:02 -0600)]
MAINTAINERS: neteffect update

Adding Nishi to the maintainers list.

Signed-off-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Fix interrupt moderation low threshold
John Lacombe [Thu, 21 Feb 2008 14:34:58 +0000 (08:34 -0600)]
RDMA/nes: Fix interrupt moderation low threshold

Interrupt moderation low threshold value was incorrectly triggering,
indicating that the threshold should be lowered.

The impact was the timer was likely to become 40usecs and get stuck
there.  The biggest side effect was too many interrupts and nonoptimal
performance.

Signed-off-by: John Lacombe <jlacombe@neteffect.com>
Signed-off-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Fix CRC endianness for RDMA connection establishment on big-endian
Faisal Latif [Thu, 21 Feb 2008 14:31:22 +0000 (08:31 -0600)]
RDMA/nes: Fix CRC endianness for RDMA connection establishment on big-endian

With commit ef19454b ("[LIB] crc32c: Keep intermediate crc state in
cpu order"), the behavior of crc32c changes on big-endian platforms.

Our algorithm expects the previous behavior; otherwise we have RDMA
connection establishment failure on big-endian platforms like powerpc.
Apply cpu_to_le32() to value returned by crc32c() to get the previous
behavior.

Signed-off-by: Faisal Latif <flatif@neteffect.com>
Signed-off-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Fix use-after-free in mini_cm_dec_refcnt_listen()
Faisal Latif [Thu, 21 Feb 2008 14:27:32 +0000 (08:27 -0600)]
RDMA/nes: Fix use-after-free in mini_cm_dec_refcnt_listen()

Fix use-after-free spotted by Coverity checker flagged by Adrian Bunk.

Signed-off-by: Faisal Latif <flatif@neteffect.com>
Signed-off-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Fix use-after-free in nes_create_cq()
Glenn Streiff [Thu, 21 Feb 2008 14:17:54 +0000 (08:17 -0600)]
RDMA/nes: Fix use-after-free in nes_create_cq()

Just delete the debugging statement so we don't use cqp_request after
freeing it.  Adrian Bunk flagged this use-after-free issue spotted by
the Coverity checker.

Signed-off-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Fix a check-after-use in nes_probe()
Adrian Bunk [Thu, 21 Feb 2008 14:13:47 +0000 (08:13 -0600)]
RDMA/nes: Fix a check-after-use in nes_probe()

Fix a check-after-use spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Fix a memory leak in schedule_nes_timer()
Adrian Bunk [Thu, 21 Feb 2008 14:12:06 +0000 (08:12 -0600)]
RDMA/nes: Fix a memory leak in schedule_nes_timer()

Fix a memory leak spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoide: remove stale comments from ide-dma.c (take 2)
Bartlomiej Zolnierkiewicz [Tue, 26 Feb 2008 20:50:36 +0000 (21:50 +0100)]
ide: remove stale comments from ide-dma.c (take 2)

- ide-dma.c is not a separate module

- ide-dma.c is not PCI specific anymore

- DMA is enabled by default nowadays

- link for Intel Zappa BIOS is dead

etc.

v2:
* Some comments should be preserved. (Noticed by Mark Lord)

Cc: Mark Lord <liml@rtr.ca>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ide-tape documentation from Documentation/ide.txt
Bartlomiej Zolnierkiewicz [Tue, 26 Feb 2008 20:50:36 +0000 (21:50 +0100)]
ide: remove ide-tape documentation from Documentation/ide.txt

More complete documentation is available in Documentation/ide/ide-tape.txt.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoqd65xx: remove commented out code
Bartlomiej Zolnierkiewicz [Tue, 26 Feb 2008 20:50:36 +0000 (21:50 +0100)]
qd65xx: remove commented out code

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: schedule driver for removal after 6 months
Borislav Petkov [Tue, 26 Feb 2008 20:50:36 +0000 (21:50 +0100)]
ide-tape: schedule driver for removal after 6 months

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-disk: add missing printk() KERN_* levels
Bartlomiej Zolnierkiewicz [Tue, 26 Feb 2008 20:50:36 +0000 (21:50 +0100)]
ide-disk: add missing printk() KERN_* levels

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix sparse warning about shadowing 'flags' symbol
Bartlomiej Zolnierkiewicz [Tue, 26 Feb 2008 20:50:35 +0000 (21:50 +0100)]
ide: fix sparse warning about shadowing 'flags' symbol

drivers/ide/ide.c:801:18: warning: symbol 'flags' shadows an earlier one
drivers/ide/ide.c:732:16: originally declared here

Also fix some whitespace damage while at it.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: fix CD/DVD burning
Andreas Schwab [Tue, 26 Feb 2008 20:50:35 +0000 (21:50 +0100)]
ide-cd: fix CD/DVD burning

Move counting of sense bytes into the transfer loop.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: fix 'ireason' handling for REQ_TYPE_ATA_PC requests
Bartlomiej Zolnierkiewicz [Tue, 26 Feb 2008 20:50:35 +0000 (21:50 +0100)]
ide-cd: fix 'ireason' handling for REQ_TYPE_ATA_PC requests

Pass 'struct request *rq' to ide_cd_check_ireason() from cdrom_newpc_intr()
and use ide_cd_check_ireason() also for REQ_TYPE_ATA_PC requests.

This fixes some hangs caused by not finishing the transfer before ending
the request and also makes use of 'ireason == 1' quirk for spurious IRQs.

Tested-by: Brad Rosser <brad.rosser@gmail.com>
Cc: Borislav Petkov <petkovbb@googlemail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoqd65xx: fix setup of QD6580 Control register
Bartlomiej Zolnierkiewicz [Tue, 26 Feb 2008 20:50:35 +0000 (21:50 +0100)]
qd65xx: fix setup of QD6580 Control register

Control register of QD6580 should be setup before probing for devices.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: skip probing port if "hdx=noprobe" was used for both devices on it
Bartlomiej Zolnierkiewicz [Tue, 26 Feb 2008 20:50:34 +0000 (21:50 +0100)]
ide: skip probing port if "hdx=noprobe" was used for both devices on it

* Skip probing port if "hdx=noprobe" parameter was used for both devices on it.

* Obsolete "idex=noprobe" parameter - it only works for ide_generic, cmd640
  and PCI hosts in Compatibility mode (on alpha/x86/ia64/m32r/mips/ppc32).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove redundant comment from ide_unregister()
Bartlomiej Zolnierkiewicz [Tue, 26 Feb 2008 20:50:33 +0000 (21:50 +0100)]
ide: remove redundant comment from ide_unregister()

Identical comment is present in ide_hwif_release_regions() documentation.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agohpt366: fix section mismatch warnings
Sam Ravnborg [Tue, 26 Feb 2008 20:50:33 +0000 (21:50 +0100)]
hpt366: fix section mismatch warnings

hpt366: fix section mismatch warnings

Fix following warnings:
WARNING: o-sparc64/vmlinux.o(.data+0x195a38): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370
WARNING: o-sparc64/vmlinux.o(.data+0x195a40): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370a
WARNING: o-sparc64/vmlinux.o(.data+0x195a48): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372
WARNING: o-sparc64/vmlinux.o(.data+0x195a50): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372n

Replace a static array with a small switch resulting in
more readable code.
Mark the pci table __devinitconst.

A lot of variables are const but annotated __devinitdata.
Annotating them __devinitconst would cause a section type
conflict error when build for 64 bit powerpc.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: Enable audio play quirk for Optiarc DVD RW AD-5200A drive
Borislav Petkov [Tue, 26 Feb 2008 20:50:32 +0000 (21:50 +0100)]
ide-cd: Enable audio play quirk for Optiarc DVD RW AD-5200A drive

Reported-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoMerge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6
Linus Torvalds [Tue, 26 Feb 2008 15:55:29 +0000 (07:55 -0800)]
Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6

* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6:
  [XFS] Undo bit ops cleanup mod due to regression on 32-bit powermac
  [XFS] Undo bit ops cleanup mod due to regression on 32-bit powermac
  Remove empty file fs/xfs/Makefile-linux-2.6.

16 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Linus Torvalds [Tue, 26 Feb 2008 15:50:16 +0000 (07:50 -0800)]
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: add missing ext4_journal_stop()
  ext4: ext4_find_next_zero_bit needs an aligned address on some arch
  ext4: set EXT4_EXTENTS_FL only for directory and regular files
  ext4: Don't mark filesystem error if fallocate fails
  ext4: Fix BUG when writing to an unitialized extent
  ext4: Don't use ext4_dec_count() if not needed
  ext4: modify block allocation algorithm for the last group
  ext4: Don't claim block from group which has corrupt bitmap
  ext4: Get journal write access before modifying the extent tree
  ext4: Fix memory and buffer head leak in callers to ext4_ext_find_extent()
  ext4: Don't leave behind a half-created inode if ext4_mkdir() fails
  ext4: Fix kernel BUG at fs/ext4/mballoc.c:910!
  ext4: Fix locking hierarchy violation in ext4_fallocate()
  Remove incorrect BKL comments in ext4

16 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Tue, 26 Feb 2008 15:49:36 +0000 (07:49 -0800)]
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  Revert "power_state: get rid of write-only variable in SATA"
  make atapi_dmadir static

16 years agoMerge branch 'v2.6.25-rc3-lockdep' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 26 Feb 2008 15:49:15 +0000 (07:49 -0800)]
Merge branch 'v2.6.25-rc3-lockdep' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep

* 'v2.6.25-rc3-lockdep' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep:
  Subject: lockdep: include all lock classes in all_lock_classes
  lockdep: increase MAX_LOCK_DEPTH

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
Linus Torvalds [Tue, 26 Feb 2008 15:48:27 +0000 (07:48 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  firewire: fix NULL pointer deref. and resource leak
  Documentation: correction to debugging-via-ohci1394
  ieee1394: sbp2: fix rescan-scsi-bus
  firewire: fw-sbp2: fix NULL pointer deref. in scsi_remove_device
  firewire: fw-sbp2: fix NULL pointer deref. in slave_alloc
  firewire: fw-sbp2: (try to) avoid I/O errors during reconnect
  firewire: fw-sbp2: enforce a retry of __scsi_add_device if bus generation changed
  firewire: fw-sbp2: sort includes
  firewire: fw-sbp2: logout and login after failed reconnect
  firewire: fw-sbp2: don't add scsi_device twice
  firewire: fw-sbp2: log bus_id at management request failures
  firewire: fw-sbp2: wait for completion of fetch agent reset
  ieee1394: sbp2: add INQUIRY delay workaround
  firewire: fw-sbp2: add INQUIRY delay workaround
  firewire: log GUID of new devices
  firewire: fw-sbp2: don't retry login or reconnect after unplug
  firewire: fix "kobject_add failed for fw* with -EEXIST"
  firewire: fw-sbp2: fix logout before login retry
  firewire: fw-sbp2: unsigned int vs. unsigned

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
Linus Torvalds [Tue, 26 Feb 2008 15:44:09 +0000 (07:44 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86

* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86: (24 commits)
  x86: no robust/pi futex for real i386 CPUs
  x86: fix boot failure on 486 due to TSC breakage
  x86: fix build on non-C locales.
  x86: make c_idle.work have a static address.
  x86: don't save unreliable stack trace entries
  x86: don't make swapper_pg_pmd global
  x86: don't print a warning when MTRR are blank and running in KVM
  x86: fix execve with -fstack-protect
  x86: fix vsyscall wreckage
  x86: rename KERNEL_TEXT_SIZE => KERNEL_IMAGE_SIZE
  x86: fix spontaneous reboot with allyesconfig bzImage
  x86: remove double-checking empty zero pages debug
  x86: notsc is ignored on common configurations
  x86/mtrr: fix kernel-doc missing notation
  x86: handle BIOSes which terminate e820 with CF=1 and no SMAP
  x86: add comments for NOPs
  x86: don't use P6_NOPs if compiling with CONFIG_X86_GENERIC
  x86: require family >= 6 if we are using P6 NOPs
  x86: do not promote TM3x00/TM5x00 to i686-class
  x86: hpet fix docbook comment
  ...

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
Linus Torvalds [Tue, 26 Feb 2008 15:43:31 +0000 (07:43 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched

* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
  latencytop: change /proc task_struct access method
  latencytop: fix memory leak on latency proc file
  latencytop: fix kernel panic while reading latency proc file
  sched: add declaration of sched_tail to sched.h
  sched: fix signedness warnings in sched.c
  sched: clean up __pick_last_entity() a bit
  sched: remove duplicate code from sched_fair.c
  sched: make early bootup sched_clock() use safer

16 years agoprintk: fix possible printk overrun
Tejun Heo [Thu, 14 Feb 2008 01:32:07 +0000 (10:32 +0900)]
printk: fix possible printk overrun

printk recursion detection prepends message to printk_buf and offsets
printk_buf when actual message is printed but it forgets to trim buffer
length accordingly. This can result in overrun in extreme cases. Fix it.

[ mingo@elte.hu:

  bug was introduced by me via:

   commit 32a76006683f7b28ae3cc491da37716e002f198e
   Author: Ingo Molnar <mingo@elte.hu>
   Date:   Fri Jan 25 21:07:58 2008 +0100

       printk: make printk more robust by not allowing recursion
]

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86: no robust/pi futex for real i386 CPUs
Thomas Gleixner [Sat, 16 Feb 2008 13:05:01 +0000 (14:05 +0100)]
x86: no robust/pi futex for real i386 CPUs

Real i386 CPUs do not have cmpxchg instructions. Catch it before
crashing on an invalid opcode.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: fix boot failure on 486 due to TSC breakage
Mikael Pettersson [Sun, 24 Feb 2008 17:27:03 +0000 (18:27 +0100)]
x86: fix boot failure on 486 due to TSC breakage

 > Diffing dmesg between git7 and git8 doesn't sched any light since
 > git8 also removed the printouts of the x86 caps as they were being
 > initialised and updated. I'm currently adding those printouts back
 > in the hope of seeing where and when the caps get broken.

That turned out to be very illuminating:

 --- dmesg-2.6.24-git7 2008-02-24 18:01:25.295851000 +0100
 +++ dmesg-2.6.24-git8 2008-02-24 18:01:25.530358000 +0100
 ...
 CPU: After generic identify, caps: 00000003 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 CPU: After all inits, caps: 00000003 00000000 00000000 00000000 00000000 00000000 00000000 00000000
+CPU: After applying cleared_cpu_caps, caps: 00000013 00000000 00000000 00000000 00000000 00000000 00000000 00000000

Notice how the TSC cap bit goes from Off to On.

(The first two lines are printout loops from -git7 forward-ported
to -git8, the third line is the same printout loop added just after
the xor-with-cleared_cpu_caps[] loop.)

Here's how the breakage occurs:
1. arch/x86/kernel/tsc_32.c:tsc_init() sees !cpu_has_tsc,
   so bails and calls setup_clear_cpu_cap(X86_FEATURE_TSC).
2. include/asm-x86/cpufeature.h:setup_clear_cpu_cap(bit) clears
   the bit in boot_cpu_data and sets it in cleared_cpu_caps
3. arch/x86/kernel/cpu/common.c:identify_cpu() XORs all caps
   in with cleared_cpu_caps
   HOWEVER, at this point c->x86_capability correctly has TSC
   Off, cleared_cpu_caps has TSC On, so the XOR incorrectly
   sets TSC to On in c->x86_capability, with disastrous results.

The real bug is that clearing bits with XOR only works if the
bits are known to be 1 prior to the XOR, and that's not true here.

A simple fix is to convert the XOR to AND-NOT instead. The following
patch does that, and allows my 486 to boot 2.6.25-rc kernels again.

[ mingo@elte.hu: fixed a similar bug in setup_64.c as well. ]

The breakage was introduced via commit 7d851c8d3db0.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix build on non-C locales.
Priit Laes [Sun, 24 Feb 2008 16:36:05 +0000 (18:36 +0200)]
x86: fix build on non-C locales.

For some locales regex range [a-zA-Z] does not work as it is supposed to.
so we have to use [:alnum:] and [:xdigit:] to make it work as intended.

[1] http://en.wikipedia.org/wiki/Estonian_alphabet

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: make c_idle.work have a static address.
Glauber Costa [Fri, 22 Feb 2008 15:09:29 +0000 (12:09 -0300)]
x86: make c_idle.work have a static address.

Currently, c_idle is declared in the stack, and thus, have no static address.

Peter Zijlstra points out this simple solution, in which c_idle.work
is initializated separatedly. Note that the INIT_WORK macro has a static
declaration of a key inside.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Acked-by: Peter Zijlstra <pzijlstr@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't save unreliable stack trace entries
Vegard Nossum [Fri, 22 Feb 2008 18:23:58 +0000 (19:23 +0100)]
x86: don't save unreliable stack trace entries

Currently, there is no way for print_stack_trace() to determine whether
a given stack trace entry was deemed reliable or not, simply because
save_stack_trace() does not record this information. (Perhaps needless
to say, this makes the saved stack traces A LOT harder to read, and
probably with no other benefits, since debugging features that use
save_stack_trace() most likely also require frame pointers, etc.)

This patch reverts to the old behaviour of only recording the reliable trace
entries for saved stack traces.

Signed-off-by: Vegard Nossum <vegardno@ifi.uio.no>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't make swapper_pg_pmd global
Adrian Bunk [Fri, 22 Feb 2008 19:58:37 +0000 (21:58 +0200)]
x86: don't make swapper_pg_pmd global

There doesn't seem to be any reason for swapper_pg_pmd being global.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't print a warning when MTRR are blank and running in KVM
Joerg Roedel [Thu, 21 Feb 2008 14:50:14 +0000 (15:50 +0100)]
x86: don't print a warning when MTRR are blank and running in KVM

Inside a KVM virtual machine the MTRRs are usually blank. This confuses Linux
and causes a warning message at boot. This patch removes that warning message
when running Linux as a KVM guest.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix execve with -fstack-protect
Ingo Molnar [Tue, 26 Feb 2008 11:55:57 +0000 (12:55 +0100)]
x86: fix execve with -fstack-protect

pointed out by pageexec@freemail.hu:

> what happens here is that gcc treats the argument area as owned by the
> callee, not the caller and is allowed to do certain tricks. for ssp it
> will make a copy of the struct passed by value into the local variable
> area and pass *its* address down, and it won't copy it back into the
> original instance stored in the argument area.
>
> so once sys_execve returns, the pt_regs passed by value hasn't at all
> changed and its default content will cause a nice double fault (FWIW,
> this part took me the longest to debug, being down with cold didn't
> help it either ;).

To fix this we pass in pt_regs by pointer.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: fix vsyscall wreckage
Thomas Gleixner [Wed, 20 Feb 2008 22:57:30 +0000 (23:57 +0100)]
x86: fix vsyscall wreckage

based on a report from Arne Georg Gleditsch about user-space apps
misbehaving after toggling /proc/sys/kernel/vsyscall64, a review
of the code revealed that the "NOP patching" done there is
fundamentally unsafe for a number of reasons:

1) the patching code runs without synchronizing other CPUs

2) it inserts NOPs even if there is no clock source which provides vread

3) when the clock source changes to one without vread we run in
   exactly the same problem as in #2

4) if nobody toggles the proc entry from 1 to 0 and to 1 again, then
   the syscall is not patched out

as a result it is possible to break user-space via this patching.
The only safe thing for now is to remove the patching.

This code was broken since v2.6.21.

Reported-by: Arne Georg Gleditsch <arne.gleditsch@dolphinics.no>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: rename KERNEL_TEXT_SIZE => KERNEL_IMAGE_SIZE
Ingo Molnar [Thu, 21 Feb 2008 12:39:30 +0000 (13:39 +0100)]
x86: rename KERNEL_TEXT_SIZE => KERNEL_IMAGE_SIZE

The KERNEL_TEXT_SIZE constant was mis-named, as we not only map the kernel
text but data, bss and init sections as well.

That name led me on the wrong path with the KERNEL_TEXT_SIZE regression,
because i knew how big of _text_ my images have and i knew about the 40 MB
"text" limit so i wrongly thought to be on the safe side of the 40 MB limit
with my 29 MB of text, while the total image size was slightly above 40 MB.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix spontaneous reboot with allyesconfig bzImage
Ingo Molnar [Thu, 21 Feb 2008 10:04:11 +0000 (11:04 +0100)]
x86: fix spontaneous reboot with allyesconfig bzImage

recently the 64-bit allyesconfig bzImage kernel started spontaneously
rebooting during early bootup.

after a few fun hours spent with early init debugging, it turns out
that we've got this rather annoying limit on the size of the kernel
image:

      #define KERNEL_TEXT_SIZE  (40*1024*1024)

which limit my vmlinux just happened to pass:

       text           data       bss        dec       hex   filename
   29703744        4222751   8646224   42572719   2899baf   vmlinux

40 MB is 42572719 bytes, so my vmlinux was just 1.5% above this limit :-/

So it happily crashed right in head_64.S, which - as we all know - is
the most debuggable code in the whole architecture ;-)

So increase the limit to allow an up to 128MB kernel image to be mapped.
(should anyone be that crazy or lazy)

We have a full 4K of pagetable (level2_kernel_pgt) allocated for these
mappings already, so there's no RAM overhead and the limit was rather
pointless and arbitrary.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove double-checking empty zero pages debug
Yinghai Lu [Thu, 21 Feb 2008 02:53:17 +0000 (18:53 -0800)]
x86: remove double-checking empty zero pages debug

so far no one complained about that.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: notsc is ignored on common configurations
Pavel Machek [Tue, 19 Feb 2008 10:02:30 +0000 (11:02 +0100)]
x86: notsc is ignored on common configurations

notsc is ignored in 32-bit kernels if CONFIG_X86_TSC is on.. which is
bad, fix it.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86/mtrr: fix kernel-doc missing notation
Randy Dunlap [Mon, 18 Feb 2008 21:10:44 +0000 (13:10 -0800)]
x86/mtrr: fix kernel-doc missing notation

Fix mtrr kernel-doc warning:
Warning(linux-2.6.24-git12//arch/x86/kernel/cpu/mtrr/main.c:677): No description found for parameter 'end_pfn'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: handle BIOSes which terminate e820 with CF=1 and no SMAP
H. Peter Anvin [Wed, 13 Feb 2008 19:16:46 +0000 (11:16 -0800)]
x86: handle BIOSes which terminate e820 with CF=1 and no SMAP

The proper way to terminate the e820 chain is with %ebx == 0 on the
last legitimate memory block.  However, several BIOSes don't do that
and instead return error (CF = 1) when trying to read off the end of
the list.  For this error return, %eax doesn't necessarily return the
SMAP signature -- correctly so, since %ah should contain an error code
in this case.

To deal with some particularly broken BIOSes, we clear the entire e820
chain if the SMAP signature is missing in the middle, indicating a
plain insane e820 implementation.  However, we need to make the test
for CF = 1 before the SMAP check.

This fixes at least one HP laptop (nc6400) for which none of the
memory-probing methods (e820, e801, 88) functioned fully according to
spec.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: add comments for NOPs
H. Peter Anvin [Tue, 19 Feb 2008 07:24:33 +0000 (23:24 -0800)]
x86: add comments for NOPs

Add comments describing the various NOP sequences.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: don't use P6_NOPs if compiling with CONFIG_X86_GENERIC
H. Peter Anvin [Thu, 14 Feb 2008 22:56:45 +0000 (14:56 -0800)]
x86: don't use P6_NOPs if compiling with CONFIG_X86_GENERIC

P6_NOPs are definitely not supported on some VIA CPUs, and possibly
(unverified) on AMD K7s.  It is also the only thing that prevents a
686 kernel from running on Transmeta TM3x00/5x00 (Crusoe) series.

The performance benefit over generic NOPs is very small, so when
building for generic consumption, avoid using them.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: require family >= 6 if we are using P6 NOPs
H. Peter Anvin [Thu, 14 Feb 2008 22:52:05 +0000 (14:52 -0800)]
x86: require family >= 6 if we are using P6 NOPs

The P6 family of NOPs are only available on family >= 6 or above, so
enforce that in the boot code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: do not promote TM3x00/TM5x00 to i686-class
H. Peter Anvin [Thu, 14 Feb 2008 22:51:00 +0000 (14:51 -0800)]
x86: do not promote TM3x00/TM5x00 to i686-class

We have been promoting Transmeta TM3x00/TM5x00 chips to i686-class
based on the notion that they contain all the user-space visible
features of an i686-class chip.  However, this is not actually true:
they lack the EA-taking long NOPs (0F 1F /0).  Since this is a
userspace-visible incompatibility, downgrade these CPUs to the
manufacturer-defined i586 level.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: hpet fix docbook comment
Pavel Machek [Mon, 4 Feb 2008 23:48:13 +0000 (00:48 +0100)]
x86: hpet fix docbook comment

Signed-off-by: Pavel Machek <Pavel@suse.cz>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: make DEBUG_PAGEALLOC and CPA more robust
Ingo Molnar [Wed, 13 Feb 2008 13:37:52 +0000 (14:37 +0100)]
x86: make DEBUG_PAGEALLOC and CPA more robust

Use PF_MEMALLOC to prevent recursive calls in the DBEUG_PAGEALLOC
case. This makes the code simpler and more robust against allocation
failures.

This fixes the following fallback to non-mmconfig:

   http://lkml.org/lkml/2008/2/20/551
   http://bugzilla.kernel.org/show_bug.cgi?id=10083

Also, for DEBUG_PAGEALLOC=n reduce the pool size to one page.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86/lguest: fix pgdir pmd index calculation
Ahmed S. Darwish [Sun, 24 Feb 2008 15:55:15 +0000 (17:55 +0200)]
x86/lguest: fix pgdir pmd index calculation

Hi all,

Beginning from commits close to v2.6.25-rc2, running lguest always oopses
the host kernel. Oops is at [1].

Bisection led to the following commit:

commit 37cc8d7f963ba2deec29c9b68716944516a3244f

    x86/early_ioremap: don't assume we're using swapper_pg_dir

    At the early stages of boot, before the kernel pagetable has been
    fully initialized, a Xen kernel will still be running off the
    Xen-provided pagetables rather than swapper_pg_dir[].  Therefore,
    readback cr3 to determine the base of the pagetable rather than
    assuming swapper_pg_dir[].

 static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
 {
- pgd_t *pgd = &swapper_pg_dir[pgd_index(addr)];
+ /* Don't assume we're using swapper_pg_dir at this point */
+ pgd_t *base = __va(read_cr3());
+ pgd_t *pgd = &base[pgd_index(addr)];
  pud_t *pud = pud_offset(pgd, addr);
  pmd_t *pmd = pmd_offset(pud, addr);

Trying to analyze the problem, it seems on the guest side of lguest,
%cr3 has a different value from &swapper_pg-dir (which
is AFAIK fine on a pravirt guest):

Putting some debugging messages in early_ioremap_pmd:

/* Appears 3 times */
[    0.000000] ***************************
[    0.000000] __va(%cr3) = c0000000, &swapper_pg_dir = c02cc000
[    0.000000] ***************************

After 8 hours of debugging and staring on lguest code, I noticed something
strange in paravirt_ops->set_pmd hypercall invocation:

static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
{
*pmdp = pmdval;
lazy_hcall(LHCALL_SET_PMD, __pa(pmdp)&PAGE_MASK,
   (__pa(pmdp)&(PAGE_SIZE-1))/4, 0);
}

The first hcall parameter is global pgdir which looks fine. The second
parameter is the pmd index in the pgdir which is suspectful.

AFAIK, calculating the index of pmd does not need a divisoin over four.
Removing the division made lguest work fine again . Patch is at [2].

I am not sure why the division over four existed in the first place. It
seems bogus, maybe the Xen patch just made the problem appear ?

[2]: The patch:

[PATCH] lguest: fix pgdir pmd index cacluation

Remove an error in index calculation which leads to removing
a not existing shadow page table (leading to a Null dereference).

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agolguest: fix build breakage
Tony Breeds [Tue, 19 Feb 2008 07:16:03 +0000 (08:16 +0100)]
lguest: fix build breakage

[ mingo@elte.hu: merged to Rusty's patch ]

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agolguest: include function prototypes
Harvey Harrison [Wed, 13 Feb 2008 21:14:35 +0000 (13:14 -0800)]
lguest: include function prototypes

Added a declaration to asm-x86/lguest.h and moved the extern arrays there
as well.  As an alternative to including asm/lguest.h directly, an
include could be put in linux/lguest.h

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: "rusty@rustcorp.com.au" <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years ago[XFS] Undo bit ops cleanup mod due to regression on 32-bit powermac
Lachlan McIlroy [Tue, 26 Feb 2008 06:00:22 +0000 (17:00 +1100)]
[XFS] Undo bit ops cleanup mod due to regression on 32-bit powermac
platform.

SGI-PV: 971186
SGI-Modid: xfs-linux-melb:xfs-kern:30559a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
16 years ago[XFS] Undo bit ops cleanup mod due to regression on 32-bit powermac
Lachlan McIlroy [Tue, 26 Feb 2008 06:00:14 +0000 (17:00 +1100)]
[XFS] Undo bit ops cleanup mod due to regression on 32-bit powermac
platform.

SGI-PV: 974005
SGI-Modid: xfs-linux-melb:xfs-kern:30558a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
16 years agoserial: Move asm-sh/sci.h to linux/serial_sci.h.
Paul Mundt [Tue, 26 Feb 2008 05:52:45 +0000 (14:52 +0900)]
serial: Move asm-sh/sci.h to linux/serial_sci.h.

This header is needed on other architectures as well (namely h8300),
which currently fails to build without this in place. Rather than
duplicating the port definition completely there, just move this to a
common location instead.

This should get h8300 working again for 2.6.25, in addition to the
changes already pushed by Sato-san in -rc2.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agosh: Fix up HAS_SR_RB typo in entry-macros.
Hideo Saito [Tue, 26 Feb 2008 05:28:48 +0000 (14:28 +0900)]
sh: Fix up HAS_SR_RB typo in entry-macros.

Signed-off-by: Hideo Saito <saito@densan.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agosh: revert dreamcast pci change
Magnus Damm [Tue, 26 Feb 2008 05:14:56 +0000 (14:14 +0900)]
sh: revert dreamcast pci change

Commit e036eaa681a17f71b64f6d9040fe605555623919 broke dreamcast pci, this
patch fixes that by reverting the dreamcast specific bits.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agomaple: fix device detection
Adrian McMenamin [Sun, 24 Feb 2008 14:30:23 +0000 (14:30 +0000)]
maple: fix device detection

The maple bus driver that went into the kernel mainline in September 2007
contained some bugs which were revealed by the update of the kobj code
for the current release series. Unfortunately those bugs also helped
ensure maple devices were properly detected. This patch (against the
current git) now ensures that devices are properly detected again.

(A previous attempt to fix this by delaying initialisation only partially
 fixed this - as became apparent when the bus was fully loaded)

Signed-off-by: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agosh: fix rtc_resources setup for sh770x
Rafael Ignacio Zurita [Tue, 19 Feb 2008 01:32:58 +0000 (22:32 -0300)]
sh: fix rtc_resources setup for sh770x

Fix the RTC resources setup for sh770x. Whit these proper
start values RTC driver (drivers/rtc/rtc-sh.c) works.

Signed-off-by: Rafael Ignacio Zurita <rizurita@yahoo.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agosh: heartbeat: ioremap is expected to succeed
Roel Kluin [Mon, 18 Feb 2008 13:09:10 +0000 (14:09 +0100)]
sh: heartbeat: ioremap is expected to succeed

ioremap is expected to succeed

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agosh: Storage class should be before const qualifier
Tobias Klauser [Sun, 17 Feb 2008 14:38:35 +0000 (15:38 +0100)]
sh: Storage class should be before const qualifier

The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agomaple: remove unused variable
Adrian McMenamin [Sat, 16 Feb 2008 23:37:33 +0000 (23:37 +0000)]
maple: remove unused variable

Remove an unused variable from the definition of struct maple_device

Signed-off-by: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Lachlan McIlroy [Tue, 26 Feb 2008 03:26:14 +0000 (14:26 +1100)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus

16 years agoRDMA/nes: Fix off-by-one
Adrian Bunk [Thu, 21 Feb 2008 14:01:18 +0000 (08:01 -0600)]
RDMA/nes: Fix off-by-one

Fix an off-by-one spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Resurrect error path dead code
Chien Tung [Thu, 21 Feb 2008 13:51:17 +0000 (07:51 -0600)]
RDMA/nes: Resurrect error path dead code

Adrian Bunk pointed out that a Coverity scan found some apparently
dead code in nes_verbs.c that really shouldn't have been dead.

The function nes_create_cq() was missing the assignment

err = 1;

just prior to an iteration that conditionally set err = 0 if a PBL was
found for a given virtual CQ.  I also noticed we should have been
returning -EFAULT on a couple related error paths.

Signed-off-by: Chien Tung <ctung@neteffect.com>
Signed-off-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/cxgb3: Fix shift calc in build_phys_page_list() for 1-entry page lists
Bryan Rosenburg [Wed, 20 Feb 2008 23:31:48 +0000 (17:31 -0600)]
RDMA/cxgb3: Fix shift calc in build_phys_page_list() for 1-entry page lists

A single entry (addr 0x10001000, size 0x2000) will get converted to
page address 0x10000000 with a page size of 0x4000.  The code as it
stands doesn't address the single buffer case, but in fact it allows
the subsequent single-buffer special case to be eliminated entirely.
Because the mask now includes the (page adjusted) starting and ending
addresses, the general case works for the single buffer case as well.

Signed-off-by: Bryan Rosenburg <rosnbrg@us.ibm.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRevert "power_state: get rid of write-only variable in SATA"
Jeff Garzik [Mon, 25 Feb 2008 22:31:10 +0000 (17:31 -0500)]
Revert "power_state: get rid of write-only variable in SATA"

This reverts commit 559bbe6cbd0d8c68d40076a5f7dc98e3bf5864b2.

Michael S. Tsirkin reports that this changes breaks suspend/resume.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomake atapi_dmadir static
Adrian Bunk [Mon, 25 Feb 2008 00:07:25 +0000 (02:07 +0200)]
make atapi_dmadir static

atapi_dmadir can now become static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoSubject: lockdep: include all lock classes in all_lock_classes
Dale Farnsworth [Mon, 25 Feb 2008 22:03:02 +0000 (23:03 +0100)]
Subject: lockdep: include all lock classes in all_lock_classes
Add each lock class to the all_lock_classes list when it is
first registered.

Previously, lock classes were added to all_lock_classes when
the lock class was first used.  Since one of the uses of the
list is to find unused locks, this didn't work well.

Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>