1) Patch doesn't change any code here, so gcc is already smart enough
to "feel" constness in such simple functions.
2) There is no such thing as const task_struct. Anyone who think
otherwise deserves compiler warning.
Paul Moore [Fri, 26 Oct 2007 11:29:08 +0000 (04:29 -0700)]
[NetLabel]: correct usage of RCU locking
This fixes some awkward, and perhaps even problematic, RCU lock usage in the
NetLabel code as well as some other related trivial cleanups found when
looking through the RCU locking. Most of the changes involve removing the
redundant RCU read locks wrapping spinlocks in the case of a RCU writer.
Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ryousei Takano [Fri, 26 Oct 2007 11:27:59 +0000 (04:27 -0700)]
[TCP]: fix D-SACK cwnd handling
In the current net-2.6 kernel, handling FLAG_DSACKING_ACK is broken.
The flag is cleared to 1 just after FLAG_DSACKING_ACK is set.
if (found_dup_sack)
flag |= FLAG_DSACKING_ACK;
:
flag = 1;
To fix it, this patch introduces a part of the tcp_sacktag_state patch:
http://marc.info/?l=linux-netdev&m=119210560431519&w=2
Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
[NET] napi: use non-interruptible sleep in napi_disable
The current napi_disable() uses msleep_interruptible() but doesn't
(and can't) exit in case there's a signal, thus ending up doing a
hot spin without a cpu_relax. Use uninterruptible sleep instead.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Adrian Bunk [Fri, 26 Oct 2007 10:55:44 +0000 (03:55 -0700)]
[NET] fs/proc/proc_net.c: make a struct static
Struct proc_net_ns_ops can become static.
Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
[NET] dev_change_name: ignore changes to same name
Prevent error/backtrace from dev_rename() when changing
name of network device to the same name. This is a common
situation with udev and other scripts that bind addr to device.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Jamal Hadi Salim [Fri, 26 Oct 2007 09:49:09 +0000 (02:49 -0700)]
[NET]: Document some simple rules for actions
This patch adds documentation on what is expected of an
action which branches away from the action-graph or when it
needs to trample on actins. It also describes what is expected of
users of such actions.
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Jamal Hadi Salim [Fri, 26 Oct 2007 09:47:23 +0000 (02:47 -0700)]
[NET_CLS_ACT]: Introduce skb_act_clone
Reworked skb_clone looks uglier with the single ifdef
CONFIG_NET_CLS_ACT This patch introduces skb_act_clone which will
replace skb_clone in tc actions
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Johannes Berg [Mon, 22 Oct 2007 12:51:37 +0000 (14:51 +0200)]
[PATCH] mac80211: fix printk warning on 64-bit
My AID message patch introduced a warning on 64-bit machines because ~
extends to unsigned long:
| net/mac80211/ieee80211_sta.c: In function ‘ieee80211_rx_mgmt_assoc_resp’:
| net/mac80211/ieee80211_sta.c:1187: warning: format ‘%d’ expects type ‘int’, but argument 7 has type ‘long unsigned int’
This fixes it by explicitly casting the result to u16 (which 'aid' is).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Tue, 23 Oct 2007 15:05:25 +0000 (17:05 +0200)]
[PATCH] add myself as mac80211 maintainer
This adds myself as mac80211 maintainer and updates the git URL to point
to the wireless-2.6 tree. Also move Jiri down so he isn't first in list.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Vlad Yasevich [Fri, 26 Oct 2007 01:54:46 +0000 (18:54 -0700)]
[UDP]: Make use of inet_iif() when doing socket lookups.
UDP currently uses skb->dev->ifindex which may provide the wrong
information when the socket bound to a specific interface.
This patch makes inet_iif() accessible to UDP and makes UDP use it.
The scenario we are trying to fix is when a client is running on
the same system and the server and both client and server bind to
a non-loopback device.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Acked-by: David L Stevens <dlstevens@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Randy Dunlap [Thu, 25 Oct 2007 21:21:49 +0000 (14:21 -0700)]
bitops kernel-doc: inline instead of macro
Use duplicated inline functions for test_and_set_bit_lock() on x86
instead of #define macros, thus avoiding a bad example. This allows
kernel-doc to run cleanly instead of terminating with an error:
Linus Torvalds [Thu, 25 Oct 2007 22:50:32 +0000 (15:50 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
[IPV4]: Explicitly call fib_get_table() in fib_frontend.c
[NET]: Use BUILD_BUG_ON in net/core/flowi.c
[NET]: Remove in-code externs for some functions from net/core/dev.c
[NET]: Don't declare extern variables in net/core/sysctl_net_core.c
[TCP]: Remove unneeded implicit type cast when calling tcp_minshall_update()
[NET]: Treat the sign of the result of skb_headroom() consistently
[9P]: Fix missing unlock before return in p9_mux_poll_start
[PKT_SCHED]: Fix sch_prio.c build with CONFIG_NETDEVICES_MULTIQUEUE
[IPV4] ip_gre: sendto/recvfrom NBMA address
[SCTP]: Consolidate sctp_ulpq_renege_xxx functions
[NETLINK]: Fix ACK processing after netlink_dump_start
[VLAN]: MAINTAINERS update
[DCCP]: Implement SIOCINQ/FIONREAD
[NET]: Validate device addr prior to interface-up
Linus Torvalds [Thu, 25 Oct 2007 22:44:54 +0000 (15:44 -0700)]
Merge branch 'sg' of git://git.kernel.dk/linux-2.6-block
* 'sg' of git://git.kernel.dk/linux-2.6-block:
fix sg_phys to use dma_addr_t
ub: add sg_init_table for sense and read capacity commands
x86: pci-gart fix
blackfin: fix sg fallout
xtensa: dma-mapping.h is using linux/scatterlist.h functions, so include it
SG: audit of drivers that use blk_rq_map_sg()
arch/um/drivers/ubd_kern.c: fix a building error
SG: Change sg_set_page() to take length and offset argument
AVR32: Fix sg_page breakage
mmc: sg fallout
m68k: sg fallout
More SG build fixes
sg: add missing sg_init_table calls to zfcp
SG build fix
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-lguest:
lguest: documentation update
lguest: Add to maintainers file.
lguest: build fix
lguest: clean up lguest_launcher.h
lguest: remove unused "wake" element from struct lguest
lguest: use defines from x86 headers instead of magic numbers
lguest: example launcher header cleanup.
Linus Torvalds [Thu, 25 Oct 2007 22:20:22 +0000 (15:20 -0700)]
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
[libata] sata_nv: SWNCQ should not apply to MCP61
libata-core: Be a bit more relaxed about early DMA zero devices
ahci: ahci: implement workaround for ASUS P5W-DH Deluxe ahci_broken_hardreset(), take #2
Fix pata_icside build for recent libata API changes
libata: cosmetic clean up in ata_eh_reset()
libata-core.c: make 2 functions static
[libata] Create internal helper ata_dev_set_feature()
Linus Torvalds [Thu, 25 Oct 2007 22:19:59 +0000 (15:19 -0700)]
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
[netdrvr] forcedeth: add MCP77 device IDs
rndis_host: reduce MTU instead of refusing to talk to devices with low max packet size
cpmac: update to new fixed phy driver interface
cpmac: convert to napi_struct interface
cpmac: use print_mac() instead of MAC_FMT
natsemi: fix oops, link back netdevice from private-struct
ehea: fix port_napi_disable/enable
bonding/bond_main.c: fix cut'n'paste error
make bonding/bond_main.c:bond_deinit() static
drivers/net/ipg.c: cleanups
remove Documentation/networking/net-modules.txt
* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
sched: mark CONFIG_FAIR_GROUP_SCHED as !EXPERIMENTAL
sched: isolate SMP balancing code a bit more
sched: reduce balance-tasks overhead
sched: make cpu_shares_{show,store}() static
sched: clean up some control group code
sched: constify sched.h
sched: document profile=sleep requiring CONFIG_SCHEDSTATS
sched: use show_regs() to improve __schedule_bug() output
sched: clean up sched_domain_debug()
sched: fix fastcall mismatch in completion APIs
sched: fix sched_domain sysctl registration again
Ram Gupta [Thu, 25 Oct 2007 15:03:28 +0000 (10:03 -0500)]
fs: Fix to correct the mbcache entries counter
This patch fixes the c_entry_count counter of the mbcache. Currently
it increments the counter first & allocate the cache entry later. In
case of failure to allocate the entry due to insufficient memory this
counter is still left incremented. This patch fixes this anomaly.
David Howells [Thu, 25 Oct 2007 14:27:40 +0000 (15:27 +0100)]
Fix pointer mismatches in proc_sysctl.c
Fix pointer mismatches in proc_sysctl.c. The proc_handler() method returns a
size_t through an arg pointer, but is given a pointer to a ssize_t to return
into.
Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Thu, 18 Oct 2007 03:18:32 +0000 (23:18 -0400)]
Fix /proc/acpi/alarm BCD alarm encodings
This fixes some totally illogical and wrong code that converts things to
and from BCD mode essentially randomly, does math on values in BCD mode
etc etc. Introduce a few helper functions to make it a bit more obvious
what is going on, and make sure that we always do all the arithmetic
(and anythign else, for that matter) in binary, not BCD.
Tested by Mark Lord, who found the problem originally, and also pushed
the patch back and reminded me about it.
Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jiri Kosina [Fri, 19 Oct 2007 22:05:19 +0000 (00:05 +0200)]
USB: usbserial - fix potential deadlock between write() and IRQ
USB: usbserial - fix potential deadlock between write() and IRQ
usb_serial_generic_write() doesn't disable interrupts when taking port->lock,
and could therefore deadlock with usb_serial_generic_read_bulk_callback()
being called from interrupt, taking the same lock. Fix it.
Oliver Neukum [Tue, 23 Oct 2007 10:26:41 +0000 (12:26 +0200)]
USB: fix read vs. disconnect race in cytherm driver
the disconnect method of this driver set intfdata to NULL before
removing attribute files. The attributes' read methods will happily
follow the NULL pointer. Here's the correct ordering.
Signed-off-by : Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Fri, 19 Oct 2007 13:51:58 +0000 (09:51 -0400)]
USB: fix interface sysfs file-creation bug
This patch (as1005) fixes a rather subtle problem. When
usb_set_configuration() registers the interfaces and their files in
sysfs, it doesn't expect those files to exist already. But when an
interface is registered, its driver may call usb_set_interface() and
thereby cause the sysfs files to be created. The result is an error
when usb_set_configuration() goes on to create those same files again.
The (not-so-great) solution is to have usb_set_configuration() remove
any existing files before creating them.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Ingo Molnar [Mon, 15 Oct 2007 17:43:21 +0000 (19:43 +0200)]
USB: fix ssb_ohci_probe() build bug
fix ssb_ohci_probe() build bug:
drivers/built-in.o: In function `ssb_ohci_probe':
ohci-hcd.c:(.text+0xbff39): undefined reference to `ssb_device_enable'
ohci-hcd.c:(.text+0xbff6f): undefined reference to `ssb_admatch_base'
ohci-hcd.c:(.text+0xbff8b): undefined reference to `ssb_admatch_size'
ohci-hcd.c:(.text+0xbffe5): undefined reference to `ssb_device_disable'
[...]
the reason was that this Kconfig combination was allowed:
Alan Cox [Mon, 15 Oct 2007 14:08:11 +0000 (15:08 +0100)]
USB: isd200: sort out USB/IDE dependancy mess
The ISD200 driver imports a single trivial routine from the IDE layer and
in doing so creates a mess of dependancies that drag in the entire old
IDE layer. Even more sad - it does this for a routine which is usually
(little endian) a null function!
- Copy the function into ISD200
- Rename it so it doesn't clash with the ide header prototype
- Remove all the depend constraints
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Tue, 16 Oct 2007 15:55:30 +0000 (11:55 -0400)]
USB: fix scheduling of Iso URBs in uhci-hcd
This patch (as1003) changes uhci-hcd to treat the URB_ISO_ASAP flag
the same as other host controller drivers, namely, to schedule an Iso
URB for the first available time slot that hasn't already expired.
URBs in which the flag isn't set will be scheduled for the first slot
following the last URB, even if it has expired.
This fixes a problem reported by Martin Bachem.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Andrew Morton [Thu, 18 Oct 2007 08:24:25 +0000 (01:24 -0700)]
USB: ftd_sio cleanups and updates for new termios work checkpatch fixes
WARNING: line over 80 characters
#23: FILE: drivers/usb/serial/ftdi_sio.c:297:
+ speed_t force_baud; /* if non-zero, force the baud rate to this value */
ERROR: use tabs not spaces
#31: FILE: drivers/usb/serial/ftdi_sio.c:881:
+^I$
ERROR: use tabs not spaces
#39: FILE: drivers/usb/serial/ftdi_sio.c:890:
+^I$
WARNING: line over 80 characters
#111: FILE: drivers/usb/serial/ftdi_sio.c:1956:
+ tty_encode_baud_rate(port->tty, priv->force_baud, priv->force_baud);
Your patch has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox [Thu, 18 Oct 2007 08:24:19 +0000 (01:24 -0700)]
USB: digi_acceleport: fix termios and also readability a bit
- Expand some x&y to x & y so I could read it when checking
- Clear CMSPAR bit in the termios (as the driver does not support it)
- Encode the speed using the new tty_encode_baud_rate facility
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox [Thu, 18 Oct 2007 08:24:18 +0000 (01:24 -0700)]
USB: ch341: fix termios handling
The ch341 currently doesn't support most of the hardware setting. So to keep
the termios data right we propogate the old termios hardware values back then
encode the speed.
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox [Thu, 18 Oct 2007 08:24:16 +0000 (01:24 -0700)]
serial: stop passing NULL to functions that expect data
Earlier patches have removed the checking for old v new differences from the
USB drivers so we can now pass in a valid blank old termios so that we don't
to fill the drivers with magic hacks for console support
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Hugh Dickins [Thu, 25 Oct 2007 07:55:05 +0000 (09:55 +0200)]
fix sg_phys to use dma_addr_t
x86_32 CONFIG_HIGHMEM64G with 5GB RAM hung when booting, after issuing
some "request_module: runaway loop modprobe binfmt-0000" messages in
trying to exec /sbin/init.
The binprm buf doesn't see the right ".ELF" header because sg_phys()
is providing the wrong physical addresses for high pages: a 32-bit
unsigned long is too small in this case, we need to use dma_addr_t.
Eugene Konev [Wed, 24 Oct 2007 02:42:02 +0000 (10:42 +0800)]
cpmac: convert to napi_struct interface
Convert cpmac to new napi_struct API introduced by bea3348eef27e6044b6161fd04c3152215f96411 [NET]: Make NAPI polling independent
of struct net_device objects.
Only disable rx interrupts if napi actually has been scheduled.
Signed-off-by: Eugene Konev <ejka@imfi.kspu.ru> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Eugene Konev [Wed, 24 Oct 2007 02:42:01 +0000 (10:42 +0800)]
cpmac: use print_mac() instead of MAC_FMT
Switch to using DECLARE_MAC_BUF/print_mac() added by commit 0795af5729b18218767fab27c44b1384f72dc9ad [NET]: Introduce and use print_mac()
and DECLARE_MAC_BUF().
Signed-off-by: Eugene Konev <ejka@imfi.kspu.ru> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Ingo Molnar [Wed, 24 Oct 2007 11:58:57 +0000 (13:58 +0200)]
natsemi: fix oops, link back netdevice from private-struct
* Andrew Nelless <andrew@nelless.net> wrote:
> Hi,
>
> I booted up 2.6.24-rc1 this morning [Real early over a brew ;-)] and
> was having a problems with multiple ~5 second hangs on SATA/drive init
> (Something to do with "EH" something-or-other and resets but I'll
> email in separately about it later unless its fixed by the time I get
> the chance).
>
> Anyway, I went to fire up netconsole to get a decent log dump and hit
> across the following nasty. Netconsole works fine in 2.6.23.1 with a
> similar config and the same kernel parameters.
>
> A shot of the screen is the only method I could come up with to
> capture the log, I hope that is OK, it is pretty readable.
>
>
> The nasty:
> http://andotnet.nfshost.com/linux/2.6.24-rc1-netconsole-nullderef.jpg
[NET]: Make NAPI polling independent of struct net_device objects.
added np->dev to drivers/net/natsemi.c's struct netdev_private, but
forgot to initialize that new field upon driver init. The result was
a predictable NULL dereference oops the first time the hardware
generated an interrupt.
Reported-by: Andrew Nelless <andrew@nelless.net> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Jeff Garzik <jeff@garzik.org>