safe/jmp/linux-2.6
14 years agoBluetooth: Fix L2CAP locking scheme regression
Andrei Emeltchenko [Tue, 15 Dec 2009 09:38:04 +0000 (11:38 +0200)]
Bluetooth: Fix L2CAP locking scheme regression

When locking was introduced the error path branch was not taken
into account. Error was found in sparse code checking. Kudos to
Jani Nikula.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Acked-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Ack L2CAP I-frames before retransmit missing packet
Gustavo F. Padovan [Tue, 15 Dec 2009 22:13:27 +0000 (20:13 -0200)]
Bluetooth: Ack L2CAP I-frames before retransmit missing packet

Moving the Ack to before l2cap_retransmit_frame() we can avoid the
case where txWindow is full and the packet can't be retransmited.

Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Fix unset of RemoteBusy flag for L2CAP
Gustavo F. Padovan [Tue, 15 Dec 2009 17:56:34 +0000 (15:56 -0200)]
Bluetooth: Fix unset of RemoteBusy flag for L2CAP

RemoteBusy flag need to be unset before l2cap_ertm_send(), otherwise
l2cap_ertm_send() will return without sending packets because it checks
that flag before start sending.

Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Fix PTR_ERR return of wrong pointer in hidp_setup_hid()
Roel Kluin [Mon, 7 Dec 2009 13:23:21 +0000 (14:23 +0100)]
Bluetooth: Fix PTR_ERR return of wrong pointer in hidp_setup_hid()

Return the PTR_ERR of the correct pointer.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agonet: sh_eth alignment fix for sh7724 using NET_IP_ALIGN V2
Magnus Damm [Wed, 16 Dec 2009 05:16:55 +0000 (21:16 -0800)]
net: sh_eth alignment fix for sh7724 using NET_IP_ALIGN V2

Fix sh_eth for sh7724 by adding NET_IP_ALIGN support V2.
Without this patch the receive data is misaligned.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: allow tx of pre-formatted vlan tagged packets
Gurucharan Shetty [Tue, 15 Dec 2009 13:00:31 +0000 (13:00 +0000)]
ixgbe: allow tx of pre-formatted vlan tagged packets

When the 82598 is fed 802.1q packets, it chokes with
an error of the form:

ixgbe: eth0: ixgbe_tx_csum: partial checksum but proto=81!

As the logic there was not smart enough to look into
the vlan header to pick out the encapsulated protocol.

There are times when we'd like to send these packets
out without having to configure a vlan on the interface.
Here we check for the vlan tag and allow the packet to
go out with the correct hardware checksum.

This patch is a clone of a previously submitted patch by
Arthur Jones <ajones@riverbed.com> for igb (Commit -
fa4a7ef36ec834fee1719636b30d2f28f4cb0166).

Signed-off-by: Gurucharan Shetty <gshetty@riverbed.com>
Signed-off-by: Arthur Jones <ajones@riverbed.com>
Acked-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Fix 82598 premature copper PHY link indicatation
Mallikarjuna R Chilakala [Tue, 15 Dec 2009 11:57:20 +0000 (11:57 +0000)]
ixgbe: Fix 82598 premature copper PHY link indicatation

Modified patch with Dave's comments to replace mdelay with proper msleep.
Fix 82598 copper link issue, where the phy prematurely indicates link
before it is ready to process packets. The new function looks for phy
link and indicates that, when it is available. If phy is not ready
within few seconds of MAC indicating link, the function will return
failure which translates to link down indication.

Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Fix tx_restart_queue/non_eop_desc statistics counters
Mallikarjuna R Chilakala [Tue, 15 Dec 2009 11:56:59 +0000 (11:56 +0000)]
ixgbe: Fix tx_restart_queue/non_eop_desc statistics counters

Fix the restart_queue and non_eop_desc counters from being
double-counted.  They are cumulative in each ring, so we don't want to
add them to the cumulative result in the adapter's master counter.
Otherwise, the stats will be inaccurate

Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobcm63xx_enet: fix compilation failure after get_stats_count removal
Florian Fainelli [Tue, 15 Dec 2009 06:45:06 +0000 (06:45 +0000)]
bcm63xx_enet: fix compilation failure after get_stats_count removal

This patch converts bcm63xx_enet to uset get_sset_count
like the other drivers do.

Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopacket: dont call sleeping functions while holding rcu_read_lock()
Eric Dumazet [Tue, 15 Dec 2009 05:47:03 +0000 (05:47 +0000)]
packet: dont call sleeping functions while holding rcu_read_lock()

commit 654d1f8a019dfa06d (packet: less dev_put() calls)
introduced a problem, calling potentially sleeping functions from a
rcu_read_lock() protected section.

Fix this by releasing lock before the sock_wmalloc()/memcpy_fromiovec() calls.

After skb allocation and copy from user space, we redo device
lookup and appropriate tests.

