firefly-linux-kernel-4.4.55.git
16 years agosfc: Use __packed macro
Ben Hutchings [Fri, 16 May 2008 20:19:21 +0000 (21:19 +0100)]
sfc: Use __packed macro

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosfc: Do not define inline macro
Ben Hutchings [Fri, 16 May 2008 20:19:05 +0000 (21:19 +0100)]
sfc: Do not define inline macro

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosfc: Use DMA_BIT_MASK() instead of our own DMA mask macros
Ben Hutchings [Fri, 16 May 2008 20:18:48 +0000 (21:18 +0100)]
sfc: Use DMA_BIT_MASK() instead of our own DMA mask macros

Also change type of efx_nic_type::max_dma_mask to u64, matching
pci_dma_supported() parameter type.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosfc: Correct and expand some comments
Ben Hutchings [Fri, 16 May 2008 20:18:14 +0000 (21:18 +0100)]
sfc: Correct and expand some comments

These comments have been revised in response to questions raised by Andrew
Morton in <20080501120858.207b6dd6.akpm@linux-foundation.org>.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosfc: Use resource_size_t for PCI bus address
Ben Hutchings [Fri, 16 May 2008 20:17:06 +0000 (21:17 +0100)]
sfc: Use resource_size_t for PCI bus address

This should make the driver work on 32-bit systems with 64-bit PCI support.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosfc: Merged efx_page_offset() into efx_rx_buf_offset()
Ben Hutchings [Fri, 16 May 2008 20:16:31 +0000 (21:16 +0100)]
sfc: Merged efx_page_offset() into efx_rx_buf_offset()

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosfc: Replaced various macros with inline functions
Ben Hutchings [Fri, 16 May 2008 20:16:10 +0000 (21:16 +0100)]
sfc: Replaced various macros with inline functions

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosfc: Added and removed braces to comply with kernel style
Ben Hutchings [Fri, 16 May 2008 20:15:49 +0000 (21:15 +0100)]
sfc: Added and removed braces to comply with kernel style

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosfc: Removed unncesssary UL suffixes on 0 literals
Ben Hutchings [Fri, 16 May 2008 20:15:29 +0000 (21:15 +0100)]
sfc: Removed unncesssary UL suffixes on 0 literals

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosfc: Simplified efx_rx_calc_buffer_size() using get_order()
Ben Hutchings [Fri, 16 May 2008 20:15:06 +0000 (21:15 +0100)]
sfc: Simplified efx_rx_calc_buffer_size() using get_order()

Merged it into its only caller, efx_init_channels().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosfc: Removed casts to void
Ben Hutchings [Fri, 16 May 2008 20:14:27 +0000 (21:14 +0100)]
sfc: Removed casts to void

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosfc: Use mod_timer() to set expiry and add_timer() together
Ben Hutchings [Fri, 16 May 2008 20:13:57 +0000 (21:13 +0100)]
sfc: Use mod_timer() to set expiry and add_timer() together

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agonet: The world is not perfect patch.
Rami Rosen [Thu, 22 May 2008 00:47:54 +0000 (17:47 -0700)]
net: The world is not perfect patch.

  Unless there will be any objection here, I suggest consider the
following patch which simply removes the code for the
-DI_WISH_WORLD_WERE_PERFECT in the three methods which use it.

The compilation errors we get when using -DI_WISH_WORLD_WERE_PERFECT
show that this code was not built and not used for really a long time.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotcp: Make prior_ssthresh a u32
Ilpo Järvinen [Thu, 22 May 2008 00:40:05 +0000 (17:40 -0700)]
tcp: Make prior_ssthresh a u32

If previous window was above representable values of u16,
strange things will happen if undo with the truncated value
is called for. Alternatively, this could be fixed by some
max trickery but that would limit undoing high-speed undos.

Adds 16-bit hole but there isn't anything to fill it with.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoxfrm_user: Remove zero length key checks.
David S. Miller [Thu, 22 May 2008 00:36:21 +0000 (17:36 -0700)]
xfrm_user: Remove zero length key checks.

The crypto layer will determine whether that is valid
or not.

Suggested by Herbert Xu, based upon a report and patch
by Martin Willi.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years agonet/ipv4/arp.c: Use common hex_asc helpers
Denis Cheng [Thu, 22 May 2008 00:34:32 +0000 (17:34 -0700)]
net/ipv4/arp.c: Use common hex_asc helpers

Here the local hexbuf is a duplicate of global const char hex_asc from
lib/hexdump.c, except the hex letters' cases:

const char hexbuf[] = "0123456789ABCDEF";

const char hex_asc[] = "0123456789abcdef";

and here to print HW addresses, the hex cases are not significant.

Thanks to Harvey Harrison to introduce the hex_asc_hi/hex_asc_lo helpers.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agocassini: Only use chip checksum for ipv4 packets.
David S. Miller [Thu, 22 May 2008 00:05:34 +0000 (17:05 -0700)]
cassini: Only use chip checksum for ipv4 packets.

According to David Monro, at least with Natsemi Saturn chips the
cassini driver has some trouble with ipv6 checksums.

Until we have more information about what's going on here, only
use the chip checksums for ipv4.

This workaround was suggested and tested by David.

Update version and release date.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotcp: TCP connection times out if ICMP frag needed is delayed
Sridhar Samudrala [Wed, 21 May 2008 23:42:20 +0000 (16:42 -0700)]
tcp: TCP connection times out if ICMP frag needed is delayed

We are seeing an issue with TCP in handling an ICMP frag needed
message that is received after net.ipv4.tcp_retries1 retransmits.
The default value of retries1 is 3. So if the path mtu changes
and ICMP frag needed is lost for the first 3 retransmits or if
it gets delayed until 3 retransmits are done, TCP doesn't update
MSS correctly and continues to retransmit the orginal message
until it timesout after tcp_retries2 retransmits.

I am seeing this issue even with the latest 2.6.25.4 kernel.

In tcp_retransmit_timer(), when retransmits counter exceeds
tcp_retries1 value, the dst cache entry of the socket is reset.
At this time, if we receive an ICMP frag needed message, the
dst entry gets updated with the new MTU, but the TCP sockets
dst_cache entry remains NULL.

So the next time when we try to retransmit after the ICMP frag
needed is received, tcp_retransmit_skb() gets called. Here the
cur_mss value is calculated at the start of the routine with
a NULL sk_dst_cache. Instead we should call tcp_current_mss after
the rebuild_header that caches the dst entry with the updated mtu.
Also the rebuild_header should be called before tcp_fragment
so that skb is fragmented if the mss goes down.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotipc: Fix initialization sequence problems when entering network mode
Allan Stephens [Wed, 21 May 2008 21:55:04 +0000 (14:55 -0700)]
tipc: Fix initialization sequence problems when entering network mode

