pandora-kernel.git
14 years agoperf: Auto-detect libelf
Peter Zijlstra [Wed, 5 Aug 2009 12:05:16 +0000 (14:05 +0200)]
perf: Auto-detect libelf

Adds autodetection for libelf as well, and simplifies the
libbfd code. Furthermore, fail make with an error when libelf
is not found and warn about the lack of libbfd.

Also provide an option to build a 32bit version even though you
might be running a 64bit kernel.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf symbol: Fix symbol parsing in certain cases: use the build-id as a symlink
Arnaldo Carvalho de Melo [Wed, 5 Aug 2009 22:02:49 +0000 (19:02 -0300)]
perf symbol: Fix symbol parsing in certain cases: use the build-id as a symlink

In some cases distros have binaries and debuginfo in weird places:

[root@doppio tuna]# ls -la /usr/lib64/{xulrunner-1.9.1/xulrunner-stub,firefox-3.5.2/firefox}
-rwxr-xr-x 1 root root 90024 2009-08-03 19:45 /usr/lib64/firefox-3.5.2/firefox
-rwxr-xr-x 1 root root 90024 2009-08-03 18:23 /usr/lib64/xulrunner-1.9.1/xulrunner-stub
[root@doppio tuna]# sha1sum /usr/lib64/{xulrunner-1.9.1/xulrunner-stub,firefox-3.5.2/firefox}
19a858077d263d5de22c9c5da250d3e4396ae739  /usr/lib64/xulrunner-1.9.1/xulrunner-stub
19a858077d263d5de22c9c5da250d3e4396ae739  /usr/lib64/firefox-3.5.2/firefox
[root@doppio tuna]# rpm -qf /usr/lib64/{xulrunner-1.9.1/xulrunner-stub,firefox-3.5.2/firefox}
xulrunner-1.9.1.2-1.fc11.x86_64
firefox-3.5.2-2.fc11.x86_64
[root@doppio tuna]# ls -la /usr/lib/debug/{usr/lib64/xulrunner-1.9.1/xulrunner-stub,usr/lib64/firefox-3.5.2/firefox}.debug
ls: cannot access /usr/lib/debug/usr/lib64/firefox-3.5.2/firefox.debug: No such file or directory
-rwxr-xr-x 1 root root 403608 2009-08-03 18:22 /usr/lib/debug/usr/lib64/xulrunner-1.9.1/xulrunner-stub.debug

Seemingly we don't have a .symtab when we actually can find it
if we use the .note.gnu.build-id ELF section put in place by
some distros. Use it and find the symbols we need.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoring-buffer: Fix advance of reader in rb_buffer_peek()
Robert Richter [Thu, 30 Jul 2009 17:19:18 +0000 (19:19 +0200)]
ring-buffer: Fix advance of reader in rb_buffer_peek()

When calling rb_buffer_peek() from ring_buffer_consume() and a
padding event is returned, the function rb_advance_reader() is
called twice. This may lead to missing samples or under high
workloads to the warning below. This patch fixes this. If a padding
event is returned by rb_buffer_peek() it will be consumed by the
calling function now.

Also, I simplified some code in ring_buffer_consume().

------------[ cut here ]------------
WARNING: at /dev/shm/.source/linux/kernel/trace/ring_buffer.c:2289 rb_advance_reader+0x2e/0xc5()
Hardware name: Anaheim
Modules linked in:
Pid: 29, comm: events/2 Tainted: G        W  2.6.31-rc3-oprofile-x86_64-standard-00059-g5050dc2 #1
Call Trace:
[<ffffffff8106776f>] ? rb_advance_reader+0x2e/0xc5
[<ffffffff81039ffe>] warn_slowpath_common+0x77/0x8f
[<ffffffff8103a025>] warn_slowpath_null+0xf/0x11
[<ffffffff8106776f>] rb_advance_reader+0x2e/0xc5
[<ffffffff81068bda>] ring_buffer_consume+0xa0/0xd2
[<ffffffff81326933>] op_cpu_buffer_read_entry+0x21/0x9e
[<ffffffff810be3af>] ? __find_get_block+0x4b/0x165
[<ffffffff8132749b>] sync_buffer+0xa5/0x401
[<ffffffff810be3af>] ? __find_get_block+0x4b/0x165
[<ffffffff81326c1b>] ? wq_sync_buffer+0x0/0x78
[<ffffffff81326c76>] wq_sync_buffer+0x5b/0x78
[<ffffffff8104aa30>] worker_thread+0x113/0x1ac
[<ffffffff8104dd95>] ? autoremove_wake_function+0x0/0x38
[<ffffffff8104a91d>] ? worker_thread+0x0/0x1ac
[<ffffffff8104dc9a>] kthread+0x88/0x92
[<ffffffff8100bdba>] child_rip+0xa/0x20
[<ffffffff8104dc12>] ? kthread+0x0/0x92
[<ffffffff8100bdb0>] ? child_rip+0x0/0x20
---[ end trace f561c0a58fcc89bd ]---

Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: <stable@kernel.org>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf_counter/powerpc: Check oprofile_cpu_type for NULL before using it
Benjamin Herrenschmidt [Thu, 6 Aug 2009 11:16:44 +0000 (21:16 +1000)]
perf_counter/powerpc: Check oprofile_cpu_type for NULL before using it

If the current CPU doesn't support performance counters,
cur_cpu_spec->oprofile_cpu_type can be NULL. The current
perf_counter modules don't test for that case and would thus
crash at boot time.

Bug reported by David Woodhouse.

Reported-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Paul Mackerras <paulus@samba.org>
LKML-Reference: <19066.48028.446975.501454@cargo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agointel-iommu: Fix enabling snooping feature by mistake
Sheng Yang [Thu, 6 Aug 2009 05:31:56 +0000 (13:31 +0800)]
intel-iommu: Fix enabling snooping feature by mistake

Two defects work together result in KVM device passthrough randomly can't
work:
1. iommu_snooping is not initialized to zero when vm_iommu_init() called.
So it is possible to get a random value.
2. One line added by commit 2c2e2c38("IOMMU Identity Mapping Support")
change the code path, let it bypass domain_update_iommu_cap(), as well as
missing the increment of domain iommu reference count.

The latter is also likely to cause a leak of domains on repeated VMM
assignment and deassignment.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoKVM: MMU: limit rmap chain length
Marcelo Tosatti [Wed, 5 Aug 2009 18:43:58 +0000 (15:43 -0300)]
KVM: MMU: limit rmap chain length

Otherwise the host can spend too long traversing an rmap chain, which
happens under a spinlock.

Cc: stable@kernel.org
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agoaf_ieee802154: provide dummy get/setsockopt
Dmitry Eremin-Solenikov [Mon, 3 Aug 2009 13:53:00 +0000 (17:53 +0400)]
af_ieee802154: provide dummy get/setsockopt

Provide dummt get/setsockopt implementations to stop these
syscalls from oopsing on our sockets.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agoaf_ieee802154: fix ioctl processing
Dmitry Eremin-Solenikov [Sun, 2 Aug 2009 10:12:01 +0000 (14:12 +0400)]
af_ieee802154: fix ioctl processing

fix two errors in ioctl processing:
1) if the ioctl isn't supported one should return -ENOIOCTLCMD
2) don't call ndo_do_ioctl if the device doesn't provide it

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agoInput: matrix_keypad - make matrix keymap size dynamic
Eric Miao [Wed, 5 Aug 2009 08:24:41 +0000 (01:24 -0700)]
Input: matrix_keypad - make matrix keymap size dynamic

Remove assumption on the shift and size of rows/columns form
matrix_keypad driver.

Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: wistron_btns - support Prestigio Wifi RF kill button
TJ [Mon, 3 Aug 2009 20:39:09 +0000 (13:39 -0700)]
Input: wistron_btns - support Prestigio Wifi RF kill button

The Prestigio 157, an old no-name clone laptop uses input keys very
similar to the Wistron 1557/MS2141 with the addition of BIOS-controlled
wireless radio frequency kill switch.