Reported-and-tested-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
David S. Miller [Wed, 16 Dec 2009 05:08:53 +0000 (21:08 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-2.6

14 years agotcp: Revert per-route SACK/DSACK/TIMESTAMP changes.
David S. Miller [Wed, 16 Dec 2009 04:56:42 +0000 (20:56 -0800)]
tcp: Revert per-route SACK/DSACK/TIMESTAMP changes.

It creates a regression, triggering badness for SYN_RECV
sockets, for example:

[19148.022102] Badness at net/ipv4/inet_connection_sock.c:293
[19148.022570] NIP: c02a0914 LR: c02a0904 CTR: 00000000
[19148.023035] REGS: eeecbd30 TRAP: 0700   Not tainted  (2.6.32)
[19148.023496] MSR: 00029032 <EE,ME,CE,IR,DR>  CR: 24002442  XER: 00000000
[19148.024012] TASK = eee9a820[1756] 'privoxy' THREAD: eeeca000

This is likely caused by the change in the 'estab' parameter
passed to tcp_parse_options() when invoked by the functions
in net/ipv4/tcp_minisocks.c

But even if that is fixed, the ->conn_request() changes made in
this patch series is fundamentally wrong.  They try to use the
listening socket's 'dst' to probe the route settings.  The
listening socket doesn't even have a route, and you can't
get the right route (the child request one) until much later
after we setup all of the state, and it must be done by hand.

This stuff really isn't ready, so the best thing to do is a
full revert.  This reverts the following commits:

f55017a93f1a74d50244b1254b9a2bd7ac9bbf7d
022c3f7d82f0f1c68018696f2f027b87b9bb45c2
1aba721eba1d84a2defce45b950272cee1e6c72a
cda42ebd67ee5fdf09d7057b5a4584d36fe8a335
345cda2fd695534be5a4494f1b59da9daed33663
dc343475ed062e13fc260acccaab91d7d80fd5b2
05eaade2782fb0c90d3034fd7a7d5a16266182bb
6a2a2d6bf8581216e08be15fcb563cfd6c430e1e

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipvs: zero usvc and udest
Simon Horman [Tue, 15 Dec 2009 16:01:25 +0000 (17:01 +0100)]
ipvs: zero usvc and udest

Make sure that any otherwise uninitialised fields of usvc are zero.

This has been obvserved to cause a problem whereby the port of
fwmark services may end up as a non-zero value which causes
scheduling of a destination server to fail for persisitent services.

As observed by Deon van der Merwe <dvdm@truteq.co.za>.
This fix suggested by Julian Anastasov <ja@ssi.bg>.

For good measure also zero udest.

Cc: Deon van der Merwe <dvdm@truteq.co.za>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: fix crashes in bridge netfilter caused by fragment jumps
Patrick McHardy [Tue, 15 Dec 2009 15:59:59 +0000 (16:59 +0100)]
netfilter: fix crashes in bridge netfilter caused by fragment jumps

When fragments from bridge netfilter are passed to IPv4 or IPv6 conntrack
and a reassembly queue with the same fragment key already exists from
reassembling a similar packet received on a different device (f.i. with
multicasted fragments), the reassembled packet might continue on a different
codepath than where the head fragment originated. This can cause crashes
in bridge netfilter when a fragment received on a non-bridge device (and
thus with skb->nf_bridge == NULL) continues through the bridge netfilter
code.

Add a new reassembly identifier for packets originating from bridge
netfilter and use it to put those packets in insolated queues.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=14805

Reported-and-Tested-by: Chong Qiao <qiaochong@loongson.cn>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoipv6: reassembly: use seperate reassembly queues for conntrack and local delivery
Patrick McHardy [Tue, 15 Dec 2009 15:59:18 +0000 (16:59 +0100)]
ipv6: reassembly: use seperate reassembly queues for conntrack and local delivery

Currently the same reassembly queue might be used for packets reassembled
by conntrack in different positions in the stack (PREROUTING/LOCAL_OUT),
as well as local delivery. This can cause "packet jumps" when the fragment
completing a reassembled packet is queued from a different position in the
stack than the previous ones.

Add a "user" identifier to the reassembly queue key to seperate the queues
of each caller, similar to what we do for IPv4.

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agosky2: leave PCI config space writeable
stephen hemminger [Mon, 14 Dec 2009 08:50:12 +0000 (08:50 +0000)]
sky2: leave PCI config space writeable

Since power management is done by PCI subsystem as well as driver,
don't toggle the bit that disables PCI register writes.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: print Optima chip name
stephen hemminger [Mon, 14 Dec 2009 08:33:47 +0000 (08:33 +0000)]
sky2: print Optima chip name

Off by one in name lookup makes Optima display as (chip 0xbc)

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agox25: Update maintainer.
Arnd Bergmann [Mon, 14 Dec 2009 01:53:41 +0000 (01:53 +0000)]
x25: Update maintainer.

On Monday 14 December 2009, andrew hendry wrote:
> Thanks, I didn't know X.25 was actively maintained. I get bounces.
> Is the the maintainers out of date?

From looking at the posts on the x.25 mailing list and the changes
that went into the kernel during the last three years in that area,
I think it is safe to say that you are now the maintainer ;-).

The last mail on this topic from Henner Eisen was around 2001.

> AX.25 NETWORK LAYER
> M:      Ralf Baechle <ralf@linux-mips.org>
>
> X.25 NETWORK LAYER
> M:      Henner Eisen <eis@baty.hanse.de>

How about this change?

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipvs: fix synchronization on connection close
Xiaotian Feng [Mon, 14 Dec 2009 15:38:21 +0000 (16:38 +0100)]
ipvs: fix synchronization on connection close

commit 9d3a0de makes slaves expire as they would do on the master
with much shorter timeouts. But it introduces another problem:
When we close a connection, on master server the connection became
CLOSE_WAIT/TIME_WAIT, it was synced to slaves, but if master is
finished within it's timeouts (CLOSE), it will not be synced to
slaves. Then slaves will be kept on CLOSE_WAIT/TIME_WAIT until
timeout reaches. Thus we should also sync with CLOSE.

Cc: Wensong Zhang <wensong@linux-vs.org>
Cc: Simon Horman <horms@verge.net.au>
Cc: Julian Anastasov <ja@ssi.bg>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: xtables: document minimal required version
Jan Engelhardt [Mon, 14 Dec 2009 13:52:10 +0000 (14:52 +0100)]
netfilter: xtables: document minimal required version

For both .33 and .32-stable.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agodrivers/net/bonding/: : use pr_fmt
Joe Perches [Mon, 14 Dec 2009 04:06:07 +0000 (20:06 -0800)]
drivers/net/bonding/: : use pr_fmt

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove DRV_NAME from pr_<level>s
Consolidate long format strings
Remove some extra tab indents
Remove some unnecessary ()s from pr_<level>s arguments
Align pr_<level> arguments

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: CAN_MCP251X should depend on HAS_DMA
Geert Uytterhoeven [Sun, 13 Dec 2009 09:11:06 +0000 (09:11 +0000)]
can: CAN_MCP251X should depend on HAS_DMA

When building for Sun 3:

drivers/net/can/mcp251x.c:1074: undefined reference to `dma_free_coherent'
drivers/net/can/mcp251x.c:976: undefined reference to `dma_alloc_coherent'
drivers/net/can/mcp251x.c:1050: undefined reference to `dma_free_coherent'

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/usb: Correct code taking the size of a pointer
Julia Lawall [Sun, 13 Dec 2009 05:47:04 +0000 (05:47 +0000)]
drivers/net/usb: Correct code taking the size of a pointer

sizeof(dev->dev_addr) is the size of a pointer.  A few lines above, the
size of this field is obtained using netdev->addr_len for a call to memcpy,
so do the same here.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression *x;
expression f;
type T;
@@

*f(...,(T)x,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/cpmac.c: Correct code taking the size of a pointer
Julia Lawall [Sun, 13 Dec 2009 05:35:45 +0000 (05:35 +0000)]
drivers/net/cpmac.c: Correct code taking the size of a pointer

sizeof(dev->dev_addr) is the size of a pointer.  On the other hand,
sizeof(pdata->dev_addr) is the size of an array, so use that instead.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression *x;
expression f;
type T;
@@

*f(...,(T)x,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/sfc: Correct code taking the size of a pointer
Julia Lawall [Sun, 13 Dec 2009 01:41:29 +0000 (01:41 +0000)]
drivers/net/sfc: Correct code taking the size of a pointer

The function efx_iterate_state contains the code
memcpy(&payload->msg, payload_msg, sizeof(payload_msg));
This is the only use of payload_msg.  The type of payload_msg is
changed from a pointer to an array, so that the result of sizeof really is
the length of the string.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression *x;
expression f;
type T;
@@

*f(...,(T)x,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/atm: Correct code taking the size of a pointer
Julia Lawall [Sun, 13 Dec 2009 01:40:55 +0000 (01:40 +0000)]
drivers/atm: Correct code taking the size of a pointer

sizeof(TstSchedTbl) is just the size of the pointer.  Change it to the size
of the referenced data.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression *x;
expression f;
type T;
@@

*f(...,(T)x,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years ago3c574_cs: disable irq before calling el3_interrupt
Ken Kawasaki [Sat, 12 Dec 2009 14:44:11 +0000 (14:44 +0000)]
3c574_cs: disable irq before calling el3_interrupt

3c574_cs, 3c589_cs:
disable irq before calling el3_interrupt
in the media_check function.

Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomlx4_core: return a negative error value
roel kluin [Sat, 12 Dec 2009 09:09:05 +0000 (09:09 +0000)]
mlx4_core: return a negative error value

The return value should be negative.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: Fix data length code handling in rx path
Oliver Hartkopp [Sat, 12 Dec 2009 04:13:21 +0000 (04:13 +0000)]
can: Fix data length code handling in rx path

A valid CAN dataframe can have a data length code (DLC) of 0 .. 8 data bytes.

When reading the CAN controllers register the 4-bit value may contain values
from 0 .. 15 which may exceed the reserved space in the socket buffer!

The ISO 11898-1 Chapter 8.4.2.3 (DLC field) says that register values > 8
should be reduced to 8 without any error reporting or frame drop.

This patch introduces a new helper macro to cast a given 4-bit data length
code (dlc) to __u8 and ensure the DLC value to be max. 8 bytes.

The different handlings in the rx path of the CAN netdevice drivers are fixed.

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Fix userspace RTM_NEWLINK notifications.
Eric W. Biederman [Sat, 12 Dec 2009 22:11:15 +0000 (22:11 +0000)]
net: Fix userspace RTM_NEWLINK notifications.

I received some bug reports about userspace programs having problems
because after RTM_NEWLINK was received they could not immediate access
files under /proc/sys/net/ because they had not been registered yet.

The original problem was trivially fixed by moving the userspace
notification from rtnetlink_event() to the end of
register_netdevice().

When testing that change I discovered I was still getting RTM_NEWLINK
events before I could access proc and I was also getting RTM_NEWLINK
events after I was seeing RTM_DELLINK.  Things practically guaranteed
to confuse userspace.

After a little more investigation these extra notifications proved to
be from the new notifiers NETDEV_POST_INIT and NETDEV_UNREGISTER_BATCH
hitting the default case in rtnetlink_event, and triggering
unnecessary RTM_NEWLINK messages.

rtnetlink_event now explicitly handles NETDEV_UNREGISTER_BATCH and
NETDEV_POST_INIT to avoid sending the incorrect userspace
notifications.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoudp: udp_lib_get_port() fix
Eric Dumazet [Mon, 14 Dec 2009 03:32:39 +0000 (19:32 -0800)]
udp: udp_lib_get_port() fix

Now we can have a large udp hash table, udp_lib_get_port() loop
should be converted to a do {} while (cond) form,
or we dont enter it at all if hash table size is exactly 65536.

Reported-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: fix error in rx completion processing.
Ajit Khaparde [Sat, 12 Dec 2009 06:59:09 +0000 (22:59 -0800)]
be2net: fix error in rx completion processing.

There are certain skews of the NIC which have multiple bits set in
adapter->cap.  Use & instead of == to process rx completions.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoigbvf: avoid reset storms due to mailbox issues
Alexander Duyck [Sat, 12 Dec 2009 06:58:14 +0000 (22:58 -0800)]
igbvf: avoid reset storms due to mailbox issues

From: Alexander Duyck <alexander.h.duyck@intel.com>

This change makes it so that reset/interrupt storms can be avoided when
there are mailbox issues.  The new behavior is to only allow the device to
trigger mailbox related resets only once every 10 seconds.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoigb: fix handling of mailbox collisions between PF/VF
Alexander Duyck [Sat, 12 Dec 2009 06:57:34 +0000 (22:57 -0800)]
igb: fix handling of mailbox collisions between PF/VF

This patch changes the handling of collisions between the use of the
PF/VF sides of the mailbox.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agousb: remove rare pm primitive for conversion to new API
Oliver Neukum [Sat, 12 Dec 2009 05:43:00 +0000 (21:43 -0800)]
usb: remove rare pm primitive for conversion to new API

This patch removes a rare use of the USB power management API which
won't be supported after the conversion to the new generic runtime power
management framework. Functionality is not altered.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of /home/davem/src/GIT/linux-2.6/
David S. Miller [Sat, 12 Dec 2009 01:12:17 +0000 (17:12 -0800)]
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/

Conflicts:
include/net/tcp.h

14 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
Linus Torvalds [Fri, 11 Dec 2009 23:59:23 +0000 (15:59 -0800)]
Merge branch 'next' of git://git./linux/kernel/git/davej/cpufreq

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [ACPI/CPUFREQ] Introduce bios_limit per cpu cpufreq sysfs interface
  [CPUFREQ] make internal cpufreq_add_dev_* static
  [CPUFREQ] use an enum for speedstep processor identification
  [CPUFREQ] Document units for transition latency
  [CPUFREQ] Use global sysfs cpufreq structure for conservative governor tunings
  [CPUFREQ] Documentation: ABI: /sys/devices/system/cpu/cpu#/cpufreq/
  [CPUFREQ] powernow-k6: set transition latency value so ondemand governor can be used
  [CPUFREQ] cpumask: don't put a cpumask on the stack in x86...cpufreq/powernow-k8.c

14 years agoStaging: batman: fix debug Kconfig option
Greg Kroah-Hartman [Fri, 11 Dec 2009 23:40:17 +0000 (15:40 -0800)]
Staging: batman: fix debug Kconfig option

The debug batman option needs to depend on the correct
config option.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[ "No means no!"  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
Linus Torvalds [Fri, 11 Dec 2009 23:34:40 +0000 (15:34 -0800)]
Merge git://git./linux/kernel/git/gregkh/tty-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (58 commits)
  tty: split the lock up a bit further
  tty: Move the leader test in disassociate
  tty: Push the bkl down a bit in the hangup code
  tty: Push the lock down further into the ldisc code
  tty: push the BKL down into the handlers a bit
  tty: moxa: split open lock
  tty: moxa: Kill the use of lock_kernel
  tty: moxa: Fix modem op locking
  tty: moxa: Kill off the throttle method
  tty: moxa: Locking clean up
  tty: moxa: rework the locking a bit
  tty: moxa: Use more tty_port ops
  tty: isicom: fix deadlock on shutdown
  tty: mxser: Use the new locking rules to fix setserial properly
  tty: mxser: use the tty_port_open method
  tty: isicom: sort out the board init logic
  tty: isicom: switch to the new tty_port_open helper
  tty: tty_port: Add a kref object to the tty port
  tty: istallion: tty port open/close methods
  tty: stallion: Convert to the tty_port_open/close methods
  ...

14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
Linus Torvalds [Fri, 11 Dec 2009 23:31:13 +0000 (15:31 -0800)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-fs-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: (21 commits)
  ext3: PTR_ERR return of wrong pointer in setup_new_group_blocks()
  ext3: Fix data / filesystem corruption when write fails to copy data
  ext4: Support for 64-bit quota format
  ext3: Support for vfsv1 quota format
  quota: Implement quota format with 64-bit space and inode limits
  quota: Move definition of QFMT_OCFS2 to linux/quota.h
  ext2: fix comment in ext2_find_entry about return values
  ext3: Unify log messages in ext3
  ext2: clear uptodate flag on super block I/O error
  ext2: Unify log messages in ext2
  ext3: make "norecovery" an alias for "noload"
  ext3: Don't update the superblock in ext3_statfs()
  ext3: journal all modifications in ext3_xattr_set_handle
  ext2: Explicitly assign values to on-disk enum of filetypes
  quota: Fix WARN_ON in lookup_one_len
  const: struct quota_format_ops
  ubifs: remove manual O_SYNC handling
  afs: remove manual O_SYNC handling
  kill wait_on_page_writeback_range
  vfs: Implement proper O_SYNC semantics
  ...

14 years agoMerge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Fri, 11 Dec 2009 23:30:29 +0000 (15:30 -0800)]
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: Fix error return for fallocate() on XFS
  xfs: cleanup dmapi macros in the umount path
  xfs: remove incorrect sparse annotation for xfs_iget_cache_miss
  xfs: kill the STATIC_INLINE macro
  xfs: uninline xfs_get_extsz_hint
  xfs: rename xfs_attr_fetch to xfs_attr_get_int
  xfs: simplify xfs_buf_get / xfs_buf_read interfaces
  xfs: remove IO_ISAIO
  xfs: Wrapped journal record corruption on read at recovery
  xfs: cleanup data end I/O handlers
  xfs: use WRITE_SYNC_PLUG for synchronous writeout
  xfs: reset the i_iolock lock class in the reclaim path
  xfs: I/O completion handlers must use NOFS allocations
  xfs: fix mmap_sem/iolock inversion in xfs_free_eofblocks
  xfs: simplify inode teardown

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
Linus Torvalds [Fri, 11 Dec 2009 23:25:56 +0000 (15:25 -0800)]
Merge git://git./linux/kernel/git/gregkh/staging-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (235 commits)
  Staging: IIO: add selection of IIO_SW_RING to LIS3L02DQ as needed
  Staging: IIO: Add tsl2560-2 support to tsl2563 driver.
  Staging: IIO: Remove tsl2561 driver. Support merged with tsl2563.
  Staging: wlags49_h2: fix up signal levels
  + drivers-staging-wlags49_h2-remove-cvs-metadata.patch added to -mm tree
  Staging: samsung-laptop: add TODO file
  Staging: samsung-laptop: remove old kernel code
  Staging: add Samsung Laptop driver
  staging: batman-adv meshing protocol
  Staging: rtl8192u: depends on USB
  Staging: rtl8192u: remove dead code
  Staging: rtl8192u: remove bad whitespaces
  Staging: rtl8192u: make it compile
  Staging: Added Realtek rtl8192u driver to staging
  Staging: dream: add gpio and pmem support
  Staging: dream: add TODO file
  Staging: android: delete android drivers
  Staging: et131x: clean up the avail fields in the rx registers
  Staging: et131x: Clean up number fields
  Staging: et131x: kill RX_DMA_MAX_PKT_TIME
  ...

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
Linus Torvalds [Fri, 11 Dec 2009 23:24:56 +0000 (15:24 -0800)]
Merge git://git./linux/kernel/git/gregkh/driver-core-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (27 commits)
  Driver core: fix race in dev_driver_string
  Driver Core: Early platform driver buffer
  sysfs: sysfs_setattr remove unnecessary permission check.
  sysfs: Factor out sysfs_rename from sysfs_rename_dir and sysfs_move_dir
  sysfs: Propagate renames to the vfs on demand
  sysfs: Gut sysfs_addrm_start and sysfs_addrm_finish
  sysfs: In sysfs_chmod_file lazily propagate the mode change.
  sysfs: Implement sysfs_getattr & sysfs_permission
  sysfs: Nicely indent sysfs_symlink_inode_operations
  sysfs: Update s_iattr on link and unlink.
  sysfs: Fix locking and factor out sysfs_sd_setattr
  sysfs: Simplify iattr time assignments
  sysfs: Simplify sysfs_chmod_file semantics
  sysfs: Use dentry_ops instead of directly playing with the dcache
  sysfs: Rename sysfs_d_iput to sysfs_dentry_iput
  sysfs: Update sysfs_setxattr so it updates secdata under the sysfs_mutex
  debugfs: fix create mutex racy fops and private data
  Driver core: Don't remove kobjects in device_shutdown.
  firmware_class: make request_firmware_nowait more useful
  Driver-Core: devtmpfs - set root directory mode to 0755
  ...

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
Linus Torvalds [Fri, 11 Dec 2009 23:22:55 +0000 (15:22 -0800)]
Merge git://git./linux/kernel/git/gregkh/usb-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (122 commits)
  USB: mos7840: add device IDs for B&B electronics devices
  USB: ftdi_sio: add USB device ID's for B&B Electronics line
  USB: musb: musb_host: fix sparse warning
  USB: musb: musb_gadget: fix sparse warning
  USB: musb: omap2430: fix sparse warning
  USB: core: message: fix sparse warning
  USB: core: hub: fix sparse warning
  USB: core: fix sparse warning for static function
  USB: Added USB_ETH_RNDIS to use instead of CONFIG_USB_ETH_RNDIS
  USB: Check bandwidth when switching alt settings.
  USB: Refactor code to find alternate interface settings.
  USB: xhci: Fix command completion after a drop endpoint.
  USB: xhci: Make reverting an alt setting "unfailable".
  USB: usbtmc: Use usb_clear_halt() instead of custom code.
  USB: xhci: Add correct email and files to MAINTAINERS entry.
  USB: ehci-omap.c: introduce missing kfree
  USB: xhci-mem.c: introduce missing kfree
  USB: add remove_id sysfs attr for usb drivers
  USB: g_multi kconfig: fix depends and help text
  USB: option: add pid for ZTE
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
Linus Torvalds [Fri, 11 Dec 2009 23:22:27 +0000 (15:22 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/ieee1394/linux1394-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  firewire: ohci: handle receive packets with a data length of zero

14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel...
Linus Torvalds [Fri, 11 Dec 2009 23:19:56 +0000 (15:19 -0800)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jwessel/linux-2.6-kgdb

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
  kgdb: Always process the whole breakpoint list on activate or deactivate
  kgdb: continue and warn on signal passing from gdb
  kgdb,x86: do not set kgdb_single_step on x86
  kgdb: allow for cpu switch when single stepping
  kgdb,i386: Fix corner case access to ss with NMI watch dog exception
  kgdb: Replace strstr() by strchr() for single-character needles
  kgdbts: Read buffer overflow
  kgdb: Read buffer overflow
  kgdb,x86: remove redundant test

14 years agotty: split the lock up a bit further
Alan Cox [Mon, 30 Nov 2009 13:18:51 +0000 (13:18 +0000)]
tty: split the lock up a bit further

The tty count sanity check may need the BKL, that isn't clear. However it
is clear that the count use of the lock is internal and independant of the
bigger use of the lock.

Furthermore the file list locking is also separately locked already

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: Move the leader test in disassociate
Alan Cox [Mon, 30 Nov 2009 13:18:45 +0000 (13:18 +0000)]
tty: Move the leader test in disassociate

There are two call points, both want to check that tty->signal->leader is
set. Move the test into disassociate_ctty() as that will make locking
changes easier in a bit

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: Push the bkl down a bit in the hangup code
Alan Cox [Mon, 30 Nov 2009 13:18:40 +0000 (13:18 +0000)]
tty: Push the bkl down a bit in the hangup code

We know that the redirect field is handled via its own locking in all
places

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: Push the lock down further into the ldisc code
Alan Cox [Mon, 30 Nov 2009 13:18:35 +0000 (13:18 +0000)]
tty: Push the lock down further into the ldisc code

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: push the BKL down into the handlers a bit
Alan Cox [Mon, 30 Nov 2009 13:18:29 +0000 (13:18 +0000)]
tty: push the BKL down into the handlers a bit

Start trying to untangle the remaining BKL mess

Updated to fix missing unlock_kernel noted by Dan Carpenter

Signed-off-by: Alan "I must be out of my tree" Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: moxa: split open lock
Alan Cox [Mon, 30 Nov 2009 13:18:24 +0000 (13:18 +0000)]
tty: moxa: split open lock

moxa_openlock is used for several situations where we want to handle the
case of an ioctl that crosses many ports (not just the open tty), and also
cases where an open races a deinit (eg a pci unplug) and we hangup a port
before we can cope with that.

The non open race cases can use the moxa_lock spinlock. This simplifies sorting
out the remaining mess.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: moxa: Kill the use of lock_kernel
Alan Cox [Mon, 30 Nov 2009 13:18:18 +0000 (13:18 +0000)]
tty: moxa: Kill the use of lock_kernel

It isn't needed here any more

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: moxa: Fix modem op locking
Alan Cox [Mon, 30 Nov 2009 13:18:13 +0000 (13:18 +0000)]
tty: moxa: Fix modem op locking

This is overkill and mostly not needed

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: moxa: Kill off the throttle method
Alan Cox [Mon, 30 Nov 2009 13:18:08 +0000 (13:18 +0000)]
tty: moxa: Kill off the throttle method

The tty flag can be tested so the shadow flag isn't needed

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: moxa: Locking clean up
Alan Cox [Mon, 30 Nov 2009 13:18:02 +0000 (13:18 +0000)]
tty: moxa: Locking clean up

- The open lock is needed to fix up the case of a board reset occuring during
  tty open but too early for a sane hangup response.
- The lock can however got for other cases
- Use the port mutex for get/setserial
- Fix up the confused lack of locking on the THROTTLE and other bits in the
  private flags. Just use set/test/clear bit and it covers the cases we need

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: moxa: rework the locking a bit
Alan Cox [Mon, 30 Nov 2009 13:17:57 +0000 (13:17 +0000)]
tty: moxa: rework the locking a bit

Introduce a lock for moxafunc() to protect the cases where were get collisions
between two function requests at the same time.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: moxa: Use more tty_port ops
Alan Cox [Mon, 30 Nov 2009 13:17:51 +0000 (13:17 +0000)]
tty: moxa: Use more tty_port ops

Rework a few bits of this into tty_port format

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: isicom: fix deadlock on shutdown
Alan Cox [Mon, 30 Nov 2009 13:17:46 +0000 (13:17 +0000)]
tty: isicom: fix deadlock on shutdown

Alexander Strakh <strakh@ispras.ru> reported

KERNEL_VERSION: 2.6.31
DESCRIBE:
Driver drivers/char/isicom.c might sleep in atomic  context, because it
calls
tty_port_xmit_buf under spin_lock.

./drivers/char/isicom.c:
1307 static void isicom_hangup(struct tty_struct *tty)
1308 {
...
1315         spin_lock_irqsave(&port->card->card_lock, flags);
1316         isicom_shutdown_port(port);
...

Path to might_sleep macro from isicom_hangup:
1. isicom_hangup calls spin_lock_irqsave (drivers/char/isicom.c:1315) and
then
calls isicom_shutdown_port.
2. isiscom_shutdown_port calls tty_port_free_xmit_buf at
drivers/char/isicom.c:906
3. tty_port_free_xmit_buf calls mutex_lock at drivers/char/tty_port:48

Found by Linux Driver Verification Project.

Reported-by: Alexander Strakh <strakh@ispras.ru>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: mxser: Use the new locking rules to fix setserial properly
Alan Cox [Mon, 30 Nov 2009 13:17:41 +0000 (13:17 +0000)]
tty: mxser: Use the new locking rules to fix setserial properly

Propogate the init/shutdown mutex through the setserial logic. Use the proper
locks for the various bits still using the BKL. Kill the BKL in this driver.

Updated to fix the bug noted by Dan Carpenter

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: mxser: use the tty_port_open method
Alan Cox [Mon, 30 Nov 2009 13:17:35 +0000 (13:17 +0000)]
tty: mxser: use the tty_port_open method

At first this looks a fairly trivial conversion but we can't quite push
everything into the right format yet. The open side is easy but care is needed
over the setserial methods. Fix up the locking now that we've adopted the
port->mutex locking rule for the initialization.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: isicom: sort out the board init logic
Alan Cox [Mon, 30 Nov 2009 13:17:30 +0000 (13:17 +0000)]
tty: isicom: sort out the board init logic

Split this into two flags - INIT meaning the board is set up and ACTIVE
meaning the board has ports open. Remove the broken HUPCL casing and push
the counts somewhere sensible.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: isicom: switch to the new tty_port_open helper
Alan Cox [Mon, 30 Nov 2009 13:17:24 +0000 (13:17 +0000)]
tty: isicom: switch to the new tty_port_open helper

Trivial conversion in this case so might as well do it while testing the
port_open design is right

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: tty_port: Add a kref object to the tty port
Alan Cox [Mon, 30 Nov 2009 13:17:14 +0000 (13:17 +0000)]
tty: tty_port: Add a kref object to the tty port

Users of tty port need a way to refcount ports when hotplugging is
involved.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: istallion: tty port open/close methods
Alan Cox [Mon, 30 Nov 2009 13:17:08 +0000 (13:17 +0000)]
tty: istallion: tty port open/close methods

Slice/dice/repeat as with the stallion driver this is just code shuffling
and removal

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: stallion: Convert to the tty_port_open/close methods
Alan Cox [Mon, 30 Nov 2009 13:17:03 +0000 (13:17 +0000)]
tty: stallion: Convert to the tty_port_open/close methods

The driver is already structured this way so just slice and dice

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: tty_port: Move the IO_ERROR clear
Alan Cox [Mon, 30 Nov 2009 13:16:57 +0000 (13:16 +0000)]
tty: tty_port: Move the IO_ERROR clear

Some devices want to set IO_ERROR in their activate methods so that you can
be handed a 'dead' port for operations like setserial. Thus we need to
clear the flag before activate so that activate can choose to set the flag
and still return 0.

This is fine as the file handle/tty are not accessible to the user yet.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: tty_port: Add IO_ERROR bit handling
Alan Cox [Mon, 30 Nov 2009 13:16:52 +0000 (13:16 +0000)]
tty: tty_port: Add IO_ERROR bit handling

To propogate tty_port_open/close to a few other devices we need to start
handling the IO_ERROR flag on the tty. We can do this pretty trivially.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: riscom8: switch to the tty_port_open API
Alan Cox [Mon, 30 Nov 2009 13:16:47 +0000 (13:16 +0000)]
tty: riscom8: switch to the tty_port_open API

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: tty_port: Change the buffer allocator locking
Alan Cox [Mon, 30 Nov 2009 13:16:41 +0000 (13:16 +0000)]
tty: tty_port: Change the buffer allocator locking

We want to be able to do this without regard for the activate/own open
method being used which causes a problem using port->mutex. Add another
mutex for now. Once everything uses port_open to do buffer allocs we can
kill it back off

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: sdio_uart: Fix the locking on "func" for new code
Alan Cox [Mon, 30 Nov 2009 13:16:30 +0000 (13:16 +0000)]
tty: sdio_uart: Fix the locking on "func" for new code

The new dtr_rts function didn't take the port->func lock as it should
so add use of the lock there.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: sdio_uart: add modem functionality
Alan Cox [Mon, 30 Nov 2009 13:16:36 +0000 (13:16 +0000)]
tty: sdio_uart: add modem functionality

Add the POSIX block for carrier

Linux TIOCMIWAIT functionality is still lacking from the driver.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: sdio_uart: Style fixes
Alan Cox [Mon, 30 Nov 2009 13:16:25 +0000 (13:16 +0000)]
tty: sdio_uart: Style fixes

Running the current code through checkpatch shows a few bits of noise
mostly but not entirely from before the changes.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: sdio_uart: Fix termios handling
Alan Cox [Mon, 30 Nov 2009 13:16:14 +0000 (13:16 +0000)]
tty: sdio_uart: Fix termios handling

Switching between two non standard baud rates fails because of the cflag
test. Do as we did elsewhere and just kill the "optimisation".

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: sdio_uart: Switch to the open/close helpers
Alan Cox [Mon, 30 Nov 2009 13:16:09 +0000 (13:16 +0000)]
tty: sdio_uart: Switch to the open/close helpers

Gets us proper tty semantics, removes some code and fixes up a few corner
case races (hangup during open etc)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agosdio_uart: Move the open lock
Alan Cox [Thu, 5 Nov 2009 13:28:38 +0000 (13:28 +0000)]
sdio_uart: Move the open lock

When we move to the tty_port logic the port mutex will protect open v close
v hangup. Move to this first in the existing open code so we have a bisection
point.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agosdio_uart: refcount the tty objects
Alan Cox [Thu, 5 Nov 2009 13:28:29 +0000 (13:28 +0000)]
sdio_uart: refcount the tty objects

The tty can go away underneath us, so we must refcount it. Do the naïve
implementation initially. We will worry about startup shortly.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agosdio_uart: Fix oops caused by the previous changeset
Nicolas Pitre [Thu, 5 Nov 2009 13:28:17 +0000 (13:28 +0000)]
sdio_uart: Fix oops caused by the previous changeset

Now... testing reveals that the very first patch "sdio_uart: use
tty_port" causes a segmentation fault in sdio_uart_open():

Unable to handle kernel NULL pointer dereference at virtual address 00000084
pgd = dfb44000 [00000084] *pgd=1fb99031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT
last sysfs file:
/sys/devices/platform/mvsdio/mmc_host/mmc0/mmc0:f111/uevent
Modules linked in:
CPU: 0    Not tainted  (2.6.32-rc5-next-20091102-00001-gb36eae9 #10)
PC is at sdio_uart_open+0x204/0x2cc
[...]

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agosdio_uart: use tty_port
Alan Cox [Thu, 5 Nov 2009 13:28:06 +0000 (13:28 +0000)]
sdio_uart: use tty_port

Add a tty_port object to the sdio uart. For the moment just begin using the
tty field of the port, as this is the critical one to clean up.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty_port: Move hupcl handling
Alan Cox [Thu, 5 Nov 2009 13:27:57 +0000 (13:27 +0000)]
tty_port: Move hupcl handling

Move the HUCPL handling from the end of close_port_start to the beginning
of close_port_end. What this actually does is change the ordering from

port shutdown
port->dtr_rts

to

port->dtr_rts
port shutdown

Some hardware drops the physical connection on shutdown so we must perform
the port operations before the shutdown.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agodevpts_get_tty() should validate inode
Sukadev Bhattiprolu [Wed, 18 Nov 2009 02:35:43 +0000 (18:35 -0800)]
devpts_get_tty() should validate inode

devpts_get_tty() assumes that the inode passed in is associated with a valid
pty.  But if the only reference to the pty is via a bind-mount, the inode
passed to devpts_get_tty() while valid, would refer to a pty that no longer
exists.

With a lot of debug effort, Grzegorz Nosek developed a small program (see
below) to reproduce a crash on recent kernels. This crash is a regression
introduced by the commit:

commit 527b3e4773628b30d03323a2cb5fb0d84441990f
Author: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Date:   Mon Oct 13 10:43:08 2008 +0100

To fix, ensure that the dentry associated with the inode has not yet been
deleted/unhashed by devpts_pty_kill().

See also:
https://lists.linux-foundation.org/pipermail/containers/2009-July/019273.html

tty-bug.c:

#define _GNU_SOURCE
#include <fcntl.h>
#include <sched.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/signal.h>
#include <unistd.h>
#include <stdio.h>

#include <linux/fs.h>

void dummy(int sig)
{
}

static int child(void *unused)
{
int fd;

signal(SIGINT, dummy); signal(SIGHUP, dummy);
pause(); /* cheesy synchronisation to wait for /dev/pts/0 to appear */

mount("/dev/pts/0", "/dev/console", NULL, MS_BIND, NULL);
sleep(2);

fd = open("/dev/console", O_RDWR);
dup(0); dup(0);
write(1, "Hello world!\n", sizeof("Hello world!\n")-1);
return 0;
}

int main(void)
{
pid_t pid;
char *stack;

stack = malloc(16384);
pid = clone(child, stack+16384, CLONE_NEWNS|SIGCHLD, NULL);

open("/dev/ptmx", O_RDWR|O_NOCTTY|O_NONBLOCK);

unlockpt(fd); grantpt(fd);

sleep(2);
kill(pid, SIGHUP);
sleep(1);
return 0; /* exit before child opens /dev/console */
}

Reported-by: Grzegorz Nosek <root@localdomain.pl>
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Tested-by: Serge Hallyn <serue@us.ibm.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoSerial: Do not read IIR in serial8250_start_tx when UART_BUG_TXEN
Ian Jackson [Wed, 18 Nov 2009 10:08:11 +0000 (11:08 +0100)]
Serial: Do not read IIR in serial8250_start_tx when UART_BUG_TXEN

Do not read IIR in serial8250_start_tx when UART_BUG_TXEN

Reading the IIR clears some oustanding interrupts so it is not safe.
Instead, simply transmit immediately if the buffer is empty without
regard to IIR.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Jiri Kosina <jkosina@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: docs: serial/tty, add to ldisc methods
Tilman Schmidt [Thu, 5 Nov 2009 00:04:52 +0000 (16:04 -0800)]
tty: docs: serial/tty, add to ldisc methods

A small addition to the ldisc method descriptions.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoSerial: pxa: work around Errata #75
Uwe Kleine-König [Fri, 6 Nov 2009 20:40:46 +0000 (21:40 +0100)]
Serial: pxa: work around Errata #75

Intel(R) PXA27x Processor Family Specification Update (Nov 2005)
says:

  E75. UART: Baud rate may not be programmed correctly on
       back-to-back writes.

  Problem:
  When programming the Divisor Latch registers, Low and High (DLL and
  DLH), with back-to-back writes, the second register write may not
  take effect. The result is an incorrect baud rate.

  Workaround:
  After programming the first Divisor Latch register, read and verify
  it before programming the second Divisor Latch register.

This was hit when changing the baud rate from 115200 to 9600 while
receiving characters at 9600 Bd.

And fixed indention of some comments nearby.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoserial, 8250: calculate irqflags bitmask before loop
André Goddard Rosa [Sun, 25 Oct 2009 14:01:34 +0000 (12:01 -0200)]
serial, 8250: calculate irqflags bitmask before loop

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoserial: cascade needless conditionals
André Goddard Rosa [Sun, 25 Oct 2009 13:18:26 +0000 (11:18 -0200)]
serial: cascade needless conditionals

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoserial: fix NULL pointer dereference
André Goddard Rosa [Sun, 25 Oct 2009 13:16:32 +0000 (11:16 -0200)]
serial: fix NULL pointer dereference

If kzalloc() or alloc_tty_driver() fails, we call:
    put_tty_driver(normal = NULL).

Then:
    put_tty_driver -> tty_driver_kref_put -> kref_put(&NULL->kref, ...)

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoopticon: Fix resume logic
Alan Cox [Tue, 6 Oct 2009 15:06:57 +0000 (16:06 +0100)]
opticon: Fix resume logic

Opticon now takes the right mutex to check the port status but the status
check is done wrongly for the modern serial code, so fix it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb_serial: Kill port mutex
Alan Cox [Tue, 6 Oct 2009 15:06:46 +0000 (16:06 +0100)]
usb_serial: Kill port mutex

The tty port has a port mutex used for all the port related locking so we
don't need the one in the USB serial layer any more.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb_serial: Use the shutdown() operation
Alan Cox [Tue, 6 Oct 2009 15:06:36 +0000 (16:06 +0100)]
usb_serial: Use the shutdown() operation

As Alan Stern pointed out - now we have tty_port_open the shutdown method
and locking allow us to whack the other bits into the full helper methods
and provide a shutdown op which the tty port code will synchronize with
setup for us.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty_port: coding style cleaning pass
Alan Cox [Tue, 6 Oct 2009 15:06:21 +0000 (16:06 +0100)]
tty_port: coding style cleaning pass

Mind the hoover wire...

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty_port: add "tty_port_open" helper
Alan Cox [Tue, 6 Oct 2009 15:06:11 +0000 (16:06 +0100)]
tty_port: add "tty_port_open" helper

For the moment this just moves the USB logic over and fixes the 'what if
we open and hangup at the same time' race noticed by Oliver Neukum.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: stallion: kill BKL ioctl
Alan Cox [Tue, 13 Oct 2009 15:34:15 +0000 (16:34 +0100)]
tty: stallion: kill BKL ioctl

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: istallion: Kill off the BKL ioctl
Alan Cox [Tue, 13 Oct 2009 15:34:06 +0000 (16:34 +0100)]
tty: istallion: Kill off the BKL ioctl

Fairly trivial as the BKL push down into the methods has already been done.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: esp: remove broken driver
Alan Cox [Fri, 9 Oct 2009 11:56:41 +0000 (12:56 +0100)]
tty: esp: remove broken driver

The ESP driver has been marked broken for years. It's an old ISA device
that clearly nobody cares about any more. Remove it

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agotty: const: constify remaining tty_operations
Alexey Dobriyan [Fri, 2 Oct 2009 20:12:06 +0000 (00:12 +0400)]
tty: const: constify remaining tty_operations

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agojsm: adding EEH handlers
Breno Leitao [Wed, 14 Oct 2009 17:57:51 +0000 (14:57 -0300)]
jsm: adding EEH handlers

Adding EEH handlers for the serial jsm driver. This patch adds
the PCI error handlers and also register them to be called when
a error is detected.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Acked-by: Scott Kilau <scottk@digi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agojsm: removing the field jsm_board->intr_count
Breno Leitão [Tue, 29 Sep 2009 18:16:59 +0000 (15:16 -0300)]
jsm: removing the field jsm_board->intr_count

Currently there is a field in the jsm_board structure to cont
the number of interrupt that the card recevived, but it's not
working properly when the IRQ line is shared, and also nowhere
else this field is used. So, This patch is removing it.

Signed-off-by: Breno Leitão <leitao@linux.vnet.ibm.com>
Cc: Scott Kilau <Scott.Kilau@digi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agojsm: Removing unused jsm_channel->ch_wopen field
Breno Leitão [Tue, 29 Sep 2009 18:16:58 +0000 (15:16 -0300)]
jsm: Removing unused jsm_channel->ch_wopen field

Currently the jsm_channel->ch_wopen field is defined and never
used. So, this patch removes it.

Signed-off-by: Breno Leitão <leitao@linux.vnet.ibm.com>
Cc: Scott Kilau <Scott.Kilau@digi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agojsm: Remove ch_cpstime field
Breno Leitão [Tue, 29 Sep 2009 18:16:57 +0000 (15:16 -0300)]
jsm: Remove ch_cpstime field

Currently the field jsm_channel->ch_cpstime is defined but never
used, so this patch removes it.

Signed-off-by: Breno Leitão <leitao@linux.vnet.ibm.com>
Cc: Scott Kilau <Scott.Kilau@digi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>