This patch ensures that TIPC's topology service and configuration
service are shut down before switching into "network mode".  This
ensures that TIPC does not mistakenly try to send unnecessary
"publication withdraw" messages to other nodes before it is fully
initialized for sending off-node messages.  Note that the node's
current network address is now updated only after the two services
are shut down; this ensures that any existing connections to the
topology server are terminated correctly using the old address.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotipc: Update "previous node" indicators when node address changes
Allan Stephens [Wed, 21 May 2008 21:54:12 +0000 (14:54 -0700)]
tipc: Update "previous node" indicators when node address changes

This patch ensures that the "previous node" field in any existing
TIPC port message header templates is updated properly when a TIPC
network address is assigned to the node.  (Previously, only the
"originating node" field was updated.)

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotipc: Optimize null pointer check during neighbor discovery
Allan Stephens [Wed, 21 May 2008 21:53:34 +0000 (14:53 -0700)]
tipc: Optimize null pointer check during neighbor discovery

This patch optimizes TIPC neighbor discovery code to avoid testing for
a null node pointer when the pointer is already known to be non-null.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotipc: Prevent node object duplication due to simultaneous discovery
Allan Stephens [Wed, 21 May 2008 21:53:00 +0000 (14:53 -0700)]
tipc: Prevent node object duplication due to simultaneous discovery

This patch ensures that the simultaneous discovery of the same
neighboring node by multiple interfaces does not cause TIPC to add
the node into its internal data structures more than once.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotipc: Fix skb_under_panic when configuring TIPC without privileges
Allan Stephens [Wed, 21 May 2008 21:52:30 +0000 (14:52 -0700)]
tipc: Fix skb_under_panic when configuring TIPC without privileges

This patch prevents a TIPC configuration command requiring network
administrator privileges from triggering an skbuff underrun if it
is issued by a process lacking those privileges.  The revised error
handling code avoids the use of a potentially uninitialized global
variable by transforming the unauthorized command into a new command,
then following the standard command processing path to generate the
required error message.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoip6mr: Use on-device stats instead of private ones.
Pavel Emelyanov [Wed, 21 May 2008 21:17:54 +0000 (14:17 -0700)]
ip6mr: Use on-device stats instead of private ones.

Similar to ipmr.

[ Fix build failures -DaveM ]

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipmr: Use on-device stats instead of private ones.
Pavel Emelyanov [Wed, 21 May 2008 21:17:33 +0000 (14:17 -0700)]
ipmr: Use on-device stats instead of private ones.

These devices use the private area of appropriate size for
statistics. Turning them to use on-device ones make them
"privless" and thus - really small wrt kmalloc cache, they
are allocated from.

Besides, code looks nicer, because of absence of multi-braced
type casts and dereferences.

[ Fix build failures -DaveM ]

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoip6tnl: Use on-device stats instead of private ones.
Pavel Emelyanov [Wed, 21 May 2008 21:17:05 +0000 (14:17 -0700)]
ip6tnl: Use on-device stats instead of private ones.

This tunnel uses its own private structure and requires separate
patch to switch from private stats to on-device ones.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotunnels: Remove stat member from ip_tunnel struct.
Pavel Emelyanov [Wed, 21 May 2008 21:16:36 +0000 (14:16 -0700)]
tunnels: Remove stat member from ip_tunnel struct.

All users already use on-device statistics, so this field can be
safely removed.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipmr: Ipip tunnel uses on-device stats.
Pavel Emelyanov [Wed, 21 May 2008 21:16:14 +0000 (14:16 -0700)]
ipmr: Ipip tunnel uses on-device stats.

The ipmr uses ipip tunnels for its purposes and updates the
tunnels' stats, but the ipip driver is already switched to
use on-device ones.

Actually, this is a part of the patch #4 from this set.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agosit: Use on-device stats instead of private ones.
Pavel Emelyanov [Wed, 21 May 2008 21:15:46 +0000 (14:15 -0700)]
sit: Use on-device stats instead of private ones.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipip: Use on-device stats instead of private ones.
Pavel Emelyanov [Wed, 21 May 2008 21:15:16 +0000 (14:15 -0700)]
ipip: Use on-device stats instead of private ones.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipgre: Use on-device stats instead of private ones.
Pavel Emelyanov [Wed, 21 May 2008 21:14:22 +0000 (14:14 -0700)]
ipgre: Use on-device stats instead of private ones.

Just switch from tunnel->stat to tunnel->dev->stats. The ip_tunnel->stat
member itself will be removed after I fix its other users (very soon).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobridge: Use on-device stats instead of private ones.
Pavel Emelyanov [Wed, 21 May 2008 21:13:47 +0000 (14:13 -0700)]
bridge: Use on-device stats instead of private ones.

Even though bridges require 6 fields from struct net_device_stats,
the on-device stats are always there, so we may just use them.

The br_dev_get_stats is no longer required after this.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: The dev->get_stats pointer is not NULL nowadays.
Pavel Emelyanov [Wed, 21 May 2008 21:12:46 +0000 (14:12 -0700)]
net: The dev->get_stats pointer is not NULL nowadays.

And so does the pointer is returns, but sysfs and netlinks still
check for both cases.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetfilter: Move linux/types.h inclusions outside of #ifdef __KERNEL__
Patrick McHardy [Wed, 21 May 2008 21:08:38 +0000 (14:08 -0700)]
netfilter: Move linux/types.h inclusions outside of #ifdef __KERNEL__

Greg Steuck <greg@nest.cx> points out that some of the netfilter
headers can't be used in userspace without including linux/types.h
first. The headers include their own linux/types.h include statements,
these are stripped by make headers-install because they are inside
#ifdef __KERNEL__ however. Move them out to fix this.

Reported and Tested by Greg Steuck.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoaf_key: Fix selector family initialization.
Kazunori MIYAZAWA [Wed, 21 May 2008 20:26:11 +0000 (13:26 -0700)]
af_key: Fix selector family initialization.