This patch adds support for the RF kill switch control and adds manual
identification of the model.

The Prestigio does not expose any recognisable identity via dmidecode
and so requires manual selection at module init using

force=1 keymap=prestigio

Signed-off-by: TJ <ubuntu@tjworld.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agodrm/radeon/kms: Fix caching mode selection for GTT object
Jerome Glisse [Wed, 29 Jul 2009 16:55:53 +0000 (18:55 +0200)]
drm/radeon/kms: Fix caching mode selection for GTT object

GTT object can either be cached,uncached or wc just let core ttm
pick the best mode according to how the bo driver and GTT memory
type was initialized.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoftrace: Fix perf-tracepoint OOPS
Peter Zijlstra [Wed, 5 Aug 2009 18:41:04 +0000 (20:41 +0200)]
ftrace: Fix perf-tracepoint OOPS

Not all tracepoints are created equal, in specific the ftrace
tracepoints are created with TRACE_EVENT_FORMAT() which does
not generate the needed bits to tie them into perf counters.

For those events, don't create the 'id' file and fail
->profile_enable when their ID is specified through other
means.

Reported-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <1249497664.5890.4.camel@laptop>
[ v2: fix build error in the !CONFIG_EVENT_PROFILE case ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agortmutex: Avoid deadlock in rt_mutex_start_proxy_lock()
Darren Hart [Wed, 5 Aug 2009 19:05:21 +0000 (12:05 -0700)]
rtmutex: Avoid deadlock in rt_mutex_start_proxy_lock()

In the event of a lock steal or owner died,
rt_mutex_start_proxy_lock() will give the rt_mutex to the
waiting task, but it fails to release the wait_lock. This leads
to subsequent deadlocks when other tasks try to acquire the
rt_mutex.

I also removed a few extra blank lines that really spaced this
routine out. I must have been high on the \n when I wrote this
originally...

Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Dinakar Guniguntala <dino@in.ibm.com>
Cc: John Stultz <johnstul@linux.vnet.ibm.com>
LKML-Reference: <4A79D7F1.4000405@us.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agonet/rds: Use AF_INET for sin_family field
Julia Lawall [Thu, 6 Aug 2009 03:30:13 +0000 (20:30 -0700)]
net/rds: Use AF_INET for sin_family field

Elsewhere the sin_family field holds a value with a name of the form
AF_..., so it seems reasonable to do so here as well.  Also the values of
PF_INET and AF_INET are the same.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
struct sockaddr_in sip;
@@

(
sip.sin_family ==
- PF_INET
+ AF_INET
|
sip.sin_family !=
- PF_INET
+ AF_INET
|
sip.sin_family =
- PF_INET
+ AF_INET
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocxgb3: fix 2 ports 1G regression
Divy Le Ray [Thu, 6 Aug 2009 03:28:27 +0000 (20:28 -0700)]
cxgb3: fix 2 ports 1G regression

commit 88045b3cf0f8981129cb489c7b6bc36c21dd33a7
cxgb3: fix mac index mapping

Override the mac index computation for the gen2 adapter,
as each port is expected to use index 0.

introduces a regression on 2 port 1G adapter
as its xauicfg vpd value is null.
Add a check on the device id.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoAdd IDs for 3C905B-TX Fast Etherlink XL PCI
Pascal Terjan [Wed, 5 Aug 2009 04:11:39 +0000 (04:11 +0000)]
Add IDs for 3C905B-TX Fast Etherlink XL PCI

We found this old card which was not supported, and physically
looks similar to the other 3C905B we have (9055).

After adding the IDs it seems to work fine (MII report, dhcp, scp, ...)

Acked-by: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotracing: do not use functions starting with .L in recordmcount.pl
Steven Rostedt [Thu, 6 Aug 2009 02:00:14 +0000 (22:00 -0400)]
tracing: do not use functions starting with .L in recordmcount.pl

On Wed, 5 Aug 2009, Ingo Molnar wrote:
> * Dave Airlie <airlied@gmail.com> wrote:
>
> > Hey,
> >
> > So I spent 3-4 hrs today (I'm stupid yes) tracking down a .o
> > breakage by blaming rawhide gcc/binutils as I was using make
> > V=1and seeing only the compiler chain running,
>
> Hm, is this that powerpc related build bug you just reported?

Well we tracked it down and it is powerpc64 specific.

Seems that in drivers/hwmon/lm93.c there's a function called:

   LM93_IN_FROM_REG()

But PPC64 has function descriptors and the real function names (the ones
you see in objdump) start with a '.'. Thus this in objdump you have:

 Disassembly of section .text:

 0000000000000000 <.LM93_IN_FROM_REG>:
       0:       7c 08 02 a6     mflr    r0
       4:       fb 81 ff e0     std     r28,-32(r1)

The function name used is .LM93_IN_FROM_REG. But gcc considers symbols
that start with ".L" as a special symbol that is used inside the assembly
stage.

The nm passed into recordmcount uses the --synthetic option which shows
the ".L" symbols (my runs outside of the build did not include the
--synthetic option, so my older patch worked). We see the function as a
local.

Now to capture all the locations that use "mcount" we need to have a
reference to link into the object file a list of mcount callers. We need a
reference that will not disappear. We try to use a global function and if
that does not work, we use a local function as a reference. But to relink
the section back into the object, we need to make it global. In this case,
we run objcopy using --globalize-symbol and --localize-symbol to convert
the symbol into a global symbol, link the mcount list, then convert it
back to a local symbol.

This works great except for this case. .L* symbols can not be converted
into a global symbol, and the mcount section referencing it will remain
unresolved.

Reported-by: Dave Airlie <airlied@gmail.com>
LKML-Reference: <alpine.DEB.2.00.0908052011590.5010@gandalf.stny.rr.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
14 years agoring-buffer: do not disable ring buffer on oops_in_progress
Steven Rostedt [Wed, 5 Aug 2009 19:26:37 +0000 (15:26 -0400)]
ring-buffer: do not disable ring buffer on oops_in_progress

The commit:

  commit e0fdace10e75dac67d906213b780ff1b1a4cc360
  Author: David Miller <davem@davemloft.net>
  Date:   Fri Aug 1 01:11:22 2008 -0700

    debug_locks: set oops_in_progress if we will log messages.

    Otherwise lock debugging messages on runqueue locks can deadlock the
    system due to the wakeups performed by printk().

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Will permanently set oops_in_progress on any lockdep failure.
When this triggers it will cause any read from the ring buffer to
permanently disable the ring buffer (not to mention no locking of
printk).

This patch removes the check. It keeps the print in NMI which makes
sense. This is probably OK, since the ring buffer should not cause
something to set oops_in_progress anyway.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
14 years agoring-buffer: fix check of try_to_discard result
Steven Rostedt [Wed, 5 Aug 2009 16:02:48 +0000 (12:02 -0400)]
ring-buffer: fix check of try_to_discard result

The function ring_buffer_discard_commit inversed the code path
of the result of try_to_discard. It should skip incrementing the
entry counter if try_to_discard succeeded. But instead, it increments
the entry conder if it succeeded to discard, and does not increment
it if it fails.

The result of this bug is that filtering will make the stat counters
incorrect.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
14 years agoARM: 5639/1: arm: clkdev.c should include <linux/clk.h>
Hartley Sweeten [Tue, 4 Aug 2009 22:38:06 +0000 (23:38 +0100)]
ARM: 5639/1: arm: clkdev.c should include <linux/clk.h>

<linux/clk.h> should be included to get the base API prototypes.

This fixes the following sparse warnings:

  arch/arm/common/clkdev.c:65:12:
    warning: symbol 'clk_get_sys' was not declared. Should it be static?

  arch/arm/common/clkdev.c:79:12:
    warning: symbol 'clk_get' was not declared. Should it be static?

  arch/arm/common/clkdev.c:87:6:
    warning: symbol 'clk_put' was not declared. Should it be static?

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoARM: 5638/1: arch/arm/kernel/signal.c: use correct address space for CRUNCH
Hartley Sweeten [Tue, 4 Aug 2009 22:20:45 +0000 (23:20 +0100)]
ARM: 5638/1: arch/arm/kernel/signal.c: use correct address space for CRUNCH

preserve_crunch_context() calls __copy_to_user() which expects the
destination address to be in __user space.  setup_sigframe() properly
passes the destination address.

restore_crunch_context() calls __copy_from_user() which expects the
source address to be in __user space.  restore_sigframe() properly
passes the source address.

This fixes {preserve/restore}_crunch_context() to accept the
address as __user space and resolves the following sparse warnings:

  arch/arm/kernel/signal.c:146:31:
     warning: incorrect type in argument 1 (different address spaces)
        expected void [noderef] <asn:1>*to
        got struct crunch_sigframe *frame

  arch/arm/kernel/signal.c:156:38:
     warning: incorrect type in argument 2 (different address spaces)
        expected void const [noderef] <asn:1>*from
        got struct crunch_sigframe *frame

  arch/arm/kernel/signal.c:250:48:
     warning: incorrect type in argument 1 (different address spaces)
        expected struct crunch_sigframe *frame
        got struct crunch_sigframe [noderef] <asn:1>*<noident>

  arch/arm/kernel/signal.c:365:49:
     warning: incorrect type in argument 1 (different address spaces)
        expected struct crunch_sigframe *frame
        got struct crunch_sigframe [noderef] <asn:1>*<noident>

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoARM: 5637/1: [KS8695] Don't reference CLOCK_TICK_RATE in drivers
Andrew Victor [Tue, 4 Aug 2009 18:55:56 +0000 (19:55 +0100)]
ARM: 5637/1: [KS8695] Don't reference CLOCK_TICK_RATE in drivers

Stop referencing CLOCK_TICK_RATE in the KS8695 drivers, rather refer
to a KS8695_CLOCK_RATE.
Issue pointed out by Russell King on arm-linux-kernel mailing list.

Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agovxge: Version update
Benjamin LaHaise [Tue, 4 Aug 2009 10:22:19 +0000 (10:22 +0000)]
vxge: Version update

Update the driver version number for any bug reports from end users.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovxge: prefetch skb->data
Benjamin LaHaise [Tue, 4 Aug 2009 10:21:57 +0000 (10:21 +0000)]
vxge: prefetch skb->data

This patch implements prefetching of skb->data from a copy of the pointer
in the descriptor (which is already in the L1 cache at this point).  This
improves netperf rx performance (netperf -L 0,0 -c -H 192.168.254.2 -- -M
131072 -m 131072) by 4.9% on a P4 Xeon host.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovxge: prefetch RxD descriptors
Benjamin LaHaise [Tue, 4 Aug 2009 10:21:39 +0000 (10:21 +0000)]
vxge: prefetch RxD descriptors

This patch prefetches RxD descriptors which helps to lower the latency of a
cache miss in vxge_hw_ring_rxd_next_completed.  This lowers the % of CPU
time used by vxge_hw_ring_rxd_next_completed() where the descriptor is
accessed in profiling netperf on a P4 Xeon from 1.5% to 1.0%.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovxge: improve tx performance by using mmiowb() instead of wmb()
Benjamin LaHaise [Tue, 4 Aug 2009 10:21:21 +0000 (10:21 +0000)]
vxge: improve tx performance by using mmiowb() instead of wmb()

wmb() is extremely heavy on x86.  The semantics required in the driver are
provided by mmiowb(), so use that and improve tx performance on P4 Xeons by
5-10%.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovxge: fix pktgen hangs (don't abuse skb->cb[])
Benjamin LaHaise [Tue, 4 Aug 2009 10:21:03 +0000 (10:21 +0000)]
vxge: fix pktgen hangs (don't abuse skb->cb[])

This patch fixes a case in the transmit completion code which was resulting
in pktgen hanging at the end of a run.  The cause is due to the fact that
the ->cb[] area of an skb cannot be used in a network driver's transmit
path, as that area belongs to the network protocol.  Pktgen hangs, as it
sends out the same packet multiple times, and vxge's use of this area of
the skb for a temporary list can only add the packet to the temporary list
once (while it may be on the queue many times).  The fix is to remove this
abuse of skb->cb[].  Instead, skb pointers are placed into a temporary
stack array, and then free outside of the tx lock.  This retains the smp
optimization of doing dev_kfree_skb() outside of the tx lock.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovxge: don't drop frame on tx queue full
Benjamin LaHaise [Tue, 4 Aug 2009 10:20:44 +0000 (10:20 +0000)]
vxge: don't drop frame on tx queue full

The vxge driver will drop a packet in its transmit function if the number
of TxDs available hits 0.  Instead of doing that, simply stop the transmit
queue when transmitting a packet with the last available TxD.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: allow vlan egress priority mapping in DCB mode
Lucy Liu [Wed, 5 Aug 2009 20:06:34 +0000 (13:06 -0700)]
ixgbe: allow vlan egress priority mapping in DCB mode

The skb priority to vlan-qos egress mapping that can be configured using
set_egress_map with vconfig is overriden by the DCB code in the driver.

This patch allows this existing mechanism to work and will increase the
configuration flexibility of DCB mode on Linux.

A hierarchy of configuration is:

1. Modifies the ixgbe_select_queue() routine for DCB mode to return the
priority value from the VLAN tag. It will normally be zero, unless the egress
priority map has modified it. This will get packets into the correct queue and
result in the queue_mapping field being set correctly.

2. Any tc filter which modifies queue_mapping will be honored, as the filters
are handled after the vlan egress map is handled.

Signed-off-by: Lucy Liu <lucy.liu@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: Patch to perform function reset at initialization
sarveshwarb [Wed, 5 Aug 2009 20:05:24 +0000 (13:05 -0700)]
be2net: Patch to perform function reset at initialization

This patch is a bug fix to avoid system going into a bad state when
driver is loaded in context of kdump kernel. The patch fixes the issue
by performing a soft reset of pci function at probe time.

Signed-off-by: sarveshwarb <sarveshwarb@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: implement a SO_DOMAIN getsockoption
Jan Engelhardt [Tue, 4 Aug 2009 07:28:29 +0000 (07:28 +0000)]
net: implement a SO_DOMAIN getsockoption

This sockopt goes in line with SO_TYPE and SO_PROTOCOL. It makes it
possible for userspace programs to pass around file descriptors — I
am referring to arguments-to-functions, but it may even work for the
fd passing over UNIX sockets — without needing to also pass the
auxiliary information (PF_INET6/IPPROTO_TCP).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: implement a SO_PROTOCOL getsockoption
Jan Engelhardt [Tue, 4 Aug 2009 07:28:28 +0000 (07:28 +0000)]
net: implement a SO_PROTOCOL getsockoption

Similar to SO_TYPE returning the socket type, SO_PROTOCOL allows to
retrieve the protocol used with a given socket.

I am not quite sure why we have that-many copies of socket.h, and why
the values are not the same on all arches either, but for where hex
numbers dominate, I use 0x1029 for SO_PROTOCOL as that seems to be
the next free unused number across a bunch of operating systems, or
so Google results make me want to believe. SO_PROTOCOL for others
just uses the next free Linux number, 38.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: add hardware LRO support
Dhananjay Phadke [Wed, 5 Aug 2009 07:34:09 +0000 (07:34 +0000)]
netxen: add hardware LRO support

Add support to handle aggregate packets from firmware.
Local TCP flows are automatically identified by firmware
based on the dest IP hash added by driver for local IP
addresses.

The packets are sent down on the jumbo rx ring.

Signed-off-by: Narender Kumar <narender.kumar@qlogic.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: remove unnecessary structures
Dhananjay Phadke [Wed, 5 Aug 2009 07:34:08 +0000 (07:34 +0000)]
netxen: remove unnecessary structures

Remove unnecessary offsetof calulations on these structures:
netxen_board_info, netxen_user_old_info, netxen_new_user_info.

The offsets into the flash are fixed, don't need to be calculated.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix vlan tso case
Dhananjay Phadke [Wed, 5 Aug 2009 07:34:07 +0000 (07:34 +0000)]
netxen: fix vlan tso case

Fix the calculation of remaining header length in TSO
over vlan device case. This was inadvertently missed
out in patch 028afe719855a157e32450c ("netxen: add vlan
tx acceleration support").

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocpmac: unmark as broken
Florian Fainelli [Tue, 4 Aug 2009 11:17:49 +0000 (11:17 +0000)]
cpmac: unmark as broken

Starting with version 0.5.1, cpmac is no longer broken.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocpmac: bump version to 0.5.1
Florian Fainelli [Tue, 4 Aug 2009 10:53:00 +0000 (10:53 +0000)]
cpmac: bump version to 0.5.1

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocpmac: wait longer after MDIO reset
Florian Fainelli [Tue, 4 Aug 2009 10:52:57 +0000 (10:52 +0000)]
cpmac: wait longer after MDIO reset

This patch slows down the MDIO_ALIVE busy waiting to let
switches and PHY come up after reset. Previous loop was
too quick for IC+175C and ADM6996C/L switches to come up.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocpmac: add support for fixed PHY
Florian Fainelli [Tue, 4 Aug 2009 10:52:52 +0000 (10:52 +0000)]
cpmac: add support for fixed PHY

This patch adds support for fixed PHY connected in MII mode
to cpmac. We allow external and dumb_switch module parameters
to override the PHY detection process since they are always connected
with MDIO bus identifier 0. This lets fixed PHYs to be detected
correctly and be connected to the their corresponding MDIO
bus identifier.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoar7: add fixed PHY support for the two on-board cpmac
Florian Fainelli [Tue, 4 Aug 2009 10:52:47 +0000 (10:52 +0000)]
ar7: add fixed PHY support for the two on-board cpmac

This patch adds fixed PHY support for the two on-chip
cpmac Ethernet adapters.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocpmac: fix wrong MDIO bus identifier
Florian Fainelli [Tue, 4 Aug 2009 10:52:41 +0000 (10:52 +0000)]
cpmac: fix wrong MDIO bus identifier

This patch fixes the wrong MDIO bus identifier which was
set to 0 unconditionaly, suitable for external switches while
it is actually 1 for PHYs different than external switches
which are autodetected.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agophonet: phonet_device_get() fix
Eric Dumazet [Mon, 27 Jul 2009 15:03:18 +0000 (08:03 -0700)]
phonet: phonet_device_get() fix

net/phonet/pn_dev.c: In function `phonet_device_get':
net/phonet/pn_dev.c:99: warning: 'dev' might be used uninitialized in this function

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrm/i915: Fix read outside array bounds in restoring the SWF10 range.
Roel Kluin [Sat, 25 Jul 2009 22:50:38 +0000 (00:50 +0200)]
drm/i915: Fix read outside array bounds in restoring the SWF10 range.

dev_priv->saveSWF1 is a 16 element array, but this reads up to index 22,
and restored values from the wrong registers.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
14 years agodrm/i915: Use our own workqueue to avoid wedging the system along with the GPU.
Eric Anholt [Mon, 3 Aug 2009 23:09:16 +0000 (16:09 -0700)]
drm/i915: Use our own workqueue to avoid wedging the system along with the GPU.

Signed-off-by: Eric Anholt <eric@anholt.net>
14 years agonet: mark read-only arrays as const
Jan Engelhardt [Wed, 5 Aug 2009 17:42:58 +0000 (10:42 -0700)]
net: mark read-only arrays as const

String literals are constant, and usually, we can also tag the array
of pointers const too, moving it to the .rodata section.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodccp: missing destroy of percpu counter variable while unload module
Wei Yongjun [Tue, 4 Aug 2009 21:44:39 +0000 (21:44 +0000)]
dccp: missing destroy of percpu counter variable while unload module

percpu counter dccp_orphan_count is init in dccp_init() by
percpu_counter_init() while dccp module is loaded, but the
destroy of it is missing while dccp module is unloaded. We
can get the kernel WARNING about this. Reproduct by the
following commands:

  $ modprobe dccp
  $ rmmod dccp
  $ modprobe dccp

WARNING: at lib/list_debug.c:26 __list_add+0x27/0x5c()
Hardware name: VMware Virtual Platform
list_add corruption. next->prev should be prev (c080c0c4), but was (null). (next
=ca7188cc).
Modules linked in: dccp(+) nfsd lockd nfs_acl auth_rpcgss exportfs sunrpc
Pid: 1956, comm: modprobe Not tainted 2.6.31-rc5 #55
Call Trace:
 [<c042f8fa>] warn_slowpath_common+0x6a/0x81
 [<c053a6cb>] ? __list_add+0x27/0x5c
 [<c042f94f>] warn_slowpath_fmt+0x29/0x2c
 [<c053a6cb>] __list_add+0x27/0x5c
 [<c053c9b3>] __percpu_counter_init+0x4d/0x5d
 [<ca9c90c7>] dccp_init+0x19/0x2ed [dccp]
 [<c0401141>] do_one_initcall+0x4f/0x111
 [<ca9c90ae>] ? dccp_init+0x0/0x2ed [dccp]
 [<c06971b5>] ? notifier_call_chain+0x26/0x48
 [<c0444943>] ? __blocking_notifier_call_chain+0x45/0x51
 [<c04516f7>] sys_init_module+0xac/0x1bd
 [<c04028e4>] sysenter_do_call+0x12/0x22

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix dma mask update calculation
Dhananjay Phadke [Tue, 4 Aug 2009 10:39:03 +0000 (10:39 +0000)]
netxen: fix dma mask update calculation

Fix dma mask calculation that caps at 63-bit addressing even
when firmware advertises full 64-bit support.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Fix spinlock use in alloc_netdev_mq()
Ingo Molnar [Tue, 4 Aug 2009 21:16:58 +0000 (21:16 +0000)]
net: Fix spinlock use in alloc_netdev_mq()

-tip testing found this lockdep warning:

[    2.272010] calling  net_dev_init+0x0/0x164 @ 1
[    2.276033] device class 'net': registering
[    2.280191] INFO: trying to register non-static key.
[    2.284005] the code is fine but needs lockdep annotation.
[    2.284005] turning off the locking correctness validator.
[    2.284005] Pid: 1, comm: swapper Not tainted 2.6.31-rc5-tip #1145
[    2.284005] Call Trace:
[    2.284005]  [<7958eb4e>] ? printk+0xf/0x11
[    2.284005]  [<7904f83c>] __lock_acquire+0x11b/0x622
[    2.284005]  [<7908c9b7>] ? alloc_debug_processing+0xf9/0x144
[    2.284005]  [<7904e2be>] ? mark_held_locks+0x3a/0x52
[    2.284005]  [<7908dbc4>] ? kmem_cache_alloc+0xa8/0x13f
[    2.284005]  [<7904e475>] ? trace_hardirqs_on_caller+0xa2/0xc3
[    2.284005]  [<7904fdf6>] lock_acquire+0xb3/0xd0
[    2.284005]  [<79489678>] ? alloc_netdev_mq+0xf5/0x1ad
[    2.284005]  [<79591514>] _spin_lock_bh+0x2d/0x5d
[    2.284005]  [<79489678>] ? alloc_netdev_mq+0xf5/0x1ad
[    2.284005]  [<79489678>] alloc_netdev_mq+0xf5/0x1ad
[    2.284005]  [<793a38f2>] ? loopback_setup+0x0/0x74
[    2.284005]  [<798eecd0>] loopback_net_init+0x20/0x5d
[    2.284005]  [<79483efb>] register_pernet_device+0x23/0x4b
[    2.284005]  [<798f5c9f>] net_dev_init+0x115/0x164
[    2.284005]  [<7900104f>] do_one_initcall+0x4a/0x11a
[    2.284005]  [<798f5b8a>] ? net_dev_init+0x0/0x164
[    2.284005]  [<79066f6d>] ? register_irq_proc+0x8c/0xa8
[    2.284005]  [<798cc29a>] do_basic_setup+0x42/0x52
[    2.284005]  [<798cc30a>] kernel_init+0x60/0xa1
[    2.284005]  [<798cc2aa>] ? kernel_init+0x0/0xa1
[    2.284005]  [<79003e03>] kernel_thread_helper+0x7/0x10
[    2.284078] device: 'lo': device_add
[    2.288248] initcall net_dev_init+0x0/0x164 returned 0 after 11718 usecs
[    2.292010] calling  neigh_init+0x0/0x66 @ 1
[    2.296010] initcall neigh_init+0x0/0x66 returned 0 after 0 usecs

it's using an zero-initialized spinlock. This is a side-effect of:

        dev_unicast_init(dev);

in alloc_netdev_mq() making use of dev->addr_list_lock.

The device has just been allocated freshly, it's not accessible
anywhere yet so no locking is needed at all - in fact it's wrong
to lock it here (the lock isnt initialized yet).

This bug was introduced via:

| commit a6ac65db2329e7685299666f5f7b6093c7b0f3a0
| Date:   Thu Jul 30 01:06:12 2009 +0000
|
|     net: restore the original spinlock to protect unicast list

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jiri Pirko <jpirko@redhat.com>
Tested-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoperf report: Add missing command line options to man page
Arnaldo Carvalho de Melo [Wed, 5 Aug 2009 13:04:53 +0000 (10:04 -0300)]
perf report: Add missing command line options to man page

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20090805130453.GC10688@ghostprotocols.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf: Auto-detect libbfd
Peter Zijlstra [Wed, 5 Aug 2009 12:05:16 +0000 (14:05 +0200)]
perf: Auto-detect libbfd

Since the C++ demangling isn't needed for everybody and
bfd/iberty aren't widely/easily available on all machines, make
it optional.

It also allows you to forcefully disable demangling by using
NO_DEMANGLE=1 and otherwise tries to detect libbfd/libiberty
combinations that result in a compiling demangler.

Reported-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
LKML-Reference: <20090801082048.GX12579@kernel.dk>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoKVM: ia64: fix build failures due to ia64/unsigned long mismatches
Avi Kivity [Mon, 6 Jul 2009 09:49:39 +0000 (12:49 +0300)]
KVM: ia64: fix build failures due to ia64/unsigned long mismatches

Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agoKVM: Make KVM_HPAGES_PER_HPAGE unsigned long to avoid build error on powerpc
Stephen Rothwell [Wed, 17 Jun 2009 05:04:19 +0000 (15:04 +1000)]
KVM: Make KVM_HPAGES_PER_HPAGE unsigned long to avoid build error on powerpc

Eliminates this compiler warning:

arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:1178: error: integer overflow in expression

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agoperf report: Make --sort comm,dso,symbol the default
Pekka Enberg [Wed, 5 Aug 2009 10:25:21 +0000 (13:25 +0300)]
perf report: Make --sort comm,dso,symbol the default

If you're doing performance testing, you're interested in the
symbols anyway so lets make "--sort comm,dso,symbol" the
default sort option.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: acme@redhat.com
LKML-Reference: <1249467921-10450-1-git-send-email-penberg@cs.helsinki.fi>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoKVM: fix ack not being delivered when msi present
Michael S. Tsirkin [Sun, 26 Jul 2009 14:10:01 +0000 (17:10 +0300)]
KVM: fix ack not being delivered when msi present

kvm_notify_acked_irq does not check irq type, so that it sometimes
interprets msi vector as irq.  As a result, ack notifiers are not
called, which typially hangs the guest.  The fix is to track and
check irq type.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agoKVM: s390: fix wait_queue handling
Christian Borntraeger [Thu, 16 Jul 2009 15:17:37 +0000 (17:17 +0200)]
KVM: s390: fix wait_queue handling

There are two waitqueues in kvm for wait handling:
vcpu->wq for virt/kvm/kvm_main.c and
vpcu->arch.local_int.wq for the s390 specific wait code.

the wait handling in kvm_s390_handle_wait was broken by using different
wait_queues for add_wait queue and remove_wait_queue.

There are two options to fix the problem:
o  move all the s390 specific code to vcpu->wq and remove
   vcpu->arch.local_int.wq
o  move all the s390 specific code to vcpu->arch.local_int.wq

This patch chooses the 2nd variant for two reasons:
o  s390 does not use kvm_vcpu_block but implements its own enabled wait
   handling.
   Having a separate wait_queue make it clear, that our wait mechanism is
   different
o  the patch is much smaller

Report-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agoKVM: VMX: Fix locking imbalance on emulation failure
Jan Kiszka [Tue, 21 Jul 2009 08:43:07 +0000 (10:43 +0200)]
KVM: VMX: Fix locking imbalance on emulation failure

We have to disable preemption and IRQs on every exit from
handle_invalid_guest_state, otherwise we generate at least a
preempt_disable imbalance.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agoKVM: VMX: Fix locking order in handle_invalid_guest_state
Jan Kiszka [Wed, 22 Jul 2009 21:53:26 +0000 (23:53 +0200)]
KVM: VMX: Fix locking order in handle_invalid_guest_state

Release and re-acquire preemption and IRQ lock in the same order as
vcpu_enter_guest does.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agoKVM: MMU: handle n_free_mmu_pages > n_alloc_mmu_pages in kvm_mmu_change_mmu_pages
Marcelo Tosatti [Wed, 22 Jul 2009 16:05:49 +0000 (13:05 -0300)]
KVM: MMU: handle n_free_mmu_pages > n_alloc_mmu_pages in kvm_mmu_change_mmu_pages

kvm_mmu_change_mmu_pages mishandles the case where n_alloc_mmu_pages is
smaller then n_free_mmu_pages, by not checking if the result of
the subtraction is negative.

Its a valid condition which can happen if a large number of pages has
been recently freed.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agoKVM: SVM: force new asid on vcpu migration
Marcelo Tosatti [Tue, 21 Jul 2009 15:47:45 +0000 (12:47 -0300)]
KVM: SVM: force new asid on vcpu migration

If a migrated vcpu matches the asid_generation value of the target pcpu,
there will be no TLB flush via TLB_CONTROL_FLUSH_ALL_ASID.

The check for vcpu.cpu in pre_svm_run is meaningless since svm_vcpu_load
already updated it on schedule in.

Such vcpu will VMRUN with stale TLB entries.

Based on original patch from Joerg Roedel (http://patchwork.kernel.org/patch/10021/)

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agoKVM: x86: verify MTRR/PAT validity
Marcelo Tosatti [Mon, 22 Jun 2009 18:27:56 +0000 (15:27 -0300)]
KVM: x86: verify MTRR/PAT validity

Do not allow invalid memory types in MTRR/PAT (generating a #GP
otherwise).

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agoKVM: PIT: fix kpit_elapsed division by zero
Marcelo Tosatti [Thu, 2 Jul 2009 23:02:15 +0000 (20:02 -0300)]
KVM: PIT: fix kpit_elapsed division by zero

Fix division by zero triggered by latch count command on uninitialized
counter.

Cc: stable@kernel.org
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agoKVM: Fix KVM_GET_MSR_INDEX_LIST
Jan Kiszka [Thu, 2 Jul 2009 19:45:47 +0000 (21:45 +0200)]
KVM: Fix KVM_GET_MSR_INDEX_LIST

So far, KVM copied the emulated_msrs (only MSR_IA32_MISC_ENABLE) to a
wrong address in user space due to broken pointer arithmetic. This
caused subtle corruption up there (missing MSR_IA32_MISC_ENABLE had
probably no practical relevance). Moreover, the size check for the
user-provided kvm_msr_list forgot about emulated MSRs.

Cc: stable@kernel.org
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agox86: Fix VMI && stack protector
Alok Kataria [Tue, 4 Aug 2009 22:34:22 +0000 (15:34 -0700)]
x86: Fix VMI && stack protector

With CONFIG_STACK_PROTECTOR turned on, VMI doesn't boot with
more than one processor. The problem is with the gs value not
being initialized correctly when registering the secondary
processor for VMI's case.

The patch below initializes the gs value for the AP to
__KERNEL_STACK_CANARY. Without this the secondary processor
keeps on taking a GP on every gs access.

Signed-off-by: Alok N Kataria <akataria@vmware.com>
Cc: <stable@kernel.org> # for v2.6.30.x
LKML-Reference: <1249425262.18955.40.camel@ank32.eng.vmware.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agointel-iommu: Mask physical address to correct page size in intel_map_single()
Fenghua Yu [Tue, 4 Aug 2009 22:10:59 +0000 (15:10 -0700)]
intel-iommu: Mask physical address to correct page size in intel_map_single()

The physical address passed to domain_pfn_mapping() should be rounded
down to the start of the MM page, not the VT-d page.

This issue causes kernel panic on PAGE_SIZE>VTD_PAGE_SIZE platforms e.g. ia64
platforms.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agointel-iommu: Correct sglist size calculation.
Fenghua Yu [Tue, 4 Aug 2009 22:09:37 +0000 (15:09 -0700)]
intel-iommu: Correct sglist size calculation.

In domain_sg_mapping(), use aligned_nrpages() instead of hand-coded
rounding code for calculating the size of each sg elem. This means that
on IA64 we correctly round up to the MM page size, not just to the VT-d
page size.

Also remove the incorrect mm_to_dma_pfn() when intel_map_sg() calls
domain_sg_mapping() -- the 'size' variable is in VT-d pages already.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoInput: i8042 - add Asus G1S to noloop exception list
Jory A. Pratt [Mon, 3 Aug 2009 16:32:34 +0000 (09:32 -0700)]
Input: i8042 - add Asus G1S to noloop exception list

The synaptic touchpad on the Asus G1S is not properly detected when
rebooting machine or on cold boot from time to time. Adding the Asus
G1S to the noloop exception table resolves the issue.

# dmidecode 2.10
SMBIOS 2.4 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
     Manufacturer: ASUSTeK Computer Inc.
     Product Name: G1S
     Version: 1.0
     Wake-up Type: Power Switch
     SKU Number:
     Family:

Signed-off-by: Jory A. Pratt <geekypenguin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoxfrm6: Fix xfrm6_policy.c build when SYSCTL disabled.
David S. Miller [Wed, 5 Aug 2009 03:32:16 +0000 (20:32 -0700)]
xfrm6: Fix xfrm6_policy.c build when SYSCTL disabled.

Same as how Randy Dunlap fixed the ipv4 side of things.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoxfrm4: fix build when SYSCTLs are disabled
Randy Dunlap [Wed, 5 Aug 2009 03:18:33 +0000 (20:18 -0700)]
xfrm4: fix build when SYSCTLs are disabled

Fix build errors when SYSCTLs are not enabled:
(.init.text+0x5154): undefined reference to `net_ipv4_ctl_path'
(.init.text+0x5176): undefined reference to `register_net_sysctl_table'
xfrm4_policy.c:(.exit.text+0x573): undefined reference to `unregister_net_sysctl_table

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrm/radeon: Add support for RS880 chips
Alex Deucher [Tue, 4 Aug 2009 15:24:24 +0000 (11:24 -0400)]
drm/radeon: Add support for RS880 chips

These are new AMD IGP chips

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Tue, 4 Aug 2009 22:49:11 +0000 (15:49 -0700)]
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (32 commits)
  MIPS: Wire up accept4 syscall.
  MIPS: VPE: Delete unused function get_tc_unused().
  MIPS: VPE: Fix bogus indentation.
  MIPS: VPE: Make various functions static.
  MIPS: VPE: Free relocation chain on error.
  MIPS: VPE: Fix compiler warning.
  MIPS: Module: Make error messages unique.
  MIPS: Octeon: Run IPI code with interrupts disabled.
  MIPS: Jazz: Fix read buffer overflow
  MIPS: Use DIV_ROUND_CLOSEST
  MIPS: MTX-1: Request button GPIO before setting its direction
  MIPS: AR7: Override CFLAGS with -Werror
  MIPS: AR7: Remove unused tnetd7200_get_clock function
  MIPS: AR7: Use DMA_BIT_MASK(nn) instead of deprecated DMA_nnBIT_MASK
  MIPS: AR7: Fix build failures when CONFIG_SERIAL_8250 is not enabled
  MIPS: Fix read buffer overflow
  MIPS: AR7: Fix build warning on memory.c
  MIPS: Octeon PCIe: Make hardware and software bus numbers match.
  MIPS: RBTX4939: Fix IOC pin-enable register updating
  MIPS: Simplify and correct interrupt handling for MSP4200
  ...

14 years agoMerge branch 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Tue, 4 Aug 2009 22:39:55 +0000 (15:39 -0700)]
Merge branch 'fix/hda' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Read buffer overflow
  ALSA: hda: Correct EAPD for Dell Inspiron 1525
  ALSA: hda: warn on spurious response
  ALSA: hda: remember last command for each codec
  ALSA: hda: read CORBWP inside reg_lock
  ALSA: hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io
  ALSA: hda: take cmd_mutex in probe_codec()
  ALSA: hda: track CIRB/CORB command/response states for each codec
  ALSA: hda - Fix quirk for Toshiba Satellite A135-S4527

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
Linus Torvalds [Tue, 4 Aug 2009 22:39:43 +0000 (15:39 -0700)]
Merge git://git./linux/kernel/git/gregkh/tty-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6:
  tty-ldisc: be more careful in 'put_ldisc' locking
  tty-ldisc: turn ldisc user count into a proper refcount
  tty-ldisc: make refcount be atomic_t 'users' count

14 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Tue, 4 Aug 2009 22:39:16 +0000 (15:39 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  Make SCSI SG v4 driver enabled by default and remove EXPERIMENTAL dependency, since udev depends on BSG
  block: Update topology documentation
  block: Stack optimal I/O size
  block: Add a wrapper for setting minimum request size without a queue
  block: Make blk_queue_stack_limits use the new stacking interface

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Tue, 4 Aug 2009 22:38:34 +0000 (15:38 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (47 commits)
  ehea: Fix napi list corruption on ifconfig down
  igbvf: Allow VF driver to correctly recognize failure to set mac
  3c59x: Fix build failure with gcc 3.2
  sky2: Avoid transmits during sky2_down()
  iwlagn: do not send key clear commands when rfkill enabled
  libertas: Read buffer overflow
  drivers/net/wireless: introduce missing kfree
  drivers/net/wireless/iwlwifi: introduce missing kfree
  zd1211rw: fix unaligned access in zd_mac_rx
  cfg80211: fix regression on beacon world roaming feature
  cfg80211: add two missing NULL pointer checks
  ixgbe: Patch to modify 82598 PCIe completion timeout values
  bluetooth: rfcomm_init bug fix
  mlx4_en: Fix double pci unmapping.
  mISDN: Fix handling of receive buffer size in L1oIP
  pcnet32: VLB support fixes
  pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
  net: restore the original spinlock to protect unicast list
  netxen: fix coherent dma mask setting
  mISDN: Read buffer overflow
  ...

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Linus Torvalds [Tue, 4 Aug 2009 22:38:10 +0000 (15:38 -0700)]
Merge git://git./linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (23 commits)
  [SCSI] sd: Avoid sending extended inquiry to legacy devices
  [SCSI] libsas: fix wide port hotplug issues
  [SCSI] libfc: fix a circular locking warning during sending RRQ
  [SCSI] qla4xxx: Remove hiwat code so scsi eh does not get escalated when we can make progress
  [SCSI] qla4xxx: Fix srb lookup in qla4xxx_eh_device_reset
  [SCSI] qla4xxx: Fix Driver Fault Recovery Completion
  [SCSI] qla4xxx: add timeout handler
  [SCSI] qla4xxx: Correct Extended Sense Data Errors
  [SCSI] libiscsi: disable bh in and abort handler.
  [SCSI] zfcp: Fix tracing of request id for abort requests
  [SCSI] zfcp: Fix wka port processing
  [SCSI] zfcp: avoid double notify in lowmem scenario
  [SCSI] zfcp: Add port only once to FC transport class
  [SCSI] zfcp: Recover from stalled outbound queue
  [SCSI] zfcp: Fix erp escalation procedure
  [SCSI] zfcp: Fix logic for physical port close
  [SCSI] zfcp: Use -EIO for SBAL allocation failures
  [SCSI] zfcp: Use unchained mode for small ct and els requests
  [SCSI] zfcp: Use correct flags for zfcp_erp_notify
  [SCSI] zfcp: Return -ENOMEM for allocation failures in zfcp_fsf
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Linus Torvalds [Tue, 4 Aug 2009 22:35:47 +0000 (15:35 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/bp/bp

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
  amd64_edac: print debug statements only on error
  amd64_edac: fix ECC checking

14 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Tue, 4 Aug 2009 22:34:30 +0000 (15:34 -0700)]
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/ttm: Read buffer overflow
  drm/radeon: Read buffer overflow
  drm/ttm: Fix a sync object leak.
  drm/radeon/kms: fix memory leak in radeon_driver_load_kms
  drm/radeon/kms: fix nomodeset.
  drm/ttm: Fix a potential comparison of structs.
  drm/radeon/kms: fix rv515 VRAM initialisation.
  drm/radeon: add some new r7xx pci ids
  drm: Catch stop possible NULL pointer reference
  drm: Small logic fix in drm_mode_setcrtc

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
Linus Torvalds [Tue, 4 Aug 2009 22:34:09 +0000 (15:34 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/deller/parisc-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-2.6:
  parisc: hppb.c - fix printk format strings
  parisc: parisc-agp.c - use correct page_mask function
  parisc: sticore.c - check return values
  parisc: dino.c - check return value of pci_assign_resource()
  parisc: hp_sdc_mlc.c - check return value of down_trylock()
  parisc: includecheck fix for ccio-dma.c
  parisc: Set correct bit in protection flags
  parisc: isa-eeprom - Fix loff_t usage
  parisc: fixed faulty check in lba_pci
  parisc: Fix read buffer overflow in pdc_stable driver
  parisc: Fix GOT overflow during module load on 64bit kernel

14 years agoflex_array: remove unneeded index calculation
Jonathan Corbet [Tue, 4 Aug 2009 19:35:17 +0000 (13:35 -0600)]
flex_array: remove unneeded index calculation

flex_array_get() calculates an index value, then drops it on the floor;
simply remove it.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Acked-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge branch 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Tue, 4 Aug 2009 22:32:40 +0000 (15:32 -0700)]
Merge branch 'perfcounters-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf_counter: Set the CONFIG_PERF_COUNTERS default to y if CONFIG_PROFILING=y
  perf: Fix read buffer overflow
  perf top: Add mwait_idle_with_hints to skip_symbols[]
  perf tools: Fix faulty check
  perf report: Update for the new FORK/EXIT events
  perf_counter: Full task tracing
  perf_counter: Collapse inherit on read()
  tracing, perf_counter: Add help text to CONFIG_EVENT_PROFILE
  perf_counter tools: Fix link errors with older toolchains

14 years agoMerge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 4 Aug 2009 22:32:22 +0000 (15:32 -0700)]
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: Fix race in cpupri introduced by cpumask_var changes
  sched: Fix latencytop and sleep profiling vs group scheduling

14 years agoMerge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 4 Aug 2009 22:32:08 +0000 (15:32 -0700)]
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  posix-timers: Fix oops in clock_nanosleep() with CLOCK_MONOTONIC_RAW

14 years agoMerge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 4 Aug 2009 22:31:51 +0000 (15:31 -0700)]
Merge branch 'tracing-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tracing: Fix missing function_graph events when we splice_read from trace_pipe
  tracing: Fix invalid function_graph entry
  trace: stop tracer in oops_enter()
  ftrace: Only update $offset when we update $ref_func
  ftrace: Fix the conditional that updates $ref_func
  tracing: only truncate ftrace files when O_TRUNC is set
  tracing: show proper address for trace-printk format

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Linus Torvalds [Tue, 4 Aug 2009 22:29:25 +0000 (15:29 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sameo/mfd-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
  mfd: twl4030 irq fixes

14 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 4 Aug 2009 22:28:59 +0000 (15:28 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Work around compilation warning in arch/x86/kernel/apm_32.c
  x86, UV: Complete IRQ interrupt migration in arch_enable_uv_irq()
  x86, 32-bit: Fix double accounting in reserve_top_address()
  x86: Don't use current_cpu_data in x2apic phys_pkg_id
  x86, UV: Fix UV apic mode
  x86, UV: Fix macros for accessing large node numbers
  x86, UV: Delete mapping of MMR rangs mapped by BIOS
  x86, UV: Handle missing blade-local memory correctly
  x86: fix assembly constraints in native_save_fl()
  x86, msr: execute on the correct CPU subset
  x86: Fix assert syntax in vmlinux.lds.S
  x86: Make 64-bit efi_ioremap use ioremap on MMIO regions
  x86: Add quirk to make Apple MacBook5,2 use reboot=pci
  x86: Fix CPA memtype reserving in the set_pages_array*() cases
  x86, pat: Fix set_memory_wc related corruption
  x86: fix section mismatch for i386 init code

14 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
Linus Torvalds [Tue, 4 Aug 2009 22:28:46 +0000 (15:28 -0700)]
Merge branch 'fixes' of git://git./linux/kernel/git/davej/cpufreq

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] Make cpufreq suspend code conditional on powerpc.
  [CPUFREQ] Fix a kobject reference bug related to managed CPUs
  [CPUFREQ] Do not set policy for offline cpus
  [CPUFREQ] Fix NULL pointer dereference regression in conservative governor

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke...
Linus Torvalds [Tue, 4 Aug 2009 22:28:23 +0000 (15:28 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/ryusuke/nilfs2

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
  nilfs2: fix missing unlock in error path of nilfs_mdt_write_page
  nilfs2: fix oops due to inconsistent state in page with discrete b-tree nodes

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Tue, 4 Aug 2009 22:27:56 +0000 (15:27 -0700)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] Update readme to reflect forceuid mount parms
  cifs: Read buffer overflow
  cifs: show noforceuid/noforcegid mount options (try #2)
  cifs: reinstate original behavior when uid=/gid= options are specified
  [CIFS] Updates fs/cifs/CHANGES
  cifs: fix error handling in mount-time DFS referral chasing code

14 years agotty-ldisc: be more careful in 'put_ldisc' locking
Linus Torvalds [Mon, 3 Aug 2009 21:54:56 +0000 (14:54 -0700)]
tty-ldisc: be more careful in 'put_ldisc' locking

Use 'atomic_dec_and_lock()' to make sure that we always hold the
tty_ldisc_lock when the ldisc count goes to zero. That way we can never
race against 'tty_ldisc_try()' increasing the count again.

Reported-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@mail.by>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty-ldisc: turn ldisc user count into a proper refcount
Linus Torvalds [Mon, 3 Aug 2009 18:11:19 +0000 (11:11 -0700)]
tty-ldisc: turn ldisc user count into a proper refcount

By using the user count for the actual lifetime rules, we can get rid of
the silly "wait_for_idle" logic, because any busy ldisc will
automatically stay around until the last user releases it.  This avoids
a host of odd issues, and simplifies the code.

So now, when the last ldisc reference is dropped, we just release the
ldisc operations struct reference, and free the ldisc.

It looks obvious enough, and it does work for me, but the counting
_could_ be off. It probably isn't (bad counting in the new version would
generally imply that the old code did something really bad, like free an
ldisc with a non-zero count), but it does need some testing, and
preferably somebody looking at it.

With this change, both 'tty_ldisc_put()' and 'tty_ldisc_deref()' are
just aliases for the new ref-counting 'put_ldisc()'. Both of them
decrement the ldisc user count and free it if it goes down to zero.
They're identical functions, in other words.

But the reason they still exist as sepate functions is that one of them
was exported (tty_ldisc_deref) and had a stupid name (so I don't want to
use it as the main name), and the other one was used in multiple places
(and I didn't want to make the patch larger just to rename the users).

In addition to the refcounting, I did do some minimal cleanup. For
example, now "tty_ldisc_try()" actually returns the ldisc it got under
the lock, rather than returning true/false and then the caller would
look up the ldisc again (now without the protection of the lock).

That said, there's tons of dubious use of 'tty->ldisc' without obviously
proper locking or refcounting left. I expressly did _not_ want to try to
fix it all, keeping the patch minimal. There may or may not be bugs in
that kind of code, but they wouldn't be _new_ bugs.

That said, even if the bugs aren't new, the timing and lifetime will
change. For example, some silly code may depend on the 'tty->ldisc'
pointer not changing because they hold a refcount on the 'ldisc'. And
that's no longer true - if you hold a ref on the ldisc, the 'ldisc'
itself is safe, but tty->ldisc may change.

So the proper locking (remains) to hold tty->ldisc_mutex if you expect
tty->ldisc to be stable. That's not really a _new_ rule, but it's an
example of something that the old code might have unintentionally
depended on and hidden bugs.

Whatever. The patch _looks_ sensible to me. The only users of
ldisc->users are:
 - get_ldisc() - atomically increment the count

 - put_ldisc() - atomically decrements the count and releases if zero

 - tty_ldisc_try_get() - creates the ldisc, and sets the count to 1.
   The ldisc should then either be released, or be attached to a tty.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@mail.by>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty-ldisc: make refcount be atomic_t 'users' count
Linus Torvalds [Mon, 3 Aug 2009 17:58:29 +0000 (10:58 -0700)]
tty-ldisc: make refcount be atomic_t 'users' count

This is pure preparation of changing the ldisc reference counting to be
a true refcount that defines the lifetime of the ldisc.  But this is a
purely syntactic change for now to make the next steps easier.

This patch should make no semantic changes at all. But I wanted to make
the ldisc refcount be an atomic (I will be touching it without locks
soon enough), and I wanted to rename it so that there isn't quite as
much confusion between 'ldo->refcount' (ldisk operations refcount) and
'ld->refcount' (ldisc refcount itself) in the same file.

So it's now an atomic 'ld->users' count. It still starts at zero,
despite having a reference from 'tty->ldisc', but that will change once
we turn it into a _real_ refcount.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@mail.by>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoath9k: fix compile warning on ath9k_hw_AR9287_check_eeprom()
Luis R. Rodriguez [Mon, 3 Aug 2009 20:51:49 +0000 (13:51 -0700)]
ath9k: fix compile warning on ath9k_hw_AR9287_check_eeprom()

CC [M]  drivers/net/wireless/ath/ath9k/eeprom.o
drivers/net/wireless/ath/ath9k/eeprom.c: In function ‘ath9k_hw_AR9287_check_eeprom’:
drivers/net/wireless/ath/ath9k/eeprom.c:2866: warning: comparison of distinct pointer types lacks a cast

Cc: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: FIF_PSPOLL filter flag
Igor Perminov [Tue, 4 Aug 2009 12:48:51 +0000 (16:48 +0400)]
mac80211: FIF_PSPOLL filter flag

When an interface is configured in the AP mode, the mac80211
implementation doesn't inform the driver to receive PS Poll frames.
It leads to inability to communicate with power-saving stations
reliably.
The FIF_CONTROL flag isn't passed by mac80211 to
ieee80211_ops.configure_filter when an interface is in the AP mode.
And it's ok, because we don't want to receive ACK frames and other
control ones, but only PS Poll ones.

This patch introduces the FIF_PSPOLL filter flag in addition to
FIF_CONTROL, which means for the driver "pass PS Poll frames".

This flag is passed to the driver:
A) When an interface is configured in the AP mode.
B) In all cases, when the FIF_CONTROL flag was passed earlier (in
addition to it).

Signed-off-by: Igor Perminov <igor.perminov@inbox.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: cancel xmit poll work at stop() callback
Luis R. Rodriguez [Sat, 25 Jul 2009 00:47:33 +0000 (20:47 -0400)]
ath9k: cancel xmit poll work at stop() callback

We forgot to cancel this work at the stop() callback.

------------[ cut here ]------------
WARNING: at net/mac80211/util.c:511 ieee80211_queue_delayed_work+0x3a/0x40 [mac80211]()
Hardware name: 6460DWU
queueing ieee80211 work while going to suspend
Modules linked in: <-- snip -->
Pid: 5124, comm: phy0 Tainted: G        W  2.6.31-rc3-wl #4
Call Trace:
 [<ffffffffa03adcda>] ? ieee80211_queue_delayed_work+0x3a/0x40 [mac80211]
 [<ffffffff810552b8>] warn_slowpath_common+0x78/0xd0
 [<ffffffff81055394>] warn_slowpath_fmt+0x64/0x70
 [<ffffffff814ed2c9>] ? thread_return+0x3e/0x635
 [<ffffffffa03adcda>] ieee80211_queue_delayed_work+0x3a/0x40 [mac80211]
 [<ffffffffa0297690>] ath_tx_complete_poll_work+0xc0/0x100 [ath9k]
 [<ffffffffa02975d0>] ? ath_tx_complete_poll_work+0x0/0x100 [ath9k]
 [<ffffffff81069b68>] worker_thread+0x178/0x260
 [<ffffffff8106ecc0>] ? autoremove_wake_function+0x0/0x40
 [<ffffffff810699f0>] ? worker_thread+0x0/0x260
 [<ffffffff8106e89e>] kthread+0x9e/0xb0
 [<ffffffff8101302a>] child_rip+0xa/0x20
 [<ffffffff8106e800>] ? kthread+0x0/0xb0
 [<ffffffff81013020>] ? child_rip+0x0/0x20

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: add initial hardware support for ar9271
Luis R. Rodriguez [Tue, 4 Aug 2009 03:14:12 +0000 (23:14 -0400)]
ath9k: add initial hardware support for ar9271

We will finalize this after some driver core changes, for now
we leave this unsupported.

Cc: Stephen Chen <stephen.chen@atheros.com>
Cc: Zhifeng Cai <zhifeng.cai@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: add initvals and registry definitions for AR9271
Luis R. Rodriguez [Tue, 4 Aug 2009 03:14:11 +0000 (23:14 -0400)]
ath9k: add initvals and registry definitions for AR9271

Cc: Stephen Chen <stephen.chen@atheros.com>
Cc: Zhifeng Cai <zhifeng.cai@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: add ar9271 revision and subrevision ID helpers
Luis R. Rodriguez [Tue, 4 Aug 2009 03:14:10 +0000 (23:14 -0400)]
ath9k: add ar9271 revision and subrevision ID helpers

These will be used later to add support for ar9271.

Cc: Stephen Chen <stephen.chen@atheros.com>
Cc: Zhifeng Cai <zhifeng.cai@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Remove _t postfix for ar9287_eeprom structure
Luis R. Rodriguez [Mon, 3 Aug 2009 21:31:25 +0000 (17:31 -0400)]
ath9k: Remove _t postfix for ar9287_eeprom structure

We don't use typdefs on ath9k, remove that _t.

Cc: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove spurious check for channel on keycache reset
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:56 +0000 (12:24 -0700)]
ath9k: remove spurious check for channel on keycache reset

ath9k_hw_keyreset() has a spurious check for ah->curchan..
remove it.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove dangling error check on keycache reset on hw init
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:55 +0000 (12:24 -0700)]
ath9k: remove dangling error check on keycache reset on hw init

The keycache reset will not fail as right above we ensure
to set the sc->keymax to be <= ah->caps.keycache_size. Just remove
this dangling check.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>