This propagates the xfrm_user fix made in commit
bcf0dda8d2408fe1c1040cdec5a98e5fcad2ac72 ("[XFRM]: xfrm_user: fix
selector family initialization")

Based upon a bug report from, and tested by, Alan Swanson.

Signed-off-by: Kazunori MIYAZAWA <kazunori@miyazawa.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireles...
David S. Miller [Wed, 21 May 2008 03:34:22 +0000 (20:34 -0700)]
Merge branch 'master' of /linux/kernel/git/linville/wireless-2.6

16 years agolibertas: Fix ethtool statistics
David Woodhouse [Mon, 19 May 2008 15:32:02 +0000 (16:32 +0100)]
libertas: Fix ethtool statistics

Fix various problems:
 - We converted MESH_ACCESS to a direct command but missed this caller.
 - We were trying to access mesh stats even on meshless firmware.
 - We should really zero the buffer if something goes wrong.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: fix NULL pointer dereference in ieee80211_compatible_rates
Helmut Schaa [Tue, 20 May 2008 07:56:37 +0000 (09:56 +0200)]
mac80211: fix NULL pointer dereference in ieee80211_compatible_rates

Fix a possible NULL pointer dereference in ieee80211_compatible_rates
introduced in the patch "mac80211: fix association with some APs". If no bss
is available just use all supported rates in the association request.

Signed-off-by: Helmut Schaa <hschaa@suse.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agopktgen: make sure that pktgen_thread_worker has been executed
Denis V. Lunev [Tue, 20 May 2008 22:12:44 +0000 (15:12 -0700)]
pktgen: make sure that pktgen_thread_worker has been executed

The following courruption can happen during pktgen stop:
list_del corruption. prev->next should be ffff81007e8a5e70, but was 6b6b6b6b6b6b6b6b
kernel BUG at lib/list_debug.c:67!
      :pktgen:pktgen_thread_worker+0x374/0x10b0
      ? autoremove_wake_function+0x0/0x40
      ? _spin_unlock_irqrestore+0x42/0x80
      ? :pktgen:pktgen_thread_worker+0x0/0x10b0
      kthread+0x4d/0x80
      child_rip+0xa/0x12
      ? restore_args+0x0/0x30
      ? kthread+0x0/0x80
      ? child_rip+0x0/0x12
RIP  list_del+0x48/0x70

The problem is that pktgen_thread_worker can not be executed if kthread_stop
has been called too early. Insert a completion on the normal initialization
path to make sure that pktgen_thread_worker will gain the control for sure.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Alexey Dobriyan <adobriyan@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agomac80211: don't claim iwspy support
Johannes Berg [Mon, 19 May 2008 05:18:10 +0000 (07:18 +0200)]
mac80211: don't claim iwspy support

We removed iwspy support a very long time ago because it is useless, but
forgot to stop claiming to support it. Apparently, nobody cares, but
remove it nonetheless.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoorinoco_cs: add ID for SpeedStream wireless adapters
Pavel Roskin [Fri, 16 May 2008 21:53:03 +0000 (17:53 -0400)]
orinoco_cs: add ID for SpeedStream wireless adapters

Reported by Gerald Willmann <gerald.willmann@econ.kuleuven.be>

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agohostap_cs: add ID for Conceptronic CON11CPro
Pavel Roskin [Fri, 16 May 2008 21:52:57 +0000 (17:52 -0400)]
hostap_cs: add ID for Conceptronic CON11CPro

Reported by Santiago Garcia Mantinan <hostap@manty.net>

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agortl8187: resource leak in error case
Oliver Neukum [Thu, 15 May 2008 19:49:16 +0000 (21:49 +0200)]
rtl8187: resource leak in error case

This fixes resource leaks in error cases due to urb submission
failures.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years ago[VLAN]: Propagate selected feature bits to VLAN devices
Patrick McHardy [Tue, 20 May 2008 21:54:50 +0000 (14:54 -0700)]
[VLAN]: Propagate selected feature bits to VLAN devices

Propagate feature bits from the NETDEV_FEAT_CHANGE notifier. For now
only TSO is propagated for devices that announce their ability to
support TSO in combination with VLAN accel by setting the NETIF_F_VLAN_TSO
flag.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agodrivers/atm/: remove CVS keywords
Adrian Bunk [Tue, 20 May 2008 21:52:25 +0000 (14:52 -0700)]
drivers/atm/: remove CVS keywords

This patch removes CVS keywords that weren't updated for a long time.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Chas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoath5k: Fix loop variable initializations
Bob Copeland [Tue, 13 May 2008 01:16:44 +0000 (21:16 -0400)]
ath5k: Fix loop variable initializations

In ath5k_tasklet_rx, both status structures 'rxs' and 'rs' are
initialized at the top of the tasklet, but not within the loop.
If the loop is executed multiple times in the tasklet then the
variables may see changes from previous packets.

For TKIP, this results in 'Invalid Michael MIC' errors if two packets
are processed in the tasklet: rxs.flag gets set to RX_DECRYPTED by
mac80211 when it decrypts the first encrypted packet.  The subsequent
packet will have RX_DECRYPTED set upon entry to mac80211, so mac80211
will not try to decrypt it.

We currently initialize all but two fields in the structures, so fix
the other two.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agovlan: Correctly handle device notifications for layered VLAN devices
Patrick McHardy [Tue, 20 May 2008 21:37:36 +0000 (14:37 -0700)]
vlan: Correctly handle device notifications for layered VLAN devices

Commit 30688a9 ([VLAN]: Handle vlan devices net namespace changing)
changed the device notifier to special-case notifications for VLAN
devices, effectively disabling state propagation to underlying VLAN
devices. This is needed for layered VLANs though, so restore the
original behaviour.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: Fix call to ->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags()
David Woodhouse [Tue, 20 May 2008 21:36:14 +0000 (14:36 -0700)]
net: Fix call to ->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags()

Am I just being particularly dim today, or can the call to
dev->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags() never
happen?

We've just set dev->flags = flags & IFF_MULTICAST, effectively. So the
condition '(dev->flags ^ flags) & IFF_MULTICAST' is _never_ going to be
true.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet_sched: cls_api: fix return value for non-existant classifiers
Patrick McHardy [Tue, 20 May 2008 21:34:46 +0000 (14:34 -0700)]
net_sched: cls_api: fix return value for non-existant classifiers

cls_api should return ENOENT when the requested classifier doesn't
exist.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipsec: Use the correct ip_local_out function
Herbert Xu [Tue, 20 May 2008 21:32:14 +0000 (14:32 -0700)]
ipsec: Use the correct ip_local_out function

Because the IPsec output function xfrm_output_resume does its
own dst_output call it should always call __ip_local_output
instead of ip_local_output as the latter may invoke dst_output
directly.  Otherwise the return values from nf_hook and dst_output
may clash as they both use the value 1 but for different purposes.

When that clash occurs this can cause a packet to be used after
it has been freed which usually leads to a crash.  Because the
offending value is only returned from dst_output with qdiscs
such as HTB, this bug is normally not visible.

Thanks to Marco Berizzi for his perseverance in tracking this
down.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv6 addrconf: Allow infinite prefix lifetime.
YOSHIFUJI Hideaki [Mon, 19 May 2008 23:56:11 +0000 (16:56 -0700)]
ipv6 addrconf: Allow infinite prefix lifetime.

We need to handle infinite prefix lifetime specially.
With help from original reporter "Bonitch, Joseph"
<Joseph.Bonitch@xerox.com>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv6 route: Fix lifetime in netlink.
YOSHIFUJI Hideaki [Mon, 19 May 2008 23:55:13 +0000 (16:55 -0700)]
ipv6 route: Fix lifetime in netlink.

We could not see appropriate lifetime if the route had been scheduled
to expired at 0 (in jiffies).  We should check rt6i_flags instead of
rt6i_expires to determine whether lifetime is valid or not.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv6 addrconf: Fix route lifetime setting in corner case.
YOSHIFUJI Hideaki [Mon, 19 May 2008 23:54:29 +0000 (16:54 -0700)]
ipv6 addrconf: Fix route lifetime setting in corner case.

Because of arithmetic overflow avoidance, the actual lifetime setting
(vs the value given by RA) did not increase monotonically around
0x7fffffff/HZ.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireles...
David S. Miller [Mon, 19 May 2008 23:29:40 +0000 (16:29 -0700)]
Merge branch 'master' of /linux/kernel/git/linville/wireless-2.6

16 years agondisc: Add missing strategies for per-device retrans timer/reachable time settings.
YOSHIFUJI Hideaki [Mon, 19 May 2008 23:25:42 +0000 (16:25 -0700)]
ndisc: Add missing strategies for per-device retrans timer/reachable time settings.

Noticed from Al Viro <viro@ftp.linux.org.uk> via David Miller
<davem@davemloft.net>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv6: Move <linux/in6.h> from header-y to unifdef-y.
Robert P. J. Day [Mon, 19 May 2008 21:13:11 +0000 (14:13 -0700)]
ipv6: Move <linux/in6.h> from header-y to unifdef-y.

Given that <linux/in6.h> contains a __KERNEL__ test, it should be
unifdef-ed.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agol2tp: avoid skb truesize bug if headroom is increased
James Chapman [Mon, 19 May 2008 21:10:01 +0000 (14:10 -0700)]
l2tp: avoid skb truesize bug if headroom is increased

A user reported seeing occasional bugs such as the following when
using the L2TP driver.

  SKB BUG: Invalid truesize (272) len=72, sizeof(sk_buff)=208

When L2TP adds its header in the transmit path, it might need to
increase the headroom of the skb. In some cases, the increased
headroom trips a kernel bug when the skb is freed because the skb has
grown beyond its truesize value. The fix is to increase the truesize
by the amount of headroom added, after orphaning the skb.

While here, fix a misleading comment.

Thanks to Iouri Kharon <bc-info@styx.cabel.net> for the initial
report and testing the fix.

Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv6: Register some net/ipv6/ core sysctls at read-only root.
Pavel Emelyanov [Mon, 19 May 2008 20:53:30 +0000 (13:53 -0700)]
ipv6: Register some net/ipv6/ core sysctls at read-only root.

There are some sysctls left to be switched to read-only,
but they are all in ipv6, so complete with them.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoinet: Register fragmentation some ctls at read-only root.
Pavel Emelyanov [Mon, 19 May 2008 20:53:02 +0000 (13:53 -0700)]
inet: Register fragmentation some ctls at read-only root.

Parts of fragments-related sysctls are read-only, but this is
done by cloning all the tables and dropping write-bits from
mode. Do the same but with read-only root.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv6: In fragmentation code, handle error returned from register_pernet_subsys.
Pavel Emelyanov [Mon, 19 May 2008 20:52:28 +0000 (13:52 -0700)]
ipv6: In fragmentation code, handle error returned from register_pernet_subsys.

The error code is ignored now, but ipv6 is a module and one can
be loaded under memory pressure, so the error may occur (in theory).

Besides, I'm going to handle error returned from registering a
read-only part of the table, so ignoring this one, while handing
the other one would look strange.

(However, this possibility of error is rather small, so I'm not
 sure whether this is a candidate for current net tree).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoinet: Rename fragmentation sysctl-related functions/variables.
Pavel Emelyanov [Mon, 19 May 2008 20:51:29 +0000 (13:51 -0700)]
inet: Rename fragmentation sysctl-related functions/variables.

The fragments sysctls also contains some, that are to be
visible, but read-only in net namespaces.

The naming in net/core/sysctl_net_core.c is - tables, that are
to be registered in namespaces have a "ns" word in their names.
So rename ones in ipv4/ip_fragment.c and ipv6/reassembly.c to
fit this.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetns: Register net/core/ sysctls at read-only root.
Pavel Emelyanov [Mon, 19 May 2008 20:49:52 +0000 (13:49 -0700)]
netns: Register net/core/ sysctls at read-only root.

Most of the net/core/xxx sysctls are read-only now, but this
goal is achieved with excessive memory consumption in each
namespace - the whole table is cloned and most of the entries
in it are ~= 0222.

Split it into two parts and register (the largest) one at the
read-only root.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetns: Introduce sysctl root for read-only net sysctls.
Pavel Emelyanov [Mon, 19 May 2008 20:45:33 +0000 (13:45 -0700)]
netns: Introduce sysctl root for read-only net sysctls.

This one stores all ctl-heads in one list and restricts the
permissions not give write access to non-init net namespaces.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotipc: Cosmetic cleanup of topology service code
Allan Stephens [Mon, 19 May 2008 20:30:13 +0000 (13:30 -0700)]
tipc: Cosmetic cleanup of topology service code

This patch contains a set of cosmetic changes to TIPC's network
topology service subsystem, including:

- updates to comments (including copyright dates)
- re-ordering structure fields to group them more logically
- removal of optional debugging code that is no longer required
- minor changes to whitespace to conform to Linux coding conventions

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotipc: Consolidate subscriber & subscriber port references
Allan Stephens [Mon, 19 May 2008 20:29:47 +0000 (13:29 -0700)]
tipc: Consolidate subscriber & subscriber port references

This patch modifies TIPC's network topology service so that it
only requires a single reference table entry per subscriber
connection, rather than two.  This is achieved by letting the
reference to the server port communicating with the subscriber
act as the reference to the subscriber object itself.  (Since
the subscriber cannot exist without its port, and vice versa,
this dual role for the reference is perfectly natural.)  This
consolidation reduces the size of the reference table by 50%
in the default configuration.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotipc: Fix bug in topology server byte swapping routine
Allan Stephens [Mon, 19 May 2008 20:29:06 +0000 (13:29 -0700)]
tipc: Fix bug in topology server byte swapping routine

This patch fixes TIPC's topology server so that it does byte swapping
correctly when endianness conversion is required.  (Note: This bug only
impacted an application if it issues a subscription request to a
topology server on another node, rather than the server on it's own
node; since the topology server is normally not accessible by off-node
applications, most TIPC applications were not impacted by the bug.)

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotipc: Add support for customized subscription endianness
Allan Stephens [Mon, 19 May 2008 20:28:32 +0000 (13:28 -0700)]
tipc: Add support for customized subscription endianness

This patch enables TIPC's topology server code to do customized
endianness conversions on a per-subscription basis.  (This
capability is needed to support the upcoming consolidation of
subscriber and subscription object references.)

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotipc: Add support for customized subscription overlap handling
Allan Stephens [Mon, 19 May 2008 20:27:31 +0000 (13:27 -0700)]
tipc: Add support for customized subscription overlap handling

This patch enables TIPC's topology server code to do customized
overlap detection handling on a per-subscription basis.  (This
capability is needed to support the upcoming introduction of
multi-cluster TIPC networks.)

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobnx2: Update version to 1.7.6.
Michael Chan [Sat, 17 May 2008 05:20:59 +0000 (22:20 -0700)]
bnx2: Update version to 1.7.6.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobnx2: Pre-initialize struct cpu_reg.
Benjamin Li [Sat, 17 May 2008 05:20:27 +0000 (22:20 -0700)]
bnx2: Pre-initialize struct cpu_reg.

Instead of assigning values for the struct cpu_reg's at runtime,
we already know these values at compile time.  Therefore, we can use
designated initializers, to initialize these structures and not have
to incur this assignment cost at run-time.

Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobnx2: Rename RX_COPY_THRESH to BNX2_RX_COPY_THRESH.
Benjamin Li [Sat, 17 May 2008 05:19:35 +0000 (22:19 -0700)]
bnx2: Rename RX_COPY_THRESH to BNX2_RX_COPY_THRESH.

To make the bnx2 code more consistent, all instances of
RX_COPY_THRESH have been changed to BNX2_RX_COPY_THRESH.

Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobnx2: Remove the rx_offset field from the bnx2 structure.
Benjamin Li [Sat, 17 May 2008 05:18:57 +0000 (22:18 -0700)]
bnx2: Remove the rx_offset field from the bnx2 structure.

The rx_offset field is set to a constant value and initialized
only once.  By replacing all references to the rx_offset field,
we can eliminate rx_offset from the bnx2 structure.  This will
save 4 bytes for every bnx2 instance.

[Added parentheses to the definition of BNX2_RX_OFFSET, as noted
by Ben Hutchings.]

Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobnx2: Add EEH PCI recovery.
Wendy Xiong [Sat, 17 May 2008 05:18:21 +0000 (22:18 -0700)]
bnx2: Add EEH PCI recovery.

Add PCI recovery functions to the driver.  The initial pci state is
also saved so the the MSI state can be restored during PCI recovery.

Signed-off-by: Wendy Xiong <wendyx@us.ibm.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobnx2: Allow phy reset to be skipped during chip reset.
Michael Chan [Sat, 17 May 2008 05:17:45 +0000 (22:17 -0700)]
bnx2: Allow phy reset to be skipped during chip reset.

Andy Gospodarek <andy@greyhouse.net> found that netconsole would
panic when resetting bnx2 devices.

>From Andy:
"The issue is the bnx2_set_link in bnx2_init_nic will print a link-status
message before we are fully initialized and ready to start polling.
Polling is currently disabled in this state, but since the
__LINK_STATE_RX_SCHED is overloaded to not only try and disable polling
but also to make the system aware there is something waiting to be
polled, we really have to fix this in drivers.

The problematic call is the one to netif_rx_complete as it tries to
remove an entry from the poll_list when there isn't one."

While this netconsole problem should be fixed separately, we really
should not reset the PHY when changing ring sizes, MTU, or other
similar settings.  The PHY reset causes several seconds of unnecessary
link disruptions.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agowireless: Create 'device' symlink in sysfs
Masakazu Mokuno [Wed, 14 May 2008 05:16:50 +0000 (14:16 +0900)]
wireless: Create 'device' symlink in sysfs

Some network interfaces of the wireless drivers lack the 'device'
symlink in sysfs.
This patch lets the drivers create the links.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agowireless, airo: waitbusy() won't delay
Roel Kluin [Tue, 13 May 2008 20:12:27 +0000 (22:12 +0200)]
wireless, airo: waitbusy() won't delay

There will be no delay even when COMMAND_BUSY (defined 0x8000) is set:
0x8000 & (delay < 10000) will evaluate to 0 - when delay is 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: fix command timeout after firmware failure
Brian Cavagnolo [Tue, 13 May 2008 12:54:59 +0000 (13:54 +0100)]
libertas: fix command timeout after firmware failure

This is a fix for OLPC ticket #6586: "SCAN command fails, timer doesn't
fire". In fact, the timer was firing; the problem was that the dnld_sent
state variable was not being updated after the timer expired, so
lbs_execute_next_command was not being called.

Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: Add RTNL version of ieee80211_iterate_active_interfaces
Ivo van Doorn [Sat, 10 May 2008 11:40:49 +0000 (13:40 +0200)]
mac80211: Add RTNL version of ieee80211_iterate_active_interfaces

Since commit e38bad4766a110b61fa6038f10be16ced8c6cc38
mac80211: make ieee80211_iterate_active_interfaces not need rtnl
rt2500usb and rt73usb broke down due to attempting register access
in atomic context (which is not possible for USB hardware).

This patch restores ieee80211_iterate_active_interfaces() to use RTNL lock,
and provides the non-RTNL version under a new name:
ieee80211_iterate_active_interfaces_atomic()

So far only rt2x00 uses ieee80211_iterate_active_interfaces(), and those
drivers require the RTNL version of ieee80211_iterate_active_interfaces().
Since they already call that function directly, this patch will automatically
fix the USB rt2x00 drivers.

v2: Rename ieee80211_iterate_active_interfaces_rtnl

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211 : Association with 11n hidden ssid ap.
Abhijeet Kolekar [Fri, 9 May 2008 16:35:41 +0000 (09:35 -0700)]
mac80211 : Association with 11n hidden ssid ap.

This patch fixes the association problem with 11n hidden ssid ap.
Patch fixes the problem of associating with hidden ssid when
all three parameters ap,essid and channel are given to iwconfig.
This patch removes the condition of checking three parameters
and always checks for bss in bss list while associating.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agohostap: fix "registers" registration in procfs
Mathieu Chouquet-Stringer [Wed, 14 May 2008 23:03:18 +0000 (19:03 -0400)]
hostap: fix "registers" registration in procfs

The "registers" entry was incorrectly created in the procfs root instead
of the device specific directory.  Move "registers" registration
immediately after the containing procfs directory is created.

Signed-off-by: Mathieu Chouquet-Stringer <mchouque@free.fr>
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 15 May 2008 07:52:37 +0000 (00:52 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next-2.6

16 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Thu, 15 May 2008 07:34:44 +0000 (00:34 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/davem/net-2.6

Conflicts:

drivers/net/wireless/iwlwifi/iwl-4965-rs.c
drivers/net/wireless/rt2x00/rt61pci.c

16 years agoisdn/capi: Return proper errnos on module init.
Marcin Slusarz [Thu, 15 May 2008 06:30:06 +0000 (23:30 -0700)]
isdn/capi: Return proper errnos on module init.

cdebug_init() is called from kcapi_init() which is module
initialization function, so it must return negative values on errors.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoiphase: Fix 64bit warning.
Alan Cox [Thu, 15 May 2008 06:28:47 +0000 (23:28 -0700)]
iphase: Fix 64bit warning.

Time is unsigned long (except when you are in a hurry) so we need to
store rx_tmp_jif in the right sized object.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agohysdn: No longer broken on SMP.
Andrew Morton [Thu, 15 May 2008 06:27:18 +0000 (23:27 -0700)]
hysdn: No longer broken on SMP.

With the cli/sti code sorted out we think this driver is OK for use on
SMP systems.

Acked-by: Mark Asselstine <mark.asselstine@windriver.com>
Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agohysdn: Remove cli()/sti() calls.
Mark Asselstine [Thu, 15 May 2008 06:25:33 +0000 (23:25 -0700)]
hysdn: Remove cli()/sti() calls.

The use of cli()/sti() within the do/while was a way to ensure
interrupts were only disabled for short periods of time while the bulk
of the time interrupts were free to occur.  The use of the spin lock
has eliminated the need to play with interrupts in this way while
still allowing for IO to be protected.

The remaining 3 sti() calls seem unneeded now that at no other point
in the driver is there a call to cli().

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoatm: Cleanup atm_tcp.h and atm.h for userspace.
Mike Frysinger [Thu, 15 May 2008 06:24:09 +0000 (23:24 -0700)]
atm: Cleanup atm_tcp.h and atm.h for userspace.

The atm_tcp.h uses types from linux/atm.h, but does not include it.
It should also use the standard __u## types from linux/types.h rather
than the uint##_t types since the former can be found with the kernel
already.

Same goes for linux/atm.h.  The linux/socket.h include there also gets
dropped as atm.h does not actually use anything from socket.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobonding: handle case of device named bonding_master
Stephen Hemminger [Thu, 15 May 2008 05:35:04 +0000 (22:35 -0700)]
bonding: handle case of device named bonding_master

If device already exists named bonding_masters, then fail. This is a wierd
corner case only a QA group could love.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agosysfs: remove error messages for -EEXIST case
Stephen Hemminger [Thu, 15 May 2008 05:34:16 +0000 (22:34 -0700)]
sysfs: remove error messages for -EEXIST case

It is possible that the entry in sysfs already exists, one case of this is
when a network device is renamed to bonding_masters. Anyway, in this case
the proper error path is for device_rename to return an error code, not to
generate bogus backtrace and errors.

Also, to avoid possible races, the create link should be done before the
remove link. This makes a device rename atomic operation like other renames.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: handle errors from device_rename
Stephen Hemminger [Thu, 15 May 2008 05:33:38 +0000 (22:33 -0700)]
net: handle errors from device_rename

device_rename can fail with -EEXIST or -ENOMEM, so handle any
problems.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh...
Linus Torvalds [Thu, 15 May 2008 02:30:13 +0000 (19:30 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/ericvh/v9fs

* 'for-linus' of ssh://master.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  9p: fix error path during early mount
  9p: make cryptic unknown error from server less scary
  9p: fix flags length in net
  9p: Correct fidpool creation failure in p9_client_create
  9p: use struct mutex instead of struct semaphore
  9p: propagate parse_option changes to client and transports
  fs/9p/v9fs.c (v9fs_parse_options): Handle kstrdup and match_strdup failure.
  9p: Documentation updates
  add match_strlcpy() us it to make v9fs make uname and remotename parsing more robust

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Thu, 15 May 2008 02:11:36 +0000 (19:11 -0700)]
Merge git://git./linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: Use a TS_RESTORE_SIGMASK
  lmb: Make lmb debugging more useful.
  lmb: Fix inconsistent alignment of size argument.
  sparc: Fix mremap address range validation.

16 years agonet/irda/irnet/irnet_irda.c needs unaligned.h
Andrew Morton [Wed, 14 May 2008 23:05:59 +0000 (16:05 -0700)]
net/irda/irnet/irnet_irda.c needs unaligned.h

net/irda/irnet/irnet_irda.c: In function 'irnet_discovery_indication':
net/irda/irnet/irnet_irda.c:1676: error: implicit declaration of function 'get_unaligned'

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotty_check_change(): avoid taking tasklist_lock while holding tty->ctrl_lock
Andrew Morton [Wed, 14 May 2008 23:05:58 +0000 (16:05 -0700)]
tty_check_change(): avoid taking tasklist_lock while holding tty->ctrl_lock

May 11 09:42:27 [kernel] [ 1104.496819] rarian-sk-get-c[5630]: segfault at 0 ip 7f478556caf0 sp 7fff8e3fe338 error 4 in libc-2.6.1.so[7f47854f9000+136000]
May 11 10:59:48 [kernel] [ 2494.165792]
May 11 10:59:48 [kernel] [ 2494.165794] =======================================================
May 11 10:59:48 [kernel] [ 2494.165801] [ INFO: possible circular locking dependency detected ]
May 11 10:59:48 [kernel] [ 2494.165805] 2.6.26-rc1-00007-g91b3a7a #217
May 11 10:59:48 [kernel] [ 2494.165807] -------------------------------------------------------
May 11 10:59:48 [kernel] [ 2494.165809] less/7053 is trying to acquire lock:
May 11 10:59:48 [kernel] [ 2494.165812]  (tasklist_lock){..??}, at: [<ffffffff80232e95>] is_current_pgrp_orphaned+0x15/0x50
May 11 10:59:48 [kernel] [ 2494.165821]
May 11 10:59:48 [kernel] [ 2494.165822] but task is already holding lock:
May 11 10:59:48 [kernel] [ 2494.165824]  (&tty->ctrl_lock){....}, at: [<ffffffff803d5f31>] tty_check_change+0x61/0x110
May 11 10:59:48 [kernel] [ 2494.165831]
May 11 10:59:48 [kernel] [ 2494.165832] which lock already depends on the new lock.
May 11 10:59:48 [kernel] [ 2494.165833]
May 11 10:59:48 [kernel] [ 2494.165835]
May 11 10:59:48 [kernel] [ 2494.165836] the existing dependency chain (in reverse order) is:
May 11 10:59:48 [kernel] [ 2494.165838]
May 11 10:59:48 [kernel] [ 2494.165839] -> #2 (&tty->ctrl_lock){....}:
May 11 10:59:48 [kernel] [ 2494.165843]        [<ffffffff80253796>] __lock_acquire+0xf86/0x1080
May 11 10:59:48 [kernel] [ 2494.165851]        [<ffffffff80253922>] lock_acquire+0x92/0xc0
May 11 10:59:48 [kernel] [ 2494.165858]        [<ffffffff804deee0>] _spin_lock_irqsave+0x40/0x60
May 11 10:59:48 [kernel] [ 2494.165866]        [<ffffffff803d31b5>] __proc_set_tty+0x35/0xe0
May 11 10:59:48 [kernel] [ 2494.165873]        [<ffffffff803d76d4>] tty_ioctl+0xbf4/0xfe0
May 11 10:59:48 [kernel] [ 2494.165880]        [<ffffffff802a05e1>] vfs_ioctl+0x31/0x90
May 11 10:59:48 [kernel] [ 2494.165888]        [<ffffffff802a06b3>] do_vfs_ioctl+0x73/0x2d0
May 11 10:59:48 [kernel] [ 2494.165895]        [<ffffffff802a095a>] sys_ioctl+0x4a/0x80
May 11 10:59:48 [kernel] [ 2494.165902]        [<ffffffff8020b5ab>] system_call_after_swapgs+0x7b/0x80
May 11 10:59:48 [kernel] [ 2494.165910]        [<ffffffffffffffff>] 0xffffffffffffffff
May 11 10:59:48 [kernel] [ 2494.165924]
May 11 10:59:48 [kernel] [ 2494.165925] -> #1 (&sighand->siglock){++..}:
May 11 10:59:48 [kernel] [ 2494.165929]        [<ffffffff80253796>] __lock_acquire+0xf86/0x1080
May 11 10:59:48 [kernel] [ 2494.165936]        [<ffffffff80253922>] lock_acquire+0x92/0xc0
May 11 10:59:48 [kernel] [ 2494.165943]        [<ffffffff804dec1f>] _spin_lock+0x2f/0x40
May 11 10:59:48 [kernel] [ 2494.165951]        [<ffffffff8022d5a3>] copy_process+0x973/0x1210
May 11 10:59:48 [kernel] [ 2494.165959]        [<ffffffff8022df12>] do_fork+0x82/0x2f0
May 11 10:59:48 [kernel] [ 2494.165967]        [<ffffffff8020bfe1>] kernel_thread+0x81/0xde
May 11 10:59:48 [kernel] [ 2494.165974]        [<ffffffff8020c048>] child_rip+0xa/0x12
May 11 10:59:48 [kernel] [ 2494.165981]        [<ffffffffffffffff>] 0xffffffffffffffff
May 11 10:59:48 [kernel] [ 2494.166038]
May 11 10:59:48 [kernel] [ 2494.166039] -> #0 (tasklist_lock){..??}:
May 11 10:59:48 [kernel] [ 2494.166043]        [<ffffffff802535ab>] __lock_acquire+0xd9b/0x1080
May 11 10:59:48 [kernel] [ 2494.166050]        [<ffffffff80253922>] lock_acquire+0x92/0xc0
May 11 10:59:48 [kernel] [ 2494.166057]        [<ffffffff804dede2>] _read_lock+0x32/0x50
May 11 10:59:48 [kernel] [ 2494.166063]        [<ffffffff80232e95>] is_current_pgrp_orphaned+0x15/0x50
May 11 10:59:48 [kernel] [ 2494.166071]        [<ffffffff803d5f80>] tty_check_change+0xb0/0x110
May 11 10:59:48 [kernel] [ 2494.166078]        [<ffffffff803dac5f>] set_termios+0x1f/0x4c0
May 11 10:59:48 [kernel] [ 2494.166085]        [<ffffffff803db379>] tty_mode_ioctl+0x279/0x3e0
May 11 10:59:48 [kernel] [ 2494.166092]        [<ffffffff803db51d>] n_tty_ioctl+0x3d/0x260
May 11 10:59:48 [kernel] [ 2494.166100]        [<ffffffff803d6c34>] tty_ioctl+0x154/0xfe0
May 11 10:59:48 [kernel] [ 2494.166107]        [<ffffffff802a05e1>] vfs_ioctl+0x31/0x90
May 11 10:59:48 [kernel] [ 2494.166114]        [<ffffffff802a06b3>] do_vfs_ioctl+0x73/0x2d0
May 11 10:59:48 [kernel] [ 2494.166121]        [<ffffffff802a095a>] sys_ioctl+0x4a/0x80
May 11 10:59:48 [kernel] [ 2494.166128]        [<ffffffff8020b5ab>] system_call_after_swapgs+0x7b/0x80
May 11 10:59:48 [kernel] [ 2494.166135]        [<ffffffffffffffff>] 0xffffffffffffffff
May 11 10:59:48 [kernel] [ 2494.166142]
May 11 10:59:48 [kernel] [ 2494.166143] other info that might help us debug this:
May 11 10:59:48 [kernel] [ 2494.166144]
May 11 10:59:48 [kernel] [ 2494.166146] 1 lock held by less/7053:
May 11 10:59:48 [kernel] [ 2494.166148]  #0:  (&tty->ctrl_lock){....}, at: [<ffffffff803d5f31>] tty_check_change+0x61/0x110
May 11 10:59:48 [kernel] [ 2494.166155]
May 11 10:59:48 [kernel] [ 2494.166156] stack backtrace:
May 11 10:59:48 [kernel] [ 2494.166159] Pid: 7053, comm: less Not tainted 2.6.26-rc1-00007-g91b3a7a #217
May 11 10:59:48 [kernel] [ 2494.166161]
May 11 10:59:48 [kernel] [ 2494.166162] Call Trace:
May 11 10:59:48 [kernel] [ 2494.166168]  [<ffffffff80251223>] print_circular_bug_tail+0x83/0x90
May 11 10:59:48 [kernel] [ 2494.166172]  [<ffffffff80250889>] ? print_circular_bug_entry+0x49/0x60
May 11 10:59:48 [kernel] [ 2494.166178]  [<ffffffff802535ab>] __lock_acquire+0xd9b/0x1080
May 11 10:59:48 [kernel] [ 2494.166184]  [<ffffffff80232e95>] ? is_current_pgrp_orphaned+0x15/0x50
May 11 10:59:48 [kernel] [ 2494.166189]  [<ffffffff80253922>] lock_acquire+0x92/0xc0
May 11 10:59:48 [kernel] [ 2494.166206]  [<ffffffff803d5f80>] tty_check_change+0xb0/0x110
May 11 10:59:48 [kernel] [ 2494.166211]  [<ffffffff803dac5f>] set_termios+0x1f/0x4c0
May 11 10:59:48 [kernel] [ 2494.166216]  [<ffffffff803d3423>] ? tty_ldisc_try+0x23/0x60
May 11 10:59:48 [kernel] [ 2494.166220]  [<ffffffff803d3444>] ? tty_ldisc_try+0x44/0x60
May 11 10:59:48 [kernel] [ 2494.166224]  [<ffffffff804df2c5>] ? _spin_unlock_irqrestore+0x65/0x80
May 11 10:59:48 [kernel] [ 2494.166230]  [<ffffffff803db379>] tty_mode_ioctl+0x279/0x3e0
May 11 10:59:48 [kernel] [ 2494.166234]  [<ffffffff803d3444>] ? tty_ldisc_try+0x44/0x60
May 11 10:59:48 [kernel] [ 2494.166239]  [<ffffffff803db51d>] n_tty_ioctl+0x3d/0x260
May 11 10:59:48 [kernel] [ 2494.166244]  [<ffffffff803d6c34>] tty_ioctl+0x154/0xfe0
May 11 10:59:48 [kernel] [ 2494.166249]  [<ffffffff80252baa>] ? __lock_acquire+0x39a/0x1080
May 11 10:59:48 [kernel] [ 2494.166256]  [<ffffffff80252baa>] ? __lock_acquire+0x39a/0x1080
May 11 10:59:48 [kernel] [ 2494.166263]  [<ffffffff80252baa>] ? __lock_acquire+0x39a/0x1080
May 11 10:59:48 [kernel] [ 2494.166269]  [<ffffffff802a05e1>] vfs_ioctl+0x31/0x90
May 11 10:59:48 [kernel] [ 2494.166274]  [<ffffffff802a06b3>] do_vfs_ioctl+0x73/0x2d0
May 11 10:59:48 [kernel] [ 2494.166280]  [<ffffffff802a095a>] sys_ioctl+0x4a/0x80
May 11 10:59:48 [kernel] [ 2494.166286]  [<ffffffff8020b5ab>] system_call_after_swapgs+0x7b/0x80
May 11 10:59:48 [kernel] [ 2494.166292]

Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoRemove blkdev warning triggered by using md
Neil Brown [Wed, 14 May 2008 23:05:54 +0000 (16:05 -0700)]
Remove blkdev warning triggered by using md

As setting and clearing queue flags now requires that we hold a spinlock
on the queue, and as blk_queue_stack_limits is called without that lock,
get the lock inside blk_queue_stack_limits.

For blk_queue_stack_limits to be able to find the right lock, each md
personality needs to set q->queue_lock to point to the appropriate lock.
Those personalities which didn't previously use a spin_lock, us
q->__queue_lock.  So always initialise that lock when allocated.

With this in place, setting/clearing of the QUEUE_FLAG_PLUGGED bit will no
longer cause warnings as it will be clear that the proper lock is held.

Thanks to Dan Williams for review and fixing the silly bugs.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Alistair John Strachan <alistair@devzero.co.uk>
Cc: Nick Piggin <npiggin@suse.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Jacek Luczak <difrost.kernel@gmail.com>
Cc: Prakash Punnoor <prakash@punnoor.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agochar: select fw_loader by moxa
Jiri Slaby [Wed, 14 May 2008 23:05:53 +0000 (16:05 -0700)]
char: select fw_loader by moxa

Select FW_LOADER since moxa needs it, otherwise we face link problems such
as:

drivers/built-in.o: In function
moxa_pci_probe':moxa.c:(.devinit.text+0x76d8): undefined reference to
request_firmware'
:moxa.c:(.devinit.text+0x7e6e): undefined reference to release_firmware'
make: *** [.tmp_vmlinux1] Error 1

Reported-by: Philippe Roussel <p.o.roussel@free.fr>
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemory_hotplug: always initialize pageblock bitmap
Heiko Carstens [Wed, 14 May 2008 23:05:52 +0000 (16:05 -0700)]
memory_hotplug: always initialize pageblock bitmap

Trying to online a new memory section that was added via memory hotplug
sometimes results in crashes when the new pages are added via __free_page.
 Reason for that is that the pageblock bitmap isn't initialized and hence
contains random stuff.  That means that get_pageblock_migratetype()
returns also random stuff and therefore

list_add(&page->lru,
&zone->free_area[order].free_list[migratetype]);

in __free_one_page() tries to do a list_add to something that isn't even
necessarily a list.

This happens since 86051ca5eaf5e560113ec7673462804c54284456 ("mm: fix
usemap initialization") which makes sure that the pageblock bitmap gets
only initialized for pages present in a zone.  Unfortunately for hot-added
memory the zones "grow" after the memmap and the pageblock memmap have
been initialized.  Which means that the new pages have an unitialized
bitmap.  To solve this the calls to grow_zone_span() and grow_pgdat_span()
are moved to __add_zone() just before the initialization happens.

The patch also moves the two functions since __add_zone() is the only
caller and I didn't want to add a forward declaration.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomprotect: prevent alteration of the PAT bits
Venki Pallipadi [Wed, 14 May 2008 23:05:51 +0000 (16:05 -0700)]
mprotect: prevent alteration of the PAT bits

There is a defect in mprotect, which lets the user change the page cache
type bits by-passing the kernel reserve_memtype and free_memtype
wrappers.  Fix the problem by not letting mprotect change the PAT bits.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoper_cpu: fix DEFINE_PER_CPU_SHARED_ALIGNED for modules
Eric Dumazet [Wed, 14 May 2008 23:05:51 +0000 (16:05 -0700)]
per_cpu: fix DEFINE_PER_CPU_SHARED_ALIGNED for modules

Current module loader lookups ".data.percpu" ELF section to perform
per_cpu relocation.  But DEFINE_PER_CPU_SHARED_ALIGNED() uses another
section (".data.percpu.shared_aligned"), currently only handled in
vmlinux.lds, not by module loader.

To correct this problem, instead of adding logic into module loader, or
using at build time a module.lds file for all arches to group
".data.percpu.shared_aligned" into ".data.percpu", just use ".data.percpu"
for modules.

Alignment requirements are correctly handled by ld and module loader.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomemory_hotplug: check for walk_memory_resource() failure in online_pages()
Geoff Levand [Wed, 14 May 2008 23:05:50 +0000 (16:05 -0700)]
memory_hotplug: check for walk_memory_resource() failure in online_pages()

Add a check to online_pages() to test for failure of
walk_memory_resource().  This fixes a condition where a failure
of walk_memory_resource() can lead to online_pages() returning
success without the requested pages being onlined.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Keith Mannthey <kmannth@us.ibm.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>